Skip to content

Latest commit

 

History

History
85 lines (58 loc) · 3.2 KB

File metadata and controls

85 lines (58 loc) · 3.2 KB

What is NaN(O)

At Sahaj, tech consultants operate at the intersection between engineering and art. Simply put, they are artisans who take on complex engineering problems in the software industry across a wide spectrum of domains. Their work is deeply rooted in first principles thinking - asking fundamental questions to dissect and understand a problem which eventually leads to one-of-a-kind solutions, each as distinct as a fingerprint.

Through NaN(O), a hackathon driven by Sahaj across multiple colleges in India, they want to instill a culture of applying first principles thinking to a problem statement.


Problem statement

This is a demo repository for a test taker to get a feel of how the testing on the system works and how to submit a successful solution. The actual problem employees similar testing strategies.

The problem statement is to create an actual calculator with a couple of endpoints. The structure of request response has been shared with the user.


API contract

GET /caluclator/greeting

Checks whether the service is available.

Response
  • Code: 200
  • Content: Hello world!
POST /calculator/add

Adds two given numbers

Request & Response headers

Content-Type: application/json

Body
{  
    first: number,
    second: number 
}  
Success Response
  • Status code: 200
  • Content: { result: result-of-the-summation }
POST /calculator/subtract

Subtracts two given numbers

Request & Response headers

Content-Type: application/json

Body
{  
    first: number,
    second: number
}  
Success Response
  • Status code: 200
  • Content: { result: result-of-the-subtraction }
How to submit a solution

In order to submit a solution, follow these steps.

  • Fork the nano-demo-calculator-app repository (How to fork a repository github)
  • Clone the forked repository (How to clone a repository github)
  • Use your favourite editor to make changes
  • Create a commit after testing it locally (How to commit git)
  • Push the commit to the remote (github repo) (How to push git)
  • If all your changes work well, you will see a green tick on the actions section on your repo (How to see last run action)
    • If it's a cross mark, the logs will tell you what you did wrong.
    • Fix the issue, and repeat steps 4+ to resubmit
  • Congratulations, you have successfully solved the dummy problem and are ready for the actual hackathon.
Hint

An actual solution is present in one of the commits. If you revert the commit with the message "Remove actual answers", you should be able to get to a working solution