Design a service that calls any passed endpoint at a fixed interval.

Medium
Company: Premium
GoogleAmazon

Let's imagine we're building a crucial component for monitoring and maintaining the health of various microservices or external APIs within a larger system. This component, the "Endpoint Poller Service," is responsible for periodically invoking a specified endpoint (e.g., a REST API) and recording the response. Think of it as a heartbeat monitor that can be configured to check any URL at a defined interval. The responses could then be processed to create health dashboards or trigger alerts if an endpoint becomes unresponsive or returns an error.

This problem emphasizes a robust, extensible, and thread-safe design. How can we create a modular service that can accommodate various endpoint types (REST, GraphQL, etc.), authentication schemes, and response processing strategies without requiring significant code modifications? We need to think about how to manage multiple pollers concurrently, handle errors gracefully, and allow for future expansion with new endpoint types or response validation rules. Let's focus on designing the core poller logic, leaving the UI/configuration aspects out of scope.

Requirements

Interview Simulation

Experience a realistic interview conversation. The interviewer will ask clarifying questions,and you'll reveal your understanding of the requirements.

Interviewer

Let's start by understanding the scope. What are the core functionalities this system needs to provide?

💡 Interview Tip

Identify the Actors (Who uses the system?) and their Use Cases (What are they trying to achieve?). Start with the 'Happy Path' scenarios.

Press ⌘ + Enter to submit

Premium Content

View detailed solutions.

UNLOCK PREMIUM