DataDriven
LearnPracticeInterviewDiscussDailyJobs

The Anomaly Detector

A hard Python mock interview question on DataDriven. Practice with AI-powered feedback, real code execution, and a hire/no-hire decision.

Domain
Python
Difficulty
hard
Seniority
L6

Interview Prompt

Given data (list of [time, value] pairs), window (positive int), and threshold (float), scan values left-to-right. For each index >= window, compute the mean and population stdev over the previous `window` values (excluding current). Flag the current value as an anomaly if |value - mean| > threshold * stdev. Return a list of dicts with keys {timestamp, value, rolling_mean, rolling_std, z_score}, each numeric field rounded to 2 decimal places, in scan order.

Summary

Spot the outliers before they page someone.

How This Interview Works

  1. Read the vague prompt (just like a real interview)
  2. Ask clarifying questions to the AI interviewer
  3. Write your python solution with real code execution
  4. Get instant feedback and a hire/no-hire decision

Related

  • All Mock Interviews
  • Practice Mode (untimed)
  • Python Interview Questions
  • Data Engineering Interview Prep Guide
  • Practice Problems
  • Daily Challenge