Skip to content
Interview Questions

Data Analyst Interview Questions & Answers: Set 11, Logistics & Supply Chain

100 interview questions with model answers for freshers, set in Logistics & Supply Chain: SQL, Excel, statistics, Python, Power BI, business cases, AI and behavioral.

  • Data Analyst
  • Logistics & Supply Chain
  • Set 11 of 20
  • Data
  • SQL
  • Excel
  • Python
  • Power BI
  • AI

Free with login: questions 1 and 2 are open to everyone, all 100 after you log in.

Part of Bundle 3 · Operations & Industry

What's inside

  • 100 questions, each with a model answer
  • SQL · Excel · Statistics · Python · Power BI · Business Case · AI · Behavioral
  • SQL and Python answers include working code
  • Set 11 of 20 · read free on DS360 with login

Questions and answers

2 of 100 questions shown · Set 11 of 20 · Logistics & Supply Chain

SQL

  1. 1.Find shipments that took longer than the average delivery time for their route.

    Answer: Compute each route's average delivery time with a window function, then keep shipments above it. Assumed table: shipments(shipment_id, route_id, pickup_ts, delivered_ts). The window lets me compare every row with its own route average without a separate join. Trap: you cannot put a window function directly in WHERE, so I calculate it in a CTE first. I exclude undelivered shipments because they have no delivery time yet.

    SQL
    WITH t AS (
      SELECT shipment_id, route_id,
             delivered_ts - pickup_ts AS delivery_time,
             AVG(delivered_ts - pickup_ts)
               OVER (PARTITION BY route_id) AS route_avg
      FROM shipments
      WHERE delivered_ts IS NOT NULL
    )
    SELECT shipment_id, route_id, delivery_time, route_avg
    FROM t
    WHERE delivery_time > route_avg
    ORDER BY route_id, delivery_time DESC;
  2. 2.Calculate the on-time delivery percentage per courier partner per month.

    Answer: Group by courier and month, and divide on-time deliveries by total deliveries. Assumed table: shipments(courier_id, promised_date, delivered_date). On-time means delivered_date <= promised_date. Two traps: integer division (so I multiply by 100.0), and ignoring parcels that are still undelivered past their promise date. Those are late too, so in a real report I would include them as late or show them separately.

    SQL
    SELECT courier_id,
           DATE_TRUNC('month', delivered_date) AS month,
           COUNT(*) AS delivered,
           ROUND(100.0 * SUM(CASE WHEN delivered_date <= promised_date
                                  THEN 1 ELSE 0 END) / COUNT(*), 1)
             AS on_time_pct
    FROM shipments
    WHERE delivered_date IS NOT NULL
    GROUP BY courier_id, DATE_TRUNC('month', delivered_date)
    ORDER BY courier_id, month;

Loading all 100 questions…

Related resources

See all resources →

Data Analyst Interview Questions & Answers: Set 11, Logistics & Supply Chain | Data Solution 360