YourAlly

Amazon Senior Principal coding interview questions

These are the 6 coding questions YourAlly has tagged for Amazon at Senior Principal. Senior Principal is the common India title for this level. Amazon calls it L8, Senior Principal SDE. YourAlly treats it as Senior staff, the same level as Google L7 and Meta E7.

A coding round at a large tech company usually runs 45 to 60 minutes with one or two problems. You write code that runs, test it on your own examples and state its time and space cost. At this level coding is often a smaller part of the loop, but the bar for clarity and speed stays high.

Practice a mock Amazon Senior Principal coding loopPractice Amazon coding questions

Shortest Aisle Span Covering an OrderFree to read

Shelf slots along one aisle hold SKUs in order. An order lists SKUs, possibly repeated. Return [start, end] of the shortest contiguous run of slots that contains every SKU in the order with its multiplicity, leftmost on ties, or an empty list if none exists.

Input: aisle = ["c","a","d","b","a","b"], order = ["a","b"] Output: [3,4]

What a strong answer covers

  • Sliding window with need counts and a missing counter
  • Handles repeated SKUs in the order
  • Strict comparison for leftmost tie-break
  • O(n + m) time
  • Empty order and impossible cases return an empty list

5 more coding questions

  1. Critical Links Between Availability Zones Locked
  2. Fewest Shuttle Transfers Locked
  3. Maximize Delivery Slot Revenue Locked
  4. Rolling Median Request Latency Locked
  5. Merge Two Sorted Lists Locked

Sign up free to practice all 6

Related pages

More Amazon Senior Principal rounds

Amazon coding at other levels

Other companies at this level

Company guide

Amazon interview guide in Academy