How many balls does it take to fill a 16x16 ft room?

How many balls does it take to fill a 16x16 ft room?

Asked at Google
18.1k views
18.1k views 18.1k views
Answers (9)
Answers (9)
Access expert answers by becoming a member

You'll get access to over 2,500 product manager interview questions and answers

Equation:

No of basketballs that can be accommodated in a 16X16 room is = ( Available Volume of the room / Volume of each basketball )

Assumptions and Facts:

  1. We are assuming that, its the basketball we are talking about in this case study. Size of the ball is assumed to be of radius 15 cms.
  2. The room is assumed to be of a cube size. So height, width and length all are assumed to be 16 ft.
  3. The best possible fit ratio is assumed to be 75%. So only 75% of the room is available for fitting basketballs in it.
  4. 1 ft = 30 cms (fact)

Process:

Volume of a Room can be calculated by formula = Length * Breadth * Height

Total space in room in cms cube (A) = 16 * 16 * 16 * 30 * 30 * 30

Calculation of available space in room (B) = 0.75 * A

Volume of each ball = Volume of each sphere = (4/3) * (22/7) * cube of radius

Volume of each ball (C) = (4/3) * (22/7) * 15 * 15 * 15

Dividing B by C, you should get around 6300, which means we can fit in approximately 6300 basketballs in a room of dimensions 16 ft X 16 ft X 16 ft

Access expert answers by becoming a member
6 likes  |  
Get unlimited access for $12/month
Get access to 2,346 pm interview questions and answers to give yourself a strong edge against other candidates that are interviewing for the same position
Get access to over 238 hours of video material containing an interview prep course, recorded mock interviews by expert PMs, group practice sessions, and QAs with expert PMs
Boost your confidence in PM interviews by attending peer to peer mock interview practices, group practices, and QA sessions with expert PMs
Platinum PM
  1. CLARIFY:
    1. How tall is the room? You choose.
    2. May I assume the room is empty and is a cube shape? Yes. (I assume here the height is also 16 feet.)
    3. Do you have a specific type of ball in mind? You choose. (I will choose a ping pong ball.)
    4. May I assume these balls are inflated / perfectly round? Yes. 
  2. EQUATION:
    1. Ping Pong Balls in Room:
      1. Ping Pong Ball Dimension:
        1. Diameter: Estimate to be ~1.5 inches.
      2. # of Cubes in Room:
        1. Let's first estimate how many cubes we could fit in the room if they were the same dimensions of the ping pong ball. Imagine each ping pong ball is in a cube box. (There is a little space in the box left because the ball is round / does not fit it completely.)
        2. Given each wall is 16 feet or 192 inches, 192 inches / 1.5 inches = 128 cubes fit if we place them next to each other.
        3. 128 cubes x 128 cubes x 128 cubes = 2.1M
      3. # of Ping Pong Balls in Room:
        1. Ping pong balls are round. When are they are stacked against each other, there is space in between each ball.
        2. When ping pong balls are poured into a container, they do not sit perfectly on top of each other in straight lines. They minimize the space in between them by sitting adjacent to each other (similar to the way bricks are layered).
        3. Given that the ping pong balls can minimize some of the space in between them when they are poured on top of each other (in 3 dimensions), I estimate the space saved is ~25% more.
        4. Let's take our 2.1M estimated ping pong balls and add another 25%.
        5. 2.1M * 1.25 = ~2.6M ping pong balls
Access expert answers by becoming a member
1 like  |  
Get unlimited access for $12/month
Get access to 2,346 pm interview questions and answers to give yourself a strong edge against other candidates that are interviewing for the same position
Get access to over 238 hours of video material containing an interview prep course, recorded mock interviews by expert PMs, group practice sessions, and QAs with expert PMs
Boost your confidence in PM interviews by attending peer to peer mock interview practices, group practices, and QA sessions with expert PMs
Clarify the question:

Is the room empty or it has furniture.

Are the balls arranged properly or just thrown in randomly

What kind of ball it is - golf, tennis, basketball?

Assumptions and Facts:

Room is empty

Ball - Tennis ball

Balls will be stacked perfectly

Equation:

No. of balls = Volume of room/ Volume of ball

Computation:

Volume of room = 16*16*12 = 3072 cubic feet (assuming empty) = 3072*1728 = 5300000 cubic inch

Volume of ball - assuming square volume of side 2.5 inch - 15.62 cubic inch

Edge cases:

Windows

Furniture

Other equipment

Ceiling top layer

Final computation:

5300000/15.62  = 3,39000 approx (Tennis balls with empty room stacked properly)

if furniture = 307000 approx
Access expert answers by becoming a member
0 likes  |  
Get unlimited access for $12/month
Get access to 2,346 pm interview questions and answers to give yourself a strong edge against other candidates that are interviewing for the same position
Get access to over 238 hours of video material containing an interview prep course, recorded mock interviews by expert PMs, group practice sessions, and QAs with expert PMs
Boost your confidence in PM interviews by attending peer to peer mock interview practices, group practices, and QA sessions with expert PMs

Assumptions/Clarifications: 

- Room is rectangular in nature with dimensions: a X b X c units. Balls are perfectly spherical with radii r units.

- Room has no content (furniture, windows), anything that will not let its volume be 'abc cubic units'.

- Interviewer wishes to know the maximum number of balls I could fit.

- Radius of ball(r) is insignificant compared to room's dimensions(a,b,c). This is important so that max number of balls I could fit will be very significantly greater than a little bit of space left at the ends because of effective radius not being a multiple of a particular dimension. Imagine fitting balls with diameter just greater than half of the length of the largest edge. No matter the packing, you can only fit 1.

- you already don't know from the lattice packing science that says spheres can be tightly packed at best 75% density. A fact already used by someone to answer this question.

Packing and Calculation:

Now, we need to strategise a packing of balls so that we fit maximum.

Imagine laying out  balls along a bottom floor edge, say 'c'. The best fit would be to place them in a line side by side. Number of balls I can fit is x = (c/2r).

Now place another line adjacent to it. You want to place it such that a ball in the second line falls between the gap of the 2 balls in the first line for the densest fit. By simple 2D geometry(height of equilateral triangle), the line connecting radii of second line is say h = (root(3)*r).Therefore the number of such lines I can lay out to fill floor is say y = b/h = b/(root(3)*r). Also ignoring the r distance between edge most lines and edge(insignificant compared to b as assumed). (You can ignore the math for the interview I guess).

Now you have a 2D plane of balls on the floor. Next obvious step is to plan the next 2D plane of balls on it to fill the height. This of course needs to be done in such a way that a ball in the second plane is in between the gaps of 3 adjacent balls of the first plane for the tightest packing. Skipping the geometry and math involved, lets say the the distance between the centers of balls of these 2 planes turns out to be some h. The number of such planes I can do is a/h = z(say).

Therefore the number of balls is x*y*z.

Access expert answers by becoming a member
0 likes  |  
Get unlimited access for $12/month
Get access to 2,346 pm interview questions and answers to give yourself a strong edge against other candidates that are interviewing for the same position
Get access to over 238 hours of video material containing an interview prep course, recorded mock interviews by expert PMs, group practice sessions, and QAs with expert PMs
Boost your confidence in PM interviews by attending peer to peer mock interview practices, group practices, and QA sessions with expert PMs

Clarifications:

1. The height of the room?

2. The room is occupied or furniture

3. Height of the room?

4. Only one layer of the floor is filled or the balls can be stacked upon each other?

Assumptions:

1. Capacity is utilized to the fullest 

Only one layer and balls are not stacked upon each other:

- This case is fairly simple all you need to do is 

1 feet = 30.48 cms

The diameter of the basketball ~25 cms

16 feets = 30.48 * 16 = 488 cms

The number of balls in one column = 488/16 = 19

The number of columns = 488/16 = 19

Some of the space remains unoccupied, as the entire space to fit a ball is not available

The answer = 30* 30 = 900;

Additional height required to stack another layer:

(refer the calculations in the attached image)

~21.65 

Height of the room  average ~ 10 feet = 304.8 cms 

Number of layers in the stack possible = 

First layer requires complete space 304.8 - 25 = 279.8 

Number of subsequent layers = 254.8/21.65 = ~11.76

With 11 as the ball must occupy the space completely:

= 11 + 1 (bottom layer) = 13 layers and 361  balls in each layer 

=  11* 361

= 3971

With 13 as the ball as the earlier unoccupied space would allow to bottom balls to spread and allows some space in height:

12 + 1 intital layer = 13 * 361

= 4693 balls

My recommendation - it will easily release enough height attributed to the Spread due to the incomplete space in 2D and 14 layers would be possible hence answer is 4693 

Access expert answers by becoming a member
0 likes  |  
Get unlimited access for $12/month
Get access to 2,346 pm interview questions and answers to give yourself a strong edge against other candidates that are interviewing for the same position
Get access to over 238 hours of video material containing an interview prep course, recorded mock interviews by expert PMs, group practice sessions, and QAs with expert PMs
Boost your confidence in PM interviews by attending peer to peer mock interview practices, group practices, and QA sessions with expert PMs
Assumptions
  • Height of the room = 12 ft
  • Voids present between balls
  • The room is empty
  • Maximum efficiency of packing without pressing the ball
Equation = Volume of the room / Effective volume of a ball#Volume of the room calculation

Volume of the room = 16 ft x 16 ft x 12 ft = ~3000 cu. ft.

 

#Effective volume of a ball caculation

When balls are stacked on top of each other, voids are left between. 

  • Let us take the smallest unit of a pack of balls which can be replicated on all sides to fill the room. 
  • If one ball is replicated, there will be less efficient packing
  • If two balls are replicated, it is same as if one ball is replicated
  • However, if three balls are stacked like the image below, we will have maximum efficiency

Volume of this unit = Volume of the cuboidal shaped container = Length x Width x Height

Width of one ball = ~ 6 cm

 

Length = Width of left bottom ball + Width of right bottom ball = 12 cm

Width = Width of one ball (sideways) = 6 cm

Height = Width of the bottom ball + Effective width of the top ball = 6 cm + 0.8 x 6 cm = 10.8 cm = ~ 11 cm

 

Volume of the unit = 12 cm x 6 cm x 11 cm = ~ 800 cu cm

 

 

Total Number of Units = Volume of the room / Volume of one unit

Total Number of Units = 3000 cu. ft. / 800 cu. cm 

1 ft = 30 cm approx.

Total Number of Units = 3000 x 30 x 30 x 30 cu cm / 800 cu cm = 81,000,000 / 800 = ~100,000

Since one unit contains three balls, total number of balls will be thrice the number of units

 

Total Number of Balls = ~ 300,000

 

Access expert answers by becoming a member
0 likes  |  
Get unlimited access for $12/month
Get access to 2,346 pm interview questions and answers to give yourself a strong edge against other candidates that are interviewing for the same position
Get access to over 238 hours of video material containing an interview prep course, recorded mock interviews by expert PMs, group practice sessions, and QAs with expert PMs
Boost your confidence in PM interviews by attending peer to peer mock interview practices, group practices, and QA sessions with expert PMs
Bronze PM
Clarification question:

Is the room empty?

Answer yes!

Can I assume that the tennis balls are going to be stacked properly?

Answer: Yes!

Can I assume it is a tennis ball?

Answer: Yes!

Main equation = Total cubic inches of the room / Total cubic inches of the ball

Assumptions:

Total cubic inches of the ball = 2.5 * 2.5 *2 = ~12 cubic inches

Assume, room height 10 feet.

Total cubic foot = 16*16*10 = 2560 cubic foot; 4,423,680 cubic inches ( 2560 * 1728)

Number of balls =  4,423,680 (cubic inches of the room) / 12 (cubic inches of the tennis ball) = 368,640
Access expert answers by becoming a member
0 likes  |  
Get unlimited access for $12/month
Get access to 2,346 pm interview questions and answers to give yourself a strong edge against other candidates that are interviewing for the same position
Get access to over 238 hours of video material containing an interview prep course, recorded mock interviews by expert PMs, group practice sessions, and QAs with expert PMs
Boost your confidence in PM interviews by attending peer to peer mock interview practices, group practices, and QA sessions with expert PMs
Platinum PM
  1. What is the height of the room = 10 feet
  2. Which balls are we talking about - Basket ball, Tennis balls, golf balls ? - Golf balls

Volume of room = 10*16*16 = 2560 cubic feet

 

Golf balls needed

  • diameter is 1.5 inches which is 1.5/12 = 0.125 feet
  • Going to calculate the volume occupied bu golf ball as the volume occupied by same size as there is space between the golf balls
  • Area of one golf ball = 0.125*3 => 0.625 cubic feet

 

Total # of Balls needed = 2560 / 0.625 = 2560000/625 = ~4000balls

Access expert answers by becoming a member
0 likes  |  
Get unlimited access for $12/month
Get access to 2,346 pm interview questions and answers to give yourself a strong edge against other candidates that are interviewing for the same position
Get access to over 238 hours of video material containing an interview prep course, recorded mock interviews by expert PMs, group practice sessions, and QAs with expert PMs
Boost your confidence in PM interviews by attending peer to peer mock interview practices, group practices, and QA sessions with expert PMs

Clarify - 

Do the balls have a fixed size or diameter? can I assume a tennis ball or a basket ball? I'll assume a basket ball that has a diameter of roughly 10 inches

The balls are round, room will be a square so there will be gaps. 

Are the ball hard or soft (squeezable)? If they are hard then we have less covereage compared to soft

What is the height of the room? Can I assume it to be 16ft as well? 

Equation - 

# of balls required = volume of room/volume of one ball

Volume of room = 16x16x16 cubic ft = ~4000 cu ft

Diameter of the ball. = 10 inch = 5/6 ft, radius = 5/12 ft

Volume of a single ball = 4/3 pi x (r)^3 = (4*3.14)/3 x (5/12)^3 = ~4*125/12*12*12 ~40/12*12 ~3/12 ~0.25 cu ft

# of balls required to fill the room = 4000/0.25 ~ 16K balls

Access expert answers by becoming a member
0 likes  |  
Get unlimited access for $12/month
Get access to 2,346 pm interview questions and answers to give yourself a strong edge against other candidates that are interviewing for the same position
Get access to over 238 hours of video material containing an interview prep course, recorded mock interviews by expert PMs, group practice sessions, and QAs with expert PMs
Boost your confidence in PM interviews by attending peer to peer mock interview practices, group practices, and QA sessions with expert PMs
Get unlimited access for $12/month
Get access to 2,346 pm interview questions and answers to give yourself a strong edge against other candidates that are interviewing for the same position
Get access to over 238 hours of video material containing an interview prep course, recorded mock interviews by expert PMs, group practice sessions, and QAs with expert PMs
Boost your confidence in PM interviews by attending peer to peer mock interview practices, group practices, and QA sessions with expert PMs
icons/star-rounded.svgMore product manager interview questions Show all questions

Akshay in the US just bought access to PM Exercises. about 5 hours ago