Notion backend engineer interviews typically focus on APIs, databases, system design, concurrency, caching, and data structures.
No verified questions yet for Notion.
CommentSystem with the following methods:__init__(self) -> None - Initializes an empty commenting system.add_comment(self, blockId: int, userId: int, content: str) -> None - Allows a user to add a new comment to a specific block.get_comments(self, blockId: int) -> List[Tuple[int, str]] - Retrieves all comments made on a specific block.delete_comment(self, blockId: int, commentId: int) -> bool - Deletes a specific comment from a block if it exists, returning a status of success.cs = CommentSystem(); cs.add_comment(1, 1, 'Great work!'); cs.get_comments(1)[(1, 'Great work!')]500 characters.VersionControl with the following methods:__init__(self) -> None - Initializes a new version control system.save(self, pageId: int, content: str) -> None - Saves the content for a given pageId. Each save increments the version number for that page.get_version(self, pageId: int, version: int) -> str - Returns the content saved at the specified version for the given pageId or empty string if not found.vc = VersionControl(); vc.save(1, 'Initial content'); vc.save(1, 'Updated content'); vc.get_version(1, 1)'Initial content'1000.Cache that implements the following methods:__init__(self, capacity: int) -> None - Initializes an empty cache with the given capacity.get(self, pageId: int) -> int - Returns the page content if found, or -1 if not.put(self, pageId: int, content: int) -> None - Adds a new page or updates the content of the existing page. If the capacity is full, it evicts the least recently used page.cache = Cache(2)cache.put(1, 1)cache.put(2, 2)cache.get(1)1capacity will be at least 1 and at most 1000.[-10^4, 10^4].notifyUsers(graph: List[List[int]], userId: int) -> List[int] that returns a list of user IDs that will receive notifications starting from the given userId. The graph represents user relationships as an adjacency list.graph = [[1,2], [0,3], [0], [1]], userId = 1[0, 2, 3]1 <= graph.length <= 10^40 <= userId < graph.lengthgraph[i] is a list of integers representing direct relationships.Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free