Master the fundamental concepts of storage fundamentals through this focused micro-challenge.
You have read the whole brief, and the concepts above stay free on every task. Writing and running the code needs a plan.
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
Every task includes starter code, theory, and hidden tests so you can implement and verify locally in the browser.
How it worksOn HDDs the seek time is fixed whether you read 4KB or 1MB afterward. Large sequential reads spread that penalty across many bytes, so effective latency per byte drops. This is why database sequential scans and log append prefer big read sizes on spinning rust.
Total time = seek + rotation + (bytes / throughput). Per-byte cost = total / bytes.
cLoading…
Keep the relevant documentation open while you implement. When your output disagrees with the reference, trace one failing case by hand before changing random lines.
You will calculate per-operation and per-byte latency for several request sizes on HDD and SSD models. This exercise requires showing how bigger I/O amortizes mechanical costs.
Every I/O request pays a fixed cost before any data moves (command processing, queueing, and on an HDD a seek), then a transfer cost proportional to its size. Model one request:
cLoading…
That is a 0.05 ms fixed overhead plus a transfer at 1 GB/s. At 4 KiB the fixed part is most of the latency; at 1 MiB the transfer dominates. That is why databases batch small writes and read large sequential runs.
One I/O size in bytes.
io_size=S latency_ms=L, with L rounded to three decimals: io_size=4096 latency_ms=0.054.