FastPrepClimbing Stairs
Problems/Climbing Stairs

Climbing Stairs

Expedia logoExpedia● EasyNEW GRADINTERNPHONE SCREENONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Many Expedia interview reports name this task: count the ways to climb n stairs when each move is one or two steps.

One report added a follow-up where a move can also be three steps. Another report links a version that returns the count modulo 1,000,000,007 with n up to 100,000. The editorial explains both, but they are not tested here. The tested version keeps moves of one or two steps, n up to 45, and the exact count.

Our version is about 95% the same as the reported questions.

A staircase has n steps. Starting below the first step, you may climb either one or two steps at a time.

Return the number of different step sequences that reach the top exactly. Sequences with a different order of moves count separately.

Function

climbStairs(n: int) → int

Examples

Example 1

n = 2return = 2

The sequences are [1,1] and [2].

Example 2

n = 3return = 3

The sequences are [1,1,1], [1,2] and [2,1].

Constraints

  • 1 <= n <= 45.

More Expedia Onsite Interview questions

  • Scramble StringONSITE INTERVIEW · Seen Sep 2026
  • Smallest Sufficient TeamONSITE INTERVIEW · Seen Sep 2026
  • Check Anagram Pairs Index by IndexONSITE INTERVIEW · Seen Oct 2025
  • Fresh Oranges Left After Rotting StopsONSITE INTERVIEW · Seen Oct 2025
  • Longest Increasing SubsequenceONSITE INTERVIEW · Seen Oct 2025
  • Lowest Common Ancestor with Repeated and Missing ValuesONSITE INTERVIEW · Seen Oct 2025
  • Shortest Substring with Exactly K OnesONSITE INTERVIEW · Seen Oct 2025
  • Middle Element of a Linked ListONSITE INTERVIEW · Seen Nov 2024
  • Minimum in a Rotated Sorted ArrayONSITE INTERVIEW · Seen Sep 2024
  • Mirror Image Binary TreesONSITE INTERVIEW · Seen Sep 2024

Similar questions at other companies

  • Biased Coin: Probability of Exactly h HeadsAkuna Capital · PHONE SCREENAkuna Capital interview questions
  • Dice Sum That Is a Multiple of mSusquehanna International Group (SIG) · PHONE SCREENSusquehanna International Group (SIG) interview questions
  • Probability of Consecutive HeadsSquarepoint Capital · PHONE SCREENSquarepoint Capital interview questions
  • Climbing StairsAmazon · ONSITE INTERVIEW
  • Count Staircase WaysGoldman Sachs · PHONE SCREENGoldman Sachs interview questions
  • Climbing StairsAMD · ONSITE INTERVIEWAMD interview questions
  • Climb Stairs with One, Two, or Three StepsAgoda · ONSITE INTERVIEWAgoda interview questions
  • Climbing StairsMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Climbing StairsGoogle · PHONE SCREENGoogle interview questions
  • Count Routes Through a City GridIMC Trading · PHONE SCREENIMC Trading interview questions

Interview reports that mention this question

  • Expedia Intern Final Round in 2021: 28 Experiences (Part 4 of 6)
  • Expedia Intern Finals Before 2020: 14 Experiences (Part 6 of 6)
  • Expedia Intern Final Round in 2020: 24 Experiences (Part 5 of 6)
  • Expedia SWE Intern Final Round: 126 Experiences (Part 1 of 6)
  • Expedia New Grad SDE Interviews: 20 Experiences (Part 1 of 3)

Expedia interview experiences

  • Expedia Intern Final Round in 2022: 15 Experiences (Part 3 of 6)
All Expedia interview questionsSee Expedia hiring insights
Saved
class Solution {
    public int climbStairs(int n) {
        // Write your code here.
    }

}
Checking account…