Uber software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.
class Feed:def add_category(self, user_id: int, category: str) -> None — Add a category to the user's subscription.def remove_category(self, user_id: int, category: str) -> None — Remove a category from the user's subscription.def get_feed(self, user_id: int) -> List[str] — Return the feed of updates for the user.Example 1:feed = Feed(), feed.add_category(1, 'Ride'), feed.add_category(1, 'Promo'), feed.get_feed(1)['Ride', 'Promo']feed.remove_category(1, 'Promo'), feed.get_feed(1)['Ride']1 <= user_id <= 10^4.1 <= category_count <= 100.class LRUCache:def __init__(self, capacity: int) — Initializes the LRU cache.def get(self, key: int) -> int — Returns the value of the key if the key exists.def put(self, key: int, value: int) — Updates the value of the key or adds the key-value pair.Example 1:lru = LRUCache(2), lru.put(1, 1), lru.put(2, 2), lru.get(1)1lru.put(3, 3), lru.get(2)-11 <= capacity <= 10^4.1 <= key, value <= 10^5.Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free