skip to content

questions

4

Why does a real-time buffer pool use an intrusive free list instead of a growth-doubling array of free slots?

level: middleimportance: should knowfreq 45%

basics

~20 s

A growth-doubling array is O(1) only amortized: one push can reallocate and copy everything, which a hard deadline cannot absorb. An intrusive free list is worst-case O(1) and stores its links inside the free buffers themselves, so it never allocates at runtime.

open as a page

In an order book where cancels hold a node handle, what does a linked list guarantee that a compacted array does not?

level: seniorimportance: should knowfreq 40%

basics

~20 s

A linked list gives every resting order a stable identity: unrelated inserts and removals never move a node, so a handle taken at insert time is still valid at cancel time. An array index names a position, and compaction or growth silently renames every later order.

open as a page

Your team's standard bans linked lists outright. When would you overrule it, and how would you justify that?

level: principalimportance: nice to knowfreq 30%

basics

~20 s

Overrule the ban only when a property, not a speed hunch, demands it: worst-case constant-time operations with no runtime allocation, or element identity that must survive unrelated mutation. Justify with a measurement, scope it to one module behind an interface, and document the exception.

open as a page