Design a Versioned Payer Policy Engine That Can Replay History
Last updated: November 29, 2026
Quick Overview
Design a service that stores thousands of payer billing policies (bundling rules, modifier requirements, frequency limits, prior authorization needs) as versioned rules, evaluates every chart against the rules in effect on its date of service, and can replay past charts when a rule changes to find claims at risk.
Charta Health
November 29, 20260
0
0 solved
Design a service that stores thousands of payer billing policies (bundling rules, modifier requirements, frequency limits, prior authorization needs) as versioned rules, evaluates every chart against the rules in effect on its date of service, and can replay past charts when a rule changes to find claims at risk.
Charta Health's payer compliance product has to know what each payer will deny, and those policies change constantly and differ by state, plan and contract. The interviewer checks bitemporal rule storage, a safe rule language, fast evaluation at chart volume, and a backfill path that tells customers which already-submitted claims are now exposed.
What the Interviewer Expects
- Models rules with effective dates and recorded-at dates (bitemporal)
- Chooses a declarative rule format with tests per rule, not arbitrary code
- Indexes rules by payer and code so evaluation touches few rules
- Explains the replay or backfill pipeline and its output
- Covers authoring workflow, review, and rollback
- Keeps decisions explainable with rule IDs and versions
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- A rule was entered with the wrong effective date and has already produced findings; how do you correct it?
- How would you let customers add their own contract-specific rules safely?
- How would you use an LLM to draft rules from a payer's policy PDF without trusting it blindly?
- How do you keep replay of a year of charts from hurting live latency?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Functional: author, review and publish rules; evaluate a chart (payer, plan, state, date of service, codes, modifiers, diagnoses, patient history) and return violations with rule references; replay a ...
High-Level Design
- Rule store (Postgres):
rule_id, version, payer_scope, code_scope, effective_from, effective_to, recorded_at, superseded_at, definition (JSON), status. - Authoring service: policy analysts (optiona...