Fitting 1x1x4 bricks into a 6x6x6 cube

Fitting 4 unit bricks in cube is a medium quant interview question on Brain Teasers.

Difficulty Medium Topic Brain Teasers

This puzzle asks whether a given number of identical rectangular bricks can be packed inside a cube without overlap and while staying entirely within the boundaries. The candidate must reason about three-dimensional tiling: how elongated pieces can be oriented, how they interact with the discrete grid of unit cubes inside the larger shape, and whether a complete packing is compatible with the shape's size and structure. The challenge is not about brute-force enumeration of placements but about finding a structural obstruction, if any, that prevents such a packing regardless of how cleverly the bricks are arranged.

The question leans heavily on invariant-based arguments and geometric combinatorics. Strong answers typically introduce a suitable coloring or partition of the cube, then analyze how each brick must interact with that partition. The interviewer is watching for the ability to invent or choose an insightful invariant, justify why it is preserved under all allowed placements, and convert that into a rigorous impossibility (or possibility) argument. Clarity of reasoning, not just the final yes/no conclusion, is what differentiates stronger candidates.

What it tests

Problems involving tiling or packing often hinge on invariants—properties that remain unchanged under the allowed moves or placements. In three-dimensional tiling, coloring arguments (such as checkerboard patterns) can reveal hidden constraints by tracking how each tile interacts with the underlying structure. The key is that each tile or brick, by its shape and orientation, must interact with the colored regions in a fixed way: for example, always covering both a black and a white region. If the counts of these regions are imbalanced, it becomes impossible to cover the entire space without violating the invariant. This approach generalizes to any situation where the covering object must always interact with the structure in a fixed, constrained manner, and the structure itself is partitioned into regions that the object cannot all simultaneously satisfy.

Practise this question with written feedback, or hear it in a spoken mock interview.

Get started free