Amazon Screen Interview Experience - L5
Summary
I completed a 1-hour Amazon screen interview that included introductions, three leadership-principle behavioral questions, and a technical parking-garage problem.
Full Experience
YOE: 3years. I recently interviewed with Amazon. The interview was 1 hour divided into three parts:
-
Introductions The interviewer started by introducing herself, then asked me to introduce myself and briefly describe my background and experience.
-
Leadership Principles She asked three behavioral questions related to Amazon’s Leadership Principles (LPs), focusing on my past work experience. (Delivering under a tight deadline, Taking ownership beyond your direct scope...)
-
Technical Question The technical portion involved a parking garage problem - similar to this question.
Technical question: Parking Garage
You manage a row of N parking spaces, numbered from 0 to N - 1. Cars come in three sizes:
- Small: requires 1 space.
- Medium: requires 2 consecutive spaces.
- Large: requires 3 consecutive spaces.
Implement two operations:
park(size): Assign the leftmost available consecutive spaces and return the starting position. Return-1if no suitable spaces are available.leave(start, size): Free the spaces occupied by that car.
My first solution used a vector<bool> to track occupied spaces. My second approach used a map.
Interview Questions (1)
Parking Garage
You manage a row of N parking spaces, numbered from 0 to N-1. Cars can be small (1 space), medium (2 consecutive spaces), or large (3 consecutive spaces). Implement park(size) to assign the leftmost available consecutive spaces and return the starting index or -1 if none, and leave(start, size) to free the occupied spaces.