Projection Area of 3D Shapes
Solve this the way you would in the interview: out loud, on a timer, with an AI interviewer asking follow-ups while you code. You get a scored report at the end.
Practice this as a mock interviewFree to start, no account neededProblem
An n x n grid holds towers of unit cubes aligned with the axes: grid[i][j] is the height of the tower standing on cell (i, j).
Project the shape onto the three coordinate planes: looking from the top (xy), from the front (yz), and from the side (zx). Each projection is the 2D shadow of the cubes.
Return the total area of the three projections.
Examples
Constraints
- n == grid.length == grid[i].length
- 1 <= n <= 50
- 0 <= grid[i][j] <= 50
What the interviewer grades
A correct solution is one of five scores. The report also grades problem understanding (did you clarify inputs and edge cases before coding), problem solving, communication while you work, code quality, and testing. See a sample report, or read up on the pattern in the lessons.