Loading...

The Tail End

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 expression evaluator needs a stack data structure. Implement a Stack class backed by a list, with push, pop, peek, and is_empty operations. Pop and peek on an empty stack should return None rather than throwing - the parser handles empty gracefully.

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.