Highlight Overlapping Phrases in a Sentence

Quick Overview

Given a sentence such as `The quick brown fox jumps over the lazy dog.` and phrases such as `quick brown` and `brown fox jumps`, design a function that returns the sentence with every character covered by any exact phrase match highlighted. Make the API or object boundaries explicit, then cover invariants, edge cases, testing strategy, and operational trade-offs.

Highlight Overlapping Phrases in a Sentence

Company: Harvey

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: hard

Interview Round: Technical Screen

Overview: Given a sentence such as `The quick brown fox jumps over the lazy dog.` and phrases such as `quick brown` and `brown fox jumps`, design a function that returns the sentence with every character covered by any exact phrase match highlighted. Make the API or object boundaries explicit, then cover invariants, edge cases, testing strategy, and operational trade-offs.

|Home/Software Engineering Fundamentals/Harvey
Harvey logo
Harvey
Jul 26, 2026
hardSoftware EngineerTechnical ScreenSoftware Engineering Fundamentals
19
0
Loading...
Loading comments...