A code-search page is a snapshot reader. It commits one query generation against one permission scope and index snapshot, accepts verified match batches in order, and carries stable source coordinates into a bounded code viewer. Speed matters, but stale or unauthorized code is never a valid partial result.
Code search looks like a text box over a list. The difficult part begins when the query has operators, results arrive from many shards, repositories change during a search, and one selected match lives near line 740,210 of a file the browser cannot safely mount in full.
The frontend needs a durable identity model before it needs polished syntax colors.
Clarify what can be searched and what must stay consistent
Ask whether the product searches one repository, an organization, or every repository a viewer can access. Define exact text, regular expressions, paths, languages, symbols, generated files, forks, branches, and commit selection. Clarify whether results can stream, whether rank may change after the first paint, and how quickly permission or index changes must appear.
Set product goals for first useful matches, completion time, cancellation, stale-batch rejection, snippet bytes, mounted result lines, selected-file memory, keyboard travel, history restoration, and permission revocation. “Search feels instant” is not a measurable contract.
The public interview prompt
Design a browser-based code-search interface that supports a structured query language, streamed and paginated results, syntax and term highlighting, stable selection, and navigation through very large files.
Explain:
- draft query parsing, committed URL state, generations, snapshots, and cancellation;
- the boundary between the browser, query service, permission service, search shards, source service, and highlighting workers;
- stable match identity across repository, commit, path, byte range, line range, and symbol;
- partial batches, deduplication, ranking, pagination, gaps, retries, and stale responses;
- result snippets, safe rendering, huge-file windows, minimaps, anchors, and history restoration;
- keyboard and screen-reader behavior, focus, status announcements, browser find, zoom, and touch;
- caching, authorization, privacy, telemetry, performance, degraded states, testing, and rollout.
What the premium solution covers
The full solution follows a query through a flight recorder, lays qualifiers onto a parser keybed, descends a million-line code canyon, and separates raw source from syntax, match, selection, and accessibility paint. A deterministic lab connects result batching, snippet size, highlight cost, query races, and bounded file rendering.