Text Search II

Highlight search matches in a DOM tree even when the match spans across multiple elements and text nodes.

Asked in frontend interviews at Google and Meta