Software Engineer • Mid-Level
Software Engineer • Mid-Level
High QualityPrep Other Coding Questions Asked by Harvey
Continue with targeted prep from Harvey's coding question bank.
Interview Summary
I had a technical phone screen with Harvey that included a medium-difficulty coding problem called Highlight Sources With Citations, centered on citation tagging and phrase matching. The problem involved counting how often source phrases appeared in a document while correctly handling word boundaries, case sensitivity, overlapping occurrences, and duplicate source entries.
Interview Details
Coding: Highlight Sources With Citations
I was given a string text representing a document and an array of source phrases sources. My task was to determine how many times each source appeared in the document and return an array of occurrence counts in the same order as the input sources.
A valid match required the entire source phrase to appear as consecutive words in the document, with matching capitalization. Partial-word matches were not allowed, so a source like "data" could match a standalone "data" but not the first four letters of "database".
The problem also required counting overlapping occurrences, meaning that a single word could participate in multiple valid phrase matches. Additionally, if the same source phrase appeared more than
Unlock Full Details
Create a free account to unlock this interview experience report.