coding_interview_letsrevolutionizetesting

Draft Disclaimer: Please note that this article is currently in draft form and may undergo revisions before final publication. The content, including information, opinions, and recommendations, is subject to change and may not represent the final version. We appreciate your understanding and patience as we work to refine and improve the quality of this article. Your feedback is valuable in shaping the final release.

Language Mismatch Disclaimer: Please be aware that the language of this article may not match the language settings of your browser or device.
Do you want to read articles in English instead ?

Cracking a coding test interview

tags: beginners, webdev, javascript, career

Coding interviews are always for me an opportunity to learn and grow which is why I wanted to share you my thought process for this one I found this morning at letsrevolutionizetesting.com

What I saw when I visited the page home page

I revisited the application form application_form

I wanted to know what technology was used for this server discovery

I was happy to find out it was ruby

And the hint was suggesting I should try json and I did. If you know ruby on rails then it comes to you naturally request

But now I am in front of the page with this json payload. It says follow so I followed the link. Once... request id json

Twice... request twice

Then I said wait... but wait...

It was too good to be true. So you have two choices:

  • either you go follow one by one the id chain
  • or you can just write a bit of function like I did

  // this is a ruby on rail challenge API
  // so adding .json to routes will give json response
  // it seems to have a loop in id so
  function send (url) {
    request = new XMLHttpRequest()
    request.onreadystatechange = function () {
      if (this.readyState === XMLHttpRequest.DONE) {
        const json = JSON.parse(this.response)
        const newUrl = json.follow.replace('challenge?', 'challenge.json?')
        send(newUrl)
      }
    }
    request.open('GET', url)
    request.send()
  }
  send('https://letsrevolutionizetesting.com/challenge.json')

Alt Text

On the last page: The holy grale result

You could have go for an iterative version with a loop

Wrap up

I guess at RainForest they will have to make a new test since you know the answer for this one. Overall I think it way simple enough. We just needed to take each problem one at the time and yeah every beginner can do it too.