Loading...

Dominant Element

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

Domain
Python
Difficulty
easy
Seniority
junior

Problem

Our IoT pipeline receives batches of sensor readings where one reading type dominates. Write a function called find_dominant that returns the reading appearing more than half the time in the list - the firmware team guarantees exactly one such reading exists per batch.

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.