PracHub
QuestionsPremiumCoachesLearningGuidesInterview 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

  • Solve Four Coding Assessment Tasks - Capital One (medium)
  • Write SQL using joins and window functions - Capital One (medium)
  • Review Preprocessing Code and Tests - Capital One (easy)
  • Remove nodes with a given value - Capital One (medium)
  • Solve multiple algorithmic interview questions - Capital One (hard)
Capital One logo
Capital One
Oct 13, 2025, 9:49 PM
Data Scientist
Technical Screen
Coding & Algorithms
4
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

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
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL 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.