Leetcode 2502. Design Memory Allocator
Design an allocator for n memory units that supports allocating the leftmost contiguous block of a given size and freeing all units with a given mID. The core challenge is efficiently tracking and updating free intervals and mID→allocated-interval mappings so you can find/carve the leftmost fit and merge freed segments.
Asked at:
Apple
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Early June, 2026
Apple
Mid-level
Similar, Variation of this, where two favorable positions we have to return
Hello Interview Premium
Your account is free and you can post anonymously if you choose.