Puzzles

The puzzles in this lesson will help you understand the types of puzzles you can expect in data science interviews.

You have two sand timers showing two minutes and three minutes, respectively. Use both the sand timers (at one time or one after another or any other combination) and measure a time of six minutes.

  1. Start the three-minute sand timer.

  2. Once the three-minute sand timer ends, turn it upside down instantly and start the two-minute sand timer simultaneously. Now, three minutes are over.

  3. Once the two-minute sand timer ends, turn the three-minute sand time upside down.

  4. The three-minute sand timer will have one minute left, and five minutes are over because the two-minute sand timer has also ended.

  5. Now the three-minute sand timer ends.

  6. We will have measured six minutes.

There are 25 horses. How many races are needed to find the three fastest horses? You don't have a stopwatch and can only race five of the horses simultaneously.

First, do five races, each with five horses, and identify all the winners as shown below (here, the number and letter pair represent a horse):

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.