13 pts
Lower-bound binary search
Implement lower_bound: return the first index whose value is greater than or equal to target in a sorted integer array. Explain the invariant, duplicate behavior, and no-match behavior.
This assessment verifies the Binary Search and Sorting module. Passing it contributes up to 7 points in the 42-48 score band.
Questions
8
Limit
90m
Pass
85%
Score
+7
13 pts
Implement lower_bound: return the first index whose value is greater than or equal to target in a sorted integer array. Explain the invariant, duplicate behavior, and no-match behavior.
12 pts
A candidate finds one matching index with binary search, then scans left and right to find the full duplicate range. The data can contain millions of duplicate timestamps. Review the risk and propose the stronger approach.
13 pts
Search for a target in a rotated sorted array with distinct values. Explain how you decide which side can be discarded.
14 pts
A warehouse must ship packages in order within D days. Design a binary-search-on-answer solution for the minimum truck capacity. Define bounds, predicate, monotonicity, and total complexity.
9 pts
Which problem is a valid fit for binary search on answer?
12 pts
A support dashboard sorts tickets only by priority descending. Product expects equal-priority tickets to appear by earliest SLA deadline, then created time, then ticket ID. Review the bug and define the correct comparator policy.
13 pts
Merge overlapping intervals. Explain why sorting by start time makes the merge linear after sorting.
14 pts
An observability dashboard shows the top 20 error signatures from millions of events. Compare full sorting, a heap of size k, and quickselect. Choose a default and state tie/output concerns.