1
vote
2answers
209 views

What is a O(n) algorithm to solve this puzzle?

We are going to hold a meeting where everybody will speak in clockwise direction around a table. There are n people with n spots. Each person has a position preference (e.g. some want to go first, ...
1
vote
1answer
536 views

Puzzle solving: Minimum number of steps to achieve a goal

I have been doing some programming contest problems, and I have noticed that many of them involve something along the lines of "get the minimum number of steps necessary to achieve a certain goal". ...
29
votes
5answers
4k views

Programming interview question on Trees

I was asked this interview question at a top internet website company recently. Certain empty glasses of water are arranged in the following order When you pour liquid into the 1st glass if ...
6
votes
6answers
2k views

Monkey Hunter algorithm - Interview question [closed]

Question asked in an Interview: You are a hunter in the forest. A monkey is in the trees, but you don't know where and you can't see it. You can shoot at the trees, you have unlimited ammunition. ...
9
votes
4answers
2k views

N queens, X by Y board decision problem interview question

I was asked the following question in an interview today and I've been thinking about it ever since. I was not able to answer it and haven't been able to find a solution online. Given a chess board ...