Chegg.com Interview Report
- 0of 0 votes
AnswersGiven two robots on an infinite line, they can move left or right. They cannot see each other. There is a marker between them that they can detect if they touch it. What algorithm will allow the bots to find each other (anywhere), if both bots are running the exact same algorithm?
- Joe Shmoe August 19, 2009
You could have the bots go right then left in ever increasing distance. They will eventually find the marker. They could then stop and await the arrival of the other bot, or increase speed in that direction to catch up to it faster.
If the bots may only pick one direction and not change it, then they each pick, say, right, and move slowly until the marker is found, then increase speed to catch up to the other bot.| Report Duplicate | Flag | PURGE
Chegg.com Consultant Brain Teasers - 0of 0 votes
AnswersGiven a singly-linked list, output the contents in reverse order, without recursion or additional memory, and in efficient time.
- Joe Shmoe August 19, 2009| Report Duplicate | Flag | PURGE
Chegg.com Consultant Algorithm - 0of 0 votes
AnswersFind a two-line program to output the Nth Fibinacci number
- Joe Shmoe August 19, 2009| Report Duplicate | Flag | PURGE
Chegg.com Amazon Consultant Software Engineer / Developer Algorithm Math & Computation