NewThe Learning module is now liveSee what's new
avatar
priyashah96Oct 3, 2026

Pinterest phone screen, elevator dispatch question (passed)

Interview Experiences
pinterest

Pinterest phone screen, elevator dispatch question (passed)

Had my Pinterest SWE phone screen last week, one coding question for the full hour. Just heard I'm moving to onsite, so dumping the problem here before I forget.

It was the call elevator question. You get a list of elevators, each with a current floor and a state (up, down, or idle). A passenger on some floor wants to go up or down and you return which elevator takes the call. Floors come in as strings btw, I almost forgot to parse them.

The eligibility rules are where I slowed down. Idle can take anyone. A moving elevator only counts if the passenger wants the same direction and is in its path. So one on 12 heading down can grab someone on 9 who wants down, but not someone on 14, and not someone on 9 going up. Among eligible ones pick the closest, ties go to the lower index, and if nobody qualifies you return a "none available" signal.

Code was one greedy pass tracking best distance and index. I pulled eligibility into a helper and the interviewer liked it since we walked cases just by calling it.

Last 10 min he asked what changes if requests arrive over time and elevators move a floor per second. I talked through advancing every elevator to the current time and reusing the same function, no code.

Not hard tbh, you just can't botch the direction checks.

25474.1k
Related QuestionsAI

Replies (3)

avatar
benhe98Oct 3, 2026

Thanks for writing this up. Did he care about the string floors or was that just parsing?

105
avatar
priyashah96Oct 3, 2026

just parsing, but he did notice when I almost compared them as strings lol

9
avatar
oliviabrownOct 3, 2026

congrats on moving forward! how long did it take to hear back?

84
avatar
priyashah96Oct 3, 2026

3 business days

29
avatar
User-5k94qOct 3, 2026

I had the timed follow up at onsite and they wanted actual code, so maybe practice that part too

82
avatar
priyashah96Oct 3, 2026

oh good to know, thanks. did it take the whole round?

143
avatar
User-5k94qOct 3, 2026

Reply to @priyashah96most of it, the base part was like 15 min

143
No more replies