All practice tasks

SQL Case

Advertising measurement: rolling event value

Advertising measurement: Calculate the rolling average over each advertiser's current and previous two events.

Schema

sql
CREATE TABLE advertising_accounts (
  id INTEGER PRIMARY KEY,
  name TEXT NOT NULL,
  segment TEXT NOT NULL,
  region TEXT NOT NULL,
  created_at TEXT NOT NULL,
  active INTEGER NOT NULL
);
CREATE TABLE advertising_objects (
  id INTEGER PRIMARY KEY,
  name TEXT NOT NULL,
  category TEXT NOT NULL,
  parent_id INTEGER,
  created_at TEXT NOT NULL
);
CREATE TABLE advertising_events (
  id INTEGER PRIMARY KEY,
  external_key TEXT NOT NULL,
  account_id INTEGER NOT NULL,
  object_id INTEGER,
  event_type TEXT NOT NULL,
  status TEXT NOT NULL,
  amount REAL NOT NULL,
  occurred_at TEXT NOT NULL
);
CREATE TABLE advertising_links (
  id INTEGER PRIMARY KEY,
  account_id INTEGER NOT NULL,
  object_id INTEGER NOT NULL,
  relation_type TEXT NOT NULL,
  started_at TEXT NOT NULL,
  ended_at TEXT
);
CREATE TABLE advertising_event_archive (
  id INTEGER PRIMARY KEY,
  account_id INTEGER NOT NULL,
  object_id INTEGER,
  event_type TEXT NOT NULL,
  status TEXT NOT NULL,
  amount REAL NOT NULL,
  occurred_at TEXT NOT NULL
);

What this task practices

Advertising measurement: rolling event value is a sql case interview exercise that trains prompt interpretation, explicit assumptions, a concrete response, and a clear explanation of tradeoffs. The catalog marks it as hard difficulty. It focuses on Data Reasoning, Validation, Technical Reasoning. The signed-in workspace provides the tools for the round and evaluates the attempt against task-specific criteria. Reference solutions, hidden checks, evaluator instructions, and candidate work remain private.

Sign in to startThe workspace and evaluation open after sign in.