SpinTheMic
Pro

Interview practice question

Choosing coordination for a singleton job across instances

Backend Engineering · Concurrency · Experienced

A billing job must run on exactly one of your 10 instances at a time, and double execution would double-charge customers. How do you guarantee correctness?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • Leader election/lease for efficiency.
  • Idempotent billing per customer per period.
  • Unique constraint on (customer, period).
  • Fencing token for writes.
  • Correctness from data layer, not lock alone.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics