Prepin
Log in

Show job listings to users in the same city according to their past search history.

Approach / Explanation

This question prompts you to create a system that presents job postings to users tailored to their location and previous search activities. The system consists of several elements, including a recommendation algorithm (which utilizes the user's past searches to inform what is displayed), a database (that holds user data and job postings), and a user interface (that showcases the job listings to the user). To effectively address this question, consider the following key aspects: Methods for tracking and storing a user's search history. Ways to ascertain the user's location. Approaches for filtering job postings according to location and search history. Design of the interface for displaying these postings to the user.

Suggested Answer

The first aspect to consider is how to monitor and save users' search history. A common approach is to utilize cookies or local storage in the user's browser to record their search terms. Alternatively, if users are logged into their accounts, we could save their search history in our backend database linked to their profile. We can identify the user's location through their IP address by using a Geo-IP service. For greater accuracy, we can ask for the user's permission to access their device's current location. To filter job listings, we can implement ElasticSearch. It supports free text search, which is essential since users' search history may include various job titles, company names, and skills. ElasticSearch also provides geospatial search capabilities, which assist in filtering jobs within the same city. Finally, the interface will present these job listings in a user-friendly manner, potentially offering options to apply filters such as job types and salary ranges.

Alternative Answer

To monitor the user's search history, queries can be stored in their session when they are not logged in. However, if the user has an account, these queries can be saved in the database and linked to their profile. The user's location can be determined by their IP address, which is sent at the start of the session. A Geolocation API can be utilized to identify the user's city based on this IP address. Job postings can be filtered at the query level by using database parameters to retrieve jobs located within the user's city, aligned with their search history. The algorithm will give priority to more recent searches, deeming them more relevant. Regarding the user interface, due to the potential amount of data to display, pagination or infinite scrolling methods could be implemented to control the number of records loaded simultaneously. The interface might also offer options to further narrow down the search, such as by posting date, company, and salary range, to ensure a highly personalized experience.

Question Details

Difficulty & Category

Medium
system design

Companies

LinkedIn

Product

For CandidatesFor RecruitersCompaniesBrowse JobsInterview QuestionsDeep ProfileSkill AssessmentOpportunity Matching
Prepin.ai

© 2026 Prepin LLC · Philadelphia, PA · All rights reserved.