Imagination Technologies Interview Question: There are 5 holes in a line, ... |

Interview Question

Graduate RTL Hardware Design Engineer Interview London, England

There are 5 holes in a line, and there is a rat in one of

  it. Each turn the rat will move either left or right, but never stay in the same hole, and each turn you can check one hole. The holes are in a line so when the rat reach one end, it must move back in the next turn. What is your strategy to catch that rat?

Interview Answer

3 Answers


start with middle move to 2nd and check twice and move to 3rd and then 4th and check 4th twice.. right? OR you start anywhere just move sequentially and check 2nd and 4th place twice

Alexis on 3 Nov 2015

middle to 2nd not needed

Alexis on 3 Nov 2015

Keep checking middle one, worst case delay is 4 check, and you should find it by then!!

Answer on 28 Sep 2016

Add Answers or Comments

To comment on this, Sign In or Sign Up.