stratascratch
  • Interview Questions
    • Interview Loops
    • Analytical
    • Algorithm
    • ML Coding
    • Stats Coding
    • Visualization
    • Concept
  • Data Labs
    • Discover
    • Your Notebooks
  • Mock Interview
  • Learn
  • Blog
  • Pricing
  • About
Log in
  • Interview Questions

    • Interview Loops
    • Analytical
    • Algorithm
    • ML Coding
    • Stats Coding
    • Visualization
    • Concept
  • Data Labs

    • Discover
    • Your Notebooks
  • Mock Interview
  • Learn
  • Blog
  • Pricing
  • About
Log inSign up
Back to Mini Analyses
  1. Assignment
  2. Your Solution
  3. Solution
  4. Solutions from Users
  5. Discussion

Detecting Latency Outliers

You must be logged in to download the datasets

Google: Build a reusable IQR-based function to flag abnormal service response times.

Assignment

You're an engineer on a site reliability team at Google. The team monitors response times for several internal services, and your lead wants a reusable way to spot abnormal latency measurements. The recent measurement export covers three services.

Note: Latency is how long a service takes to respond to a request, measured here in milliseconds. A fast service answers in a few milliseconds; a slow one can take hundreds or more. Monitoring systems record one latency measurement per request, so over time each service builds up a range of values that describe what "normal" looks like for it.

Deliverables

  • A reusable Python function that detects outliers in a set of values using the IQR (interquartile range) method, with the multiplier as a parameter.
  • The function applied to each service's response times, with the outliers it finds.
  • A short closing report for the site reliability team: your assessment of each flagged measurement — a real performance problem or something else, and what the team should do about it — plus anything they should double-check before relying on the numbers.

Data Description

google_service_latency.csv has one latency measurement per row:

  • measurement_id
  • service - the service the measurement belongs to
  • response_time_ms - response time in milliseconds

Practicalities

Solve this one in Python: the first deliverable is a reusable function with a parameter, which SQL alone can't express.

Assume this data comes directly from the monitoring pipeline and hasn't been cleaned, so review it carefully before relying on the numbers. When something looks off, work out what it is and decide how to handle it; when a definition or a final decision is genuinely ambiguous, choose a reasonable option and explain why. There's often more than one valid way to compute a result, so explain the approach you take and the reasoning behind your choices.

What's assessed: your results, and how clearly you explain what you see in the data and justify the choices you make.

This question is part of an interview loop

See the full interview round by round, with questions for each stage.

Big Tech platforms · Analytics Engineer