Skip to content

moshejs/Point72-Oil-Production-Challenge

Repository files navigation

Oil Production Exercise for Point72

Imagine that you are hired by an oil company in need of assistance predicting their supply output. You are tasked with formulating and implementing an algorithm given the following production parameters:

The company own a number, d, of mining drills. Each drill finishes an oil well each period, p, at which point the well immediately starts supplying oil. - Each well has an initial output, out(0), per day of barrels of oil. There are no wells to start. They start accumulating wells as drills complete them. - Each day the oil well output declines linearly by a fixed rate, r until the production reaches zero and the well is depleted.

Given the inputs [d, p, out(0), r] your task is to predict two outputs:

  • t(max): how long until the company reaches its maximum production level
  • out(t(max)): what is the company's peak daily oil production, in barrels.

Approach, Motivation, and Discussion can be found here.

Clone Repo

Follow these steps to clone the repository

git clone https://github.com/moshejs/Point72-Oil-Production-Challenge.git

Run CLI calculator

This will allow you to use your own inputs.

cd Point72-Oil-Production-Challenge/
npm install
npm start

Your output should look like this...

$ npm start

> [email protected] start /Point72-Oil-Production-Challenge
> node index.js

How many mining drills does the company own (d)? 1
What is the period of days each drill finishes an oil well (p)? 7
What is the initial output of a well per day in barrels of oil (out0)? 300
What is the daily rate of decline of oil output in barrels of oil per day (r)? 11
It will take 28 day(s) until max production levels are reached, and will yield 738 barrel(s) of oil!
Would you like to run this again? (1 = Yes, any key to quit) 

Run CLI calculator on JSFiddle

This will allow you to use your own inputs programatically.

You can access a demo of the algorithm here. Note that this is a different implementation from the Node demo presented here, but the algorithm used is the same.

Run Tests

This will run all the unit tests available for this exercise.

cd Point72-Oil-Production-Challenge/
npm install
npm test

Your results should look like this...

$ npm test

> [email protected] test /Point72-Oil-Production-Challenge
> mocha --recursive

  Example 1: Simple case
    ✓ should calculate t(max)
    ✓ should calculate out(t(max))

  Example 2: Simple case
    ✓ should calculate t(max)
    ✓ should calculate out(t(max))

  Example 3: Simple case with floats
    ✓ should calculate t(max)
    ✓ should calculate out(t(max))

  Example 4: Edge case
    ✓ should calculate t(max)
    ✓ should calculate out(t(max))

  Example 5: Bad Parameters case
    ✓ should not be able to create instance


  9 passing (8ms)

About

Algorithm Demo Deployed on JSFiddle

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published