PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Airtable

Count business days excluding holidays

Last updated: Mar 29, 2026

Quick Overview

This question evaluates proficiency in date and calendar arithmetic, handling set-based exclusions (holiday lists), and reasoning about algorithmic efficiency for counting working days across potentially large ranges.

  • medium
  • Airtable
  • Coding & Algorithms
  • Software Engineer

Count business days excluding holidays

Company: Airtable

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

## Problem: Count Working Days Between Two Dates Given a start date, an end date (inclusive), and a set of holiday dates, compute the number of **working days**. A working day is a date that: - is **not** Saturday or Sunday, and - is **not** in the provided holiday set. ### Input - `startDate`: string in `YYYY-MM-DD` - `endDate`: string in `YYYY-MM-DD` (guaranteed `endDate >= startDate`) - `holidays`: list of distinct date strings in `YYYY-MM-DD` ### Output - An integer: number of working days in `[startDate, endDate]`. ### Example - `startDate = 2026-12-24` - `endDate = 2026-12-28` - `holidays = [2026-12-25]` Dates: - 12/24 Thu (work) - 12/25 Fri (holiday, not work) - 12/26 Sat (weekend) - 12/27 Sun (weekend) - 12/28 Mon (work) Output: `2` ### Constraints (typical) - Date range length up to \(10^6\) days for a naive iteration; design an approach appropriate to the stated constraints. - Holiday count up to \(10^5\).

Quick Answer: This question evaluates proficiency in date and calendar arithmetic, handling set-based exclusions (holiday lists), and reasoning about algorithmic efficiency for counting working days across potentially large ranges.

Related Interview Questions

  • Implement undo/redo with two stacks - Airtable (medium)
  • Implement spreadsheet undo/redo operations - Airtable (medium)
  • Implement BFS serializer and deserializer - Airtable (Medium)
Airtable logo
Airtable
Jan 22, 2026, 12:00 AM
Software Engineer
Onsite
Coding & Algorithms
26
0
Loading...

Problem: Count Working Days Between Two Dates

Given a start date, an end date (inclusive), and a set of holiday dates, compute the number of working days.

A working day is a date that:

  • is not Saturday or Sunday, and
  • is not in the provided holiday set.

Input

  • startDate : string in YYYY-MM-DD
  • endDate : string in YYYY-MM-DD (guaranteed endDate >= startDate )
  • holidays : list of distinct date strings in YYYY-MM-DD

Output

  • An integer: number of working days in [startDate, endDate] .

Example

  • startDate = 2026-12-24
  • endDate = 2026-12-28
  • holidays = [2026-12-25]

Dates:

  • 12/24 Thu (work)
  • 12/25 Fri (holiday, not work)
  • 12/26 Sat (weekend)
  • 12/27 Sun (weekend)
  • 12/28 Mon (work)

Output: 2

Constraints (typical)

  • Date range length up to 10610^6106 days for a naive iteration; design an approach appropriate to the stated constraints.
  • Holiday count up to 10510^5105 .

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Airtable•More Software Engineer•Airtable Software Engineer•Airtable Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.