Microsoft Interview Puzzles
-
Find two positive integers that together with 23 are the lengths of a right triangle.
Hint: There’s a simple technique that, given any odd positive integer, allows you to figure out the other two integer sides of a right triangle in your head (or with pen and paper if the numbers get too large). Find this technique.
View SolutionSubmit Solution- 1,606.7K views
- 1 answers
- 1 votes
-
For any even number N, partition the integers from 1 to N into pairs such that the sum of the two numbers in each pair is a prime number.
Hint: Chebyshev proved that the following property (Bertrand’s Postulate) holds: for any k > 1, there exists a prime number p in the range k < p < 2*k.
Submit Solution- 1,606.6K views
- 0 answers
- 0 votes
-
At some point during a baseball season, a player has a batting average of less than 80%. Later during the season, his average exceeds 80%. Prove that at some point, his batting average was exactly 80%.
Also, for which numbers other than 80% does this property hold?
View SolutionSubmit Solution- 1,606.5K views
- 1 answers
- 0 votes
-
A game is played as follows. N people are sitting around a table, each with one penny. One person begins the game, takes one of his pennies (at this time, he happens to have exactly one penny) and passes it to the person to his left. That second person then takes two pennies and passes them to the next person on the left. The third person passes one penny, the fourth passes two, and so on, alternating passing one and two pennies to the next person. Whenever a person runs out of pennies, he is out of the game and has to leave the table. The game then continues with the remaining people.
A game is terminating if and only if it ends with just one person sitting at the table (holding all N pennies). Show that there exists an infinite set of numbers for which the game is terminating.
View SolutionSubmit Solution- 1,606.0K views
- 1 answers
- 1 votes
-
Let’s say that a number is squarish if it is the product of two consecutive numbers. For example, 6 is squarish, because it is 2*3.
A friend of mine at Microsoft recently had a birthday. He said his age is now squarish. Moreover, since the previous time his age was a squarish number, a squarish number of years has passed. How many years would he have to wait until his age would have this property again?
View SolutionSubmit Solution- 1,606.1K views
- 1 answers
- 0 votes
-
A building has 16 rooms, arranged in a 4×4 grid. There is a door between every pair of adjacent rooms (“adjacent” meaning north, south, west, and east, but no diagonals). Only the room in the northeast corner has a door that leads out of the building.
In the initial configuration, there is one person in each room. The person in the southwest corner is a psycho killer. The psycho killer has the following traits: If he enters a room where there is another person, he immediately kills that person . But he also cannot stand the site of blood, so he will not enter any room where there is a dead person.
As it happened, from that initial configuration, the psycho killer managed to get out of the building after killing all the other 15 people. What path did he take?
View SolutionSubmit Solution- 1,607.5K views
- 1 answers
- 0 votes
-
You have two jars. One contains vinegar, the other oil. The two jars contain the same amount of their respective fluid.
Take a spoonful of the vinegar and transfer it to the jar of oil. Then, take a spoonful of liquid from the oil jar and transfer it to the vinegar jar. Stir. Now, how does the dilution of vinegar in the vinegar jar compare to the dilution of oil in the oil jar?
View SolutionSubmit Solution- 1,606.9K views
- 1 answers
- 0 votes
-
You’re given a procedure that with a uniform probability distribution outputs random numbers between 0 and 1 (to some sufficiently high degree of precision, with which we need not concern ourselves in this puzzle). Using a bounded number of calls to this procedure, construct a procedure that with a uniform probability distribution outputs a random point within the unit circle.
View SolutionSubmit Solution- 1,606.1K views
- 1 answers
- 0 votes
-
Initially, you’re somewhere on the surface of the Earth. You travel one kilometer South, then one kilometer East, then one kilometer North. You then find yourself back at the initial position. Describe all initial locations from which this is possible.
View SolutionSubmit Solution- 1,605.8K views
- 1 answers
- 0 votes
-
The games played in the soccer world championship form a binary tree, where only the winner of each game moves up the tree (ignoring the initial games, where the teams are placed into groups of 4, 2 of which of which go onto play in the tree of games I just described). Assuming that the teams can be totally ordered in terms of how good they are, the winner of the championship will indeed be the best of all of the teams. However, the second best team does not necessarily get a second place in the championship. How many additional games need to be played in order to determine the second best team?
View SolutionSubmit Solution- 1,606.7K views
- 1 answers
- 0 votes