Loading...

The Word Map

A easy Python interview practice problem on DataDriven. Write and execute real python code with instant grading.

Domain
Python
Difficulty
easy
Seniority
mid

Problem

Our search indexing pipeline needs a basic term frequency calculator. Write a function that takes a text string and returns a dictionary mapping each word to its occurrence count - lowercase everything, split on whitespace, and strip attached punctuation.

Practice This Problem

Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.