Node.js (Coding) Assessment Test

Node.js (Coding)

 60 Minutes
 3 Questions


Our Node.js coding assessments are designed to evaluate a candidate's ability to tackle various real-world challenges, requiring them to write, compile, and run fully functional services. These tasks encompass building dynamic APIs, implementing secure authentication systems, designing scalable middleware, and developing feature-rich applications such as booking systems, inventory management, and more. Candidates must utilize industry-standard libraries like express, JSON web token, and express-rate-limit to deliver robust and high-performance solutions. This hands-on approach tests proficiency and highlights a candidate's problem-solving capabilities, making it the perfect tool to identify top-tier development talent.


Example Question:

Coding
In this challenge, you are requested to create an Express service for a library's book reservation system. The service allows users to reserve and cancel reservations for books. It also provides the ability to check the reservation status of a book.

The initial set of books and their reservation statuses are as follows:

"Moby Dick" - Not reserved
"Pride and Prejudice" - Not reserved
"The Catcher in the Rye" - Not reserved

Your API should support the following:

Reserve a Book

URL: /ReserveBook
Method: POST
Request Body (as JSON):

{
  "bookTitle": "..."
}

Response:
"0" for success (book successfully reserved)
"-1" for error (book already reserved or does not exist)

Cancel a Reservation

URL: /CancelReservation
Method: POST
Request Body (as JSON):

{
 "bookTitle": "..."
}

Response:
"0" for success (reservation successfully canceled)
"-1" for error (book not reserved or does not exist)

Get Reservation Status

URL: /GetReservationStatus
Method: GET
Parameters: bookTitle
Response:
"Reserved" if the book is reserved
"Available" if the book is not reserved
"-1" if the book does not exist

All responses must be strings (not numbers or objects).

Examples:

Reserve a book:

POST to /ReserveBook

{
 "bookTitle": "Moby Dick"
}

Response: "0"

Check reservation status:

GET /GetReservationStatus?bookTitle=Moby%20Dick
Response: "Reserved"

Cancel the reservation:

POST to /CancelReservation

{
 "bookTitle": "Moby Dick"
}

Response: "0"