PracHub
QuestionsLearningGuidesInterview Prep
|Home/Coding & Algorithms/Capital One

Design late-tolerant streaming window aggregator

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's ability to design scalable streaming aggregations and stateful algorithms for handling out-of-order and late-arriving events, including unique-user counting and quantile estimation over time windows.

  • medium
  • Capital One
  • Coding & Algorithms
  • Data Scientist

Design late-tolerant streaming window aggregator

Company: Capital One

Role: Data Scientist

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

You receive an unbounded stream of events: (event_time, user_id, category). Events may arrive up to 48 hours late and are not ordered by time. Design and implement an API to support: ingest(event), and query(window_start, window_end) that returns, for each hour in [start, end), the number of unique users and the 95th percentile of per-user interarrival delay, computed using event_time (not processing time). Constraints: (a) updates for late arrivals must retroactively correct prior aggregates; (b) each ingest must be amortized O(log n) or better; (c) memory must be bounded by O(W·C) where W is the 48-hour correction window and C is the number of active categories; (d) queries over H hours should be O(H + C·log W). Describe your data structures (e.g., time-bucketed hash + approximate distinct like HyperLogLog, plus order-stat sketches or t-digest), how you handle clock skew, deduplication, and idempotency, and provide test cases that demonstrate correctness when late data arrives exactly at the 48-hour boundary.

Quick Answer: This question evaluates a candidate's ability to design scalable streaming aggregations and stateful algorithms for handling out-of-order and late-arriving events, including unique-user counting and quantile estimation over time windows.

Related Interview Questions

  • Reorder a String by Alternating Its Left and Right Ends - Capital One (medium)
  • Arrange Match Results in Repeating Win-Draw-Loss Order - Capital One (medium)
  • Sort Every Concentric Matrix Border Clockwise - Capital One (medium)
  • Count Pairs of Cyclically Equivalent Integers - Capital One (medium)
  • Sort Matrix Diagonals By Their Values - Capital One (medium)
|Home/Coding & Algorithms/Capital One

Design late-tolerant streaming window aggregator

Capital One logo
Capital One
Oct 13, 2025, 9:49 PM
mediumData ScientistTechnical ScreenCoding & Algorithms
7
0

You receive an unbounded stream of events: (event_time, user_id, category). Events may arrive up to 48 hours late and are not ordered by time. Design and implement an API to support: ingest(event), and query(window_start, window_end) that returns, for each hour in [start, end), the number of unique users and the 95th percentile of per-user interarrival delay, computed using event_time (not processing time). Constraints: (a) updates for late arrivals must retroactively correct prior aggregates; (b) each ingest must be amortized O(log n) or better; (c) memory must be bounded by O(W·C) where W is the 48-hour correction window and C is the number of active categories; (d) queries over H hours should be O(H + C·log W). Describe your data structures (e.g., time-bucketed hash + approximate distinct like HyperLogLog, plus order-stat sketches or t-digest), how you handle clock skew, deduplication, and idempotency, and provide test cases that demonstrate correctness when late data arrives exactly at the 48-hour boundary.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Capital One•More Data Scientist•Capital One Data Scientist•Capital One Coding & Algorithms•Data Scientist Coding & Algorithms
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.