给这里的女ID们提个醒,化妆品大deal# Fashion - 美丽时尚
l*y
1 楼
有点晚, 3月的。 当时是个event,所以只面4轮,其中一轮behavioral,两轮程序一轮
设计。
--------------------------------------
Coding
1. Support undo and redo on a picture.
-- Two stacks, one for each
2. Now each command has a cost and we need peekMax() to get the most
expensive command so that we can potentially save the snapshop (of pic) and
store it to server for that command. How do you support the peekMax() method?
-- Suggested a heaping Heap and the stack are just pointers. O(lgn)
-- Hinted to get O(1) with an example
-- Solution is to get two Stacks for undo (same for redo). The max cost
stack holds only non-duplicated commands with current max cost.
E.g. (left is the first stack and right is the second (view it vertically)
D
C C
B
A A
--------------------------------------
Design
1. System that test furniture stress score.
Furniture interface has applyWeights, applyTest, getColor and isStable
methods.
You may have WoodenChair, SteelChair, WoodenTable, SteelTable and etc
classes.
Key: Composition.
After interview I realized it can be solved with Bridge pattern but I only
mentioned the name but failed to elaborate.
2. Flight Controller for airport and nearby airspace.
No method provided. Need to work it out together with interviewer.
Figured out:
--Land, takeoff and fly-through requests may be made by planes.
Discussed about components needed and what attributes they have:
--Controller, Runway/track, scheduler.
Discussed how components work together
-- E.g. Runway should have collections. Timing and location to make fly-
through requests more efficient. Requests should be made ahead of time to
allow scheduling to happen. Request replies should be valid for only a
period of time. Replies for fly-through should include more information such
as area and height.
-- Take away:
Examined: communication, how you analyze problems. I don't think I made any
remarkable comments at all, just follow the natural thinking and
conversation.
Not quite sure if it is satisfactory about seems smooth.
--------------------------------------
Algorithm and Coding
1. Car on race-track that has 25000 sound sources but for each position only
up to 32 sounds can be played. Each sound source has its range and you can
calculate distance easily given a position. Sound source may also have
priority to help decide which to play.
-- O(lgn) using minHeap and loop through.
-- Discussed heap in detail
-- Suggested that we can partition track into areas with applicable points
so that we don’t need to go through all 25000 each time.
-- Coding and complexity analysis
2. How to improve performance given that a smaller move will not cause too
many changes of the applied sound sources? How to modify the 32 sources?
Asked to modify priority based on distance.
-- Suggested to normalize priority to get max. For any point within range
add max priority; subtract if it becomes out of range.
-- Suggested that we can further partition within each area (hashing) to
narrow down the lists of sound sources for each position so that when moving
from one position to the other the diff list is smaller and faster to
achieve.
-- Actually it can be improved to record only different set between
different positions and the total storage would be about 25000 only.
Conclusion: for gaming it is very important to save cpu cycles as they are
most critical and use memory as tradeoff.
-------------------------------------
Behavioral Omitted
------------------------------------
背景: MS 毕业6年经验得到包但是不高,出于某些特殊原因没有争就接受了 ,base
109K 总包不到130K。SDE2.
设计。
--------------------------------------
Coding
1. Support undo and redo on a picture.
-- Two stacks, one for each
2. Now each command has a cost and we need peekMax() to get the most
expensive command so that we can potentially save the snapshop (of pic) and
store it to server for that command. How do you support the peekMax() method?
-- Suggested a heaping Heap and the stack are just pointers. O(lgn)
-- Hinted to get O(1) with an example
-- Solution is to get two Stacks for undo (same for redo). The max cost
stack holds only non-duplicated commands with current max cost.
E.g. (left is the first stack and right is the second (view it vertically)
D
C C
B
A A
--------------------------------------
Design
1. System that test furniture stress score.
Furniture interface has applyWeights, applyTest, getColor and isStable
methods.
You may have WoodenChair, SteelChair, WoodenTable, SteelTable and etc
classes.
Key: Composition.
After interview I realized it can be solved with Bridge pattern but I only
mentioned the name but failed to elaborate.
2. Flight Controller for airport and nearby airspace.
No method provided. Need to work it out together with interviewer.
Figured out:
--Land, takeoff and fly-through requests may be made by planes.
Discussed about components needed and what attributes they have:
--Controller, Runway/track, scheduler.
Discussed how components work together
-- E.g. Runway should have collections. Timing and location to make fly-
through requests more efficient. Requests should be made ahead of time to
allow scheduling to happen. Request replies should be valid for only a
period of time. Replies for fly-through should include more information such
as area and height.
-- Take away:
Examined: communication, how you analyze problems. I don't think I made any
remarkable comments at all, just follow the natural thinking and
conversation.
Not quite sure if it is satisfactory about seems smooth.
--------------------------------------
Algorithm and Coding
1. Car on race-track that has 25000 sound sources but for each position only
up to 32 sounds can be played. Each sound source has its range and you can
calculate distance easily given a position. Sound source may also have
priority to help decide which to play.
-- O(lgn) using minHeap and loop through.
-- Discussed heap in detail
-- Suggested that we can partition track into areas with applicable points
so that we don’t need to go through all 25000 each time.
-- Coding and complexity analysis
2. How to improve performance given that a smaller move will not cause too
many changes of the applied sound sources? How to modify the 32 sources?
Asked to modify priority based on distance.
-- Suggested to normalize priority to get max. For any point within range
add max priority; subtract if it becomes out of range.
-- Suggested that we can further partition within each area (hashing) to
narrow down the lists of sound sources for each position so that when moving
from one position to the other the diff list is smaller and faster to
achieve.
-- Actually it can be improved to record only different set between
different positions and the total storage would be about 25000 only.
Conclusion: for gaming it is very important to save cpu cycles as they are
most critical and use memory as tradeoff.
-------------------------------------
Behavioral Omitted
------------------------------------
背景: MS 毕业6年经验得到包但是不高,出于某些特殊原因没有争就接受了 ,base
109K 总包不到130K。SDE2.