Core Entities
Patient: (patient_id, name, dob, allergies[], insurance_id, primary_care_provider_id). Prescription: (rx_id, patient_id, prescriber_id, drug_ndc, drug_name, dosage, quantity, days_supply, refills_remaining, written_date, expiry_date, status=ACTIVE|FILLED|CANCELLED|EXPIRED). Fill: (fill_id, rx_id, fill_number, dispensed_quantity, dispensed_date, pharmacist_id, insurance_claim_id, patient_copay_cents, status). Drug: (ndc, name, generic_name, drug_class, is_controlled, schedule, manufacturer). DrugInteraction: (drug_ndc_a, drug_ndc_b, severity=MINOR|MODERATE|MAJOR|CONTRAINDICATED, description).
Drug Interaction Checking
Before dispensing any prescription: check for drug interactions with the patient’s current active medications. Algorithm: retrieve all active prescriptions for the patient (status=ACTIVE, refills_remaining > 0, not expired). For the new prescription drug: query DrugInteraction table for (new_drug, each_active_drug) pairs. Flag interactions by severity: MINOR: log and continue. MODERATE: display warning to pharmacist, require acknowledgment. MAJOR: require pharmacist override with documented reason. CONTRAINDICATED: block dispensing entirely, require prescriber contact. Allergy check: compare drug’s allergy_cross_reactivity field against patient.allergies. Therapeutic duplication: flag if patient already has an active prescription in the same drug class (e.g., two antidepressants). Alert the pharmacist but do not block — therapeutic duplication is sometimes intentional.
Refill Management
Refill eligibility: a prescription can be refilled when refills_remaining > 0 and the prescription is not expired. Early refill rules: for non-controlled medications, allow refill when >= 75% of the supply has been used (fill_date + 0.75 * days_supply 0. Create a refill request and notify the patient. Refill reminders: send push notification or SMS 3 days before running out (fill_date + days_supply – 3 = today).
Insurance Adjudication
Insurance adjudication determines the patient’s copay. Flow: pharmacist submits a claim to the patient’s insurance (PBM — Pharmacy Benefit Manager) via the NCPDP standard protocol. Claim includes: patient insurance ID, drug NDC, quantity, days supply, prescriber NPI, pharmacy NPI. PBM responds with: copay amount (patient responsibility), plan paid amount, rejection reason if denied. Rejection codes: 70 (drug not covered on formulary — needs prior authorization), 75 (refill too soon), 88 (DUR — drug utilization review conflict). On rejection: pharmacist reviews the rejection code. Options: process as cash pay, request prior authorization, select an alternative drug. Store the adjudication response on the Fill record for audit.
Controlled Substance Compliance
Controlled substances (opioids, benzodiazepines, stimulants) require: state PDMP (Prescription Drug Monitoring Program) reporting — submit each dispensed controlled substance fill to the state PDMP database within 24 hours (often real-time required). PDMP query: before dispensing, query the patient’s PDMP history to detect “doctor shopping” (obtaining controlled substances from multiple prescribers). Red flags: 3+ prescribers for the same drug class in 90 days, overlapping fills from different pharmacies. Schedule II restrictions: no refills allowed. Each fill requires a new prescription. Paper or electronic prescription only (no verbal orders). Audit trail: all access to Schedule II prescription records is logged with the accessor, timestamp, and reason.
Interview Tips
- Drug interaction checking is the most safety-critical feature. Emphasize fail-safe behavior: on any system error during interaction checking, default to blocking the fill until manually reviewed.
- The insurance adjudication flow (NCPDP protocol) is real-world pharmacy-specific knowledge. In an interview, describe the pattern (submit claim, receive copay or rejection, handle rejection) without needing to know the exact protocol details.
- Controlled substance compliance is a regulatory requirement with serious legal consequences for violations. Always flag this as needing legal/compliance team involvement in the design phase.
{
“@context”: “https://schema.org”,
“@type”: “FAQPage”,
“mainEntity”: [
{
“@type”: “Question”,
“name”: “How do you implement drug interaction checking efficiently?”,
“acceptedAnswer”: {
“@type”: “Answer”,
“text”: “When a pharmacist fills a new prescription for patient P with drug D: retrieve all active medications for P (SELECT from prescriptions WHERE patient_id=P AND status=ACTIVE AND expiry_date > NOW()). Query drug interactions: SELECT * FROM drug_interactions WHERE (drug_a=D AND drug_b IN active_drugs) OR (drug_b=D AND drug_a IN active_drugs). Group results by severity: CONTRAINDICATED blocks dispensing. MAJOR requires pharmacist override. MODERATE shows a warning. MINOR is logged. Performance: index drug_interactions on (drug_a, drug_b) as a composite index and (drug_b, drug_a) as a second index for fast bidirectional lookup. Cache the active medication list per patient in Redis (TTL: 5 minutes, invalidated on new fill). A patient typically has 3-10 active medications — the interaction query is small and fast. Third-party interaction databases (Multum, DrugBank) provide the interaction data via API or licensed dataset.”
}
},
{
“@type”: “Question”,
“name”: “How does refill eligibility work for controlled vs non-controlled substances?”,
“acceptedAnswer”: {
“@type”: “Answer”,
“text”: “Non-controlled medications: allow refill when >= 75% of the days supply has elapsed. A 30-day supply filled on Jan 1 can be refilled on Jan 23 (day 23 = 76.7% elapsed). This prevents stockpiling while accommodating travel or timing preferences. Refills remaining must be > 0 and prescription must not be expired. Controlled substances (Schedule III-V): stricter — typically require >= 80-90% of days supply elapsed before refill. No early refills by default. Some states have specific minimum intervals. Schedule II (opioids, amphetamines): no refills. Each fill requires a new prescription. Maximum 30-day supply per fill. Electronic prescriptions (EPCS) required in many states. State PDMP query required before dispensing: verify no recent controlled fills from other pharmacies (detect doctor shopping). Dispensing controlled substances without PDMP check is a regulatory violation.”
}
},
{
“@type”: “Question”,
“name”: “How does insurance adjudication work in the pharmacy workflow?”,
“acceptedAnswer”: {
“@type”: “Answer”,
“text”: “When a patient presents a prescription with insurance: the pharmacy submits a claim to the PBM (Pharmacy Benefit Manager — e.g., Express Scripts, CVS Caremark) in real time via the NCPDP SCRIPT protocol. Claim includes: patient BIN/PCN/group (identifies their insurance plan), drug NDC, quantity, days supply, prescriber NPI, pharmacy NPI, and dates. PBM response (within 3-10 seconds): paid claim (copay amount, plan paid amount, deductible applied) or rejected claim (with rejection code). Common rejection codes: 75 (refill too soon — submit after the eligible date), 70 (drug not covered — needs prior authorization or formulary exception), 88 (DUR alert — interaction or duplicate therapy detected by PBM). On rejection: pharmacist reviews options: switch to a covered formulary alternative, request prior authorization from the prescriber, or process as cash pay. Cash price comparison (e.g., GoodRx discount): compare the cash price to the insurance copay; dispense the cheaper option.”
}
},
{
“@type”: “Question”,
“name”: “How do you implement electronic prior authorization for non-formulary drugs?”,
“acceptedAnswer”: {
“@type”: “Answer”,
“text”: “Prior Authorization (PA): insurance companies require PA for certain drugs before they will cover them (high-cost drugs, off-label uses). PA workflow: prescriber submits a PA request to the insurer with clinical justification (diagnosis codes, failed alternatives). Insurer reviews (24-72 hours) and approves or denies. If approved: authorization code is linked to the patient and drug. Pharmacy verifies the authorization code before dispensing. Electronic PA (ePA): standardized protocol (CoverMyMeds, SureScripts) allows PA requests to be submitted electronically from the prescriber’s EHR or pharmacy system. Status tracking: PA request states: SUBMITTED -> PENDING_CLINICAL_REVIEW -> APPROVED or DENIED -> APPEALED. Send status updates to the prescriber and pharmacist. Temporary supplies: some insurers authorize an emergency 3-day supply while the PA is pending, to avoid treatment gaps.”
}
},
{
“@type”: “Question”,
“name”: “How would you design a prescription monitoring program (PDMP) integration?”,
“acceptedAnswer”: {
“@type”: “Answer”,
“text”: “PDMPs track controlled substance prescriptions to detect drug diversion and doctor shopping. Integration requirements: before dispensing a Schedule II-V drug: query the state PDMP for the patient’s controlled substance history in the last 12 months. Response: list of all controlled fills by any pharmacy in the state (drug, quantity, prescriber, fill date). Review triggers: flag if patient received opioids from 3+ prescribers in 90 days, or if daily morphine milligram equivalents (MME) exceed a safety threshold (90 MME/day). Reporting: within 24 hours of dispensing a controlled substance, submit the fill to the state PDMP. API: most states use the ASAP (American Society for Automation in Pharmacy) standard for PDMP data exchange. Multi-state: interstate PDMP data sharing (PMPInterConnect) allows pharmacies to query patients’ histories across state lines. Audit: all PDMP queries are logged with the querier, timestamp, and patient — PDMP access is itself a privacy-regulated activity.”
}
}
]
}
Asked at: Stripe Interview Guide
Asked at: Atlassian Interview Guide
Asked at: Shopify Interview Guide
Asked at: DoorDash Interview Guide