codebaobab

FDE interview labData & Systems

Scheduling Recommendation

Build a scheduling recommendation across the modules of a dispatch planner.

JavaScript45 minutesData & Systems

Challenge brief

Read before you begin

Your mission · Dispatch planning

Build a planner that proposes a qualified technician and the earliest time a repair fits.

Coldline Facilities dispatchers spend 11 minutes per repair checking three systems. During the cold snap, 140 repairs waited at one hub, and a freezer down four hours costs a store about $8,000. A wrong technician was also sent once. Operations wants proposals live at the north hub on March 2.

  • Modules · 4 rules
  • Target · All public checks
Skip to round setup

Your assignment

  1. Build the review reasons, in the published order.
  2. Build eligibility: zone and certification.
  3. Build availability, then selection.
  4. Handle the new requirement when it arrives.
  5. Work WO-512 by hand in NOTES.md.

The problem

Dispatch is slow by hand

A dispatcher checks three systems for each repair, 11 minutes a job.

Impact: In the cold snap, 140 repairs waited at the north hub.

Wrong technician sent

A technician without refrigerant certification was sent to a refrigeration job.

Impact: Coldline had to report it to its insurer.

The planner is not built

The review, eligibility, availability and selection modules all fail with "Build ..." errors.

Impact: Dispatchers get no proposal at all.

Context

To dispatch one job
11 min
Spoiled stock per freezer
$8,000
North hub pilot
Mar 2

Requirements

  • Return {technicianId, start, end} or {reason}.
  • Check review reasons in the published order.
  • A stale feed goes to a person.
  • A technician needs the zone and the certification.
  • The job fits the window, shift and bookings.
  • Bookings may be unsorted, overlapping or nested.
  • Earliest start, then the smaller id as a string.
  • The request is never changed.

System overview

Edit the components marked “Your work”. The other components show where your changes fit.

Dispatch consoleRequests a proposal
Three source feedsOrders, roster and bookings
Feed adapterChecks feed freshness
Dispatch serviceRecords feed timestamps
Planner(Your work)Proposes a schedule
DispatcherApproves or reviews proposals
Read the connections
  • Dispatch console → Dispatch service: site + order
  • Three source feeds → Feed adapter: JSON feeds
  • Feed adapter → Dispatch service: one request
  • Dispatch service → Planner: request
  • Planner → Dispatcher: proposal/reason
  • Dispatch console: Asks for a proposal for one site and work order.
  • Three source feeds: Work orders, roster and bookings, each with observedAt.
  • Feed adapter: dispatch/adapters/snapshot: checks feed age (5 minutes) and joins by site.
  • Dispatch service: dispatch/service: records feed timestamps beside the decision.
  • Planner: recommend(request) in dispatch/planning/recommend.js, calling the review, eligibility, availability and selection modules.
  • Dispatcher: Approves the proposal or handles the review.

Details

Full requirements

Functional

  1. Return a proposal {technicianId, start, end} or a review answer {reason}. Times are minutes from the start of the service day, end is start plus duration, and the request is left unchanged.
  2. Review reasons, first that applies: closed-work-order, source-not-ready, invalid-duration, no-eligible-slot. A stale feed goes to a person, because a proposal on yesterday's bookings double-books a technician.
  3. A technician is eligible only with the job's zone and its certification. Refrigerant work by an uncertified technician is a reportable incident.
  4. The whole duration must fit inside the promised window, the shift, and clear of every booking. Bookings arrive unsorted and may overlap or nest; touching ends are allowed.
  5. Propose the earliest start, and on a tie the smaller technician id compared as plain strings, whatever the roster order. Two dispatchers looking at the same request must see the same proposal.

Non-functional

  • Volume: about 520 work orders a day across six hubs, up to 900 in a cold snap. The north hub roster is up to 12 technicians with over 120 bookings each on a busy day.
  • Latency: a proposal must appear in the console in under 300 ms, so the planner's share is under 50 ms, with no calls out of the process.
  • Freshness: a feed older than 5 minutes (maxAgeMs 300000) is not ready, and the job goes to a dispatcher.
  • Determinism: the same request always gives the same answer, so a dispatcher can reproduce what the tool proposed during an incident review.

Out of scope

  • Approving and reserving the slot: a separate booking service checks eligibility again and reserves only if the slot is still free.
  • Travel between stores and arrival times rounded for customers: the operator may raise these later.
  • The adapter, the service and the planner's wiring in dispatch/planning/recommend.js: they are supplied. Build the four rules in their own modules.
  • Clock times and dates: every time stays a whole number of minutes.
Data model

Work order

FieldTypeNotes
id, siteIdstringSuch as WO-512 at north-hub.
zone, certificationstringWhat the technician must cover and hold.
start, endintegerThe window promised to the store, in minutes.
durationintegerWhole minutes greater than zero; anything else is invalid-duration.
statusstringOnly "open" can be planned.

Technician (joined)

FieldTypeNotes
idstringCompared as plain strings on a tie.
zones, certificationsstring[]From the roster feed.
shift{start, end}Minutes of the service day.
bookings[{start, end}]From the bookings feed, for this site. Unsorted.

Request sources

FieldTypeNotes
orders, roster, bookingsbooleanTrue when that feed is no older than 5 minutes.
Files you are given · 4
  • samples/request-wo-512.json One joined request at the north hub: unsorted and nested bookings, a technician without the certification, one in another zone, and two who can both start at 540 listed in the wrong order.
    {
      "workOrder": {
        "id": "WO-512",
        "siteId": "north-hub",
        "zone": "north",
        "certification": "refrigeration",
        "start": 480,
        "end": 720,
        "duration": 60,
        "status": "open"
      },
      "sources": {
        "orders": true,
        "roster": true,
        "bookings": true
      },
      "technicians": [
        {
          "id": "kim",
          "zones": [
            "north"
          ],
          "certifications": [
            "refrigeration",
            "electrical"
          ],
          "shift": {
            "start": 480,
            "end": 1020
          },
          "bookings": [
            {
              "start": 600,
              "end": 660
            },
            {
              "start": 480,
              "end": 540
            },
            {
              "start": 495,
              "end": 525
            }
          ]
        },
        {
          "id": "raj",
          "zones": [
            "north"
          ],
          "certifications": [
            "electrical"
          ],
          "shift": {
            "start": 480,
            "end": 1020
          },
          "bookings": []
        },
        {
          "id": "jo",
          "zones": [
            "north",
            "east"
          ],
          "certifications": [
            "refrigeration"
          ],
          "shift": {
            "start": 480,
            "end": 1020
          },
          "bookings": [
            {
              "start": 420,
              "end": 540
            },
            {
              "start": 600,
              "end": 630
            }
          ]
        },
        {
          "id": "ana",
          "zones": [
            "north"
          ],
          "certifications": [
            "refrigeration"
          ],
          "shift": {
            "start": 540,
            "end": 1080
          },
          "bookings": [
            {
              "start": 540,
              "end": 600
            }
          ]
        },
        {
          "id": "lena",
          "zones": [
            "south"
          ],
          "certifications": [
            "refrigeration"
          ],
          "shift": {
            "start": 480,
            "end": 1020
          },
          "bookings": []
        }
      ]
    }
  • samples/decision-wo-512.json What recommend must return for that request.
    {
      "technicianId": "jo",
      "start": 540,
      "end": 600
    }
  • logs/dispatch-console-2026-02-02.log The supplied snapshot through the command line at 10:00, and again at 10:04:30 when all three feeds are past five minutes old.
    2026-02-02T10:00:00Z console site=north-hub order=WO-500 as_of=2026-02-02T10:00:00Z decision={"technicianId": "alex", "start": 630, "end": 675}
    2026-02-02T10:04:30Z console site=north-hub order=WO-500 as_of=2026-02-02T10:04:30Z decision={"reason": "source-not-ready"} stale=orders,roster,bookings
    2026-02-02T10:05:12Z console site=north-hub order=WO-512 dispatcher=m.ortiz action=requested
  • metrics/north-hub-dispatch-2026-01.csv January at the north hub: time to assign, wrong-certification reassignments and double bookings, by week.
    week,work_orders,median_minutes_to_assign,p90_minutes_to_assign,reassigned_wrong_cert,double_booked
    2026-01-05,612,9,21,1,4
    2026-01-12,1034,14,48,2,11
    2026-01-19,987,13,41,1,9
    2026-01-26,655,10,24,0,5
Tickets · 4
  • TASK-201 Build the review reasons, in the published order Reported by Marisol (dispatch lead)

    Expected {"reason": "source-not-ready"}, then {"reason": "invalid-duration"}.

    Actual Every call fails in the review module with its "Build ..." error, before anything else runs.

  • TASK-202 Build eligibility: zone and certification Reported by Dev (field operations)

    Expected raj (electrical only) and lena (south zone) are never proposed for WO-512.

    Actual The eligibility module is not built: it fails with its "Build ..." error.

  • TASK-203 Build availability: the first start where the whole job fits Reported by Marco (QA)

    Expected kim's first start is 540: free from 540 to 600, exactly the 60 minutes the job needs. ana's is 600.

    Actual The availability module is not built: it fails with its "Build ..." error.

  • TASK-204 Build selection: earliest start, then the smaller id Reported by Marisol (dispatch lead)

    Expected {"technicianId": "jo", "start": 540, "end": 600}: jo and kim both start at 540, and "jo" is the smaller id.

    Actual The selection module is not built, so no proposal is returned.

What you hand in
  • The four planning modules built, with every public check and the request test passing, including the new requirement when it arrives.
  • NOTES.md: the supplied snapshot and WO-512 worked by hand, and the case you added in the Preview tab.
  • Your answer to the interviewer's follow-up and the debrief questions.
How the work is judged
Breaking down the work
Works the snapshot by hand, then builds review, eligibility, availability and selection one module at a time with the checks after each.
Directing the assistant
Gives the assistant one module, its contract and a worked example, and keeps the supplied wiring out of the change.
Checking the work
Tries unsorted and nested bookings, touching ends and a tie listed in the wrong order, and checks the request is unchanged.
Judging the assistant
Rejects an in-place sort, a stale feed planned anyway, true accepted as a duration, or a tie broken by roster order.
Correct result
Every check passes: reasons in order, the whole job inside window, shift and bookings, earliest start then smaller id.
Explaining the work
Explains to a dispatcher, in plain words, why WO-512 goes to jo at 09:00 and why a stale feed comes back as a review.
Trade-offs to discuss
  • Proposing on slightly stale data versus sending the job to a person, when a freezer is down.
  • Earliest start versus balancing work across technicians, and who should decide.
  • What the booking service must check again at approval, when someone books the technician in between.
How you are graded
  • Decomposition 15%
  • Prompting the assistant 15%
  • Verification 20%
  • Judgment about AI output 15%
  • Correctness 25%
  • Communication 10%

Scores use evidence from your session. A short or incomplete session may not provide enough evidence for every skill. See a sample scorecard

Interview guidance

A facilities operator wants a tool that proposes a qualified technician and a free time for a repair, or tells the dispatcher why the job needs a person. The service around the planner is built. Build the four planning rules, one module at a time, and use the AI assistant however you like. Work the supplied snapshot by hand before you trust any code.

  • AI is allowed and expected: your own Claude, OpenAI or Gemini key, or the free in-browser model.
  • You are graded on how you drive and check the AI, not on how much you prompt.
  • Run the checks; read what fails.
  • A new requirement will arrive partway through.
  • Too little AI use is reported as “not enough to grade”, never as a fail.
Debrief · 7 questions
  • What did you delegate to the AI, and why?
  • Name one AI suggestion you rejected or changed, and why.
  • Choose one block the AI helped write. Explain what each line does and which test verifies it.
  • What is still risky, and what would you test or ship next?
  • Walk one request through the four modules. Which rule was easiest to get subtly wrong?
  • Which case of your own did you add, and what did it show?
  • How did travel time change the slot search, and where does it not apply?