Menu
mediumDHL · date-timeGlobal · hiring in Asia

Flag shipments that breached their SLA

Each shipment has an agreed delivery window (sla_days). For every shipment, compute the actual number of days it took to deliver, and flag it 'Late' if that exceeds the SLA, otherwise 'On time'.

Return tracking_no, actual_days, and status.

Schema

shipments
idINT
tracking_noTEXT
dispatched_atTIMESTAMP
delivered_atTIMESTAMP
sla_daysINT

Example input

shipments
↑ Read the question

The interviewer's next question

Instead of a Late/On time flag, show by how many days each shipment breached its SLA — 0 for anything on time or early. Return tracking_no and days_over.

Solving follow-ups — the questions an interviewer actually asks next — unlocks with a Basic plan.

See Basic plans

RM 25/mo · cancel anytime

For a variance report, show each shipment's days_variance: actual days minus SLA days, as a signed number (negative means it beat the SLA, positive means it breached it).

Solving follow-ups — the questions an interviewer actually asks next — unlocks with a Basic plan.

See Basic plans

RM 25/mo · cancel anytime

Keep going

Company names are trademarks of their respective owners, used here only to describe practice material. mahir_data is not affiliated with, endorsed by, or sponsored by any company named on this site. Terms.