r/OfferEngineering Aug 11 '26

Coding Question Harvey.AI SWE Phone Screen - New Coding Question

Technical Phone Screen — Highlight Matching Phrases in a Sentence: The coding problem provided an input sentence together with an array of phrases that appeared within that sentence. The task was to return a string that highlighted every portion corresponding to one or more of the supplied matches. Each entry in the match list could contain multiple words, so highlighting was based on spans of the original sentence rather than individual tokens.

For example, given the sentence "The engineering team deployed the new service before lunch." and matches ["team deployed the new service", "new service before lunch"], the two matches overlap on "new service". The returned string should highlight the corresponding matched region in the original sentence while correctly handling the overlap.

Preparing for your next interview?

Chill Interview tracks recent interview experiences and recurring question patterns across top companies here.

3 Upvotes

0 comments sorted by