InterviewDB Experience

Size Match: Match Items to Containers Using Bin-Packing Heuristics

Interview Experience

Problem You have n items with sizes and k bins each with a fixed capacity. Assign each item to exactly one bin such that no bin exceeds its capacity, and the number of bins used is minimized. Items cannot be split. Example Follow-ups First-Fit Decreasing gives at most (11/9)OPT + 6/9 bins — can you prove why? How do you solve this exactly using dynamic programming or ILP for small inputs? How does the problem change if bins have both weight and volume constraints?

Full Details

🔒

Unlock all Shopify questions

Full insider details, leaked discussions, and candidate experiences.

Get full access — $100 a year, unlimited access

About This Question

This is a candidate experience report from a shopify interview.

It covers the following topics: Coding, Pair Programming, Dynamic Programming .