Flag Gaps In Treatment From Visit Dates

Last updated: November 29, 2026

Quick Overview

Given the dates of a claimant's medical visits, return every gap between consecutive distinct visits that exceeds a configurable number of days, with the start date, end date and gap length.

EvenUp
Coding & Algorithms
Software Engineer
EvenUp
November 29, 2026
Software Engineer
Online Assessment
Coding & Algorithms
Easy

0

0

0 solved


Given the dates of a claimant's medical visits, return every gap between consecutive distinct visits that exceeds a configurable number of days, with the start date, end date and gap length.

Insurance adjusters use gaps in treatment to argue an injury resolved or was unrelated, so EvenUp's case review surfaces them for the attorney before a demand goes out. The assessment checks sorting, deduplication and careful date arithmetic.

What the Interviewer Expects
  • Sorts and deduplicates dates before comparing neighbors
  • Uses real date differences rather than string math
  • Defines whether the threshold is strict or inclusive
  • Returns structured output a UI can render
  • Discusses multiple providers being merged into one timeline
Key Topics to Cover
Sorting
Dates
Arrays
Timeline analysis
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • How would you exclude gaps explained by a scheduled surgery wait or a documented reason?
  • How would you compute gaps per provider and overall at once?
  • What if some visit dates were extracted with low OCR confidence?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Input: a list of datetime.date visits (possibly unsorted, possibly repeated because one visit produced several records) and max_gap_days. Output: list of (prev_visit, next_visit, gap_days) where...

High-Level Design

Deduplicate with a set, sort, then walk adjacent pairs. Each pair's gap is (cur - prev).days. Anything above the threshold is appended. This is a single pass after sorting....


Submit Your Answer
Markdown supported

Related Questions