Image for post
Image for post
Drawing based on a shutterstock image

The top 5 coolest questions I was asked during tech interviews

César Ferreira
Jan 13, 2016 · 3 min read

These are some of the best logical/reasoning questions/puzzles that I’ve been asked during tech interviews in the past few years.

Water in a bottle

Image for post
Image for post

You have an unlimited supply of water. Given a 3 gallon empty bottle and a 5 gallon empty bottle, get me exactly 4 gallons.

The solution is restricted to the exclusive use of the 3 gallon and the 5 gallon containers.

3 bulbs in a room

Image for post
Image for post

There is a room which has 3 bulbs inside it and one door. Now the switches of all three are placed outside, behind the room. The three switches are similar to each other and you don’t know which switch corresponds to which bulb. You have one chance to set the configuration of the switch in such a manner that you can determine which switch corresponds to which bulb?

Which is the bad coin?

Image for post
Image for post

You have 12 coins. One of them is either heavier or lighter than the others — you don’t know which. You only have a jeweler’s balancing scale — so, there are just two sides that will either balance or not, according to which coins you put on each side.

What is the minimum number of weighings with which you can find out the bad coin and also tell whether it is heavier or lighter than the others?

Socks!

Image for post
Image for post

You are in a dark room. In the sock drawer you’ll find 5 blue socks, 5 red socks and 10 white socks.

What is the minimum number of socks that you need to bring to the corridor to be sure that you have at least 1 pair of socks with the same color?

Blind pills

Image for post
Image for post

You are blind. You are in your kitchen and on the kitchen’s table there are 4 pills, 2 blue and 2 red. They have the same weight, size, form and smell, so they can’t be distinguished by someone who can’t see. You need to take only 1 red and 1 blue pill, if you take 2 blue or 2 red you’ll die instantly.

Given that you are alone, how can you be sure that you are taking one of each?



Credits

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store