PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/System Design/Cloverhealth

Design appointment scheduling data model and APIs

Last updated: Mar 29, 2026

Quick Overview

This question evaluates backend data modeling, REST API design, and enforcement of domain constraints within a web framework, focusing on scheduling, time-window validation, and resource relationships.

  • medium
  • Cloverhealth
  • System Design
  • Software Engineer

Design appointment scheduling data model and APIs

Company: Cloverhealth

Role: Software Engineer

Category: System Design

Difficulty: medium

Interview Round: Technical Screen

## Scenario You are extending an existing healthcare system that already has **User** and **Patient** management APIs. - **Doctors** and **Staff** are **Users**. - **Patients are not Users** (they are separate entities managed via Patient APIs). - You must add an **Appointment Scheduling** capability between **Doctors** and **Patients** at **Hospitals**. - Implementation context: **Django** (data model design + REST API design). ## Definitions & Business Rules ### Hospital operating hours - Each **Hospital** has operating hours (e.g., 09:00–19:00). - The schedule UI only displays hours when the hospital is open. ### Doctor Availability - An **Availability** is a time range when a **Doctor** can see patients **at a specific Hospital**. - A Doctor can only have Availabilities **within the Hospital operating hours**. - Users (staff) can create Availabilities for doctors. ### Appointment - An **Appointment** is a time when a **Patient** is scheduled to see a **Doctor** at a **Hospital**. - Appointments are: - exactly **1 hour** long - must **start on the hour** (e.g., 10:00, 11:00) - An Appointment can only be scheduled **within an Availability**. - Users (staff) can create Appointments between Doctors and Patients. ## UX-driven behavior - Clicking an **empty time slot** prompts the user to schedule an **Availability**. - Clicking an **Availability** prompts the user to schedule an **Appointment**. ## Required API capabilities (Gherkin-style) 1. **View** Availabilities and Appointments filtered by: - date - doctor(s) - hospital 2. **Create** a Doctor’s Availability for a given date and hospital. 3. **Create** an Appointment within an Availability. ## Your task Design: 1. A Django-friendly **data model** (entities, key fields, relationships, constraints). 2. The **REST APIs** (endpoints, request/response shapes, validation rules, error cases). 3. The core logic to enforce constraints (operating hours, no invalid times, appointment-within-availability, conflict handling).

Quick Answer: This question evaluates backend data modeling, REST API design, and enforcement of domain constraints within a web framework, focusing on scheduling, time-window validation, and resource relationships.

Cloverhealth logo
Cloverhealth
Feb 5, 2026, 12:00 AM
Software Engineer
Technical Screen
System Design
0
0
Loading...

Scenario

You are extending an existing healthcare system that already has User and Patient management APIs.

  • Doctors and Staff are Users .
  • Patients are not Users (they are separate entities managed via Patient APIs).
  • You must add an Appointment Scheduling capability between Doctors and Patients at Hospitals .
  • Implementation context: Django (data model design + REST API design).

Definitions & Business Rules

Hospital operating hours

  • Each Hospital has operating hours (e.g., 09:00–19:00).
  • The schedule UI only displays hours when the hospital is open.

Doctor Availability

  • An Availability is a time range when a Doctor can see patients at a specific Hospital .
  • A Doctor can only have Availabilities within the Hospital operating hours .
  • Users (staff) can create Availabilities for doctors.

Appointment

  • An Appointment is a time when a Patient is scheduled to see a Doctor at a Hospital .
  • Appointments are:
    • exactly 1 hour long
    • must start on the hour (e.g., 10:00, 11:00)
  • An Appointment can only be scheduled within an Availability .
  • Users (staff) can create Appointments between Doctors and Patients.

UX-driven behavior

  • Clicking an empty time slot prompts the user to schedule an Availability .
  • Clicking an Availability prompts the user to schedule an Appointment .

Required API capabilities (Gherkin-style)

  1. View Availabilities and Appointments filtered by:
    • date
    • doctor(s)
    • hospital
  2. Create a Doctor’s Availability for a given date and hospital.
  3. Create an Appointment within an Availability.

Your task

Design:

  1. A Django-friendly data model (entities, key fields, relationships, constraints).
  2. The REST APIs (endpoints, request/response shapes, validation rules, error cases).
  3. The core logic to enforce constraints (operating hours, no invalid times, appointment-within-availability, conflict handling).

Solution

Show

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Cloverhealth•More Software Engineer•Cloverhealth Software Engineer•Cloverhealth System Design•Software Engineer System Design
PracHub

Master your tech interviews with 8,000+ 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.