﻿﻿﻿﻿ Data Science puzzles in interview questions – TheDataMonk

Home » Data Science » Data Science puzzles in interview questions

# Data Science puzzles in interview questions

In the current scenario, getting your first break into analytics can be difficult. Around 30% of analytics companies (especially the top ones) evaluate candidates on their prowess at solving puzzles. It implies that you are logical, creative and good with numbers.

The ability to bring a unique perspective to solving business problems can provide you a huge advantage over other candidates. Such abilities can only be developed with regular practice and consistent efforts.

below are some common puzzling questions which are generally asked during interviews.

Two trains X and Y (80 km from each other) are running towards each other on the same track with a speed of 40km/hr. A bird starts from the train X and travels towards train Y with a constant speed of 100km/hr. Once it reaches train Y, it turns and starts moving toward train X. It does this till the two trains collide with each other. Find the total distance traveled by the bird?

Solution : Velocity of approach for the two trains = (40 + 40) km/hr

Total time the trains will take to collide = 80km/80km/hr = 1 hour

Total distance travelled by the bird = 100km/hr * 1hr = 100 km.

You have two beakers – one of 4 liters and other of 5 liters. You are expected to pour exactly 7 liters in a bucket. How will you complete the task?

Step 1 : Fill in 5-liter beaker and empty it in the 4-liter beaker. You are left with 1 liter in the 5-liter beaker. Pour this 1 liter in the bucket.

Step 2 : Repeat step 1 and you will have 2 liters in the bucket.

Step 3 : Fill in the 5-liter beaker and add to the bucket.You now have 7 liters in the bucket.

There are 5 pirates on a ship. Pirates have hierarchy C1, C2, C3, C4 and C5.C1 designation is the highest and C5 is the lowest. These pirates have three characteristics: a. Every pirate is so greedy that he can even take lives to make more money.  b. Every pirate desperately wants to stay alive. c. They are all very intelligent.There are total 100 gold coins on the ship. The person with the highest designation on the deck is expected to make the distribution. If the majority of the deck does not agree to the distribution proposed, the highest designation pirate will be thrown out of the ship (or simply killed). Only the person with the highest designation can be killed at any moment. What is the right distribution of the coins proposed by the captain so that he is not killed and does make maximum amount?

The solution of this problem lies in thinking through what will happen if all the pirates were thrown one by one and then thinking in reverse order.

Let us name pirates as A,B,C,D and E in hierarchy (A being highest).

If only D and E are left at end, D will simply give 0 coins to E and still escape because majority cannot be reached. Hence, even if E gets 1 coin he will give his vote to the distributor.

If C, D and E are there on the deck, C will simply give one coin to E to get his vote. And D  simply gets nothing. Hence, even if D gets 1 coin he will give his vote to the distributor.

If B,C,D and E are there on the deck, B will simply give one coin to D to get his vote. C & E simply gets nothing.

If A,B,C,D and E are there on the deck, A simply gives 1 coin each to C and E to get their votes.

Hence, in the final solution A gets 98 coins and only C & E get 1 coin each.

There are 3 mislabeled jars, with apple and oranges in the first and second jar respectively. The third jar contains a mixture of apples and oranges. You can pick as many fruits as required to precisely label each jar. Determine the minimum number of fruits to be picked up in the process of labeling the jars.

This is another tricky puzzle where you must really churn your brain. A noticeable aspect in this puzzles is the fact that there’s a circular misplacement, which implies if apple is wrongly labelled as Apple, Apple can’t be labelled as Orange, i.e., it has to be labeled as A+O. We are acquainted with the fact that everything is wrongly placed, which means A+O jar contains either Apple or Orange (but not both). The candidate picks one fruit from A+O, and let’s assume he gets an apple. He labels the jar as apple, however, jar labelled Apple can’t have A+O. Thus, the third jar left in the process should be labelled A+O. Basically, picking only one fruit

To crack Data Science/Business Analyst interviews, you need to be good at puzzles and case studies.

You can take a look on my book for more such puzzles, before your interview

100 Puzzles and case studies to crack data science interview