0PricingLogin
SQL Interview Prep · Lesson

Building a Multi-Step Funnel

Counting users who reach each ordered step and computing step conversion rates.

What a Funnel Question Really Tests

When an interviewer says "build me a signup funnel", they are testing whether you can count distinct users who reach each ordered step and express drop-off between them.

A funnel has stages like visit -> signup -> activate -> purchase. The deliverable is usually one row per step with a user count and a conversion rate.

  • Count users, not events (one user firing an event twice is still one user).
  • Steps are ordered; reaching step 3 implies you passed steps 1 and 2.

The Event Table You Will Be Given

Almost every funnel question hands you a single events table in long form. Picture this shape:

  • user_id who did the action
  • event_name such as 'visit', 'signup', 'purchase'
  • event_time a timestamp

One row per action. Your job is to reshape this into a step-by-step count. Always confirm the exact event names with the interviewer before writing SQL.

CREATE TABLE events (
  user_id    INT,
  event_name VARCHAR(50),
  event_time TIMESTAMP
);

All lessons in this course

  1. Building a Multi-Step Funnel
  2. Ordered Events and Time Windows
  3. A/B Test Assignment and Metrics
  4. Lift, Significance and Guardrails in SQL
← Back to SQL Interview Prep