PracHub
QuestionsPremiumCoachesLearningGuidesInterview 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 Log Collection System - Amazon (medium)
  • Design Human Avoidance for Warehouse Robots - Amazon (medium)
  • Design a High-Availability Load Balancer - Amazon (hard)
  • Design a Ride-Hailing Matching System - Amazon (medium)
  • Design a replicated cloud storage service - Amazon (hard)
Amazon logo
Amazon
Dec 17, 2025, 12:00 AM
Software Engineer
Take-home Project
System Design
136
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.

Solution

Show

Submit Your Answer

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
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.