Coinbase software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.
No verified questions yet for Coinbase.
set creates a new version without destroying older versions. An empty string is a valid value and is different from a missing value.ValueError, without changing any state.None for a missing setting. Reads before the first mutation or after the last mutation are valid.delete_subkey makes one setting absent from its timestamp onward. delete_key makes every setting under that product absent from its timestamp onward. Both preserve historical reads. A subsequent set recreates only the specified setting: it must not resurrect other deleted settings.get_all returns a new dictionary containing only settings visible at the requested time. Return an empty dictionary for a product with no visible settings. Dictionary order is not significant, and modifying a returned dictionary must not change the store.delete_key. Historical point reads must use binary search rather than scanning every version. Deletes of missing products or settings are valid mutations.Class APIAssetConfigStore() — construct an empty store.set(product: str, setting: str, value: str, timestamp: int) -> None — append a setting version.get(product: str, setting: str, timestamp: Optional[int] = None) -> Optional[str] — retrieve the visible value at the requested time.get_all(product: str, timestamp: Optional[int] = None) -> dict[str, str] — retrieve all visible settings for a product.delete_subkey(product: str, setting: str, timestamp: int) -> None — append a setting-deletion marker.delete_key(product: str, timestamp: int) -> None — append a product-deletion marker without visiting its settings.set("BTC-USD", "min_order", "0.0001", 10)
set("BTC-USD", "status", "online", 20)
set("BTC-USD", "min_order", "0.0002", 30)
get("BTC-USD", "min_order", 25)
delete_key("BTC-USD", 40)
get_all("BTC-USD", 35)
get_all("BTC-USD", 40)
set("BTC-USD", "status", "post_only", 50)
get_all("BTC-USD")null represents None):[null, null, null, "0.0001", null, {"min_order": "0.0002", "status": "online"}, {}, null, {"status": "post_only"}]status, but the older min_order remains deleted.Example 2:set("ETH-USD", "notice", "", 5)
get("ETH-USD", "notice", 4)
get("ETH-USD", "notice", 5)
delete_subkey("ETH-USD", "notice", 8)
get("ETH-USD", "notice", 8)
set("ETH-USD", "notice", "maintenance", 12)
get_all("ETH-USD", 7)
get_all("ETH-USD", 10)
get_all("ETH-USD", 100)[null, null, "", null, null, null, {"notice": ""}, {}, {"notice": "maintenance"}]maintenance at 12. A future read sees all mutations recorded so far.Constraints[0, 10^12]. Out-of-range read timestamps also raise ValueError. String arguments and argument types satisfy the stated bounds.get_all may inspect every setting ever recorded for the product.follow(follower_id: int, followee_id: int), unfollow(follower_id: int, followee_id: int), and get_feed(user_id: int) -> List[int]. The feed should return the most recent 10 transactions from the followed users.def follow(follower_id: int, followee_id: int) -> None: update the following relationship.def unfollow(follower_id: int, followee_id: int) -> None: remove the following relationship.def get_feed(user_id: int) -> List[int]: return the user feed containing transaction IDs of the most recent 10 transactions from followed users.manager = FeedManager() manager.follow(1, 2) manager.follow(1, 3) manager.get_feed(1) [x, y, z] 1 <= follower_id, followee_id <= 10^4 10^5.get(key: int) -> int and put(key: int, value: int) -> void methods.def get(key: int) -> int: returns the value of the key if it exists or -1.def put(key: int, value: int) -> None: updates the value if the key exists, otherwise, adds the key-value pair to the cache. If the cache reaches its capacity, it should invalidate the least recently used item before inserting a new item.cache = LRUCache(2) cache.put(1, 1) cache.put(2, 2) cache.get(1) 1 cache.put(3, 3) cache.get(2) -1 1 <= capacity <= 3000 0 <= key, value <= 10^4.Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free