PracHub
QuestionsLearningGuidesInterview Prep
|Home/System Design/Amazon

Design streaming error-log counting with moving average

Last updated: Apr 28, 2026

Quick Overview

This question evaluates understanding of real-time stream processing concepts such as event filtering, stateful per-service counting, sliding-window moving averages, late-event handling, scalability, and fault-tolerant state management for monitoring and alerting.

  • medium
  • Amazon
  • System Design
  • Software Engineer

Design streaming error-log counting with moving average

Company: Amazon

Role: Software Engineer

Category: System Design

Difficulty: medium

Interview Round: Take-home Project

Design a core component in a streaming system: Input: - Multiple upstream services continuously emit log events. - Each event includes at least: `service_id`, `timestamp`, `log_level`, `message`. Tasks: 1) Filter and output only **error logs**. 2) Maintain **real-time per-service error count**. 3) Maintain a **moving average** of error count per service over a sliding time window. 4) Trigger an **alarm** when a service’s error rate/moving average crosses a threshold. Describe the architecture, state management, windowing approach, and how you handle late events, scale, and fault tolerance.

Quick Answer: This question evaluates understanding of real-time stream processing concepts such as event filtering, stateful per-service counting, sliding-window moving averages, late-event handling, scalability, and fault-tolerant state management for monitoring and alerting.

Related Interview Questions

  • Design a Personalized Weekly Deals Service - Amazon (medium)
  • Design an Amazon Locker Service - Amazon (easy)
  • Architect an AI Chatbot for Enterprise Users - Amazon (medium)
  • Object-Oriented Design: Snake Game - Amazon (medium)
  • High Availability and Failover for a Primary-Replica Database - Amazon (medium)
|Home/System Design/Amazon

Design streaming error-log counting with moving average

Amazon logo
Amazon
Dec 17, 2025, 12:00 AM
mediumSoftware EngineerTake-home ProjectSystem Design
153
0

Design a core component in a streaming system:

Input:

  • Multiple upstream services continuously emit log events.
  • Each event includes at least: service_id , timestamp , log_level , message .

Tasks:

  1. Filter and output only error logs .
  2. Maintain real-time per-service error count .
  3. Maintain a moving average of error count per service over a sliding time window.
  4. Trigger an alarm when a service’s error rate/moving average crosses a threshold.

Describe the architecture, state management, windowing approach, and how you handle late events, scale, and fault tolerance.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Amazon•More Software Engineer•Amazon Software Engineer•Amazon System Design•Software Engineer System Design

Your design canvas — auto-saved

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.