CSE Roadmap

Common tier · about 4 hours · 8 parts

Part 8 of 8 · 2 min read

Exercises

Easy

Easy 1: Launch rate (20 minutes)

120,000 launches an hour. Give the average per second. A peak of 15,000 in one minute gives how many per second?

Done when: you write about 33 and 250 per second.

Hint

120,000 / 3,600, and 15,000 / 60.

Easy 2: Log size (20 minutes)

Each launch writes two records of 150 bytes. 2 million launches a day. Give the log size in MB a day.

Done when: you write 600 MB.

Hint

2,000,000 × 2 × 150 bytes.

Easy 3: Spread (20 minutes)

9,000 jobs choose a random minute inside one hour. Give the average launches per minute.

Done when: you write 150.

Hint

9,000 / 60.

Medium

Medium 1: Quorum (30 minutes)

A group of 5 replicas. Give the majority and how many can fail. Then for 3 and 7.

Done when: you write 3 and 2; 2 and 1; 4 and 3.

Hint

More than half.

Medium 2: Walk a crash (30 minutes)

The leader announces a launch start, sends 2 of 4 requests and dies. Write the steps of recovery.

Done when: a list that finds the open launch, looks up names, sends the two missing requests and writes the end record.

Hint

The names are known from the log.

Medium 3: Choose a policy (30 minutes)

For three jobs (cache clean-up every 5 minutes, monthly invoices, hourly report email) say whether to skip or retry after an outage, and why.

Done when: a table of three rows with a policy and a reason.

Hint

Ask whether a run twice would hurt.

Hard

Hard 1: Draw the design (60 minutes)

Draw the replicas, the log, the cluster scheduler and the job store. Number the steps of one launch including both sync points.

Done when: a diagram with at least 6 parts and a numbered launch.

Hint

The start record comes before the request.

Hard 2: Time handling (60 minutes)

A job is set for 02:30 local time in a zone that skips 02:00 to 03:00 once a year, and repeats it once a year. Write the rule for each case.

Done when: two rules and a test list of four dates.

Hint

Say whether it runs once or twice on the repeated hour.

Hard 3: Delayed jobs (60 minutes)

Extend the design to 50 million one-off jobs. Say how they are stored, found at their time, and launched, and the cost of storage.

Done when: a design with a time-ordered store, a wake-up method and a size estimate.

Hint

Group jobs into time buckets.