Google Interview Question: How many ping pong balls fit ... | Glassdoor

Interview Question

Associate Product Manager Interview Mountain View, CA

How many ping pong balls fit in a school bus?

Answer

Interview Answer

3 Answers

2

There's a few things I would clarify with the interviewer before starting but I'll spare you for now.

Let's start with the size of the balls, that we assume will have a radius of 2cm.

To account for the gap between balls when filling a space, we will also assume that the balls take up the space of a 4cm x 4cm cube (16cm3). At the end we will also add an extra ball for every 4 balls to account for the gap neglected in assuming a cube.

To keep things simple, we assume we have nothing inside (no seats, etc). In guesstimating the dimensions of the bus we'll say each seat would be 3.5ft long while the center aisle is 1.5ft for a total width of 8.5ft. We'll also guess that a bus is about 40ft long and 8ft tall. This brings our net volume to: 2,720ft3.

1ft ~ 30.5cm
2,720ft3 ~ 77,021,823cm3
77,021,823cm3 / 16cm3 ~ 4,813,864 balls
Accounting for gap: 4,813,864 / 4 ~ 1,203,466 balls
Net total: 4,813,864 + 1,203,466 = 6,017,330 balls

Luca on Jul 31, 2013
6

Another ridiculously detailed answer can be found at > http://www.nab.bz/bus-explanation.pdf

This is not my work, just found it while preparing.

Luca on Jul 31, 2013
0

Assumptions: Big school bus, windows closed and empty
Deduction
Number of ping pong balls that can fit = vol of bus/vol of ball
vol of school bus = L*B*H =8 * 70 * 10 ~=6000 cb . ft
B= two seats on each side and each seat is about 2 feet wide, so ~ width of bus = 4+4+2 =10ft
L = 20 rows + Entrance + Driver seat = ~25*3 = 70 ft
H = 8 ft
Volume of a Ping pong balls = sphere=4/3 pi r3 =4 cb. inch
But Vol df sphere doesn’t matter unless we use the inside volume of the ball. So we can find the volume of sphere when the balls are stacked efficiently by adjusting height for the gaps.
Volume of cube = L B H = (diameter of ball * diameter of ball * adjusted ht of sphere)
                     = 2 * 2 * 2.5 = 10 cu in ~= 12cu in = 1/144 cu ft
1 cu ft = 12 * 12 * 12
1 cu in = 1/12 * 1/12 * 1/12
6000 / (1/144) = 60*144 = 864000 balls

Prashanthy on Feb 14, 2016

Add Answers or Comments

To comment on this, Sign In or Sign Up.