How would you answer an interview scenario involving infrastructure layer?
For an interview scenario involving infrastructure layer, I would first clarify the business goal, scale, constraints, and the failure or quality attribute the interviewer wants to explore. Infrastructure contains implementations for databases, messaging, file storage, email, external APIs, and other technical details. In this scenario, a third-party email provider is being replaced. Explain what should and should not change across layers. For production, implement application-owned interfaces, centralize integration policies, handle retries and timeouts, and map external models at boundaries. I would then explain the main alternatives and tradeoffs, identify likely failure modes, and describe how I would validate the solution through testing, observability, security controls, and recovery or rollback planning.