Memory Allocator (Allocate / Free)

Asked at Okta · Coding Questions · Difficulty: Medium · Last asked Nov 5, 2025

Implement a memory manager over a 0/1 array. Process a command stream of allocate/free operations: allocate the left-most consecutive free chunk and assign it an ascending id; free a chunk by id. Return the per-command results.

Loading the problem…