← Nextdoor Interview Insights

Nextdoor·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

SQL round for a Data Engineer role at Nextdoor, built around a fake social app schema. Three questions, all relational, nothing crazy but the last one had a small wrinkle I didn't fully anticipate.

Questions Asked (3)

Q1

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

Product Analytics & Metrics
Author's notes

Warmup question, basically just COUNT(*) FROM users.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the exact requirement: do they want a simple count of all rows or a count of distinct users? Then write a straightforward SQL query using COUNT(*), and briefly explain your choice. Finally, mention any assumptions about the table schema and potential edge cases like NULLs or duplicates.

Pro tip: In a product analytics context, always consider whether 'total users' means all-time registered users or active users within a time frame; asking this shows you think beyond the syntax and understand business metrics.

1. Clarify the requirement

Ask whether 'total users' means all rows in the users table or distinct users, and whether there are any filters like active status or date range.

2. Inspect the schema

Mention that you would check the table structure to identify the primary key or unique user identifier, and understand if there are duplicates or NULLs.

3. Write the query

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

4. Explain and validate

Walk through what the query does, discuss performance considerations (e.g., COUNT(*) vs COUNT(column)), and suggest testing on a sample if needed.

Key Points to Mention

  • Difference between COUNT(*) and COUNT(column) and handling of NULLs
  • Use of DISTINCT if the table might have duplicate user records
  • Assumptions about the schema, such as the primary key column
  • Potential need for filters (e.g., active users, date range) based on business context
  • Performance implications of counting large tables and possible optimizations
  • Importance of clarifying ambiguous requirements before writing SQL

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

Q2

Which month saw the highest number of user signups? Return both the month and the count.

Product Analytics & MetricsData Modeling
Author's notes

You need to extract the month from created_at, group by it, and sort descending with a LIMIT 1.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the definition of 'signup' and the relevant time period, then write a SQL query that groups signups by month and orders by count descending to find the top month. Finally, present the month and count, and discuss any data quality considerations or trends.

Pro tip: Always confirm whether 'signup' means account creation or first meaningful action, and check for timezone or duplicate account issues that could skew monthly counts.

1. Clarify requirements

Ask clarifying questions about the definition of 'signup', the time range, and whether to consider all users or a specific segment.

2. Explore the data

Identify the relevant tables and columns, such as a users table with a signup timestamp, and check for data quality issues like nulls or duplicates.

3. Write the query

Use SQL to extract the month from the signup date, count signups per month, and order by count descending to get the top month.

4. Validate and interpret

Sanity-check the results, consider timezone adjustments, and interpret the finding in the context of business events or seasonality.

Key Points to Mention

  • Definition of 'signup' (e.g., account creation vs. first login)
  • Time period to consider (e.g., all time, last year)
  • SQL functions for date truncation (e.g., DATE_TRUNC, EXTRACT)
  • Handling timezones and duplicates
  • Ordering and limiting results to find the top month
  • Potential data quality issues and business context

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

Q3

From the follows table, find the username of the user with the most followers. If there's a tie, return all tied users.

Data ModelingAlgorithms & Data Structures
Author's notes

The tie-breaker clause is what makes this not trivial.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Use a GROUP BY on the follows table to count followers per user, then filter for the maximum count using a subquery or window function. Ensure the query returns all users who tie for the highest follower count.

Pro tip: Mention that window functions like RANK() or DENSE_RANK() can elegantly handle ties, and discuss the trade-offs between different SQL approaches for performance and readability.

1. Understand the schema

Identify the relevant columns in the follows table, typically follower_id and followee_id, where followee_id represents the user being followed.

2. Count followers per user

Write a query to group by followee_id and count the number of followers for each user.

3. Find the maximum follower count

Determine the highest follower count from the grouped results, either using a subquery or a window function.

4. Return all users with that count

Filter the grouped results to include only users whose follower count equals the maximum, ensuring ties are handled.

5. Join to get usernames

If usernames are in a separate users table, join the result with that table to retrieve the usernames.

Key Points to Mention

  • Use of GROUP BY and COUNT to aggregate followers.
  • Handling ties with subqueries or window functions like RANK() or DENSE_RANK().
  • Consideration of NULL values and self-follows (if applicable).
  • Performance implications: indexing on followee_id, and avoiding unnecessary joins.
  • Clarity and readability of the SQL query, including proper aliasing.
  • Edge cases: no followers, all users tied, or empty table.

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