What the Night Changed

A hard Python 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
Python
Difficulty
hard
Seniority
L5

Interview Prompt

A nightly job dumps a dimension table to a list of row dicts, and you get two of them: old_snapshot from yesterday and new_snapshot from today, where each row carries an id_field key that identifies it across runs. Return a dict splitting the differences into inserts (ids seen only today), deletes (ids gone since yesterday), and updates (ids in both runs whose other fields moved).

Summary

Two photographs of the same table, a day apart. Account for everything that moved.

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 Python against test cases
  4. Answer the interviewer's follow-up questions, then get a hire or no-hire decision