PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Software Engineering Fundamentals/Netflix

Design a concurrent latency percentile tracker

Last updated: Mar 29, 2026

Quick Overview

This question evaluates understanding of concurrent data structures, thread-safety, time-windowed metrics aggregation, and percentile computation for latency tracking within the Software Engineering Fundamentals domain.

  • hard
  • Netflix
  • Software Engineering Fundamentals
  • Software Engineer

Design a concurrent latency percentile tracker

Company: Netflix

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: hard

Interview Round: Technical Screen

Design a **thread-safe** `LatencyTracker` class that supports: 1. **Recording samples** - Input: `timestamp` (e.g., epoch millis) and `latencyMs` (integer milliseconds) - Operation: `addSample(timestamp, latencyMs)` 2. **Querying percentile latency over a time window** - Input: a time window and a percentile - Window can be specified as `[startTimestamp, endTimestamp]` (inclusive) - Percentile `p` is in `(0, 100]` (e.g., 50, 90, 95, 99) - Operation: `getPercentile(startTimestamp, endTimestamp, p)` - Output: the latency value (ms) at percentile `p` among samples whose timestamps fall inside the window. Additional requirements: - The class must support **concurrent** writers (`addSample`) and readers (`getPercentile`). - Clarify any assumptions you need (e.g., maximum query window/retention, acceptable approximation, out-of-order timestamps).

Quick Answer: This question evaluates understanding of concurrent data structures, thread-safety, time-windowed metrics aggregation, and percentile computation for latency tracking within the Software Engineering Fundamentals domain.

Related Interview Questions

  • Model Direct-Sold DSP Orders - Netflix
  • Design demand-side ads relational tables - Netflix (hard)
  • Explain concurrency and reliability tradeoffs - Netflix (hard)
  • Design a thread-safe key-value store - Netflix (medium)
Netflix logo
Netflix
Feb 12, 2026, 12:00 AM
Software Engineer
Technical Screen
Software Engineering Fundamentals
19
0
Loading...

Design a thread-safe LatencyTracker class that supports:

  1. Recording samples
    • Input: timestamp (e.g., epoch millis) and latencyMs (integer milliseconds)
    • Operation: addSample(timestamp, latencyMs)
  2. Querying percentile latency over a time window
    • Input: a time window and a percentile
      • Window can be specified as [startTimestamp, endTimestamp] (inclusive)
      • Percentile p is in (0, 100] (e.g., 50, 90, 95, 99)
    • Operation: getPercentile(startTimestamp, endTimestamp, p)
    • Output: the latency value (ms) at percentile p among samples whose timestamps fall inside the window.

Additional requirements:

  • The class must support concurrent writers ( addSample ) and readers ( getPercentile ).
  • Clarify any assumptions you need (e.g., maximum query window/retention, acceptable approximation, out-of-order timestamps).

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Netflix•More Software Engineer•Netflix Software Engineer•Netflix Software Engineering Fundamentals•Software Engineer Software Engineering Fundamentals
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.