Coinbase DevOps engineer interviews cover CI/CD pipelines, infrastructure as code, container orchestration, monitoring, and incident response procedures.
No verified questions yet for Coinbase.
ServiceHealthMonitor class that can check the health of services and report their status. This monitor should allow dynamic addition of services and periodic health checks.def add_service(name: str, check_func: Callable[[], bool]) -> None: - Adds a service to be monitored along with its health check function.def check_health() -> Dict[str, bool]: - Checks the health of all services and returns a dictionary mapping service names to health status.def report_status() -> None: - Reports the health status of the services, ideally logging or sending alerts for any down services.Example 1:add_service('auth_service', lambda: True)Nonecheck_health(){'auth_service': True}1 <= name.length <= 50100.LRUCache class that supports the following operations: get and put. The operations should be efficient enough to meet the demands of high-frequency API access.def get(key: int) -> int: - Returns the value of the key if the key exists, otherwise returns -1.def put(key: int, value: int) -> None: - Updates the value of the key if the key exists and if it doesn't, adds the key-value pair to the cache. When the cache reaches its capacity, it should invalidate the least recently used item before inserting a new item.Example 1:put(1, 1)Noneget(1)1capacity must be a positive integer.get and put will not exceed 10000.1 <= key, value <= 1000.Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free