Notion software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.
No verified questions yet for Notion.
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:twitter = TwitterFeed() and twitter.post(1, 5) and twitter.follow(1, 2) and twitter.getFeed(1)[5]twitter.post(2, 6)[6, 5]1 <= userId, followerId, followeeId <= 10^40 <= tweetId <= 10^4The operations' total number does not exceed 1000.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:cache = LRUCache(2) and cache.put(1, 1) and cache.put(2, 2) and cache.get(1)1cache.put(3, 3)None1 <= capacity <= 30000 <= key, value <= 10^4Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free