Notion

Notion Software Engineer Onsite Coding Questions

3+ questions from real Notion Software Engineer Onsite Coding rounds, reported by candidates who interviewed there.

3
Questions
1
Topic Areas
10+
Sources

What does the Notion Onsite Coding round test?

The Notion onsite coding round is the core technical evaluation. Software Engineer candidates typically see 2-3 algorithm and data structure problems. Problems range from medium to hard difficulty, and interviewers evaluate both correctness and code quality.

Top Topics in This Round

Notion Software Engineer Onsite Coding Questions

## Problem Design a lightweight in-app logging library for a mobile client. The library must support multiple log levels, write logs to local disk without blocking the UI thread, and expose an API to upload buffered logs to a remote endpoint on demand. ```kotlin // Android (Kotlin) class MobileLogger(val maxBufferSize: Int, val logDir: File) { fun log(level: Level, tag: String, message: String) fun flush(): List<LogEntry> fun upload(endpoint: String, onComplete: (Boolean) -> Unit) } enum class Level { VERBOSE, DEBUG, INFO, WARN, ERROR } ``` **Scenario:** A user reports a crash. Your library should let the support team retrieve the last 500 log lines from their session without requiring a new build. ## Follow-ups 1. How do you ensure logs are not lost if the app is force-killed mid-write? 2. What strategy prevents the log directory from growing unbounded on a low-storage device? 3. How would you redact PII (emails, tokens) before writing to disk? 4. Describe how you would unit-test the disk-write path without hitting real I/O.

## Problem Build a mobile TODO application with the following requirements: add, complete, and delete tasks; persist state locally so data survives app restarts; sync with a REST backend when connectivity is restored. ```swift // iOS (Swift) protocol TaskRepository { func fetchAll() -> [Task] func add(title: String) -> Task func complete(id: UUID) func delete(id: UUID) func syncWithRemote(baseURL: URL, completion: @escaping (Result<Void, Error>) -> Void) } struct Task { let id: UUID var title: String var isCompleted: Bool var updatedAt: Date } ``` **Edge case:** A task is deleted locally while offline, then the server sends it back during sync. Define the conflict resolution strategy. ## Follow-ups 1. How do you handle the case where two devices edit the same task offline simultaneously? 2. Should sync be optimistic or pessimistic? Justify your choice. 3. How would you implement a soft-delete so deleted tasks can be recovered within 30 days? 4. What schema migration strategy would you use if Task gains a new required field?

## Problem Implement a `TODOList` class that manages tasks with priorities and optional deadlines. The list should always return the highest-priority, earliest-deadline task next. ```python import heapq from dataclasses import dataclass, field from datetime import datetime from typing import Optional @dataclass(order=True) class Task: priority: int # lower = higher priority deadline: Optional[datetime] id: int = field(compare=False) title: str = field(compare=False) class TODOList: def add(self, title: str, priority: int, deadline: Optional[datetime] = None) -> int: ... def next(self) -> Optional[Task]: ... def complete(self, task_id: int) -> bool: ... def pending(self) -> list[Task]: ... ``` **Example:** ``` add("File taxes", priority=1, deadline=2024-04-15) add("Buy milk", priority=2) next() -> Task("File taxes", priority=1, ...) ``` ## Follow-ups 1. How do you handle lazy deletion for `complete()` efficiently with a heap? 2. What happens if two tasks have equal priority and no deadline? 3. How would you add recurring tasks that re-insert after completion? 4. How would you persist and restore the list across process restarts?

See All 3 Questions from This Round

Full question text, answer context, and frequency data for subscribers.

Get Access