Python data engineering interview problem. Difficulty: intermediate. Pattern: Dictionaries. About 15 minutes. Part of the Pro drill bank.
A knowledge-base search wants word counts from an article but should ignore stop words like 'the' and 'and' so the histogram is actually useful.
Count word frequency in text after removing a provided stop-word list.
Input: word_freq_filtered('The the cat sat', ['the']) Output: {'cat': 1, 'sat': 1} This input follows the stated rules and produces this output.
Topics: lakebench, python, frequency-counting.
More Python interview questions · All interview problems · Learn data engineering
Interview-style drill: Count word frequency in a document, excluding a given set of stop words.
Count word frequency in text after removing a provided stop-word list.