Lead-to-Lease Funnel by Channel With First Response Time

Last updated: November 29, 2026

Quick Overview

Using leads, messages, tours and leases tables, write SQL that reports for each inbound channel (SMS, email, web chat, voice, listing site) the number of leads, median minutes to first outbound reply, tour rate and lease rate within 30 days of the lead.

EliseAI
Data Manipulation (SQL/Python)
Data Scientist
EliseAI
November 29, 2026
Data Scientist
Onsite
Data Manipulation (SQL/Python)
Medium

0

0

0 solved


Using leads, messages, tours and leases tables, write SQL that reports for each inbound channel (SMS, email, web chat, voice, listing site) the number of leads, median minutes to first outbound reply, tour rate and lease rate within 30 days of the lead.

Speed to lead is the headline value of an AI leasing assistant, and operators want to see it next to conversion by channel. The interviewer checks multi-table aggregation without fan-out, window or percentile functions, and attribution windows.

What the Interviewer Expects
  • Pre-aggregate each child table to one row per lead before joining
  • Compute first response as the minimum outbound timestamp after lead creation
  • Use a median (percentile_cont) rather than a mean for response time
  • Apply a 30-day attribution window to tours and leases
  • Explain how fan-out would inflate counts
Key Topics to Cover
CTEs
fan-out
percentile_cont
attribution window
funnel metrics
How to Approach This
  1. Clarify the schema and expected output format before writing queries.
  2. Use CTEs (WITH clauses) to break complex queries into readable steps.
  3. Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
  4. Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
  5. For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
  • How would you split first response time between AI replies and human replies?
  • A prospect arrives through two channels: which channel gets credit?
  • How do you show this per property with confidence that small properties are not noise?
  • What index or partitioning would make this fast on a billion messages?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice SQL Problems
Sample Answer
Clarify the Data

leads(lead_id, property_id, channel, created_at), messages(lead_id, direction, sent_at) with direction in ('inbound','outbound'), tours(lead_id, scheduled_at, status), `leases(lead_id, signed_at...

Approach

Build one row per lead with three derived fields: first outbound reply time, whether a completed tour happened within 30 days, whether a lease was signed within 30 days. Each comes from its own groupe...


Submit Your Answer
Markdown supported

Related Questions