Yahoo Interview Question
Software Engineer / DevelopersWrong. How will you represent 06,07,08 or 09 using the above solution?
This is a trick question. It is mathematically impossible to represent all the dates using unique numbers. The trick lies in the fact that if you invert 6, it becomes 9. And if you invert 2, it becomes 5. So, the correct solution is:
Dice 1: 0,1,2,3,4,6
Dice 2: 0,1,2,3,7,8
Good thinking about the 9 (inverting the six), but don't you think 5 cannot be inverted to get 2. It has to be inverted and mirror imaged. 3 in Dice 1 can be replaced by 5 and your solution would hold good.
Well.. I would say, do your homework. 5 doesnt have to be mirror image. All you have to do is just invert. You can try download an image of 5 and rotating it 180 degrees. Inverting a 3 doesnt even closing resemble a 5. Unless you prove me wrong.. :)
Dice 1: 0 1 2 7 8 {9 or 6} as (9 is mirror of 6)
- L.Ppt July 21, 2012Dice 2: 0 1 2 3 4 5