r/OfferEngineering • u/Aoki_zhang • 3h ago
Coding Question Grammarly(Superhuman) SWE OA
Question 1 — Binary Search: Find the First Index
The first coding question asked me to implement binary search to find the first index satisfying a given condition. Unlike a basic binary search that returns any matching index, this variation focused on identifying the first qualifying position. The main challenge was implementing the search boundaries correctly so that the algorithm returned the appropriate index rather than an arbitrary match.
Question 2 — Interval List Intersections (LC 986 Variant)
The second question was a variation of LeetCode 986 — Interval List Intersections. The standard problem involves two lists of sorted, non-overlapping intervals. The goal is to identify the intersections between intervals from the two lists.
For example:
Input:
firstList = [[2, 6], [10, 14], [18, 22]]
secondList = [[4, 12], [16, 20]]
Output:
[[4, 6], [10, 12], [18, 20]]Each resulting interval represents a range shared by an interval from the first list and an interval from the second list. The interview question was based on this problem but included a variation of the standard version.
Want to practice more real interview coding questions?
You can practice real interview coding questions at here.
Preparing for your next interview?
Chill Interview tracks recent interview experiences and recurring question patterns across top companies at here.