SmithRx logo

SmithRx Software Engineer System Design Questions

7 practice questions for SmithRx Software Engineer interviews

SmithRx software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.

Software Engineer Backend Engineer Frontend Engineer Full Stack Engineer Mobile Engineer Data Engineer Data Scientist ML Engineer DevOps Engineer DevOps Engineer Product Manager SRE Security Engineer Engineering Manager Data Analyst UX/UI Designer QA Engineer

No verified questions yet for SmithRx.

system design Medium database #1

1. [Database] — Implement a system to track prescription records for patients

Background: SmithRx needs a reliable way to manage and store patient prescription records to ensure accurate medication dispensation. This system helps keep track of which medications each patient has been prescribed, along with relevant details like dosage and refill dates.
Problem statement: You are to implement a class named PrescriptionTracker that will manage patient prescriptions. Each patient can have multiple prescriptions, and each prescription contains details including the medicationName, dosage, refillDate, and a patientId. The class should support adding new prescriptions and retrieving a list of prescriptions for a given patient ID.
Function/class signature:
  • def add_prescription(self, patient_id: str, medication_name: str, dosage: str, refill_date: str) -> None:

  • def get_prescriptions(self, patient_id: str) -> List[Dict[str, str]]:

Example 1:
Input:
tracker = PrescriptionTracker()
tracker.add_prescription('PATIENT123', 'Amoxicillin', '500mg', '2023-12-01')
output = tracker.get_prescriptions('PATIENT123')
Output:
[{'medicationName': 'Amoxicillin', 'dosage': '500mg', 'refillDate': '2023-12-01'}]
Explanation: After adding a prescription for the patient, the retrieval shows the correct details.
Example 2:
Input:
tracker.add_prescription('PATIENT123', 'Ibuprofen', '200mg', '2024-01-10')
output = tracker.get_prescriptions('PATIENT123')
Output:
[{'medicationName': 'Amoxicillin', 'dosage': '500mg', 'refillDate': '2023-12-01'}, {'medicationName': 'Ibuprofen', 'dosage': '200mg', 'refillDate': '2024-01-10'}]
Explanation: The retrieval now includes both prescriptions for the same patient.
Constraints:
  • The patient_id, medication_name, and dosage are strings with a maximum length of 100 characters.

  • The refill_date is a string in YYYY-MM-DD format.

  • The number of prescriptions for a single patient cannot exceed 1000.

Related SmithRx Software Engineer interview prep

Start practicing SmithRx questions

Sign up for free to access walkthroughs, AI-generated questions, and more.

Get Started Free