Code Monkey home page Code Monkey logo

js-interview's Introduction

Interview Exercise

Brief

Hey there! Thank you for taking the time to work on this exercise as part of the interview process. Relax and enjoy this exercise. When you do, you will be at your best. If you are not in your best condition right now, have a coffee, then come back for this.

To assure you, not completing this exercise doesn’t mean you are not a good fit for us. Being part of a team takes more than just competence. Character, chemistry, and culture fit are equally important to us.

Without further ado, let’s jump into the fun part!

To give you an overview, you will be working on these tasks:

  1. Create a backend with a set of RESTful API. (Node.js, Express, Sequelize with sqlite)
  2. Create a frontend that consumes it. (React)
  3. Push it to a public GIT repository.
  4. Setup CICD.

Complete the respective tasks with minimal effort based on the role you are applying for.

Role Requirements
Frontend Developer The interviewer should have shared information on backend APIs with you.
You should complete (2) and (3).
(4) is optional.
Backend Developer You should complete (1) and (3).
(4) is optional.
Full Stack Developer You should complete (1), (2) and (3).
(4) is optional.
DevOps Engineer The interviewer should have shared a git repository to implement (4).

Task 1 - Create RESTful APIs

Using Node.js, express and sequelize (sqlite), accomplish the following HTTP contract. Please fork this repository and work on it.

You may show your understanding of how a production Node.js application should be. Use TDD approach if possible.

Path Method Description
/signup POST Takes in username(email) and password. Returns a JWT Token for authorization
/process POST Validate JWT token in the header. Process ./data/data.json file by inserting records into database using sequelize (ORM) where randAlphabet is 'a' and 'b'. This endpoint verify JWT Token in the HTTP Header 'Authoriszation Bearer '.
/fetch GET Fetch the persisted data and return them as HTTP Response Body.

Task 2 - Create React Frontend

Using React, create a signup screen and a home screen. The signup screen should consume POST /signup endpoint. The home screen should have a button that calls endpoint POST /process (requires standard authorization header) to start processing some data in the backend upon click. Then, another button that calls endpoint GET /fetch to retrieve the processed data.

GET /fetch endpoint would return an array of objects that look like this:

[
    {
        "id":1,
        "randAlphabet":"a"
    },
    {
        "id":304,
        "randAlphabet":"b"
    },
    ...
]

For every object in the array received in the response body, render a square element with the value of property randAlphabet displayed in it using a grid layout on the home screen.

BaseURL: https://dev.svested.com/interview/api

In achieving the above mentioned use cases, try to demonstrate container & representational component separation to achieve component reusability effect. You are encouraged to demonstrate your knowledge on React and its best practices.


Task 3 - Push to a GIT Repository

Once you are done with the tasks, push them to a personal GIT repository (not the one you cloned from) and squash it. Share the repository with the interviewer.


Task 4 - Create CICD Pipeline

Choose a CICD platform of your choice and create CICD pipeline with the GIT repository. Share the admin rights to the CICD platform with your interviewer.

js-interview's People

Contributors

edisonzsq avatar

Watchers

 avatar  avatar

js-interview's Issues

sending token name

In the README.md of the assignment, for frontend devs, it is required to send the JWT token to the API. But it does not specify with what name it should be sent to backend. It just says Authoriszation Header. The spacing is not allowed in headers when sending HTTP requests to server. I think you may need to specify with which name it has to send to backend.

According to readme, the header is supposed to be

{ 
  "Authoriszation Header" : "someToken"
}

the header cannot contain spaces and so on, I've tried with token and also Authorization but nothing seems to be working. The spelling is also wrong.

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.