Base CS from zero
Data in memory: free-recall review
Retrieval beats re-reading. For each prompt, say or write a full answer from memory before you open the model answer — the effort of recall is what makes the layout stick.
Reconstruct the unit’s spine without looking back: why an array is contiguous and equal-size, how the index becomes an address, why access is constant time, how an object differs, and why references turn nested data into a graph of cells.
- 01What is an array's shape in memory, and why must every cell be the same size?
- 02Give the formula for the address of element i, and name each part.
- 03Why is the first element index 0, not index 1?
- 04Why is reaching any element constant time, and what would break that?
- 05How does an object differ from an array, and why does an object's field order not matter?
- 06How can an array hold a hundred different-size objects and still keep its equal-size grid?
If you could reconstruct each answer from memory, you hold the unit’s spine: an array is a contiguous run of equal-size cells; the index becomes an address by base + i x element_size, which is why index 0 is first and why access is constant time; an object reaches values by name so field order is meaningless; and references let a fixed-size grid point at variable-size objects, turning any nested structure into a graph of cells wired together by addresses.