There is no correct answer to this question. It's all based on your problem solving abilities.

The method for "solving" this involves making assumptions and then calculating an answer. The assumptions could be wrong, which isn't as important, and the interviewer will likely help guide your assumptions if they felt it was necessary. The assumptions here would be about the approximate size of a tennis ball, the approximate volume of the room, etc. Getting fancy, you might begin discussing how the weight of the tennis balls would begin compressing the lower levels, giving more potential room at the top, as well as how the second level of tennis balls would rest in a lattice structure on the first level, sitting in the gaps, and thus not being as high as simply multiplying the diameter of the tennis ball by 2 to get the height of two layers.

I agree with both prior posts. An interviewer asking this question is trying to determine your problem solving skils. The worst thing you could do is blurt out an actual number without explaining your thought process. I'm not sure the interviewer is as interested in the quantity as much as how you arrive at it. The worst answer "Wow, I have no idea".

Everybody is reading this question wrong. It doesn't say how many tennis balls CAN FILL this room. It says how many tennis balls are IN THIS ROOM and why. The question is probably meant to see if the candidate is actually fully paying attention to the questions (unlike everybody who has answered it here). It is a trick. I would gather to say that there are NO tennis balls in the room...and why? Because it is an office, not a tennis court.

Hi wildfiresg, Maybe you should ask the interviewer to show the insides of his pockets? You never know, maybe there is a tennis ball in there!

I think wildiresg is the only one above who's really paying attention (which is CRITICAL in an interview) - give him the job!! And Igor makes a very good but funny point....the candidate should also ask to check any drawers, boxes or closets in the room!!!

In the original post the candidate did mention "how many tennis balls can fill this room?" as part of the interview. The first answers were tricked into reading this question as the same in the story. Good job wildiresg!

"If the room is already filled with sand, none. Do you want to know if I can actually write code?"

If the question really is how many "are in this room", then make an observation about how many you can see. I'm going to assume "zero" is a safe bet for most interviews. If, however, the question was suppose to be how many *can fit* in the room, then please ask (type, in this forum) the right question, or the people who are smart enough to actually listen to the question you're asking will never give you a response you'll be happy with.

Assume: 1) this is a theoretical determination of how many the room would hold & 2) not an exercise of observation & 3) there is no compression ... then this is a simple mathematical problem (as long as you know the formulas) and you have the relevant metrics to hand. A tennis ball is a sphere & its volume is calculated at 4/3 Pi r(cubed). Packing ratios are 66 & 1/2% (there will be space between the balls when packed). With the dimensions of the room you can then calculate how many tennis balls would fit into it. This can be used to work out the fairground game of how many marbles in a jar or even m&m's in a jar (though that is a different formula & is for an oblate spheroid & not a sphere)

This is a metaphorical question. There is one tennis ball in the room. The interviewer is serving and the candidate is returning. The game will continue until the ball is missed.

As any schoolboy could tell you: count the number of chairs in the room and multiply by 4. The tennis balls are on the bottom of the chair legs so they don't scuff the floor!

sound weird but they i want to be sure that u r focus