CSE Roadmap

Common tier · about 5 hours · 8 parts

Part 8 of 8 · 2 min read

Exercises

Easy

Easy 1: Nodes needed (20 minutes)

500,000 transfers a second, 2 writes each, nodes that handle 2,500 writes a second. Give the node count.

Done when: you write 400 nodes.

Hint

1,000,000 writes a second divided by 2,500.

Easy 2: Downtime (20 minutes)

Give the minutes of downtime a year allowed by 99.9 per cent and by 99.99 per cent.

Done when: you write about 526 minutes and about 52.6 minutes.

Hint

525,600 minutes in a year.

Easy 3: Replay (20 minutes)

Events for an account: +50, −20, −10, +5, −8. Give the balance after each event.

Done when: you write 50, 30, 20, 25 and 17.

Hint

Running totals.

Medium

Medium 1: Raft tolerance (30 minutes)

How many failed nodes can a group of 3, 5 and 7 tolerate?

Done when: you write 1, 2 and 3.

Hint

A majority must survive.

Medium 2: Groups (30 minutes)

3 million transfers a second, 2 events each, and a group that handles 50,000 events a second. Give the groups and the nodes with 3 per group.

Done when: you write 120 groups and 360 nodes.

Hint

6,000,000 / 50,000.

Medium 3: Saga run (30 minutes)

Write the steps of a saga for A→C with a failure on the second step. List the compensation.

Done when: steps: deduct A, add C fails, compensation adds back to A.

Hint

Undo only what succeeded.

Hard

Hard 1: Draw the design (60 minutes)

Draw the final design with the coordinator, partitions, Raft groups, read paths and reverse proxy. Number the happy-path steps of a transfer.

Done when: a diagram with at least 10 parts and a numbered happy path.

Hint

Each group has its own leader.

Hard 2: Failure table (60 minutes)

List five crash points in a TC/C transfer and what recovery does for each.

Done when: a table of five rows with the state found on restart and the action taken.

Hint

Use the phase status table for each case.

Hard 3: Audit report (60 minutes)

An auditor asks for the balance of account A at 00:00 on 1 March and proof it is right. Write the steps with snapshots and replay.

Done when: a step list naming the snapshot used, the events replayed and the checks run.

Hint

The nearest earlier snapshot saves most of the replay.