Design ticket reservation system in Java
- Basically would like to understand the design for ticket reservation system, for ex : movie tickets
- What are the different ways that we can avoid if multiple users trying to book the same ticket.
- What java collections can be used for the above usecase.
Consider the below usecase
- User A logged into the system at 10:00 AM
- User B also logged into the system at 10:00 AM
- Only one ticket is available
- Which java collection to use so that only one user gets the ticket.
- Is it required to use synchronization, without synchronization can't we achieve this by using only java collections.
Open Chat in New Window