Design intern interview questions shared by candidates
there is a disk half painted white and the other half black. There are two sensors and the outputs of these sensors are the only signals available. How will you determine if the disk is rotating clockwise or anti-clockwise?
Got an idea however it is valid only if clock can be used additionally to the two sensors. I use clock hours to describe the locations of the 2 sensors. The first sensor will be located at hour 12:00 the second will be located at hour 3:00. Then the first sensor will have to calculate the time it takes for one complete circle by: T=(time change from black to white) * 2 or T=(time change from white to black) * 2 The first sensor deliver signal to the second sensor when there is a change from black to white (or white to black) and the sensor is expecting the change. if the change (from black to white or from white to black) detected at the second sensor T/4 after getting the signal from the first sensor then the disk rounds clockwise else (when it take more then T/4 time) it runs counter clockwise when the second sensor get the signal it start timer to 1/4
Disk - vertically divided, left side White, right side Black, sensors - on upper quadrants horizontal division line of the disk, white sensor in left upper quadrant, black - in the right upper quadrant. 1. No rotation, initial state - White sensor (WS) = HI, Black sensor (BS) = LO 2. Clockwise rotation to 90" : WS =HI, BS changes from LO to HI Truth table (for each 90") WS BS 1 0 1 1 0 1 0 0 1 0 etc WS ==__==__==__==__==__==__==__==__==__==__== BS _==__==__==__==__==__==__==__==__==__==__= 3. Anti-clockwise rotation to - 90" : WS changes from HI to LO, BS=LO Truth table (for each - 90") WS BS 1 0 0 0 0 1 1 1 1 0 etc WS =__==__==__==__==__==__==__==__==__==__ BS __==__==__==__==__==__==__==__==__==__=
There is a much simpler solution. Place the sensors about 1/4 circumference apart. Use one FF. Feed one sensor into the clock pin and the other sensor into the D pin. Let's say bottom left sensor is A is is used for the clock. Lets say bottom right sensor (90 degrees apart from A) is connected to the D pin. When the wheel spins, the transition from black to light (0->1) cause the FF to sample the other input. If the D input is 1, the Q will become one and you are rotating CW. If there is a 0->1 transition and the D input is a 0, the Q becomes 0 and we are rotating CCW.
See Interview Questions for Similar Jobs
- ASIC Design Engineer
- Verification Engineer
- Software Engineer
- ASIC Verification Engineer
- Hardware Engineer
- ASIC Engineer
- Design Engineer
- Design Verification Engineer
- Digital Design Engineer
- Physical Design Engineer