The Projection Area of 3D Shapes problem gives you a 2D grid of column heights (stacks of unit cubes). Find the total projection area on three planes: top (XY), front (XZ), and side (YZ). This easy coding problem tests 2D matrix column/row analysis with geometry. The array, matrix, math, and geometry interview pattern is demonstrated.
Google asks this to test 3D geometry reasoning through a 2D grid representation. The key insight: top projection = count of non-zero cells; front projection = max per column (sum of column-wise maxima); side projection = max per row (sum of row-wise maxima).
Three independent projections. Top (XY plane): count cells where grid[i][j] > 0. Front (XZ plane): for each column j, add max(grid[i][j] for all i). Side (YZ plane): for each row i, add max(grid[i][j] for all j).
Grid=[[2,0,2],[1,1,1],[0,0,2]]. Top: non-zero cells: (0,0)=2,(0,2)=2,(1,0)=1,(1,1)=1,(1,2)=1,(2,2)=2. Count=6. Front (column maxima): col0→max(2,1,0)=2. col1→max(0,1,0)=1. col2→max(2,1,2)=2. Sum=5. Side (row maxima): row0→max(2,0,2)=2. row1→max(1,1,1)=1. row2→max(0,0,2)=2. Sum=5. Total = 6+5+5 = 16.
3D projection problems reduce 3D geometry to 2D array operations. Memorize: top=count(non-zero), front=sum(column-max), side=sum(row-max). Practice similar "shadow area" problems: "maximum area of projection," "overlapping shadows." 3D geometry appears in graphics programming and simulation interviews — understanding projections from different planes is the core skill.
| Title | Difficulty | Topics | LeetCode |
|---|---|---|---|
| Surface Area of 3D Shapes | Easy | Solve | |
| Matrix Cells in Distance Order | Easy | Solve | |
| Valid Boomerang | Easy | Solve | |
| Largest Triangle Area | Easy | Solve | |
| Minimum Time Visiting All Points | Easy | Solve |