DSAIntermediateReady

Binary Search and Sorting Assessment

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

Question 1codingIntermediate

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.

Question 2code-reviewIntermediate

12 pts

Duplicate range search with bounds

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.

Question 3codingIntermediate

13 pts

Binary search with conditional monotonic halves

Search for a target in a rotated sorted array with distinct values. Explain how you decide which side can be discarded.

Question 4scenarioIntermediate

14 pts

Binary search on monotonic feasibility

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.

Question 5multiple-choiceIntermediate

9 pts

Recognizing monotonic decision spaces

Which problem is a valid fit for binary search on answer?

Question 6code-reviewIntermediate

12 pts

Comparator correctness and deterministic tie-breaking

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.

Question 7codingIntermediate

13 pts

Sorting as preprocessing for local reasoning

Merge overlapping intervals. Explain why sorting by start time makes the merge linear after sorting.

Question 8scenarioIntermediate

14 pts

Selection and partial sorting trade-off judgment

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.