Giter VIP home page Giter VIP logo

happening_xyz's Introduction

This is Super shopping cart simulator app!

Welcome to your live coding assignment of Super Shopping cart simulator (for happening.xyz (superbet)). We will hang out for about 2 hours, so let's have fun.

We just came from a meeting with product managers and they need to have live demo in two hours. Please help.

Main app functionality is to hold items in shopping cart and display total sum on items prices. Available items with prices needs to be fetched from API and displayed in list.

Requirements:

  • items needs to be fetched from REST API once on application start
  • total price and item count in shopping cart needs to be updated every time item is added or removed from shopping cart

Optional/bonus requirements:

  • main logic parts of the app needs to be covered with unit tests
  • add buy functionality that will call API to make a purchase of items in shopping cart

Good luck and happy coding.

REST API

Base URL: https://apache.superology.dev/interview

Get all products

Request

GET /getAllProducts

Response

{
  "data": {
    "products": [
      {
        "id": "7aa080fd-aafc-4cd7-9d26-030457708297",
        "name": "Bread"
      },
      {
        "id": "05313b70-ffc8-40c0-958c-46f595b75ea9",
        "name": "Milk"
      },
      {
        "id": "d3eb4223-5104-426c-a456-5f5650b53e99",
        "name": "Eggs"
      }
    ],
    "prices": [
      {
        "id": "05313b70-ffc8-40c0-958c-46f595b75ea9",
        "price": 0.94
      },
      {
        "id": "d3eb4223-5104-426c-a456-5f5650b53e99",
        "price": 2.45
      },
      {
        "id": "7aa080fd-aafc-4cd7-9d26-030457708297",
        "price": 1.25
      }
    ]
  }
}

Purchase products

Request

POST /purchaseProducts

Body

{
  "products": [
    {
      "id": "7aa080fd-aafc-4cd7-9d26-030457708297",
      "amount": 1
    },
    {
      "id": "d3eb4223-5104-426c-a456-5f5650b53e99",
      "amount": 2
    }
  ]
}

Response

Success Status: 201

{
    "message": "Products purchased!"
}

Error - invalid request Status: 400

{
    "message": "Request body must be a non-empty array of products."
}
app

iOS live coding challenge, the interviewers expect to finish this in 90 minutes happening.xyz superbet

happening_xyz's People

Contributors

abin0992 avatar

Watchers

 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.