Design data structures

Design data structures in C++ — with the four heights of help laid out: do it now, make it easier for the next person to accept, work out the right move when you are stuck, and learn the pattern so it stops coming back.

4prompt heights
Open it in the interactive atlas →

The four heights

The same task, four distances: today's deadline, the next reviewer, the stuck moment, the pattern.

Execute — do the immediate task

+
Design a data structure to hold a large, sparse game world grid where most cells are empty, lookups…
Design a data structure to hold a large, sparse game world grid where most cells are empty, lookups must be O(log n) or better, iteration over populated cells must be efficient, and memory should stay small for tens of thousands of populated cells. Provide the C++ class API: constructors, get/set cell, erase cell, iterate populated cells, and serialize for networking. State any template parameters and ownership semantics.

Improve — make it easier to accept

+
Before I choose an implementation for the sparse grid, make it easy for the team to approve. Put…
Before I choose an implementation for the sparse grid, make it easy for the team to approve. Put the expected read/write ratios and worst-case memory use up front, make lookups and iteration performance findable, and flag reviewer hesitations: fragmentation from many small allocations, heavy pointer-chasing, or unclear ownership of cell payloads.

Decide — diagnose the stuck moment

+
Iteration over populated cells in a hot loop is twice as slow as I expected; I suspect pointer…

Iteration over populated cells is unexpectedly slow in a hot loop.

Iteration over populated cells in a hot loop is twice as slow as I expected; I suspect pointer chasing in the chosen map or poor cache layout. What is the likely cause, what measurement should I run first, and what is the lowest-risk change to improve iteration speed now without rewriting the whole structure?

Become — change the pattern

+
Across projects we keep replacing maps and tweaking serialization for every new sparse grid and…

We repeatedly swap map implementations and rework serialization for similar grids.

Across projects we keep replacing maps and tweaking serialization for every new sparse grid and lose compatibility and time. Where are we bleeding effort, and what two habits should we change — one design (pick a family of compact, cache-friendly containers with a stable adapter) and one process (define a serialization version policy and gate changes) — to stop that churn?

Next to this one

Other programming language work people do in C++.

Every task here came from the work, not from a feature list — which is why the prompts name what you want done and never the button that does it. The tool changes; the work does not.
Copyright © LLOS.ai · 2026 — original pedagogy, voice, and design — all rights reserved.

The rest of the map

Same library, five ways in.