Giter Club home page Giter Club logo

nano-demo-calculator-app's Introduction

Logo

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 coding event driven by Sahaj across multiple colleges in India, they want to instil 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)
    • Deselect the "Copy the main branch only" to copy other language demos as well
  • Clone the forked repository (How to clone a repository github)
  • Change the branch according to the language of your choice (This demo is available in (language-> branch) "kotlin"-> main, "node" -> "node", "python" -> "python", "cpp" -> "cpp" ) (How to change branches git )
  • Enable workflows in your github fork (Under the actions tab -> Select "I understand my workflows, go ahead and enable them" to enable the test workflow)
  • Use your favourite editor to make changes
  • Create a commit after testing it locally (How to commit git)
  • Push the commit to the remote to the same branch (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 under the selected branch (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 event.
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

nano-demo-calculator-app's People

Contributors

kartikay-sahaj avatar javatarz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.