Fibonacci Web API

Problem Definition: Implement a web service.

  1. to support a REST GET call.

a. The web service accepts a number, n, as input and returns the first n Fibonacci numbers, starting from 0. I.e. given n = 5, appropriate output would represent the sequence "0 1 1 2 3".

b. Given a negative number, it will respond with an appropriate error.

  1. Include whatever instructions are necessary to build and deploy/run the project. "deploy/run" means the web service is accepting requests and responding to them as appropriate.
  2. add enough unit tests. add some functional tests. list all other tests you would think of.
  3. While this project is admittedly trivial, approach it as representing a more complex problem that you'll have to put into production and maintain for 5 years.

Basic Approach:

Features

  • Implemented using flask-restful module in python.
  • The Web service accepts get call at the defined endpoints and throws forbidden error otherwise
  • The Rest API exposes a novel implementation of Fibonacci which serves a fibonacci series for a given * integer value n as a response to a GET call.
  • If a negative value is passed error message will appear in response.
  • If a non-numeric value is passed error message will appear in response.
  • As problem size grows option of using caching
  • All configurable parameters are placed in a central yaml config file