YourAlly

Amazon L8 coding interview questions

These are the 6 coding questions YourAlly has tagged for Amazon at L8. Amazon L8 is 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 L8 coding loopPractice Amazon coding questions

Rolling Median Request LatencyFree to read

An AWS service emits request latencies in arrival order. For every window of k consecutive requests, report the lower median, the element at index (k - 1) / 2 of the sorted window. Return the medians in window order.

Input: latencies = [12,40,8,15,90,33,7], k = 3 Output: [12,15,15,33,33]

What a strong answer covers

  • Two heaps split into lower and upper halves
  • Lazy deletion with a delayed-count map
  • Rebalance by logical size and prune tops
  • States O(n log n) time and O(n) space for lazy deletion, and O(k) space only with real deletion
  • Handles k > n and duplicate values

5 more coding questions

  1. Critical Links Between Availability Zones Locked
  2. Fewest Shuttle Transfers Locked
  3. Maximize Delivery Slot Revenue Locked
  4. Shortest Aisle Span Covering an Order Locked
  5. Merge Two Sorted Lists Locked

Sign up free to practice all 6

Related pages

More Amazon L8 rounds

Amazon coding at other levels

  • L6 10 questions
  • L7 6 questions

Other companies at this level

Company guide

Amazon interview guide in Academy