A synchronised ticket booking system has N seats. Each request gets the lowest free seat, or -1 once everything is sold — even when requests arrive from many threads at once.
A synchronised ticket booking system has N seats. Each request gets the lowest free seat, or -1 once everything is sold — even when requests arrive from many threads at once.
Opens with the full question.