Interview Puzzle
-
You are visiting New York City when a man approaches you.
\”Not counting bald people, I bet a hundred bucks that there are two people living in New York City with the same number of hairs on their heads,\” he tells you.
\”I\’ll take that bet!\” you say. You talk to the man for a minute, after which you realize you have lost the bet.What did the man say to prove his case?
View SolutionSubmit Solution- 1,289.8K views
- 2 answers
- 0 votes
-
Two robots are placed at different points on a straight line of infinite length. When they are first placed down, they each spray out some oil to mark their starting points.
You must program each robot to ensure that the robots will eventually crash into each other. A program can consist of the following four instructions:
- Go left one space
- Go right one space
- Skip the next instruction if there is oil in my current spot
- Go to a label
[Note that a “label” is a name that refers to a line of your code. For example, you could label the third line of your program “surveying”. Then, the instruction “goto surveying” would jump to line 3 and start executing from there on the next cycle.]
A robot will carry out one instruction per second. Both robots need not have the same program. Note that you won’t know ahead of time which robot is on the left and which is on the right.
View SolutionSubmit Solution- 1,291.6K views
- 1 answers
- 0 votes
-
Tower of Hanoi 5 Disk Puzzle Game
The goal of the puzzle is to move all the disks from the leftmost peg to the rightmost peg,
Adhering to the following rules:
1) Move only one disk at a time.
A) Larger disk may not be placed on top of a smaller disk.Tower Of Hanoi – 3 Disk Puzzle Tower Of Hanoi – 4 Disk Puzzle Tower Of Hanoi – 5 Disk Puzzle Tower Of Hanoi – 6 Disk Puzzle View SolutionSubmit Solution- 1,301.0K views
- 2 answers
- 1 votes
-
Ring City has 100 houses arranged in a circle. Alice starts at her own house, and every day she randomly moves to one of the two adjacent houses, each with 50% probability.She repeats this until she has visited all of the houses.
Which house(s) is/are the most likely to be visited last?
View SolutionSubmit Solution- 1,346.5K views
- 3 answers
- 0 votes