Full Stack take-home
Constraint-based monthly roster generator for hospital emergency duty shifts.
Build a monthly duty doctor roster scheduler for a hospital emergency department. Staff names below are fictional — use them exactly as written in your seed data and UI.
| Shift | Timing | Eligibility | Min doctors |
|---|---|---|---|
| Morning Shift | 8:00 AM – 2:00 PM | Any doctor | 1 |
| Day Shift | 10:00 AM – 6:00 PM | Any doctor | 1 |
| OBGYN Shift | 10:00 AM – 6:00 PM | Female doctors only | 1 |
| Afternoon Shift | 2:00 PM – 8:00 PM | Any doctor | 1 |
| Night Shift | 8:00 PM – 8:00 AM | Any doctor | 1 |
Additional rule: Any doctor who remains unassigned after mandatory shift allocation should be assigned to the Day Shift.
Seed the roster with 4 approved leave days on the dates below. These doctors must be treated as unavailable on their leave date (same as weekly off). Do not assign any shift to them on these days.
| Doctor | Leave date | ISO date |
|---|---|---|
| Dr. Meera Kapoor | Friday, 5 June 2026 | 2026-06-05 |
| Dr. Aditya Nair | Friday, 12 June 2026 | 2026-06-12 |
| Dr. Priya Sharma | Friday, 19 June 2026 | 2026-06-19 |
| Dr. Kavya Menon | Tuesday, 23 June 2026 | 2026-06-23 |
Your UI should display these leaves on the calendar. Admins may add more leave days later; generation must re-run with updated availability.
Eligible: Dr. Meera Kapoor, Dr. Priya Sharma, Dr. Kavya Menon
Not eligible: Dr. Rohan Khanna, Dr. Aditya Nair, Dr. Imran Siddiqui
Distribute OBGYN duties equally among eligible female doctors.
Dr. Rohan Khanna
Dr. Imran Siddiqui
Remaining night shifts
Distribute equally among: Dr. Meera Kapoor, Dr. Aditya Nair, Dr. Priya Sharma, Dr. Kavya Menon.
Applies to everyone except Dr. Rohan Khanna. After a Night Shift, the next working day can only be an Afternoon Shift or an off day. Morning, Day, and OBGYN shifts are not allowed the day after a night.
Consecutive Night shifts are not allowed for any doctor except Dr. Rohan Khanna.
Maximum 1 shift per day and 6 shifts per week for every doctor.
Apply constraints in this order:
Expect difficult scheduling around weekends, female-only OBGYN coverage, and recovery windows — especially Fridays through Sundays.
Supabase database
Use Supabase as the database. Start from the reference schema (doctors, shift types, monthly rosters, assignments with manual-override flags, and leaves). Run it in your Supabase project and commit the SQL in your repo at supabase/duty-doctor-roster-schema.sql.
Apply on the careers page under Full Stack Developer. You will receive a Test ID and 24-hour deadline. Submit your repo and deployment link via the submission form.