Question bank › Binary Search
Dsa Binary Search Warm-up

The Quietest Cabin

You are a hotel manager reviewing noise level readings (in decibels) taken along a single long hallway. The rooms are numbered sequentially, and due to the building's design, the noise level readings are guaranteed to be in non-decreasing order. A guest requests a room with a noise level of at least X decibels for their white-noise therapy. Find the 0-based index of the first room that meets or exceeds this noise level. If no such room exists, print -1. Example: Input: 5 75 60 70 75 80 85 Output: 2

Key concepts

binary_searchlower_bound

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
Part of Praxari's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.