Preparing your design workspace

Loading the problem and your saved attempt…

Design a Document Find Session

Design a stateful Ctrl+F session for exact search, highlighting, and circular match navigation in a static document.

For this exercise, assume an immutable UTF-8 plain-text document split by newline characters. Search is case-sensitive exact substring matching, a query never spans lines, and columns count Unicode code points rather than UTF-8 bytes.

Matches are non-overlapping, ordered by document position, and reported with zero-based line and column coordinates. A changed non-empty query recomputes all matches and selects the first match; an empty query clears the session. Next and previous navigation wrap around, and all matches are exposed as highlight ranges.

Design the object model, public contracts, collaborations, and a bounded implementation of the core find session. Exclude document editing, persistence, regular expressions, and UI rendering.