DataDriven
LearnPracticeInterviewDiscussDailyJobs

The Spike

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

A monitoring service emits readings as `(timestamp, value)` pairs in time order, and on-call needs the points that jump away from their recent baseline. Walking the readings in order, treat a reading at index `window` or later as anomalous when its distance from the mean of the `window` readings immediately before it (the current reading excluded) is more than `threshold` times their population standard deviation. Skip the opening readings that lack a full history and any stretch where those prior readings are identical, and for each anomaly return a dict with `timestamp`, `value`, `rolling_mean`, `rolling_std`, and `z_score` (the signed count of standard deviations from the mean), every numeric field rounded to two decimals, 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