Microsoft Interview Question
Software Engineer in Tests2 sensors is the correct.
place it at an angle of 90 to each other.
Lets consider the arrangement as
S1
X.......S2
X
we need 3 timestamp from these sensors.
2 from S1 call it (tS11, tS12) and 1 timestamp from S2 (tS21)
if(ts11 - ts21) > (ts21 - ts12)
rotating in anti clocwise direction
else
Clockwise.
Correct me if i m worng.
thats the solution I had in mind. The angel of 90 degrees is not that important. All we need to know is that the 2 sensors are not at 180 degrees and in which 2 quadrant they are located in.
Also we need to have the assumption that the plate is rotating at a constant speed else this solution wont work.
In case of variable rotation speed we would need 3 sensors. Put them on say at 1 O' Clock, 2 O'Clock and 3 O'Clock. Take 3 time stamps. from 3 sensors.
If sensor 1Time stamp is > sensor 2 Time Stamp> sensor 3 Time stamp the plate is moving counter clock wise else clock wise.
thats the solution I had in mind. The angel of 90 degrees is not that important. All we need to know is that the 2 sensors are not at 180 degrees and in which 2 quadrant they are located in.
Also we need to have the assumption that the plate is rotating at a constant speed else this solution wont work.
In case of variable rotation speed we would need 3 sensors. Put them on say at 1 O' Clock, 2 O'Clock and 3 O'Clock. Take 3 time stamps. from 3 sensors.
If sensor 1Time stamp is > sensor 2 Time Stamp> sensor 3 Time stamp the plate is moving counter clock wise else clock wise.
2 sensors required
- Mat June 08, 2011---
place them apart
if (sensor1 has action and not on sensor2, then both sensors trigger action, then only sensor2 has action)
It's clock-wise rotating disk
else
counter clock-wise