Notion frontend engineer interviews emphasise JavaScript, DOM manipulation, CSS, accessibility, browser APIs, and UI component architecture.
No verified questions yet for Notion.
n changes made on the page with the given timestamps.Problem Statement:
user, a string change, and an integer timestamp. Implement a ChangeLog class, which maintains the n most recent changes in their chronological order. The class should support the following methods:addChange(user: str, change: str, timestamp: int): Adds a new change to the log.getRecent(n: int) -> List[str]: Returns a list of the last n changes in chronological order of their timestamps.Example 1:
log = ChangeLog(3)
log.addChange("Alice", "Added a new section", 1)
log.addChange("Bob", "Fixed a typo", 2)
log.addChange("Alice", "Updated the header", 3)
log.getRecent(2)['Fixed a typo', 'Updated the header']Example 2:
log.addChange("Charlie", "Removed a line", 4)
log.getRecent(3)['Added a new section', 'Fixed a typo', 'Updated the header']Constraints:
1 <= n <= 10001 <= timestamp <= 10^6Problem Statement:
text which represents a Notion page's content, and an integer k representing the size of the sliding window. Your task is to find the maximum number of unique words present in any contiguous substring of text with length k. You need to return this maximum count.Example 1:
text = "This is a sample Notion page, Notion pages are great!", k = 20 8 "a sample Notion page, Notion pages are" contains 8 unique words.Example 2:
text = "Test Test Test!", k = 10 2 "Test Test" which contains 2 unique words.Constraints:
1 <= k <= text.lengthtext.length <= 10^5Problem Statement:
LRUCache class with the following methods:get(key: int) -> int: Returns the value of the key if it exists in the cache, otherwise returns -1.put(key: int, value: int): Updates or inserts the value by the key. When the cache reaches its capacity, it should invalidate the least recently used item before inserting a new item.Example 1:
cache = LRUCache(2) cache.put(1, 1) cache.put(2, 2) cache.get(1) cache.put(3, 3) cache.get(2)
1
-1Example 2:
cache.put(4, 4) cache.get(1) cache.get(3) cache.get(4)
-1
3
4Constraints:
1 <= capacity <= 30001 <= key, value <= 10^4Problem Statement:
RichTextEditor class that supports the following operations:addText(text: str): Adds plain text to the document.formatText(start: int, end: int, format: str): Applies the specified format (like bold, italic, underline) from start to end indices.getContent() -> str: Returns the current content of the editor as a string, preserving formatting information.Example 1:
editor = RichTextEditor()
editor.addText("Hello")
editor.addText(" World")
editor.formatText(0, 5, "bold")
editor.getContent()'<b>Hello</b> World'Example 2:
editor.formatText(6, 11, "italic") editor.getContent()
'<b>Hello</b> <i>World</i>'Constraints:
1 <= text.length <= 1000Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free