A friend was asked the following riddle in a Google interview yesterday. I found it quite interesting. If you have the right background it is trivial, however, if you do not then it can be rather tricky. Feel free to post a solution.
An enemy submarine is somewhere on the number line (consider only integers for this problem). It is moving at some rate (again, integral units per minute). You know neither its position nor its velocity.
You can launch a torpedo each minute at any integer on the number line. If the the submarine is there, you hit it and it sinks. You have all the time and torpedoes you want. You must sink this enemy sub - devise a strategy that is guaranteed to eventually hit the enemy sub.Note: This was copied from here. That page contains at least one other questions I was asked in my interviews with Google.