Notion frontend engineer interviews emphasise JavaScript, DOM manipulation, CSS, accessibility, browser APIs, and UI component architecture.
No verified questions yet for Notion.
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.python
cache = LRUCache(2)
cache.put(1, 1)
cache.put(2, 2)
cache.get(1)
cache.put(3, 3)
cache.get(2)
1
-1python
cache.put(4, 4)
cache.get(1)
cache.get(3)
cache.get(4)
-1
3
41 <= capacity <= 30001 <= key, value <= 10^4RichTextEditor 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.python
editor = RichTextEditor()
editor.addText("Hello")
editor.addText(" World")
editor.formatText(0, 5, "bold")
editor.getContent()
'<b>Hello</b> World'python
editor.formatText(6, 11, "italic")
editor.getContent()
'<b>Hello</b> <i>World</i>'1 <= text.length <= 1000Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free