Dsa
Binary Search
Warm-up
The Ticket Registry
At a high-security event, guests are assigned unique integer IDs. The security team maintains a sorted list of checked-in IDs. When a guest arrives, you must quickly check if their ID is already in the registry. Print 'Access Granted' if the ID exists in the sorted list, and 'Access Denied' otherwise.
Example:
Input:
4 105
101 103 105 107
Output:
Access Granted
Key concepts
binary_searchexistence
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now