How do you generate invoice numbers?
An Invoice number is the ID of an invoice in the accounting ledger, it must be in sequence, must be generated in a distributed environment, and some invoices might fail (transaction rollback).
Is this an interview question? I think we would want to know the stack to give you a useful answer. There are many ways to achieve this.