← Notion Interview Insights

Notion·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

SQL-heavy technical screen for a data engineering role at Notion. Just one question but they really wanted to dig into it, kept pushing with follow-ups.

Questions Asked (1)

Q1

Given a parent table and a related child/transactional table, write a SQL query that returns all parent rows along with any matching child rows, including parents with no matching children. The interviewer expected proper LEFT JOIN syntax, NULL handling on the unmatched side, aliasing, and asked you to extend it to multiple joined tables.

Data ModelingTechnical Trade-offs
Author's notes

Felt fine at first, wrote the basic LEFT JOIN no problem.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the schema and the exact requirement: all parent rows with matching child rows, including parents without children. Then write a LEFT JOIN query with proper aliasing, select parent columns and child columns, and handle NULLs on the child side. Finally, extend the pattern to multiple tables by chaining LEFT JOINs and discussing performance considerations.

Pro tip: Mention that you would verify the join keys and indexes, and consider whether a LEFT JOIN with a WHERE clause on the child table could accidentally filter out unmatched parents—a common pitfall. Also, note that for multiple tables, the order of joins can affect readability and performance.

1. Clarify requirements and schema

Ask about the table structures, join keys, and whether all parent rows are needed even if no child exists. Confirm the expected output columns and any filtering conditions.

2. Write the basic LEFT JOIN

Construct a query selecting from the parent table LEFT JOIN the child table on the foreign key. Use table aliases for clarity and select parent columns plus child columns.

3. Handle NULLs and unmatched rows

Explain that unmatched child columns will be NULL. If needed, use COALESCE or CASE to provide default values, and ensure any WHERE conditions on child columns are in the ON clause to preserve unmatched parents.

4. Extend to multiple tables

Show how to add more LEFT JOINs for additional related tables, maintaining the parent as the left side. Discuss how to avoid fan-out and ensure correct aggregation if needed.

5. Discuss performance and trade-offs

Mention indexing on join keys, the impact of join order, and alternatives like subqueries or EXISTS if only existence is needed. Highlight readability and maintainability.

Key Points to Mention

  • LEFT JOIN syntax and the importance of the ON clause versus WHERE clause for filtering
  • NULL handling for unmatched child rows, including COALESCE and IS NULL checks
  • Table aliasing for readability and to avoid ambiguity in multi-table joins
  • Extending to multiple LEFT JOINs and the potential for row multiplication (fan-out)
  • Performance considerations: indexing join keys, join order, and alternatives like EXISTS
  • The difference between LEFT JOIN and INNER JOIN, and when to use each

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