Git Product home page Git Product logo

take_home_travellers_flight_info's Introduction

Assumptions

Because the function getTravelersFlightInfo doesn't take any arguments for, say, a traveller id to specify which traveller you want the flight info for, and trip returns an object that contains multiple travelerIds for each flight, I assumed the returned travellers object should be an array of travllers objects instead of an array of traveller values for one traveller (see Discrepancy in requirements below).

I also assumed that if a traveller on a trip was not on the first flight of the trip, they can be picked up along the away for subsequent flights. For example, a group of travellers can take a flight, then meetup with someone who will join them on their next flight.

Discrepancy in requirements

I noticed there's a discrepancy between the travelers data structure example in the README.md file and the sample output in the index.js file. In the README the travelers property is an array of traveler values for a single travelers while in index.js it's an array of traveler objects:

README.md

{
  travelers: [
    id,
    name,
    flights: [
      {
        legs: [
          {
            airlineCode,
            airlineName,
            flightNumber,
            frequentFlyerNumber
          }
        ]
      }
    ]
  ]
}

index.js

// TODO Replace this hard coded response with your code
return {
  travelers: [
    {
      id: 1,
      name: 'Neo',
      flights: [
        {
          legs: [
            {
              airlineCode: 'AA',
              airlineName: 'American',
              flightNumber: 'AA456',
              frequentFlyerNumber: ''
            }
          ]
        },
        {
          legs: [
            {
              airlineCode: 'VA',
              airlineName: 'Virgin',
              flightNumber: 'VA789',
              frequentFlyerNumber: 'NVA123'
            },
            {
              airlineCode: 'AK',
              airlineName: 'Alaskan',
              flightNumber: 'AK789',
              frequentFlyerNumber: 'NAK123'
            }
          ]
        }
      ]
    }
  ]
};

take_home_travellers_flight_info's People

Contributors

holdenhinkle 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.