Coinbase DevOps engineer interviews cover CI/CD pipelines, infrastructure as code, container orchestration, monitoring, and incident response procedures.
KnowledgeBaseSystem that stores articles with CRUD operations. The system operates entirely...Input: Graph (nodes and edges)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.Dockerfile used to build a service image. The goal is to minimize the image size while ensuring that all dependencies are available and the application runs as expected.def optimize_dockerfile(base_image: str, packages: List[str]) -> str: - Returns an optimized Dockerfile as a string.Example 1:optimize_dockerfile('python:3.9-slim', ['flask', 'requests'])"FROM python:3.9-slim\nRUN pip install --no-cache-dir flask requests"optimize_dockerfile('node:14', ['express', 'body-parser'])"FROM node:14\nRUN npm install --production"1 <= base_image.length <= 501 <= packages.length <= 20 and each package name is at most 30 characters long.def build_image(service_name: str) -> None: - Builds the Docker image for the service.def run_tests(service_name: str) -> bool: - Runs tests for the service and returns True if all tests pass.def deploy(service_name: str, environment: str) -> None: - Deploys the service to the specified environment.def rollback(service_name: str) -> None: - Rolls back the deployment to the previous version.Example 1:build_image('auth_service')Nonerun_tests('auth_service')True1 <= service_name.length <= 100environment must be one of the strings: 'staging', 'production', 'development'.Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free