Level: Unknown Level
Round: Online Assessment · Type: Coding · Difficulty: 7/10 · Duration: 60 min · Interviewer: Unfriendly
Topics: Algorithms, Binary Search
Location: San Francisco, CA
Interview date: 2026-02-15
Question: LeetCode problem and a variation of climbing stairs with energy constraints and binary search.
The first question was LeetCode. The second question, which I hadn't seen before, was similar to climbing stairs. In this variation, I could take an elevator once at the beginning. Each floor has an energy gain e1 and a time t1 if I take the elevator. After that, I need to climb stairs, which cost energy e2 per floor and take ceil(c / current energy) time, where c is a constant. Energy cannot be negative during the process. I needed to calculate the minimum time difference between taking the elevator and climbing the stairs. Binary search can be used to solve it.
LeetCode similar: LeetCode 1475