PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Akuna Capital

Design streaming stats with sliding window

Last updated: Mar 29, 2026

Quick Overview

This question evaluates skills in streaming algorithms, online data-structure design, statistical aggregation (max, mean, mode), and probabilistic approximation techniques for memory-constrained scenarios.

  • Medium
  • Akuna Capital
  • Coding & Algorithms
  • Data Scientist

Design streaming stats with sliding window

Company: Akuna Capital

Role: Data Scientist

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Technical Screen

Design a data structure that ingests an integer stream and supports online queries for maximum, mean, and mode. 1) Describe your update and query operations and their time/space complexity. 2) If values are guaranteed to be in the range [1, 1001], propose an exact solution and compute the memory required to maintain the mode. 3) If the value domain is unbounded or memory is constrained, describe how you would approximate the mode, including the accuracy trade-offs. 4) Extend your design to support returning the max, mean, and mode over only the most recent k elements (a sliding window). Explain how you maintain these statistics as the window slides, analyze the complexity, and discuss how you handle ties and empty-window cases.

Quick Answer: This question evaluates skills in streaming algorithms, online data-structure design, statistical aggregation (max, mean, mode), and probabilistic approximation techniques for memory-constrained scenarios.

Related Interview Questions

  • Find minimum swaps to sort array with duplicates - Akuna Capital (hard)
  • Heapify an array into a max-heap - Akuna Capital (Medium)
  • Implement a ring buffer - Akuna Capital (Medium)
  • Compute max profit across dated stock quotes - Akuna Capital (Medium)
  • Break a palindrome to smallest non-palindrome - Akuna Capital (Medium)
Akuna Capital logo
Akuna Capital
Aug 1, 2025, 12:00 AM
Data Scientist
Technical Screen
Coding & Algorithms
1
0

Design a data structure that ingests an integer stream and supports online queries for maximum, mean, and mode.

  1. Describe your update and query operations and their time/space complexity.
  2. If values are guaranteed to be in the range [1, 1001], propose an exact solution and compute the memory required to maintain the mode.
  3. If the value domain is unbounded or memory is constrained, describe how you would approximate the mode, including the accuracy trade-offs.
  4. Extend your design to support returning the max, mean, and mode over only the most recent k elements (a sliding window). Explain how you maintain these statistics as the window slides, analyze the complexity, and discuss how you handle ties and empty-window cases.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

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

Master your tech interviews with 7,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.