Compute the Payroll Submission Deadline Around Bank Holidays
Last updated: November 29, 2026
Quick Overview
Given a desired pay date, the number of business days the direct deposit cycle needs, and a set of bank holidays, return the date employees will actually be paid and the last day the employer can submit payroll.
Gusto
November 29, 20260
0
0 solved
Given a desired pay date, the number of business days the direct deposit cycle needs, and a set of bank holidays, return the date employees will actually be paid and the last day the employer can submit payroll.
Gusto offers several direct deposit speeds, and each one turns into a hard deadline that small business owners plan around. This question checks business-day arithmetic, a clear rule for pay dates that land on weekends or holidays, and awareness that a wrong deadline means people get paid late.
What the Interviewer Expects
- Moves a non-business pay date earlier, never later, and explains why
- Counts lead days backward over business days only
- Handles holidays that fall inside the lead window
- Keeps functions small and testable with an injected holiday calendar
- Discusses time-of-day cutoffs and time zones
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- How would you add a 4 pm Pacific cutoff so a submission at 5 pm counts as the next business day?
- How would you answer the reverse question: if I submit now, what is the earliest pay date?
- How would you make this fast if it runs for every company every day across years of dates?
- Where should the holiday calendar live, and who updates it when the Federal Reserve adds a holiday?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Inputs: pay_date, lead_days (for example 4 for standard, 2 or 1 for faster tiers), and a set of Federal Reserve holidays. Output: the effective pay date and the submission deadline date. Rule: if ...
High-Level Design
Write is_business_day and previous_business_day as tiny helpers. Adjust the pay date first, then step back lead_days business days from the effective pay date. Keep the holiday set as a paramete...