GithubHelp home page GithubHelp logo

coding-challenge's Introduction

9Spokes Coding Challenge

Overview

This repo contains the instructions and the data you need to complete the 9Spokes coding challenge. This challenge is not intended to be complex, but it is an opportunity for you to showcase your understanding and applying of good development practices.

You are encouraged to treat this as a real-life project. This typically means:

  • Use version control effectively
  • Include some basic documentation
  • Include some unit tests
  • Use a naming convention

You are free to use any programming language you'd like.

The Challenge

You are tasked with developing an application that performs the following tasks in sequence:

  • Read and parse an external data file data.json (located in this repo)
  • Using this data, calculate and print the values of 5 common accounting metrics:
    1. Revenue
    2. Expenses
    3. Gross Profit Margin
    4. Net Profit Margin
    5. Working Capital Ratio
  • Commit your changes, and upload all your work to a feature branch of your choice.

Instructions

  • Begin by forking the current repository to your own github.com account
  • Clone the repo locally
  • Write your code, commit often
  • Once you are satisfied with the output, push your changes to your github.com account
  • Share the link

Calculations

Use the formulas below to calculate your values:

Revenue

This should be calculated by adding up all the values under total_value where the account_category field is set to revenue

Expenses

This should be calculated by adding up all the values under total_value where the account_category field is set to expense

Gross Profit Margin

This is calculated in two steps: first by adding all the total_value fields where the account_type is set to sales and the value_type is set to debit; then dividing that by the revenue value calculated earlier to generate a percentage value.

Net Profit Margin

This metric is calculated by subtracting the expenses value from the revenue value and dividing the remainder by revenue to calculate a percentage.

Working Capital Ratio

This is calculated dividing the assets by the liabilities creating a percentage value where assets are calculated by:

  • adding the total_value from all records where the account_category is set to assets, the value_type is set to debit, and the account_type is one of current, bank, or current_accounts_receivable
  • subtracting the total_value from all records where the account_category is set to assets, the value_type is set to credit, and the account_type is one of current, bank, or current_accounts_receivable

and liabilities are calculated by:

  • adding the total_value from all records where the account_category is set to liability, the value_type is set to credit, and the account_type is one of current or current_accounts_payable
  • subtracting the total_value from all records where the account_category is set to liability, the value_type is set to debit, and the account_type is one current or current_accounts_payable

Formatting

All currency figures must be formatted as follows:

  • The value is prefixed with a $ sign
  • A comma is used to separate every 3 digits in the thousands, millions, billions, and trillions
  • Cents are removed

All percentage values must be formatted to one decimal digit and be prefixed with a % sign. Don't forget to multiply by 100 each time you're tasked with calculating a percentage value.

Example

Below is what a typical output should look like. Please note this is not the output of the challenge but a mere example.

$ ./myChallenge
Revenue: $519,169
Expenses: $411,664
Gross Profit Margin: 22%
Net Profit Margin: 21%
Working Capital Ratio: 95%

Dependencies

If your program requires a special way to compile or a specific version of a toolset, please be sure to include that in your running instructions.

Thank you and good luck!

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.