Friday 10 April, 2009

Some Puzzles

- Producer Consumer Problem:
Scenario 1: Traditional Problem
Scenario 2: Producer should produce and puts in the shared buffer. Every consumer should consume the item before we delete it from the shared buffer.

- In race court, there are 5 tracks and 25 horses to race. We need to find the top 3 from the 25 horses. Assumption is - Horses perform in the same way during all the races and we can't record the times. You can make horses to participate any number of times. In how many races, you can find the top 3?

6 comments:

Sankar said...

What happened ?

Vijesh said...

8 races for top 3..

Vishnu said...

7 races for top 3
@Sankar: What "What happened?" :)
Everything is fine..

Vishnu said...

@Sankar:
One junk fellow asked me these questions and I thought I will share them..

Vijesh said...

@Vishnu Solution for scenario 2, you have?

Sankar said...

>> @Sankar: What "What happened?" :)

Looked like an interview question ;-)