DEV Community

Cover image for How it went my Booking.com coding interview?
Matheus Mello
Matheus Mello

Posted on

How it went my Booking.com coding interview?

This was my experience during the hacker rank challenge.

I had 120 minutes to create an MVP to render results with a review higher or equal to the user’s input.

Unfortunately, it was not a good experience because the tests were wrong, the description problem was confusing and the comments in the files were also saying something different from the test cases and problem description.

I was able to solve the backend and the frontend using React/Node in 20 minutes and I was planning to refactor in more 10 minutes and ship my solution but since the tests were failing I didn't submit my solution because I felt too much insecure and thought the problem was with my code itself.

Since I was not allowed to change the tests because they were locked and could directly impact the Hackerrank metrics, I failed.

These were the spots where I had a hard time:

/*
  Example output:

  [{
    name: "Boat Tour A",
    score: 5
  },{
    name: "Boat Tour B",
    score: 4
  }]
*/
exports.getAttractionsByReviewScore = (score) => {
  // TODO: Implement a method that gets all attractions with an average review score equal to or higher than a certain score.
}

Enter fullscreen mode Exit fullscreen mode

As you can see it was requested to return the output as the example but the tests were expected this:

it('it should GET all attractions with a review score higher than 1', (done) => {
        chai.request(server)
            .get('/attractions/search?score=1')
            .end((err, res) => {
                  res.should.have.status(200);
                  attractions = res.body;

                  attractions.should.be.a('array');
                  attractions.length.should.be.eql(5);

                  for (attraction of attractions) {
                    👉 attraction.average_review_score.should.gte(1) 👈
                  }
              done();
            });
    });

Enter fullscreen mode Exit fullscreen mode

I thought that I could not understand the problem description, leading me to read it again and again.

Test case not matching the description

The test described a scenario when the score should be equal to or higher than 10 but it was sending the API the number 7 and comparing the result with 10.

it('it should GET all attractions with a review score higher than or equal to 10'🥲, (done) => {
    chai.request(server)
        .get('/attractions/search?score=7')🤯
        .end((err, res) => {
              res.should.have.status(200);
              attractions = res.body;

              attractions.should.be.a('array');
              attractions.length.should.be.eql(1);

              for (attraction of attractions) {
                attraction.average_review_score.should.gte(10)👈
              }
          done();
        });
 });

Enter fullscreen mode Exit fullscreen mode

Copy and Paste

I had the feeling this challenge was copied and pasted using a different repository since I faced the issues that I mentioned above and some comments on the files didn't make any sense, like:

class Attraction {
    constructor(id, name) {       // Accept name and age in the constructor👈
        this.id = id || null;🥲
        this.name = name || null;🥲
    }

    getName() {
        return this.name;
    }

    setName(name) {
        this.name = name;
    }

    getId() {
        return this.id;
    }

    setId(id) {
        this.id = id;
    }
}

module.exports = Attraction;

Enter fullscreen mode Exit fullscreen mode

In the end, I wrote a private Notion page and shared it with the interviewer but I didn't receive any response from it. I tried to reach out to the Booking support email but I also didn't receive any response from it.

The reason why I am sharing this is to help people that are facing these coding challenges but sometimes it is not well calibrated and this could lead to some issues or self-doubt.

Booking.com is a great and huge company and I am looking forward to receiving any updates on my case, and I encourage you to try to improve yourself and the candidate to work in some of these amazing tech companies.

Let me know if you already faced something like this in the comments below.

Top comments (0)