Booking.com SDE2 | Interview Experience | Bengaluru
Summary
I applied for an SDE2 position at booking.com and received a recruiter call in May after applying in January. Although I had switched jobs by February, I decided to proceed with the interviews primarily for practice and to gather questions for the community. The process included a HackerRank Machine Coding OA, a System Design round, and a Data Structures & Algorithms round. I was ultimately ghosted and assume I was rejected, especially since I didn't solve the DSA round.
Full Experience
I applied for an SDE2 role on booking.com's careers page around January. The recruiter reached out to me in May. By February, I had already moved to another company, but I decided to go through with the interview process. My primary motivation was to gain more interview practice and, of course, to collect and share the interview questions with the community here.
HackerRank OA - Machine Coding
The online assessment involved a machine coding challenge. I was provided with a Spring Boot application template, where data was already populated in an h2 database. All the necessary JPA entities, such as Hotel and City, along with their corresponding repository classes, were pre-existing.
The specific tasks were:
- Build basic CRUD APIs for the
Hotelentity. - Implement an API to return the 3 closest hotels from a given city.
- Write Unit Tests if they were required (I don't recall if I wrote them).
For calculating distances, the problem explicitly mentioned that Latitude and Longitude information for both City and Hotel would be available in their respective tables. It also suggested using the Haversine formula for distance calculation and even hinted that I could Google search for the formula.
Round 1 - System Design
This round focused on System Design. I was tasked with designing a Rating and Review System specifically for booking.com. The system needed to support a few key features:
- Allow users to search for and filter hotels based on their ratings.
- Enable users to rate a hotel.
- Provide functionality for users to add a review for a hotel.
Round 2 - DSA
This was the Data Structures and Algorithms round. The problem presented was to find all possible ways to spend a total budget given certain conditions.
Constraints:
- A tourist must spend
numDaysInEachCityconsecutive days in a single city. - The total expenditure across all cities should not exceed
totalBudget.
The input was provided in a JSON-like structure:
{
"numDaysInEachCity": 2,
"totalBudget": 390,
"pricesPerCity": {
"Paris": [10, 20, 50, 80, 100, 20],
"LA" : [90, 10, 40, 90, 12, 11],
"Amsterdam": [70, 20, 10, 30, 20, 80]
}
}The expected output was a list of all possible valid expenditures. An example scenario was given: spending 2 days in Paris (10+20=30), 2 days in LA (40+90=130), and 2 days in Amsterdam (20+80=100), totaling 260, which is less than the totalBudget and thus should be included in the output.
Verdict
After the interviews, I was unfortunately ghosted. I didn't receive any feedback regarding my performance or the outcome. Since I didn't manage to solve the DSA round completely, I can only assume that I was rejected.
Interview Questions (3)
I was given a Spring Boot App template with data populated in an h2 database, including JPA entities (Hotel, City) and their repositories. The tasks were:
- Build basic CRUD APIs for the Hotel entity.
- Write an API to return 3 closest hotels from a given city.
- Write Unit Tests if required.
I was asked to design a Rating and Review System for Booking.com. The system needed to support the following features:
- Search and filter hotels based on their ratings.
- Allow users to rate a hotel.
- Enable users to add a review for a hotel.
I needed to find all possible ways to spend a total budget given constraints. The tourist should spend 'numDaysInEachCity' consecutive days in a city, and the total expenditure should not exceed 'totalBudget'.
Constraints:
- Tourist should spend
numDaysInEachCityconsecutive days in a city. - Expenditure should not exceed
totalBudget.
Input:
{
"numDaysInEachCity": 2,
"totalBudget": 390,
"pricesPerCity": {
"Paris": [10, 20, 50, 80, 100, 20],
"LA" : [90, 10, 40, 90, 12, 11],
"Amsterdam": [70, 20, 10, 30, 20, 80]
}
}Output:
Return list of all possible expendituresExample:
One possible permutation is
- 1st and 2nd day in Paris - 10 + 20 = 30
- 3rd and 4th day in LA - 40 + 90 = 130
- 5th and 6th day in Amsterdam - 20 + 80 = 100
Total expenditure = 30 + 130 + 100 = 260 260 < 'totalBudget' => include in output list