Google: Build a reusable IQR-based function to flag abnormal service response times.
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.
google_service_latency.csv has one latency measurement per row:
measurement_idservice - the service the measurement belongs toresponse_time_ms - response time in millisecondsSolve 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.
See the full interview round by round, with questions for each stage.