Python data engineering interview problem. Difficulty: beginner. Pattern: Hashing. About 10 minutes. Free to practice.
True if any value appears more than once. Treat this as a production helper: match the contracted return shape, including empty and duplicate inputs.
Implement contains_duplicate(nums: list) -> bool.
Input: contains_duplicate([1, 2, 3, 1]) Output: True 1 appears twice.
Topics: lakebench, python, set, duplicate.
More Python interview questions · All interview problems · Learn data engineering
Interview-style drill: True if any value appears more than once.
Implement `contains_duplicate(nums: list) -> bool`. Example: `[1, 2, 3, 1]` → `True`. Keep the harness.