Notion logo

Notion Software Engineer System Design Questions

31 practice questions for Notion Software Engineer interviews

Notion software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.

Software Engineer Backend Engineer Frontend Engineer Full Stack Engineer Mobile Engineer Data Engineer Data Scientist ML Engineer DevOps Engineer DevOps Engineer Product Manager SRE Security Engineer Engineering Manager Data Analyst UX/UI Designer QA Engineer

No verified questions yet for Notion.

system design Medium api design #1

1. Design ImageCarousel — A component for displaying images in a rotating carousel


Background: Notion often incorporates rich media elements in its notes and pages. An ImageCarousel component helps users navigate through a collection of images efficiently, enhancing visual storytelling in workspace documents.
Requirements:
1. The carousel should allow addition and removal of images dynamically.
2. Users can navigate through images using next and previous buttons.
3. The carousel should support automatic transitions after a specified interval.
4. A method to pause and resume automatic transitions should be included.
5. Each image should display a caption at the bottom.
Class API:
  • addImage(imageUrl: str, caption: str) -> None - Adds an image with its caption to the carousel.

  • removeImage(imageUrl: str) -> None - Removes an image from the carousel based on its URL.

  • nextImage() -> str - Moves to the next image and returns the current image's URL.

  • previousImage() -> str - Moves to the previous image and returns the current image's URL.

  • startAutoPlay(interval: int) -> None - Begins automatic transitions at the specified interval (in milliseconds).

  • pauseAutoPlay() -> None - Pauses the automatic transitions.

  • resumeAutoPlay() -> None - Resumes the automatic transitions.


Example 1:
  • Input: addImage("https://example.com/image1.jpg", "First image")

  • Output: None (image added successfully)

  • Explanation: The image with URL "https://example.com/image1.jpg" and caption "First image" is added to the carousel.


Example 2:
  • Input: addImage("https://example.com/image2.jpg", "Second image") followed by nextImage()

  • Output: "https://example.com/image1.jpg"

  • Explanation: After adding the second image, calling nextImage() returns the first image's URL and moves the pointer to the second image.


Constraints:
  • Maximum of 10 images can be added to the carousel.

  • Image URLs must be valid and not exceed 255 characters.

  • The interval for automatic transitions should be between 1000ms and 10000ms.
system design Senior api design #2

2. [OA] Twitter Feed — Design a minimal backend for Notion-like collaborative posting

Design a class structure that simulates a collaborative posting system similar to a Twitter feed in Notion. Users should be able to post messages, follow each other, and retrieve feeds from followed users in the correct order.
Class Signature:
  • class TwitterFeed:

  • def __init__(self): Initializes the Twitter feed object.

  • def post(self, userId: int, tweetId: int) -> None: Posts a tweet for a user.

  • def follow(self, followerId: int, followeeId: int) -> None: Allows follower to follow a followee.

  • def unfollow(self, followerId: int, followeeId: int) -> None: Allows follower to unfollow a followee.

  • def getFeed(self, userId: int) -> List[int]: Retrieves the 10 most recent tweet IDs in the order they were posted.


Example 1:
Input: twitter = TwitterFeed() and twitter.post(1, 5) and twitter.follow(1, 2) and twitter.getFeed(1)
Output: [5]
Explanation: User 1 posts a tweet and follows user 2.
Example 2:
Input: twitter.post(2, 6)
Output: [6, 5]
Explanation: User 2 posts a tweet, and user 1 gets the feed with both tweets in the right order.
Constraints:**
  • 1 <= userId, followerId, followeeId <= 10^4

  • 0 <= tweetId <= 10^4

  • The operations' total number does not exceed 1000.
system design Senior caching #3

3. [OA] LRU Cache — Implement caching for Notion's API responses

In Notion, caching is critical for performance, especially for frequent API requests. Implement an LRU (Least Recently Used) Cache to store API responses and efficiently handle eviction of the least recently accessed items.
Class Signature:
  • class LRUCache:

  • def __init__(self, capacity: int): Initializes the LRU Cache with a capacity.

  • def get(self, key: int) -> int: Fetches the value from the cache.

  • def put(self, key: int, value: int) -> None: Updates the cache with a new key-value pair or updates the value if the key exists.


Example 1:
Input: cache = LRUCache(2) and cache.put(1, 1) and cache.put(2, 2) and cache.get(1)
Output: 1
Explanation: Cache contains {1=1, 2=2} and fetching key 1 returns 1.
Example 2:
Input: cache.put(3, 3)
Output: None
Explanation: Previously added key 2 will be evicted due to LRU policy.
Constraints:
  • 1 <= capacity <= 3000

  • 0 <= key, value <= 10^4

Related Notion Software Engineer interview prep

Start practicing Notion questions

Sign up for free to access walkthroughs, AI-generated questions, and more.

Get Started Free