Coding & Algorithms (DSA)

Sorting & Searching

6 practice questions. Free questions open a full answer guide; the rest unlock with Pro.

  • Walk me through how binary search works, what its prerequisite is, and one subtle bug people introduce when they compute the midpoint. Junior level
  • How do you decide which sorting algorithm to use, and why do standard libraries not just ship plain quicksort?Go Pro Mid level
  • Binary search is conceptually simple but engineers still ship subtly broken versions. Walk me through the off-by-one and boundary traps, and how you'd write one you actually trust — including finding the first element satisfying a predicate, not just an exact match.Go Pro Senior level
  • Most language standard libraries sort in O(n log n). Why can't a general-purpose sort do better, and when can a sort actually run in linear time?Go Pro Junior level
  • Production code almost always calls the standard library's sort. So why should an engineer still understand what sorting algorithm sits underneath, and what concretely changes their decisions?Go Pro Senior level
  • Walk me through how you'd write a binary search correctly, including how you avoid the off-by-one and overflow bugs that trip people up.Go Pro Mid level
Want questions matched to your role? Paste a job title, job description, or CV for a personalized set, or go Pro to unlock the full bank.