- Binary Search
Write a function that takes in a sorted array of integers as well as a target integer. The function should use the Binary Search algorithm to determine if the target integer is contained in the array and should return its index if it is, otherwise -1. I have a solution here.
- Quick Sort
Write a function that takes in an array of integers and returns a sorted version of that array. Use the Quick Sort algorithm to sort the array. I have a solution here.
- Three Number Sum
Where the two-pointer technique stops being a curiosity and becomes the tool — sorting buys three separate things at once and no hash-based approach gets all three. Why both pointers move after a hit, why the result should be List<List<Integer>> rather than List<Integer[]>, and exactly what changes when duplicates are allowed.
- Two Number Sum
Three reasonable answers with genuinely different trade-offs, and laying all three out before choosing is the actual skill being tested. Why the inner loop starts at x + 1 rather than 0, why you must check the set before inserting or an element pairs with itself, and why sorting quietly reorders the caller's array. Java and Python, plus the indices variant.
- Fizzbuzz