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

Interview Question

Graduate RTL Hardware Design Engineer Interview London, England (UK)

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?
Answer

Interview Answer

3 Answers

0

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 Nov 3, 2015
0

middle to 2nd not needed

Alexis on Nov 3, 2015
0

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

Answer on Sep 28, 2016

Add Answers or Comments

To comment on this, Sign In or Sign Up.