Total Medical Specials Per Provider With Duplicate Bill Lines
Last updated: November 29, 2026
Quick Overview
Given itemized medical bill lines extracted from a personal injury case file, compute the total billed amount per provider and the overall medical specials, counting duplicate lines (same provider, date of service, procedure code and amount) only once.
EvenUp
November 29, 20260
0
0 solved
Given itemized medical bill lines extracted from a personal injury case file, compute the total billed amount per provider and the overall medical specials, counting duplicate lines (same provider, date of service, procedure code and amount) only once.
Medical specials are the backbone of a personal injury demand, and EvenUp's extraction pipeline often sees the same bill twice because firms request records from a provider more than once. A phone screen in this style checks whether you can normalize messy keys, deduplicate correctly and handle money without floating point errors.
What the Interviewer Expects
- Asks what makes two lines the same bill before coding
- Normalizes provider names (case, whitespace) for the dedupe key and grouping
- Keeps money in integer cents, never floats
- Runs in one pass with a hash set
- Mentions that legitimate repeat visits (same code, different date) must not be dropped
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- Two lines share provider, date and code but the amounts differ by a cent: how do you decide?
- How would you surface removed duplicates to a reviewer instead of silently dropping them?
- Providers appear as 'Mercy ER' and 'Mercy Hospital Emergency Dept': how would you resolve them?
- How does the answer change if lines also carry adjustments and write-offs?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Input is a list of bill lines, each with provider, date (ISO string), code (CPT or revenue code) and amount_cents. Output a mapping provider to total billed, sorted by amount descending, plus ...
High-Level Design
Build a normalized key (provider_key, date, code, amount) where provider_key collapses whitespace and lowercases. Keep a set of seen keys; the first time a key appears, add the amount to that prov...