Browsing the blog archives for February, 2010

Burning Sticks

Tweet Question: You have two sticks and matchbox. Each stick takes exactly an hour to burn from one end to the other. The sticks are not identical and do not burn at a constant rate. As a result, two equal lengths of the stick would not necessarily burn in the same amount of time.  How […]

2 Comments

10 Famous Microsoft Interview Puzzles

Tweet Here is a list of 10 famous puzzles which have been asked on a Microsoft Interview. They are not in any specific order. Clock Hands How many times a day do the minute and hour hands of a clock overlap? Answer Is Your Husband a Cheat? A certain town comprises of 100 married couples. Everyone […]

Trains and Birds

Tweet Question: A train leaves City X for City Y at 15 mph. At the very same time, a train leaves City Y for City X at 20 mph on the same track. At the same moment, a bird leaves the City X train station and flies towards the City Y train station at 25 […]

5 Comments

Globe Walker

Tweet Question: How many points are there on the globe where, by walking one mile south, then one mile east and then one mile north, you would reach the place where you started? Answer: The trivial answer to this question is one point, namely, the North Pole. But if you think that answer should suffice, […]

4 Comments

Clock Hands

Tweet Question: How many times a day do the minute and hour hands of a clock overlap? Answer: Did you think the answer was 24 times? Well if you did, it’s time you think again. Let’s do some math. In T hours, the minute hand completes T laps. In the same amount of time, the hour […]

20 Comments

10 Google Interview Puzzles

Tweet Here is a list of 10 puzzles which have been asked on a Google Interview. They are not in any specific order. Reverse a Linked-List Reverse a Linked-list. Write code in C. Answer Challenge – Equal Probability between 1 and 7 Write a method to generate a random number between 1 and 7, given […]

The Ant Problem

Tweet Question: Three ants are sitting at the three corners of an equilateral triangle. Each ant starts randomly picks a direction and starts to move along the edge of the triangle. What is the probability that none of the ants collide? Answer: So let’s think this through. The ants can only avoid a collision if […]

13 Comments

Piece of Cake

Tweet Question: How would you cut a rectangular cake into two equal pieces when a rectangular piece has already been cut out of it? The cut piece can be of any size and orientation. You are only allowed to make one straight cut. Answer: Simple question right? There are two possible solutions to this problem. […]

18 Comments

My Tech Interviews

Tweet Hello everyone, Welcome to My Tech Interviews. A blog which helps people prepare for a software technical interview. My Tech Interviews This blog is dedicated to helping people prepare for a technical interview, mainly for a software interview. It contains various types of questions like puzzles and programming tasks. These questions are not posted […]

Combinations of a String

Tweet Question: Write an algorithm to print all possible combinations of characters in a string. Answer: Any thoughts? One thing is for sure, we can definitely use some recursive logic here. Let’s approach this problem methodically. Since we need to generate combinations, we can start with a single character and then continue to add a […]