Whenever you're ready, walk me through how you'd approach this.
Explain your approach to designing a scalable API that interacts with a database.
Discuss the API contract, request routing, data access patterns, consistency model, caching, database scaling, security, observability, and failure handling. If the API serves ML-backed results, explain how retrieval, ranking, and model inference fit into the request path without violating latency or reliability requirements.