Loading...

The Step Counter

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

Domain
Python
Difficulty
easy
Seniority
junior, mid

Problem

A UI analytics team needs to count the distinct navigation paths a user can take through a fixed-length flow. Given n steps in a sequence, a user can advance 1 or 2 steps at a time. Return the total number of distinct ways to reach step n from step 0.

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.