Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing

Climbing Stairs

Python data engineering interview problem. Difficulty: advanced. Pattern: Dynamic Programming. About 18 minutes. Part of the Pro drill bank.

Number of ways to climb n stairs taking 1 or 2 steps. Treat this as a production helper: match the contracted return shape, including empty and duplicate inputs.

Implement climb_stairs(n: int) -> int. (1+1+1, 1+2, 2+1).

Requirements

  • Number of distinct climb sequences.

Constraints

  • n >= 1.
  • Order matters.

Examples

Input: climb_stairs(3) Output: 3 Three sequences.

Topics: lakebench, python, dp, fibonacci.

More Python interview questions · All interview problems · Learn data engineering

advanced

Climbing Stairs

Interview-style drill: Number of ways to climb n stairs taking 1 or 2 steps.

Implement `climb_stairs(n: int) -> int`. Example: `n=3` → `3` (1+1+1, 1+2, 2+1). Keep the harness.