QUALCOMM Interview Question
308 Interview Reviews |
Back to all QUALCOMM Interview Questions & Reviews
Interview questions and reviews posted anonymously by interview candidates
Interview Question for Engineering at QUALCOMM:
given 20 "destructable" light bulbs(which breaks at certain height), and a building with 100 floors, how do you determine the height that the light bulb breaks.
Helpful Question?
Yes |
No
Inappropriate?
Answers & Comments (45)
1 of 19 people found this helpful
Helpful Answer?
Yes |
No
Inappropriate?
16 of 19 people found this helpful
Helpful Answer?
Yes |
No
Inappropriate?
6 of 13 people found this helpful
"You will get a bonus of $1000 for each remaining glass bulb after the test. What is the highest bonus you can absolutely guarantee, and with what algorithm?"
The interviewer told me that he only had it answered correctly once, and that person had a master's degree in pure mathematics. The candidate explained the theory behind the answer using lots of appropriately mathematical terms.
The long-winded, logic-based solution to prove that you can earn an $18'000 bonus goes as follows:
• If you drop a ball from floor X and it shatters, you will need to drop the other from floors 1 to x-1 in that order to find out the lowest floor at which the ball would break.
• Therefore, if you started at floor 20 and the ball shatters, you have to drop the other from 1 to 19 to see at which that one will shatter.
• If it shatters at floor 19, your bonus is all gone (you're performed 20 drops, losing $20'000 from your bonus).
• If the ball does *not* shatter at floor 20, then you might try again at floor 40, but then you'd only have 18 drops left— if it broke at 40, but not at 38 (when you've used all your drops) you don't know if 39 or 40 was the breaking-point.
• Therefore, after trying 20, you go up 19 floors to 39 and try again there.
• You repeat, going up 18 floors to 58, then 77, then 86, etc.
• However, this isn't optimized. You can't *guarantee* a bonus by stepping up by [20 19 18 …], since you could conceivably deduce the amount only using a full 20 drops.
• Therefore we look at how we can divide up our 100 floors by a descending sequence:
• 10 + 9 + 8 + … = 55 => No Good.
• 11 + 10 + 9 + … = 66 => No Good.
• Try going the other way; starting at 1 and counting up (sort of like the Fibonacci sequence), at which point do we pass 100?
• 1 + 2 + 3 + 4 + … + 12 + 13 + 14 = 105.
• Therefore, we can start dropping the ball at floor 14 using the algorithm above, and still have enough drops to determine the exact floor at which the ball breaks, even should it be floor 99 or 100.
• Using 14 as a base, this means that the *maximum* number of times we will drop the ball is 14 times, while still guaranteeing that we drop at $BREAK_HEIGHT and $BREAK_HEIGHT-1.
Therefore, the correct solution can be calculated using only two glass balls, a maximum of two of which will smash, guaranteeing us a bonus of $18'000.
QED :o)
Helpful Answer?
Yes |
No
Inappropriate?
29 of 30 people found this helpful
Start at floor level, drop it, and if it does not brake USE THE SAME BULB for next trial higher up until the very same bulb brakes.
Helpful Answer?
Yes |
No
Inappropriate?
3 of 8 people found this helpful
Helpful Answer?
Yes |
No
Inappropriate?
0 of 1 people found this helpful
Helpful Answer?
Yes |
No
Inappropriate?
3 of 3 people found this helpful
Helpful Answer?
Yes |
No
Inappropriate?
2 of 3 people found this helpful
Helpful Answer?
Yes |
No
Inappropriate?
4 of 6 people found this helpful
2. the question does not say the bulbs are all the same
Helpful Answer?
Yes |
No
Inappropriate?
1 of 3 people found this helpful
Nothing was said about testing it from a floor.
I could also drop it on a very soft surface and if soft enough make the $20000.
Sometimes we think too much. You were misdirected.
Helpful Answer?
Yes |
No
Inappropriate?
4 of 4 people found this helpful
Helpful Answer?
Yes |
No
Inappropriate?
1 of 2 people found this helpful
Helpful Answer?
Yes |
No
Inappropriate?
1 of 2 people found this helpful
Helpful Answer?
Yes |
No
Inappropriate?
2 of 2 people found this helpful
What is the desired OUTCOME?
There are a number of ways to determine the correct floor. But in most tasks, there are desired outcomes. Does the questioner wish the most efficient way to determine the floor number (that's not in the question)? Or does the questioner care more about having extra light bulbs at the end? People often jump into the programmatic solution first, without ever thinking to ask "What should my end state be?"
Helpful Answer?
Yes |
No
Inappropriate?
0 of 1 people found this helpful
Helpful Answer?
Yes |
No
Inappropriate?
2 of 2 people found this helpful
Helpful Answer?
Yes |
No
Inappropriate?
2 of 4 people found this helpful
20k in the bank.
Helpful Answer?
Yes |
No
Inappropriate?
Helpful Answer?
Yes |
No
Inappropriate?
1 of 1 people found this helpful
Helpful Answer?
Yes |
No
Inappropriate?
2 of 4 people found this helpful
Helpful Answer?
Yes |
No
Inappropriate?
1 of 1 people found this helpful
I think you can actually figure it out with only lightbulb lost. Assuming you started from the bottom floor and worked up to the top floor dropping the bulb and then picking it up and dropping it again on the next floor. It would take quite a while though. That is assuming you want to optimize the number of bulbs lost. If you want to optimize based on time, you would want to do a binary search algorithm
Helpful Answer?
Yes |
No
Inappropriate?
2 of 2 people found this helpful
Fact one - no one said you couldn't pick up an unbroken bulb and try it again.
Fact two - no one said you had to drop the bulb. It just said "breaks at a certain height."
None of you considered that...maybe by ascending the building carrying one (1) bulb...it might just...break?
Convergent thinkers!!!
Helpful Answer?
Yes |
No
Inappropriate?
3 of 3 people found this helpful
Helpful Answer?
Yes |
No
Inappropriate?
1 of 1 people found this helpful
Helpful Answer?
Yes |
No
Inappropriate?
1 of 1 people found this helpful
A) Does the question mean the bulb would break if placed on a certain floor of the building or is the asker really meaning the bulb would break if dropped from a certain height?
B) Is the goal to find the most efficient solution to the question (i.e. fewest number of tests)?
C) Assuming we are dropping the bulbs from the building, can we collect unbroken bulbs and reuse them?
Without this information, there is no way to answer the question. The answer depends on this additional information.
Helpful Answer?
Yes |
No
Inappropriate?
Helpful Answer?
Yes |
No
Inappropriate?
Helpful Answer?
Yes |
No
Inappropriate?
is it really that hard??
Helpful Answer?
Yes |
No
Inappropriate?
Given the condition that Jim Dovey added in above comments, if one is going to get bonus of $1000! algorithm depends on what you want to achieve.
1. Optimize number of trials:
Solution- use binary search approach. guaranteed bonus=13k
2. optimize profit:
solutino - start from 1st floor. go up one level. Only 1 bulb needed. guaranteed bonus = 19k
Helpful Answer?
Yes |
No
Inappropriate?
Your logic is interesting.
But when you say (uses the least amount of bulbs) your word usage is incorrect.
Amount is for a measured quantity as in amount of sugar.
You should have said (uses the least number of bulbs) or (uses the least bulbs)
Number is for counted quantities
Helpful Answer?
Yes |
No
Inappropriate?
1 of 1 people found this helpful
"I'm not answering it for the same reason you Googled the questions to ask: neither of us have time for this."
I kind of just blurted it out. As you might expect, I wasn't offered the engineer position.
I was instead offered the group supervisor position.
I would not try this at home -- but they told me they'd never had anyone answer it that way, and it was the reason they made me that offer. It's an extreme example of how these questions are as much about attitude as aptitude.
Helpful Answer?
Yes |
No
Inappropriate?
We can reduce trials and sacrifices some bonus, if each trial cost something that will impact bonus
Helpful Answer?
Yes |
No
Inappropriate?
Helpful Answer?
Yes |
No
Inappropriate?
1 of 1 people found this helpful
Take one bulb, leave the rest at the bottom of the building. Walk up the stairs until the bulb breaks. At most, one will break. $19,000 bonus guaranteed.
Helpful Answer?
Yes |
No
Inappropriate?
Helpful Answer?
Yes |
No
Inappropriate?
0 of 1 people found this helpful
Helpful Answer?
Yes |
No
Inappropriate?
1 of 1 people found this helpful
What is more important to save time or save bulbs?
(Similar question as what is more costly the light bulbs or my time?)
If they are experimental bulbs that cost $1000 each, I'm pretty sure I could walk to eah floor in less than 16 hours (and unless I get payed $1000 an hour) then it is more economical to go up one floor at a time (although I would not quite do that).
If the bulbs are cheap (let say $1 each) then my time is more expensive. So the number of times over 1 that I drop it an it does not break is wasted time (or money). Then I would use a binary search algorithm. Also if there is an elctro magnet attached to a cable it may help in making the test shorter (ideally it needs to be 25 stories in length).
How accurate do the findings need to be? (down to a floor or down to an inch).
BTW, the minimum number of bulbs that would need to be destroyed is 3. Since the experiment (yes, it is a scientific experiment) needs to be verified at least 3 times.
BTW, LED light bulbs are very tough is is essentially a piece a piece of metal inside a piece of plastic. This bulbs are tough. I have drop an entire fixture from 20 feet (bulbs and metal casing) and it survived.
So for those who "ASSUMED" that all bulbs break at distance greater than 0. Thank you for applying, but the management positions are already taken, they were looking for an engineer. As I can tell many people here are not the core group Qualcomm was looking for.
Helpful Answer?
Yes |
No
Inappropriate?
Helpful Answer?
Yes |
No
Inappropriate?
You know what? I don't need this job anymore, I have a 100 story building now!!!
Helpful Answer?
Yes |
No
Inappropriate?
I generally agree with all the people that say that the lightbulbs break at a height of zero though, assuming that you're dropping the lightbulbs off the building FROM any height. The question wasn't what height the bulb breaks when dropped FROM. Obviously the height that the bulb breaks is ZERO when it hits the ground. But that's assuming that you drop it on the ground next to the building and not on each of the 100 floors.
Then again, the bulbs might break at EVERY height. If you so much as touch these light bulbs they will break, let alone drop them! Maybe these lightbulbs and the new high-tech ultra-thin glass breaks in anything short of an absolute vaccuum and zero gravity. Maybe this really is an altitude issue. Maybe your 100 story, 350-foot tall building is insufficient and irrellivent because the bulbs break at an altitude of 35,000 feet.
Also, every single one of you assumed that you recieved these light bulbs intact. Maybe to answer the question you simply need to look at the light bulb where it already lies in pieces on the floor.
Alternatively, these could be self-destructable lightbulbs with an altimeter and an explosive charge built in. Walking up or down the stairs holding one of these lightbulbs would be suicide. The question then would be what might motivate you to figure this out if it would cost you your life?
Helpful Answer?
Yes |
No
Inappropriate?
I lose zero bulbs. Simply wait until evening and look up. The number of floors that have lights turned on will tell you which floor they start breaking at.
Helpful Answer?
Yes |
No
Inappropriate?
Helpful Answer?
Yes |
No
Inappropriate?
But if I really want to come up with an definite answer, I would say the "certain" height is the height at which I smash the bulb. So if I am in a building that has a foundation 535 feet above sea level and I smash the bulb on the 100th floor and each floor is 12 feet above the one below: (12 X 99) + 535 = 1723 feet. You do not add 12 feet for the 100th floor because the 1st floor is 0 feet above 535.
Helpful Answer?
Yes |
No
Inappropriate?
To comment on this
question,
Sign In with Facebook or
Sign Up
12 of 14 people found this helpful
by Anonymous: