How many balls does it take to fill a 16x16 ft room?
You'll get access to over 3,000 product manager interview questions and answers
Recommended by over 100k members
- CLARIFY:
- How tall is the room? You choose.
- May I assume the room is empty and is a cube shape? Yes. (I assume here the height is also 16 feet.)
- Do you have a specific type of ball in mind? You choose. (I will choose a ping pong ball.)
- May I assume these balls are inflated / perfectly round? Yes.
- EQUATION:
- Ping Pong Balls in Room:
- Ping Pong Ball Dimension:
- Diameter: Estimate to be ~1.5 inches.
- # of Cubes in Room:
- 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.)
- 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.
- 128 cubes x 128 cubes x 128 cubes = 2.1M
- # of Ping Pong Balls in Room:
- Ping pong balls are round. When are they are stacked against each other, there is space in between each ball.
- 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).
- 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.
- Let's take our 2.1M estimated ping pong balls and add another 25%.
- 2.1M * 1.25 = ~2.6M ping pong balls
- Ping Pong Ball Dimension:
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:
- 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.
- The room is assumed to be of a cube size. So height, width and length all are assumed to be 16 ft.
- The best possible fit ratio is assumed to be 75%. So only 75% of the room is available for fitting basketballs in it.
- 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
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
- What is the height of the room = 10 feet
- 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
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
- Height of the room = 12 ft
- Voids present between balls
- The room is empty
- Maximum efficiency of packing without pressing the ball
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
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
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.
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
Top Google interview questions
- What is your favorite product? Why?89 answers | 263k views
- How would you design a bicycle renting app for tourists?62 answers | 82.5k views
- Build a product to buy and sell antiques.54 answers | 66.8k views
- See Google PM Interview Questions
Top Estimation interview questions
- Calculate the number of queries answered by Google per second.45 answers | 78.5k views
- How do you decide how many cash registers you need for a new Walmart store?33 answers | 39.4k views
- How many dentists are there in New York?33 answers | 36.7k views
- See Estimation PM Interview Questions
Top Google interview questions
- How would you improve Google Maps?53 answers | 228k views
- A metric for a video streaming service dropped by 80%. What do you do?50 answers | 135k views
- How would you design a web search engine for children below 14 years old?36 answers | 42.9k views
- See Google PM Interview Questions
Top Estimation interview questions
- Estimate the number of Uber rides.30 answers | 51.3k views
- Estimate the number of bicycles required to start a bike sharing operation in a big city.18 answers | 15.8k views
- Estimate the number of WhatsApp chats occuring in India.14 answers | 13.3k views
- See Estimation PM Interview Questions