← Nextdoor Interview Insights

Nextdoor·Software Engineer·Technical Phone Screen·Senior

Senior
Jun 2026

Summary

SQL-heavy technical screen for a data engineering role at Nextdoor. The whole thing was built around a photo-sharing app schema and escalated pretty fast from basic counts to populating aggregate tables and computing retention cohorts. Not a vibe check at all, just raw SQL for like an hour.

Questions Asked (5)

Q1

Given a users table, write a query to count the total number of users.

Product Analytics & Metrics
Author's notes

Warmup question, COUNT(*) on users.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the table schema and whether 'total users' means all rows or only active/valid users. Then write a simple COUNT(*) query, but also discuss edge cases like NULLs, duplicates, and performance considerations for large tables.

Pro tip: Mention that COUNT(*) is generally faster than COUNT(column) and that for very large tables, you might use an approximate count or a pre-aggregated metric to avoid full table scans.

1. Clarify requirements

Ask whether 'total users' includes all rows or only distinct/active users, and confirm the table schema (e.g., primary key, status column).

2. Write the basic query

Use SELECT COUNT(*) FROM users; for total rows, or SELECT COUNT(DISTINCT user_id) FROM users; if duplicates are possible.

3. Discuss edge cases

Consider NULLs (COUNT(column) ignores NULLs), duplicates, and whether to filter by a condition like status = 'active'.

4. Address performance

For large tables, COUNT(*) can be slow; mention indexes, approximate counts, or using a summary table if real-time accuracy isn't required.

5. Validate and test

Suggest running the query on a sample or using EXPLAIN to check performance, and verify results against known metrics if available.

Key Points to Mention

  • Difference between COUNT(*) and COUNT(column)
  • Handling NULL values and duplicates
  • Filtering for active users if relevant
  • Performance implications on large datasets
  • Use of indexes to speed up counting
  • Alternative approaches like approximate counts or pre-aggregation

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

Using the users table, find the calendar month with the highest number of new user signups.

Product Analytics & MetricsData Modeling
Author's notes

Straightforward GROUP BY on a truncated timestamp, then ORDER BY and LIMIT 1.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the definition of 'new user signups' and the relevant date column (e.g., created_at). Then write a SQL query that truncates the signup date to the month, counts the number of signups per month, and orders by count descending to find the top month.

Pro tip: Mention that you would check for data quality issues like NULL signup dates or duplicate users, and consider whether to use COUNT(DISTINCT user_id) to avoid double-counting.

1. Clarify requirements

Confirm the definition of 'new user signup' and identify the correct date column (e.g., created_at) in the users table.

2. Aggregate by month

Use DATE_TRUNC or equivalent to group signups by calendar month, and count the number of signups per month.

3. Find the maximum

Order the aggregated results by the count in descending order and limit to 1 to get the month with the highest signups.

4. Validate and handle edge cases

Check for ties, missing data, or timezone considerations that could affect the result.

Key Points to Mention

  • Use of DATE_TRUNC or EXTRACT to group by calendar month
  • Counting signups with COUNT(*) or COUNT(DISTINCT user_id) depending on data uniqueness
  • Ordering by count descending and limiting to 1 to find the top month
  • Handling ties by potentially returning all months with the maximum count
  • Considering timezone effects on signup timestamps
  • Data quality checks such as NULL signup dates or duplicate records

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

Find the user with the largest follower count using the follows table.

Product Analytics & Metrics
Author's notes

COUNT + GROUP BY on followed_user_id, then join back to users for the name.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the schema of the follows table and the definition of 'largest follower count' (e.g., total followers vs. net followers). Then write a SQL query that groups by the followed user ID, counts distinct followers, and orders descending with a limit 1, while considering edge cases like ties and inactive users.

Pro tip: Discuss how you would handle ties (e.g., using RANK() or DENSE_RANK() to return all top users) and mention that for large-scale systems, pre-aggregated counts or a materialized view might be more efficient than a raw GROUP BY.

1. Clarify requirements and schema

Ask about the table structure (e.g., columns like follower_id, followee_id, timestamp) and define what 'largest follower count' means (e.g., total followers, distinct followers, or net followers after unfollows).

2. Write the core SQL query

Use a GROUP BY on the followee_id, COUNT(DISTINCT follower_id) to get follower counts, ORDER BY count DESC, and LIMIT 1 to find the top user.

3. Address edge cases and ties

Consider if multiple users have the same max count; use window functions like RANK() or DENSE_RANK() to return all tied users, and handle cases with no follows or inactive users.

4. Optimize for performance

Mention indexing on followee_id, and for large datasets, discuss using pre-aggregated tables, materialized views, or approximate algorithms if exact counts are not required.

5. Validate and interpret results

Explain how you would sanity-check the result (e.g., compare with known metrics) and interpret it in the context of Nextdoor's neighborhood graph, such as identifying influential users.

Key Points to Mention

  • Schema assumptions: follows table likely has follower_id and followee_id columns.
  • Use of COUNT(DISTINCT follower_id) to avoid duplicate follows.
  • Handling ties with window functions (RANK, DENSE_RANK) or subqueries.
  • Performance considerations: indexing, pre-aggregation, and scalability.
  • Edge cases: users with zero followers, inactive users, and data freshness.
  • Business context: how this metric informs product decisions at Nextdoor.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q4

Write SQL to populate a set of daily aggregate tables from raw event, user, photo, and follows data. The dashboard needs new users, DAU, new photos, new photos per DAU, total follow edges, and follower bucket distributions, all with 7-day comparisons and timezone conversion to America/Los_Angeles.

Data ModelingProduct Analytics & MetricsSystem Design
Author's notes

This is where things got real.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the schema and metric definitions, then design a modular SQL pipeline that computes each metric separately before joining into a daily aggregate table. Use timezone conversion early in the pipeline and ensure 7-day comparisons are handled via window functions or self-joins.

Pro tip: Mention that you would materialize intermediate results as CTEs or temp tables to avoid recomputation and ensure consistency, and that you'd validate the timezone conversion with edge cases like DST transitions.

1. Clarify requirements and schema

Ask about table structures, metric definitions (e.g., what counts as a new user, DAU), and how 7-day comparisons should be presented (e.g., day-over-day or rolling average).

2. Design modular CTEs for each metric

Write separate CTEs for new users, DAU, new photos, follow edges, and follower buckets, each aggregating raw data by day in the target timezone.

3. Compute derived metrics and comparisons

Calculate new photos per DAU and use window functions (e.g., LAG) to compute 7-day comparisons for each metric.

4. Join and populate the aggregate table

Combine all metrics into a single daily aggregate table, ensuring proper handling of missing dates and null values.

5. Optimize and validate

Add indexes, consider partitioning, and validate results against known benchmarks or sample data to ensure correctness.

Key Points to Mention

  • Timezone conversion using AT TIME ZONE 'America/Los_Angeles' and handling DST
  • Definition of DAU and new users (e.g., based on first activity date)
  • Follower bucket distribution: define buckets (e.g., 0, 1-10, 11-50, etc.) and compute counts per bucket per day
  • 7-day comparison: use window functions like LAG(metric, 7) or self-join on date - 7
  • Performance considerations: indexing, partitioning, and avoiding full table scans
  • Data consistency: ensure all metrics use the same date dimension and timezone

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q5

Extend your SQL to compute week-1 retention: for users who signed up on day D, what share had at least one event between day D+7 and D+13, using the reporting timezone?

Product Analytics & MetricsA/B Testing & ExperimentationData Modeling
Author's notes

The definition sounds clean but the timezone boundary stuff makes it annoying.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the definitions: signup day D is the date of the signup event in the reporting timezone, and week-1 retention requires at least one event on days D+7 through D+13 inclusive. Then write a SQL query that joins signups to events within that window, aggregates per user, and computes the retention rate as the share of users with any event.

Pro tip: Explicitly state that you're using the reporting timezone for all date calculations and that the window is inclusive of both D+7 and D+13; this avoids off-by-one errors and shows attention to detail.

1. Define the cohort

Identify users who signed up on day D by selecting user_id and the signup date converted to the reporting timezone.

2. Identify retained users

For each user in the cohort, check if they have at least one event between D+7 and D+13 inclusive, using the reporting timezone for event timestamps.

3. Aggregate and compute rate

Count the number of users in the cohort and the number of retained users, then divide to get the week-1 retention rate.

4. Handle edge cases

Consider users with no events, multiple events, and ensure the date arithmetic correctly handles timezone conversions and inclusive bounds.

Key Points to Mention

  • Use of reporting timezone for both signup and event timestamps
  • Inclusive date range: D+7 to D+13
  • Definition of 'at least one event' (e.g., any event type or specific events)
  • Handling of users with no events (they are not retained)
  • Potential need to deduplicate events per user
  • Performance considerations for large datasets (e.g., indexing on user_id and event date)

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.