The ongoing pandemic has affected hiring in many companies across data science domains. Even if companies are recruiting, they are adopting stringent procedures to spot the right candidate. Puzzles are often preferred to evaluate a candidate as it best accesses the critical thinking ability, problem-solving and in many cases, even the coding skills of a candidate.
In this article, we list a few such brainstorming puzzles which help aspiring data science and analytics candidates to exercise their brain muscles. These questions have been sourced from various resources available on the internet and experiences of data science candidates in interviews.
Sign up for your weekly dose of what's up in emerging technology.
Read some other puzzles here.
1| A scooter has two tyres and one Stepney. Each tyre can run a maximum distance of five kilometres. How long will the scooter run?
To approach this problem, let us assume three tyres to be A, B and C
A = 5km; B = 5km, C = 5km
At first, we can ride 2.5 kilometres with A and B.
A = 2.5 km, B = 2.5 km, C = 5 km
Then Remove A and travel with BC to 2.5 km more.
Remaining A = 2.5, B = 0, C = 2.5
Then remove B and travel with AC to 2.5 km more.
Remaining A = 0, B = 0, C = 0
Therefore, total distance travelled is 2.5 + 2.5 + 2.5 = 7.5 km
2| 100 people are standing in a circle numbered 1 to 100. Person 1 kills the next person (i.e. No. 2) with a sword and gives the sword to the next to next person (i.e. No.3). All of them do the same until only one survives. Which number survives at last?
You should get the nearest smaller number that is the power of 2. In this, it is 64. Subtract it will be the total number of people, i.e., 100.
100 – 64 = 36
Now we apply the formula 2n + 1,
2 * 36 + 1= 72 + 1 = 73.
The lone survivor will therefore be the No. 73.
Read here for a more detailed answer.
3| Two friends A and B meet at a party on a new year day. As they met after a long time, B wanted A to guess his birthday. As they met after a long time, A was unable to guess B’s birthday. B decided to give some hints as below:
- The day before yesterday I was 25, and next year I will be 28
- The above condition can be true for only one day in the year.
The approach to this problem goes as below:
A met B on new year day, let’s assume. January 1, 2019. So, the day before yesterday, i.e. on December 30, 2018, B was 25 years old, and on the present-day, i.e. January 1, 2019, B is 26. On December 31, 2019, B will be 27 and next year, i.e. on December 31, 2020, his age will be 28.
So, B’s birthday is on December 31.
4| A person is working for you for five days, and you should pay him a gold bar at the end of every day. It should be done in a way that you make the fewest number of cuts in the one big gold bar that you have that will allow you to pay him 1/5th each day?
The fewest number of cuts would be 2.
Make a cut in a way that there are three pieces — one of 1 unit and two of 2 units.
On day 1: Give him 1 unit.
On day 2: Give him 2 units and take back 1 unit.
On day 3: Give him 1 unit (he already has 2 units).
On day 4: Give him 2 units and take back 1 unit (he already has 2 units).
On day 5: Give him 1 unit (he already has two 2 units).
5| A bus has 100 labelled seats from 1 to 100. There are 100 people standing in a queue from 1 to 100, and people board the bus in the sequence of 1 to n. The rule is, if a person ‘a’ boards the bus, he checks if seat ‘a’ is empty. If the seat is empty, he sits there, else he randomly picks an empty seat to sit. Given that the first person picks a seat randomly, find the probability that the 100th person sits in his place, i.e. seat number 100.
The last person to board will have a seat determined the moment either the first or the last seat is selected. This is because the last person will either get the first seat or the last seat. Any other seat will be taken by the time the last person gets to make a selection of the seat.
As each person boards the bus, the probability of the first or last seat being taken is equal. This means that the last person will get either the first or last seat with equal probability.
Therefore, the probability of the last person getting onto seat no. 100 is 1/2.
6| There are 5 jars of pills. Each pill weighs 10 grams, except for contaminated pills contained in one jar, where each pill weighs 9 grams. Given a scale, how could you tell which jar had the contaminated pills in just one measurement?
Take out 1 pill from jar 1, 2 pills from jar 2, 3 pills from jar 3, 4 pills from jar 4 and 5 pills from jar 5. Put all these 15 pills on the scale.
The correct weight should be 15*10 = 150
But, since one of the jars has contaminated pills, the weight will definitely be less than 150.
If the weight is 149, then jar 1 has contaminated pills because there is only one pill taken from jar 1. If the weight is 148 then it is jar 2, if the weight is 147 then it is jar 3, if the weight is 146 then jar 4 is contaminated and, if the weight is 145, then jar 5 has contaminated pills.
7| Three ants are sitting at the three corners of an equilateral triangle. Each ant starts randomly picking a direction and starts to move along the edge of the triangle. What is the probability that none of the ants collides?
For the ants to avoid a collision, they must move in one direction — either clockwise or anticlockwise. If they do not move in one direction, there will definitely be a collision. Each ant has the option to either move clockwise or anti-clockwise. There is a one in two chance that an ant decides to pick a particular direction.
The probability of no collision will therefore be,
N (No collision) = N (All ants go in a clockwise direction) + N (All ants go in an anti-clockwise direction) = 0.5 * 0.5 * 0.5 + 0.5 * 0.5 * 0.5 = 0.25
8| There are 10 bags full of coins, with infinite coins in each bag. But one bag is full of forgeries, and you can’t remember which one. But you do know that genuine coins weigh 1 gram and forgeries weigh 1.1 grams. You have to identify that bag in minimum readings. You are provided with a digital weighing machine.
Building upon the same approach as the solution in question 6 above, we have to first take 1 coin from the first bag, 2 coins from the second bag, 3 coins from the third bag and so on till 10 coins from the 10th bag are taken out.
The total number of coins taken out will be 1 + 2 + 3…+10 = 55 coins.
Now, weigh the 55 coins together.
Depending on the reading, the bag with the forged coin can be found out. For instance, if the reading ends with 0.4, it is the fourth bag, if it is 0.8, then it is the 8th bag, and so on.
9| A snail is at the bottom of a 30-foot well. Every hour the snail can climb up 3 feet and then it slides back down 2 feet. How many hours will it take for the snail to get out of the well?
Every 1 hour, the snail is climbing 3 feet and sliding down 2 feet. It is therefore covering a distance of 3 – 2 = 1 feet every hour.
Now, once the snail reached the top, it will not slide back.
So, the position from where it will reach the top in 1 hour would be:
30 feet – 3 feet (upward distance covered in 1 hr) = 27th feet.
It means that the snail will not slide down when it starts climbing from 27th feet.
Now, as the snail can climb 1 foot every hour, it can climb 27 feet in 27 hours.
The last 3 feet will be covered in 1 hour from 27th feet.
Hence, the time taken to climb to the top of the well is,
27 hours + 1 hour = 28 hours.
10| If a hen and a half lay an egg and a half in a day and a half then how many hens will it take to lay six eggs in six days?
Since, 1.5 eggs in 1.5 days require 1.5 hens
1 egg in 1.5 days will require 1.5/1.5 = 1 hen
1 egg in 1 day will require 1 * 1.5 = 1.5 hens
6 eggs in 1 day will require 1.5 * 6 hens
6 eggs in 6 days will require 1.5 * 6 / 6 = 1.5 hens