MEDIUMVerified Real Interview• Logistics Operations Analyst

Prime 24-Hour Guaranteed Delivery SLA Breaches

Amazon Logistics monitors fulfillment performance against Prime 24-hour delivery SLAs.

Write a SQL query to identify all orders where actual delivery time exceeded order placement time by more than 24.0 hours. Calculate:

  • order_id
  • customer_id
  • hours_to_deliver (rounded to 1 decimal place)
  • breach_severity categorizing delay:
    • 'Moderate Breach' if between 24.1 and 36.0 hours
    • 'Severe Breach' if greater than 36.0 hours

Order by hours_to_deliver descending.

Tables:

  • fulfillment_orders (order_id INT, customer_id INT, ordered_at TIMESTAMP, delivered_at TIMESTAMP)

Execution Sandbox:

Your query executes inside an isolated in-memory PostgreSQL engine (PGlite WebAssembly). You have full access to standard PostgreSQL aggregations, window functions, and CTEs.

Standard SQL (ANSI)|Ln 1, Col 1
⌘↵ Run Query
Ready to execute. Press Run (⌘+Enter)
Write your query and click “Run” or press ⌘+Enter to inspect output.