InterviewDB Experience

Optimal Packing of Blocks in a Container - Coding Interview

Interview Experience

Problem You have a container of width W and unlimited height. Blocks have varying widths w_i and heights h_i. Pack all blocks into the container in given order (left to right, then shelf by shelf). When a block does not fit on the current shelf, start a new shelf. A shelf's height equals the tallest block placed on it. Return the total container height used. Example: Follow-ups How would you minimize total height if you can reorder the blocks before packing? What heuristic ordering (e.g., sort b…

Full Details

🔒

Unlock all Codesignal questions

Full insider details, leaked discussions, and candidate experiences.

or every company, $100/year →

About This Question

This is a candidate experience report from a codesignal interview.

It covers the following topics: Coding, General Coding Assessment, Q4 .