Giter Club home page Giter Club logo

investorbook's Introduction

Problem Statement

InvestorBook

Welcome to InvestorBook, Inc! This is your first week at InvestorBook and you are excited to build on top of the data. The dataset contains three tables: Investors, Companies, and Investments.

Your Task

Build a simple web server that returns an Excel export for a given company's data.

  • GET /companies/:companyId/export
    • Header(top of each page)
      • Row 1, Column A is {Name of Company} Export.
      • Row 2, Column B is Generated on {date}.
      • Row 3 is blank.
      • Row 4 has the column headers.
      • The background color of the first two header rows should be RGB(92, 128, 185).
      • The text color in the first two header rows should be white.
      • Example
    • Sheet 1 - Investors
      • In this sheet, list all of the investors that have invested in this company.
      • Column A is the name of the investor.
      • Column B is the total amount invested.
    • Sheet 2 - Related Companies
      • List the companies that are connected to this company through at least one shared investor.
      • Column A is the name of the related company.
      • Column B is the list of names of the shared investors

README.md has instructions for connecting to the database.

Submission

Fork this repository and send us a link to your fork after pushing your changes.

Evaluation Criteria

  • Clean, modular, easy-to-maintain code
  • Test coverage
    • Bonus points for tests that are short, fast, and reliable but offer an unexpectedly high ROI in terms of coverage.
  • Performance - Aim for a response time of less than 100ms.

Solution Note

##NOTE

  • Looks like DB end-point provided in the README.md postgres://postgres:[email protected]:5432 is not reachable. DB Error
  • Found the DB dump inside a compressed file https://github.com/ProlificLabs/investorbook/blob/master/investorbook.zip
  • Restored the DB locally and wrote a solution accordingly.

How To Run

  1. Make sure you are running postgres 11.
  2. Run the following commands to restore the database.
unzip investorbook.zip && createdb investorbook && psql -f investorbook.sql -d investorbook
  1. Start the application. go run main.go
  2. Open http://localhost:9001/companies/:companyId/export in the browser.

Performance

Average response time is ~90ms.

Res1 Res2

investorbook's People

Contributors

maknahar avatar markerdmann avatar yyw 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.