← Notion Interview Insights

Notion·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

SQL-heavy technical screen for a Data Engineer role at Notion. One question, but they pushed on edge cases and made sure you actually understood what was happening under the hood.

Questions Asked (1)

Q1

Given a blocks table and an edit_events table, write a SQL query to find the percentage of blocks that have never been edited.

Data ModelingProduct Analytics & Metrics
Author's notes

I went with a LEFT JOIN approach, grouped by block_id, counted edits per block, then wrapped it in an outer query with a CASE WHEN to flag zero-edit blocks.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the table schemas and the definition of 'never been edited' (e.g., no rows in edit_events for a block). Then, use a LEFT JOIN or NOT EXISTS to identify blocks without edits, and compute the percentage by dividing the count of such blocks by the total number of blocks, multiplying by 100.

Pro tip: Mention that you would confirm whether 'never been edited' means no edit events at all or no successful edits, and consider performance implications of different SQL patterns (e.g., NOT EXISTS vs LEFT JOIN) on large datasets.

1. Clarify requirements and schema

Ask about the structure of blocks and edit_events tables, and confirm the exact definition of 'never been edited' (e.g., no rows in edit_events for a block).

2. Identify blocks with no edits

Use a LEFT JOIN with a WHERE clause filtering NULLs, or a NOT EXISTS subquery, to select blocks that have no corresponding entries in edit_events.

3. Count total blocks and unedited blocks

Compute the total number of blocks and the number of unedited blocks, either in separate subqueries or using conditional aggregation.

4. Calculate percentage

Divide the count of unedited blocks by the total count, multiply by 100, and handle division by zero if the blocks table is empty.

5. Write final query and consider edge cases

Assemble the SQL query, ensuring correct rounding and aliasing, and discuss potential edge cases like duplicate edit events or NULL block IDs.

Key Points to Mention

  • Use of LEFT JOIN or NOT EXISTS to find blocks without edits
  • Handling of NULLs and ensuring correct join conditions
  • Calculation of percentage with proper casting to decimal/float
  • Consideration of performance and indexing on edit_events.block_id
  • Edge cases: empty tables, duplicate edits, and definition of 'edited'

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