## Brain Teasers Interview Questions

- 0of 0 votes

AnswersWhat is the next line in the following sequence:

- DPS Prog May 17, 2009

1

11

21

Answer: it's 1211 and the next is 111221| Report Duplicate | Flag | PURGE

Bloomberg LP Software Engineer / Developer Brain Teasers - 0of 0 votes

AnswersOut of 10 coins, one weighs less then the others. You have a scale.

- DPS Prog May 17, 2009

(A)How can you determine which one weighs less in 3 weighs?

(B)Now how would you do it if you didn't know if the odd coin weighs less or more?| Report Duplicate | Flag | PURGE

Bloomberg LP Software Engineer / Developer Brain Teasers - 0of 0 votes

AnswersThere are n gas stations positioned along a circular road. Each has a limited supply of gas. You can only drive clockwise around the road. You start with zero gas. Knowing how much gas you need to get from each gas station to the next and how much gas you can get at each station, design an algorithm to find the gas station you need to start at to get all the way around the circle.

- DPS Prog May 17, 2009| Report Duplicate | Flag | PURGE

Bloomberg LP Software Engineer / Developer Brain Teasers - 0of 0 votes

AnswersYou have 2 supposedly unbreakable light bulbs and a 100-floor building. Using fewest possible drops, determine how much of an impact this type of light bulb can withstand. (i.e. it can withstand a drop from 17th floor, but breaks from the 18th).

- DPS Prog May 17, 2009

Note that the ever-popular binary search will give you a worst case of 50 drops. You should be able to do it with under 20.| Report Duplicate | Flag | PURGE

Bloomberg LP Software Engineer / Developer Brain Teasers - 0of 0 votes

AnswersSuppose you have below line in your file

- sonu March 01, 2009

foo (bar ( new Point(x, graph.getY()) ));

write a regular expression to convert it to below format. I want to see space before and after bracket

foo ( bar ( new Point ( x, graph.getY ( ) ) ) ) ;| Report Duplicate | Flag | PURGE

Amazon Software Engineer / Developer Brain Teasers - -1of 1 vote

AnswersConsider the problem of building a wall out of 2×1 and 3×1 bricks (horizontal×vertical dimensions) such that, for extra strength, the gaps between horizontally-adjacent bricks never line up in consecutive layers, i.e. never form an internal "running crack". For example, the following 9×3 wall is not acceptable due to the internal running crack shown as a dotted line:

- Anonymous January 11, 2009

There are eight ways of forming a crack-free 9×3 wall, written W(9,3) = 8. Write a program to calculate W(32,10). To get you started, here are a few smaller values:

W(9, 3) = 8

W(18, 5) = 7958| Report Duplicate | Flag | PURGE

Amazon Software Engineer in Test Brain Teasers - 1of 1 vote

AnswersThere are four different treasue chests each one containing gold, silver, brass and copper. There are 100 participants who try to find which chest contains which treasure.

- Treasure Chests January 09, 2009

In the end, it appears, that 23 have found none correctly, 58 have only 1 correct and 14 have 2 correct. How many have 3 correct? and how many have 4 correct?| Report Duplicate | Flag | PURGE

Bloomberg LP Financial Software Developer Brain Teasers - 0of 2 votes

AnswersA river separates two banks, there are 3 men and 3 lions on one side that need to be taken across using a boat that can carry 2 entities at a time(irrespective of being a lion and man), subject to the condition that at no point can you have more number of lions than men on any bank, as then the lions would eat the man/men. Solve the puzzle. Then code it to make it a generic program that solves the puzzle for X men and Y lions.

- me December 27, 2008

3-3 is easy, generalization is a bit problematic.| Report Duplicate | Flag | PURGE

Google Software Engineer in Test Brain Teasers - 0of 0 votes

AnswersThere are two rabbits: Rabit A and Rabit B. Both of them run a 100 m race . When rabbit A finishes the race rabbit B is at 90 m mark. They run at constant speed. Without calculating time , speed or distance , by just analyzing the given data tell when A starts from 10 m behind the 0 m mark (110 m run for A) and B starts at 0 mark only , who wins and why ?

- Prashi December 20, 2008| Report Duplicate | Flag | PURGE

Amazon Software Engineer / Developer Brain Teasers - 0of 0 votes

AnswersThere is a circular table. You and your friend have infinite number of coins. Both of you place one coin in each turn on the table. Coin can be placed only in the empty space. Whoever places the last coin wins the game. If you are starting first, design a strategy so you will always win.

- Meghna December 05, 2008| Report Duplicate | Flag | PURGE

Amazon Software Engineer / Developer Brain Teasers - 1of 0 votes

AnswersThere are 9 marbles. 8 of them are of equal weight, 1 is not. You are given a weighing scale. How do you find out which one is has the different weight? Is there a faster solution? What is the speed of your solution?

- Zefram Cochrane November 22, 2008| Report Duplicate | Flag | PURGE

Amazon Software Engineer / Developer Brain Teasers - 0of 0 votes

Answersif you have 50 white beads and 50 black beads and you MUST put all of the beads into two bins (50 beads in each), how do you maximize your chance of choosing a white bead (from either bin)

- S November 12, 2008| Report Duplicate | Flag | PURGE

Amazon Software Engineer / Developer Brain Teasers - 0of 0 votes

AnswersHow many oranges/spheres (each of diameter 10 units) can you fit into a box with a size = 100 X 100 X 100 units.

- FinExpress October 31, 2008| Report Duplicate | Flag | PURGE

Goldman Sachs Software Engineer / Developer Brain Teasers - 2of 0 votes

AnswersThere are hundred prisoners each standing in a column. Each one is given a hat and there are two possible colors of hat which are red and white. The 100th person can see the hats of 99 people in front of him and the 99th person can see 98 people in front of him but can't see his own and the previous hat. The number of hats aren't known and the hats are placed in random order. Starting with the 100th person, each person is asked what color hat they have. If they guess wrong, they die. Come up with a strategy such that maximum people are alive. How many people are alive? (Do not use probability constraint given)

- preethi natarajan October 31, 2008| Report Duplicate | Flag | PURGE

Google Software Engineer in Test Brain Teasers - 0of 0 votes

AnswersBag A = 10 Red balls.

- Satish October 22, 2008

Bag B = 10 Green balls.

Shuffle bag A move three balls from A => B then

Shuffle bag B move three balls from B => A

Which bag is likely have more number of balls of other color.| Report Duplicate | Flag | PURGE

Microsoft Software Engineer in Test Brain Teasers - -1of 1 vote

AnswersA good and challenging Series to solve

- ajay October 08, 2008

I need to find to the mathematical series for this one .

f(-9)=-49213156

f(-8)= -2448222

f(-7)=-141362

f(-6)= -9751

f(-5)= -839

f(-4)= -97

f(-3)= -16

f(-2)= -4

f(-1)= -1

f(1) = 1

f(2) = 0

f(3) = 8

f(4) = -47

f(5) = 503

f(6) = -6485

f(7) = 100898

f(8) =- 1835574

f(9) = 38270970

for both + ve and - ve numbers different series algo.

+ number input vary from 1 to 9

- number input vary from -1 to -9| Report Duplicate | Flag | PURGE

Microsoft Brain Teasers - -1of 1 vote

AnswersA duck, pursued by a fox, escapes to the center of a perfectly circular pond. The fox cannot swim, and the duck cannot take flight from the water (it’s a deficient duck). The fox is four times faster than the duck. Assuming the fox and duck pursue optimum strategies, is it possible for the duck to reach the edge of the pond and fly away without being eaten? If so, how?

- Google September 19, 2008| Report Duplicate | Flag | PURGE

Google Software Engineer / Developer Brain Teasers - 0of 0 votes

AnswersA room has 3 light bulbs. There are 3 switches outside the room. You cannot see the lights from outside the room. You can go into the room once. Find out the corresponding switch to each light bulb.

- microsoft September 19, 2008| Report Duplicate | Flag | PURGE

Microsoft Software Engineer / Developer Brain Teasers - 2of 0 votes

AnswersA big cube is made of 1000 small cubes. How many small cubes are there at the surface?

- Barcap September 17, 2008| Report Duplicate | Flag | PURGE

Barclays Capital Software Engineer / Developer Brain Teasers - 1of 1 vote

AnswersGiven a 3 liter jug and a 5 liter jug, explain how you would measure 4 liters.

- xyz September 12, 2008

He was making it more complex by asking to formulate an equation for that .. was just for stress check..| Report Duplicate | Flag | PURGE

Bloomberg LP Financial Software Developer Brain Teasers - 1of 1 vote

AnswersBrain teaser. You have 8 coins, only 1 is more heavy. How to detect it

- Bloomberg london July 31, 2008| Report Duplicate | Flag | PURGE

Bloomberg LP Financial Software Developer Brain Teasers - -1of 1 vote

AnswerSome sort of a planning problem

- ns April 22, 2008

5 friends 5 cities 5 distances ...

some 6 conditional statements given

map the friends to cities and also map distance to cities such that

the conditional statements are true| Report Duplicate | Flag | PURGE

Microsoft Program Manager Brain Teasers Algorithm - 0of 0 votes

AnswersYou have two identical roop. Both of them have the following properties:

- Shoaib April 04, 2008

1. Each burns in one hour.

2. They burn at a non-uniform rate. i.e. there is no correlation between the length of the rope with the time it takes to burn it.

Using only these roops find out when 1.5 hrs have elapsed?| Report Duplicate | Flag | PURGE

Microsoft Software Engineer / Developer Brain Teasers - 0of 0 votes

AnswersThere are thousands of webpages. Find all the files where the hyperlink "www.amazon.com" occurs and append a string to it. For example, all "www.amazon.com" hyperlinks become "www.amazon.com?id=123"

- lax February 17, 2008| Report Duplicate | Flag | PURGE

Amazon Software Engineer / Developer Brain Teasers Algorithm - 0of 0 votes

AnswersYou have a cube that is painted red on all 6 sides. If you were to make two symmetrical cuts in each dimension, you would have a total of 27 pieces. How many pieces have red on all 4 sides, on 3 sides, on 2 sides, on 1 side and on no sides?

- Koonz February 14, 2008

Heres the best way I can explain the cut in one dimension:

=============

| 1 2 |

| 1 2 |

| 1 2 |

| 1 2 |

=============

where the vertical '1' and '2' lines are the cuts so now you have three pieces. So imagine that in every dimension.| Report Duplicate | Flag | PURGE

Deshaw Inc Software Engineer / Developer Brain Teasers - 0of 0 votes

Answers5 6 7 8 8 8 8 8 ? What is the next number in the series ???

- vas November 15, 2007| Report Duplicate | Flag | PURGE

Goldman Sachs Software Engineer / Developer Brain Teasers - 0of 0 votes

AnswersThere are three machines with different processing powers. They each take respectively 2, 10 and 20 units of execution time to finish a task requiring X effort. If we let all three machines work on same task, considering each quantum of task is independent of the other, so that not for a moment a machine has to wait for another one to finish, how long will it take for three machines to finish the given task.

- Jayesch October 18, 2007| Report Duplicate | Flag | PURGE

Qualcomm Software Engineer / Developer Brain Teasers

**CareerCup**is the world's biggest and best source for software engineering interview preparation. See all our resources.

Open Chat in New Window