Compute a Delivery Promise Date From Supplier and Carrier Calendars

Last updated: November 29, 2026

Quick Overview

Given an order timestamp, a supplier's order cutoff hour, the supplier's lead time in business days, the carrier's pickup weekdays, transit time in carrier business days, and separate holiday sets for supplier and carrier, return the date the customer should be promised.

Wayfair
Coding & Algorithms
Software Engineer
Wayfair
November 29, 2026
Software Engineer
Technical Screen
Coding & Algorithms
Medium

0

0

0 solved


Given an order timestamp, a supplier's order cutoff hour, the supplier's lead time in business days, the carrier's pickup weekdays, transit time in carrier business days, and separate holiday sets for supplier and carrier, return the date the customer should be promised.

Most Wayfair items ship directly from one of thousands of suppliers, each with its own cutoff, lead time and carrier, and the product page shows a 'Get it by' date that drives conversion. Interviewers use this to see whether you can decompose a messy business rule into small, testable date steps and avoid off-by-one errors around cutoffs, weekends and holidays.

What the Interviewer Expects
  • Clarifies whether lead time and transit count business or calendar days
  • Separates cutoff handling, lead time, pickup wait and transit into distinct steps
  • Uses different holiday calendars for supplier and carrier
  • Writes helper functions that are easy to unit test
  • Traces at least one example across a weekend and a holiday
Key Topics to Cover
date arithmetic
business days
decomposition
delivery estimation
drop-ship
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • The page renders this for 48 items in a search grid. How do you make it cheap enough per request?
  • Lead times are noisy. How would you turn this into a date range with a confidence level?
  • How does the answer change when the customer's ZIP code is in a different time zone from the supplier?
  • An item ships in two boxes from two suppliers. What date do you promise?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Clarify first:

  • Cutoff is in the supplier's local time; an order at or after the cutoff counts as next working day.
  • Lead time = supplier business days (Mon to Fri, minus supplier holidays) until th...
High-Level Design

Pipeline of four pure steps, each taking and returning a date:

  1. Effective start: move past the cutoff or a non-working order day.
  2. Ready date: add lead_days supplier business days.
  3. ...

Submit Your Answer
Markdown supported

Related Questions