Skip to content
Theory · Unique ID generator · lesson 4 of 10

API and data model

In this prompt the API is not HTTP requests but a library function the service's code calls. The data model is unusual too: its main part is the layout of the ID itself, and the second is the records of which process holds which worker number. In an interview both take about five minutes, and the interviewer expects three things: the call, its errors and the bit layout.

In this lesson

  • The library call
  • The ID layout
  • Worker numbers in etcd
  • Services' data
  • Common mistake
  • Key points