# Healthcare System Design in Interviews: Privacy & Compliance Isn’t Optional

<div style="text-align:center;margin-bottom:20px;">
  <img src="https://bugfree-s3.s3.amazonaws.com/mermaid_diagrams/image_1767782804222.png" alt="Healthcare system design diagram" style="max-width:600px;width:100%;height:auto;border-radius:6px;">
</div>

# Healthcare System Design in Interviews: Privacy & Compliance Aren’t Optional

When you design a healthcare system, privacy and regulatory compliance must be treated as first-class requirements — not afterthoughts. Interviewers expect you to show both technical controls and operational practices that reduce risk, preserve patient trust, and demonstrate accountability.

## Core technical requirements (what to mention)

- Encrypt PHI in transit and at rest
  - Use TLS 1.2+ for network transport and strong authenticated encryption (e.g., AES-256-GCM) for stored data.
  - Manage keys with a KMS or HSM; rotate keys and restrict key access via IAM.
  - Consider tokenization or envelope encryption for sensitive fields.

- Enforce RBAC and least privilege
  - Use role-based access control with fine-grained scopes (e.g., service, clinician, admin).
  - Apply attribute-based access control where needed (time, purpose, patient relationship).
  - Integrate with identity providers (OIDC/OAuth2) and enforce MFA for privileged roles.

- Keep tamper-evident audit trails
  - Log every access and change to PHI with immutable or append-only storage.
  - Record who, what, when, where, and purpose (if required).
  - Retain logs according to policy and make them searchable for investigations.

## Compliance mindset (policy + design trade-offs)

- Secure interoperability
  - Support standards (FHIR, HL7) but protect endpoints with OAuth2 scopes, mTLS, and API gateways.
  - Design APIs to minimize exposure (limit fields, pagination, rate limits).

- Data minimization & retention
  - Collect only necessary data and purge according to retention policies.
  - Use pseudonymization or de-identification for analytics and testing data.

- Patient consent & provenance
  - Model consent as data (consent receipts, timestamps, revocation) and enforce it at the API layer.
  - Provide auditability for consent decisions and clear UI flows for patients.

## Security execution (operations you should describe)

- Regular assessments
  - Automated vulnerability scanning, dependency checks in CI/CD, and periodic penetration tests.
  - Compliance audits and third-party attestations (SOC 2, HITRUST, ISO 27001) where applicable.

- Incident response & breach readiness
  - Maintain runbooks, triage procedures, escalation paths, and communication templates.
  - Test IR plans with tabletop exercises; keep evidence to demonstrate timely response.

- People & training
  - Ongoing security and privacy training (phishing simulations, least-privilege practices).
  - Onboard privacy champions who understand clinical workflows.

## How to explain these choices in interviews

- Tie controls to risk reduction: "Encrypting at rest and using KMS reduces the risk of data exposure if a disk or backup is compromised." 
- Explain trade-offs and why you chose them: "We use RBAC + attribute checks rather than broad admin roles to limit blast radius while keeping clinical workflows smooth." 
- Show accountability: "Immutable logs plus retention policies let us prove who accessed PHI and when — critical for audits and incident investigations." 
- Give concrete examples: mention FHIR APIs protected by OAuth2 scopes, use of HSM-backed keys, or how consent flags are enforced at the API gateway.

## Quick interview-ready checklist

- Encryption: TLS + AEAD at rest, KMS/HSM key lifecycle
- Access control: RBAC/ABAC, MFA for privileged users
- Logging: Immutable audit trails, searchable logs
- Privacy: Data minimization, de-identification for analytics
- Consent: Recorded, enforceable, revocable
- Operations: Vulnerability scans, pentests, IR plan, staff training
- Compliance artifacts: Policies, runbooks, attestation reports

## Closing

When asked about healthcare system design in an interview, go beyond buzzwords. Describe specific technical controls, operational processes, and measurable outcomes that reduce risk and prove accountability. Privacy and compliance aren’t optional — they’re central to safe, trustworthy health systems.

#SystemDesign #CyberSecurity #HealthTech
