Microsoft Interview Question
Software Engineer / DevelopersNeed two sensor X, Y. Placing them on the right side of the disk, with the same distance to the center. Assuming X is the higher one, Y is the lower one. If X detects the color transition first, Y next, it is clockwise rotation. If Y detects the color transition first, X next, it is auti-clockwise rotation.
put x at 12'o clock and y at 3'o colok on the same track
- winia October 24, 2008if(color(x)==color(y))
{
if color(x) changes first, that is a clockwise
if color(y) changes first, that is a anti-clockwise
}
if(color(x)!=color(y))
{
if color(x) changes first, that is a anti-clockwise
if color(y) changes first, that is a clockwise
}