Tuesday, November 23, 2010

Escalator Problems

Problem #1
A person walking takes 26 steps to come down on a escalator and it takes 30 seconds for him for walking. The same person while running takes 18 second and 34 steps. How many steps are there ??
Sol:
Let's suppose that escalator moves n steps/sec.
It is given that if he walks he takes 30 sec and covers 26 steps.
So in that 30 sec escalator would have covered 30n steps.
Hence the total number of steps on the escalator is 26 + 30n----(1)

Similarly when he runs he takes 18 sec and covers 34 steps.
So in 18 sec escalator covers 18n steps.
Hence total steps on the escalator must be 34 + 18n-------(2)

Equating (1) & (2) 26 +30n = 34 + 18n we get n= 2/3
Hence no. steps is 26+30(2/3) = 46.

Problem #2
An escalator is descending at constant speed. A walks down and
takes 50 steps to reach the bottom. B runs down and takes 90 steps
in the same time as A takes 10 steps. How many steps are visible
when the escalator is not operating?

Sol: Lets suppose that A walks down 1 step / min and
escalator moves n steps/ min
It is given that A takes 50 steps to reach the bottom
In the same time escalator would have covered 50n steps
So total steps on escalator is 50+50n.

Again it is given that B takes 90 steps to reach the bottom and time
taken by him for this is equal to time taken by A to cover 10 steps i.e
10 minutes. So in this 10 min escalator would have covered 10n steps.
So total steps on escalatro is 90 + 10n

Again equating 50 + 50n = 90 +10n we get n = 1
Hence total no. of steps on escalator is 100.

Problem #3
There is a escalator and 2 persons move down it. A takes 50 steps and B takes 75 steps while the escalator is moving down. Given that the time taken by A to take 1 step is equal to time taken by B to take 3 steps, find the no. of steps in the escalator while it is staionary.

Sol: Let A take 1 step/min.
Hence B takes 3 steps/min. Let the escalator take n steps/min
Given that A takes 50 steps and hence in the same time escalator will
take 50n steps. So total no. of steps must be 50 + 50n

It is given that B takes 75 steps (which means he takes 25 min)
So in the same time escalator will cover 25n steps.
Hence no. of steps must be 75 +25n

Equating 50+50n = 75+25n we get n = 1.
Hence total no. of steps must be 100.
I hope my answers are correct and my explanation is lucid

Sunday, September 19, 2010

5 jars of pills


You have 5 jars of pills. Each pill weighs 10 gram, except for contaminated pills contained in one jar, where each pill weighs 9 gm. Given a scale, how could you tell which jar had the contaminated pills in just one measurement?
ANS.
1. Mark the jars with numbers 1, 2, 3, 4, and 5.
2. Take 1 pill from jar 1, take 2 pills from jar 2, take 3 pills from jar 3, take 4 pills from jar 4 and take 5 pills from jar 5.
3. Put all of them on the scale at once and take the measurement.
4. Now, subtract the measurment from 150 ( 1*10 + 2*10 + 3*10 + 4*10 + 5*10)
5. The result will give you the jar number which has contaminated pill.

Saturday, September 18, 2010

8 Identical Balls Problem

Q. You have 8 balls. One of them is defective and weighs less than others. You have a balance to measure balls against each other. In 2 weighings how do you find the defective one?


A. weigh three balls against another three balls. if both weigh the same , then just weighing the remain two (one against one) will show the lighter ball. if the sets of three do not weigh equal, then weigh any two balls in the lighter set, one against the other . the balance will show if the lighter one is on the balance,if not the remaining one is the lighter one.
8= (3 + 3 ) + 2
(the numbers in the brackets are balls on either side of the balance)
if both are equal, then
2= (1 + 1) done.
else, from the lighter set of 3
3= (1 + 1) + 1 done.

There are 3 baskets. one of them have apples, one has oranges only and the other has mixture of apples and oranges. The labels on their baskets always lie. (i.e. if the label says oranges, you are sure that it doesn’t have oranges only,it could be a mixture) The task is to pick one basket and pick only one fruit from it and then correctly label all the three baskets.

HINT. There are only two combinations of distributions in which ALL the baskets have wrong labels. By picking a fruit from the one labeled MIXTURE, it is possible to tell what the other two baskets have.

in a race u drove 1st lap with 40kmph and in the second lap at what speed u must drive so that ur average speed must be 80kmph.


Its impossible! if u drove the first lap in 40 kmph, its impossible that the 
average speed of both the laps is 80kmph.
for eg. consider one lap distance = 80km.
time req. to cover 1 lap = 80km/40kmph = 2 hrs.
 if the avg. speed is 80kmph, then the total time would have taken = 160kms/80kmph = 2 hrs.
same is the case with any other distance u consider. so the avg to be 80kmph is impossible

Can u make 120 with 5 zeros?

Factorial (factorial (0)+factorial (0)+factorial (0)+factorial (0)+factorial (0)) = 120

Monday, July 26, 2010

Welcome to techInterview, a site for technical interview questions, brain teasers, puzzles, quizzles (whatever the heck those are) and other things that make you think!