Implement service to Find the recently viewed listings on the website by the user. Example a user looked for hotels in Bangalore. Design a system responsible to return the recent listings for a user.

Medium
Company: Premium
GoogleAmazon

Imagine you're building the backend for a popular e-commerce platform. A key feature is displaying recently viewed listings to users, allowing them to easily pick up where they left off. This seemingly simple feature has significant implications for user engagement and sales. A poorly implemented "Recently Viewed" service can lead to frustrated users, lost sales, and performance bottlenecks.

This problem focuses on designing a robust and scalable in-memory service to manage recently viewed listings for users. We need to consider how to efficiently store and retrieve this data while handling concurrent user requests. A straightforward approach might use simple lists, but that quickly becomes inefficient with a large user base.

Your task is to design a solution that addresses these challenges using sound object-oriented principles and design patterns. We need a design that's not only efficient but also easy to maintain and extend as the platform evolves.

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