design interview questions shared by candidates
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?