Top CPU Pods per Namespace

A hard SQL mock interview question on DataDriven, with an AI interviewer who asks follow-up questions and a hire or no-hire decision at the end.

Domain
SQL
Difficulty
hard
Seniority
L5

Interview Prompt

Each row of `k8s_pods` is a CPU sample of a pod in its namespace, and a pod whose status is 'Completed' has finished and does not count. For each namespace, produce a single row naming its heaviest-CPU pod and its runner-up in separate columns.

Summary

The two most CPU-hungry pods in each namespace.

How This Interview Works

  1. Read the vague prompt (just like a real interview)
  2. Ask clarifying questions to the AI interviewer
  3. Write and run your SQL against a real database
  4. Answer the interviewer's follow-up questions, then get a hire or no-hire decision