Minimum folds to fit a carpet into a box
Filed under Nutanix
The question
Given a carpet of dimensions a * b and a box of dimensions c * d, determine the minimum number of folds required to fit the carpet inside the box. In each fold, you may fold the carpet in half along its length or breadth. Rotating the carpet by 90 degrees can be done any number of times for free.
No write-up yet. Related questions below have one.
Related Nutanix questions
Collected from public candidate posts and coding forums. Updated Nov 2026.