FastPrepAssign Escalations to Teams
Problems/Assign Escalations to Teams

Assign Escalations to Teams

Amazon logoAmazon● MediumFULLTIMEONSITE INTERVIEW

Updated Nov 2026

QuestionExamples

Problem statement

Source note: Reported in a post from November 2026 about an Amazon Software Development Engineer II interview loop in India. It was the coding question of the third of four interview rounds. Customer escalations have to be split among three teams. Each escalation has its own value for each team, -1 marks a team that cannot take it, each team has a limit on how many it takes, every escalation goes to one team that can take it, and the goal is the largest total.

The report gave these rules and one example with four escalations and team limits 1, 2 and 1, but no answer, no input limits and no rule for when the escalations cannot all be placed. We worked out the answer for that example (41) and use it as Example 1, added two examples of our own, return -1 when no full assignment exists, and chose the limits (up to 100 escalations, values up to 10^4, team limits up to 100). The values and limits are passed to a function.

Our version is about 95% the same as the reported question.

There are n customer escalations, numbered 0 to n - 1, and three teams, numbered 0, 1 and 2. values[i][t] is the business value of giving escalation i to team t. When values[i][t] is -1, team t cannot handle escalation i.

Team t can take at most capacities[t] escalations. Every escalation must be given to exactly one team that can handle it.

The problem statement continues
Pro

Examples

Example 1

values = [[10,5,-1],[7,12,4],[-1,8,15],[9,-1,6]]capacities = [1,2,1]return = 41

Give escalation 0 to team 1 (5), escalation 1 to team 1 (12), escalation 2 to team 2 (15) and escalation 3 to team 0 (9): 5 + 12 + 15 + 9 = 41. Team 1 takes two escalations, which its capacity 2 allows. Giving escalation 0 to team 0 for 10 instead leaves only team 2 for escalation 3, and the best total after that choice is 10 + 12 + 8 + 6 = 36.

02 · Example 2
FastPrep Pro
Reported in 1 Amazon interview this week

Unlock this recently reported problem

FastPrep Pro gives you full access to interview problems reported within the last week.

  • Full problem statement and constraints
  • 2 more worked examples, explained
  • Guided hints and editorial
  • Run your code on real test cases
$8.25/month

$99 billed yearly — or $19 month-to-month. Cancel anytime.

Free plan — 2 of 2 free unlocks used this week

More Amazon Onsite Interview questions

  • Best Time to Buy and Sell StockONSITE INTERVIEW · Seen Nov 2026
  • Course SchedulePHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Maximum Earnings Across WarehousesONSITE INTERVIEW · Seen Nov 2026
  • Priority Message BufferONSITE INTERVIEW · Seen Nov 2026
  • Search in a Rotated Sorted ArrayPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Top K Frequent ElementsOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • LRU Cache for Query ResultsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Maximal SquareONSITE INTERVIEW · Seen Nov 2026
  • Serialize and Deserialize a Binary TreeONSITE INTERVIEW · Seen Nov 2026
  • Course Schedule IIPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026

Similar questions at other companies

  • Maximum All-Ones Square Side LengthOmnissa · ONSITE INTERVIEWOmnissa interview questions
  • Minimum Path SumMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Minimum Path SumBloomberg LP · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions
  • Bomb Enemy Best CoordinatesSambaNova Systems · ONSITE INTERVIEWSambaNova Systems interview questions
  • Largest Square of Ones in a GridExpedia · ONSITE INTERVIEWExpedia interview questions
  • Longest Increasing Path in a MatrixNew Relic · PHONE SCREEN · ONSITE INTERVIEW
  • Longest Increasing Path in a MatrixVisa · ONSITE INTERVIEWVisa interview questions
  • Maximal Rectangle in a Binary MatrixGoogle · ONSITE INTERVIEWGoogle interview questions
  • Find Robots by Blocker DistancesUber · PHONE SCREENUber interview questions
  • Largest Square of OnesOpenAI · OAOpenAI interview questions

Amazon interview experiences

  • Amazon Experienced SDE Onsite Questions: 1 Experience
  • Amazon SDE Onsite Interview Questions: 9 Experiences
  • Amazon SDE II and L5 FDE Interview Questions: 4 Experiences
  • Amazon Full-Time OA Problems, Earlier Reports (Part 5 of 5)
  • Amazon Full-Time OA Problems, Recent Reports (Part 4 of 5)
  • Amazon New Grad OA Problems: Every Task We Have (Part 3 of 5)
See Amazon hiring insights
CodePython 3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import heapq
from collections import defaultdict
 
class Solution:
def solve(self, values, queries):
# Build the adjacency structure
n = len(values)
graph = defaultdict(list)
for u, v in queries:
graph[u].append(v)
 
best = [float("inf")] * n
heap = [(0, 0)]
while heap:
cost, node = heapq.heappop(heap)
if cost > best[node]:
continue
Run and Submit unlock with Pro
FastPrep Pro
Reported in 1 Amazon interview this week

Unlock this recently reported problem

FastPrep Pro gives you full access to interview problems reported within the last week.

  • Full problem statement and constraints
  • 2 more worked examples, explained
  • Guided hints and editorial
  • Run your code on real test cases
$8.25/month

$99 billed yearly — or $19 month-to-month. Cancel anytime.

Free plan — 2 of 2 free unlocks used this week