FastPrepCompare Labeling Worker Annotations
Problems/Compare Labeling Worker Annotations

Compare Labeling Worker Annotations

Scale AI logoScale AI● MediumNEW GRADINTERNOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Scale AI online assessment. The report defines the three levels and the box comparison by UUID, but it leaves out the final report. We chose exact equality, counts for each worker and the input limits. Our version is about 65% the same as the reported question.

Each labeling task has three completed attempts, in order L0, L1, and L2. Treat L2 as correct. Each attempt has one worker and a list of boxes. A box has a UUID, width, height, center coordinates, and label. The three workers on a task are different. A worker may handle many tasks, but always at the same level.

Compare boxes with matching UUIDs and produce the following report.

workersByTask[t][level] identifies the worker for task t at that level. The remaining parallel arrays list boxes in any order. At index i, taskIndexes[i], levels[i], and uuids[i] identify the box, boxes[i] is [width, height, centerX, centerY], and labels[i] is its label. A UUID is unique within one attempt. L0 and L2 have exactly the same UUIDs; L1 may add or omit UUIDs.

For this exercise, assume each L0 or L1 worker receives these four counts, summed over all of that worker's tasks:

  • agree: the UUID exists in L2 and all four numeric values and the label equal L2.
  • changed: the UUID exists in L2 but at least one numeric value or the label differs.
  • missing: a UUID in L2 is absent from this attempt.
  • extra: a UUID in this attempt is absent from L2.

For this exercise, assume comparison uses exact numeric and label equality, with no tolerance or geometric overlap calculation. Each shared UUID contributes once to agree or changed, even when several fields differ. The same UUID on different tasks represents separate boxes.

For this exercise, assume the result contains one row [worker, agree, changed, missing, extra] for every worker assigned to L0 or L1, including workers with no boxes. Write counts as decimal strings and sort rows by worker ID in increasing lexicographic order. Do not return L2 workers. Empty task input returns an empty array.

Function

compareAnnotations(workersByTask: String[][], taskIndexes: int[], levels: int[], uuids: String[], boxes: double[][], labels: String[]) → String[][]

Examples

Example 1

workersByTask = [["alice","bob","carol"]]taskIndexes = [0,0,0,0,0,0]levels = [0,0,1,1,2,2]uuids = ["a","b","a","c","b","a"]boxes = [[10,20,5,6],[10,20,5,6],[10,20,7,6],[10,20,5,6],[10,20,5,6],[10,20,5,6]]labels = ["cat","dog","cat","cat","dog","cat"]return = [["alice","2","0","0","0"],["bob","0","1","1","1"]]

Alice has two boxes that exactly agree with L2. Bob changes a, omits b, and adds c, so his counts are 0 agree, 1 changed, 1 missing, and 1 extra.

Example 2

workersByTask = [["ann","ben","cat"],["ann","dan","cat"]]taskIndexes = [1,0,1,0,1]levels = [2,0,0,2,1]uuids = ["x","x","x","x","x"]boxes = [[10,20,5,6],[11,20,5,6],[10,20,5,6],[10,20,5,6],[10,20,5,6]]labels = ["cat","cat","cat","cat","cat"]return = [["ann","1","1","0","0"],["ben","0","0","1","0"],["dan","1","0","0","0"]]

Ann changes the width of x on task 0 and agrees on task 1, giving 1 agree and 1 changed. Ben has no box for task 0, so he is missing x. Dan agrees with x on task 1. Reusing x across tasks does not join those boxes.

Example 3

workersByTask = [["z0","z1","z2"]]taskIndexes = []levels = []uuids = []boxes = []labels = []return = [["z0","0","0","0","0"],["z1","0","0","0","0"]]

There are no annotations. Both L0 worker z0 and L1 worker z1 are returned with four zero counts. L2 worker z2 is omitted.

Constraints

  • For this exercise, assume 0 <= workersByTask.length <= 1000 and every workersByTask row has exactly 3 entries.
  • For this exercise, assume 0 <= taskIndexes.length <= 10000.
  • taskIndexes.length = levels.length = uuids.length = boxes.length = labels.length.
  • For this exercise, assume 0 <= taskIndexes[i] <= 999. Every task index refers to an existing workersByTask row.
  • 0 <= levels[i] <= 2.
  • Every boxes row has exactly 4 entries. For this exercise, assume every box value is a finite number in [0, 1000000].
  • For this exercise, assume every worker ID, UUID, and label has 1 to 64 characters, using only lowercase ASCII letters, digits, @, ., _, or -.
  • Each task has three distinct workers. Each worker appears at only one level across all tasks.
  • The pair of task index and level, together with UUID, uniquely identifies an annotation.
  • For each task, the UUID sets at L0 and L2 are equal; L1 may have a different UUID set. Any attempt may be empty.

More Scale AI Online Assessment questions

  • Part 2: Batch Access ReviewOA · Seen Nov 2026
  • Part 1: The Narrowest KeyOA · Seen Nov 2026
  • Build Sessions from Unordered Events (Part 1)OA · Seen Oct 2026
  • Match Billing Charges to User Sessions (Part 2)OA · Seen Oct 2026
  • Four-Player Trick-Taking Card Game SimulationOA · PHONE SCREEN · Seen Aug 2026
  • Free Windows Between Busy IntervalsOA · PHONE SCREEN · Seen Apr 2026
  • Count Stable Server SubsegmentsOA · Seen Nov 2024
  • Distinct OR Values of Increasing SubsequencesOA · Seen Nov 2024
  • Running Through Walls with Limited EnergyOA · Seen Sep 2024
  • Relative Score Graph ComponentsOA · Seen Sep 2023

Similar questions at other companies

  • Subscription and Usage-Based Billing CalculatorStripe · OAStripe interview questions
  • Temporal Key-Field Database with Prefix ScansThe Trade Desk · OA
  • HTTP Request RedirectionAmazon · OA
  • Aggregate Paginated Project Run RecordsReplit · OA
  • Determine the Elimination Order (MLE)Quora · OAQuora interview questions
  • Eliminate Drivers by Slowest Personal BestZipRecruiter · OAZipRecruiter interview questions
  • Document and Layer OperationsFigma · OAFigma interview questions
  • Blood Type Inheritance: Possible Parent GenotypesAbridge · OAAbridge interview questions
  • Power Cell BankOptiver · OAOptiver interview questions
  • Credit Accounts with Scheduled TransfersAirbnb · OAAirbnb interview questions

Scale AI interview experiences

  • Scale AI Forward Deployed Engineer Debugging Round: 1 Experience
  • Scale AI ML Research Engineering Intern Interviews: 1 Experience
  • Scale AI SWE Intern Debugging Interview: 9 Experiences
  • Scale AI New Grad SWE and MLE Question Bank
  • Scale AI New Grad SWE Poker Screen and Onsite: 1 Experience
  • Scale AI New Grad SWE OA Questions: 1 Experience
All Scale AI interview questionsSee Scale AI hiring insights
Saved
class Solution {
    public String[][] compareAnnotations(String[][] workersByTask, int[] taskIndexes, int[] levels, String[] uuids, double[][] boxes, String[] labels) {
        // write your code here
    }
}
Checking account…