Skip to content

Practice Find Overbooked Employees

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Medium#3611
LeetCode Problem

Find Overbooked Employees

Problem Statement

The employees table contains employee_id (integer primary key), employee_name (text), and department (text). The meetings table contains meeting_id (integer primary key), employee_id, meeting_date (date), meeting_type (Team, Client, or Training), and duration_hours (decimal). Assume a 40-hour work week. Group each employee's meetings into calendar weeks running Monday through Sunday, summing all meeting types. A week qualifies only when the total exceeds 20 hours; exactly 20 does not qualify. Return employees with at least two qualifying weeks. Output employee_id, employee_name, department, and meeting_heavy_weeks. Sort by that count descending, then name ascending. Practice approach: Aggregate hours by employee and the Monday date of the week. Filter with SUM(duration_hours) > 20, then count the qualifying weeks per employee and require COUNT(*) >= 2. Join employees for the display fields. Use a week-start date, not a week number without its year.

Source: Find Overbooked Employees on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
employees: (7, "Asha", "Engineering"), (8, "Ben", "Sales")
meetings: (1,7,"2026-10-05","Team",12), (2,7,"2026-10-06","Client",9), (3,7,"2026-10-12","Training",22), (4,8,"2026-10-05","Team",20), (5,8,"2026-10-12","Client",25)
Output
[(7, "Asha", "Engineering", 2)]
Explanation

Asha has weeks totaling 21 and 22 hours. Ben has only one qualifying week because 20 is not greater than 20.

Constraints

Each employee_id uniquely identifies one employee.
Each meeting_id uniquely identifies one meeting.
A week is Monday through Sunday; use the calendar date to keep years distinct.

Related LeetCode Problems

Practice more problems similar to Find Overbooked Employees.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.