Code Monkey home page Code Monkey logo

breadinterview's Introduction

Technical screening for Bread Finance

Objective

Using the documentation found on https://platform.seatgeek.com/, I was asked to complete the following assignments.

  1. Build a function that takes in a search query and prints the name of the first 10 events related to that query along with their score.
  2. Find the event with the highest score.
  3. Print the name of 10 events that are recommended based on the event that we found in step 2.

Breakdown

  • Tested me on API request and the use of query strings. (question 1) The base events(events on the documentation) request of:
https://api.seatgeek.com/2/events/
  • parameters for our query string. client SECRET KEY & boston + celtics
?client_id=<SECRET_KEY> + &q=boston+celtics
  • A lesson on linear search (question 2)
axios.get(`https://api.seatgeek.com/2/events/?client_id=${key}&q=boston+celtics`)
    .then(res => {
          let largestNum = 0;
          let largestKey = 0;
          // in a search query and print the name of the first 10
          //events related to that  query along with their score.
            for (let i = 0; i <= 9; i++) {
                console.log(res.data.events[i].score, res.data.events[i].title);
                if (res.data.events[i].score > largestNum) {
                    largestNum = res.data.events[i].score;
                    largestKey = i;
                    eventId = res.data.events[i].id;
                }
            }
            // Find the event with the highest score.
            console.log('this is the event and largest score', res.data.events[largestKey].title, 'with a score of', res.data.events[largestKey].score, )
        })
  • A lesson on scoping (question 3)

To start up the project (need keys)

In our terminal cd into the directory and type in the following commands

  1. npm install
  2. node

breadinterview's People

Contributors

yimd85 avatar

Watchers

James Cloos avatar  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.