# Design an electronic prescription system: system design interview question

> Prescription and refill rules must remain safe during pharmacy delays, repeated requests, transfers, and access changes.

Source: https://sysround.com/questions/design-electronic-prescription-system
Updated: 2026-11-05


Difficulty: hard. Levels: Senior, Staff+.

## How the interviewer opens it

"Design a system that lets clinicians issue prescriptions and send them to pharmacies. Patients and clinicians need to track dispensing and refills. The system must prevent duplicate fulfillment and protect patient information."

## What to clarify first

- Users and volume
- Traffic mix
- Prescription and refill rules
- User actions and retries
- Pharmacy interface
- Latency
- Consistency and availability
- Durability and retention
- Patient information
- Scope limits

## Scope of a strong answer

Core requirements:

- Issue and cancel prescriptions with a dose, quantity, expiry date, and refill allowance.
- Route prescriptions to pharmacies and let patients request a pharmacy change.
- Prevent duplicate prescriptions from repeated issue requests and duplicate fulfillment within each prescription.
- Restrict access to patient records and record every read and change.

Usually out of scope:

- Clinical decisions about drug interactions or duplicate medicines across separate prescriptions.
- Coordination between an old prescription and its replacement.
- Controlled substances and detailed legal rules.
- Insurance, payments, and pharmacy stock.
- Partial fills and offline dispensing.

## What interviewers probe

### Prescription requests and refills

One lost issue response can create separate prescriptions. A repeated dispense request can also consume the next refill.

### Pharmacy response delays

A missing pharmacy response leaves the dispense result unknown. A second authorization can cause two physical dispenses.

### Prescription changes

A pharmacy can dispense while a cancellation or transfer remains unresolved. A local record change cannot stop physical work.

### Patient record access

Patients, prescribers, and pharmacies need different access to the same prescription. Their access can change during active sessions.

## Common mistakes

- Creating duplicate prescriptions after a lost issue response because issuance has no independent, durable request identity.
- Treating a pharmacy timeout as proof that no dispense occurred and releasing the reserved fill.
- Checking the refill count outside the transaction that grants dispense permission.
- Letting a delayed authorization retry consume the next refill.
- Confusing pharmacy receipt, dispense permission, and completed dispensing.
- Protecting changes while exposing patient records through reads, logs, or support tools.

## The bar by level

- **Senior:** Defines issuance identity before any prescription ID exists. Stores the issuance result atomically with creation. Preserves dispense request identities after completion. Handles cancellation and transfer races without releasing unresolved allowances. Designs durable delivery and read audits.
- **Staff+:** Defines safety rules across request retries, database recovery, and pharmacy actions. Explains the pharmacy contract limits and when safety blocks service. Defines access revocation, audit failure policy, and recovery for unresolved attempts. Keeps cross-prescription guarantees outside the base scope. For the regional outage extension, defines ownership and recovery rules that prevent duplicate authorization.

Practice this question with an AI interviewer: https://sysround.com/practice/new?problem=prescription-management


---
SysRound (https://sysround.com) is an AI practice tool for system design interviews. It has a voice or typed AI interviewer and a shared whiteboard. At the end, you get feedback on each skill and a model answer. The AI feedback can be wrong.
