Back to problems

Search Words and Phrases in a Large Line-Oriented File

System Design · Confluent · Medium

Build the search layer for a large UTF-8 text file. Each line contains one sentence, but the whole file may be much larger than available RAM, so it must not be loaded into memory at once. The design must support two operations: locating every line that contains a given word, and locating every line that contains an exact multiword phrase. Specify the tokenization rules, phrase-boundary rules, case and Unicode handling, result record shape, and how newly written file content…

Checking your access…