Quick Overview

Simulate a memory allocator over n units: each allocation takes the leftmost run of consecutive free units for an owner, and each free releases all of that owner's units. Return the result of every operation. It tests interval bookkeeping and logarithmic-time search for free runs at up to 100,000 operations.

Leftmost-Fit Memory Allocator: Allocate Consecutive Units and Free by Owner

Company: OpenAI

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: hard

Interview Round: Onsite

Overview: Simulate a memory allocator over n units: each allocation takes the leftmost run of consecutive free units for an owner, and each free releases all of that owner's units. Return the result of every operation. It tests interval bookkeeping and logarithmic-time search for free runs at up to 100,000 operations.

Loading…