CSE Roadmap

Specialist tier · about 2 hours · 4 parts

Part 4 of 4 · 4 min read

Exercises

Easy

Easy 1: Name RAID's purpose (15 minutes)

State, in one sentence, what RAID is generally used for.

Done when: combining multiple disks for speed or protection against failure is correctly stated.

Hint

RAID combines multiple physical disks into one logical unit, for speed, protection against disk failure, or both.

Easy 2: Match RAID level to trade-off (15 minutes)

Match RAID 0 and RAID 1 to "speed with no redundancy" and "protection at the cost of capacity."

Done when: both are correctly matched.

Hint

RAID 0 is "speed with no redundancy"; RAID 1 is "protection at the cost of capacity."

Easy 3: Define a block (15 minutes)

Explain, in one sentence, what a block is.

Done when: the explanation correctly describes the fixed-size unit of disk read and write.

Hint

A block is the fixed-size chunk, commonly 4 or 8 kilobytes, that disk reads and writes always happen in.

Medium

Medium 1: Predict the I/O for a tiny change (25 minutes)

Explain what I/O actually happens when a single discount column is updated for one row, in terms of blocks.

Done when: the explanation correctly describes reading the full containing block, modifying the value in memory, and writing the full block back.

Hint

The database reads the whole block containing that row, changes the value in memory, then writes the entire block back to disk.

Medium 2: Choose a RAID level (25 minutes)

A system needs to tolerate one disk failing without losing data, while keeping more usable capacity than full mirroring would allow. Name the RAID level that fits.

Done when: RAID 5 is correctly chosen, with parity named as the mechanism providing protection at lower capacity cost than mirroring.

Hint

RAID 5, since its parity-based protection tolerates one disk failing while using less total capacity than full mirroring would.

Medium 3: Why RAID 0 alone is risky for a database (25 minutes)

Explain why RAID 0 alone, with no redundancy, is a risky choice for a production database's primary storage, despite its speed advantage.

Done when: the explanation correctly notes any single disk's failure in a RAID 0 array loses data across the whole array, with no way to recover it.

Hint

With no redundancy, a single disk failure in a RAID 0 array destroys data across the entire array, since the data is striped across all disks with nothing to reconstruct it from.

Hard

Hard 1: Block size trade-off, worked through (30 minutes)

Explain what would go wrong, in terms of wasted I/O, if a database used an extremely large block size, such as 1 megabyte, for a workload dominated by tiny, scattered single-row updates.

Done when: the explanation correctly identifies that each tiny update would still force reading and rewriting the entire 1-megabyte block, wasting enormous I/O relative to the actual change.

Hint

Every tiny update would still force a full 1-megabyte block read and rewrite, making the actual useful work done per I/O operation extremely small relative to the total data moved.

Hard 2: RAID doesn't replace backups (35 minutes)

Explain why a RAID 1 mirrored array, which protects against a single disk failing, still does not remove the need for a separate backup strategy.

Done when: the explanation correctly notes RAID protects against physical disk failure specifically, not against mistakes like an accidental DELETE, corruption replicated to both mirrors, or a disaster destroying the whole machine.

Hint

RAID only protects against a physical disk failing; it does not protect against an accidental delete, application-level corruption written to all mirrored copies identically, or a disaster that destroys the entire machine at once.

Hard 3: Diagnosing unexpectedly high write I/O (40 minutes)

A team notices far more disk I/O than expected for a workload that only updates small, individual row values. Propose a hypothesis connecting this to block size, and describe what evidence would confirm it.

Done when: a hypothesis connecting the small-update pattern to full-block read-and-rewrite overhead is proposed, with a plausible way to confirm it, such as measuring actual I/O per update against the configured block size.

Hint

The hypothesis is that small updates are each triggering full-block I/O; confirming it means measuring the actual bytes written per logical update and comparing that to the configured block size, expecting the measured I/O to roughly match one block per update rather than the tiny size of the actual changed value.