Skip to content

Instantly share code, notes, and snippets.

@morloy
Last active January 31, 2019 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save morloy/f6e4b6cef0cb7a833bc6beb01d25f1c7 to your computer and use it in GitHub Desktop.
Save morloy/f6e4b6cef0cb7a833bc6beb01d25f1c7 to your computer and use it in GitHub Desktop.
Frontend Challenge: Cap Table

Frontend Challenge: Cap Table

Every company is divided into shares. Shares are issued to shareholders. Founders usually get them for free, whereas investors need to pay for each share. Aggregating all shares of a shareholder, we get the cap table: a list of all shareholders and the percentage they own in the company.

The goal of this challenge is to build a simple cap table management app.

First, we need to define a shareholder. For this, we use Flow to define a basic JavaScript object:

type Shareholder = {|
  _id: string
  name: string,
  email: string,
  address: {|
    line1: string,
    line2?: string,
    street: string,
    postcode: number,
    city: string,
    country: string, // ISO Alpha-2, e. g. CH, GB, US
  |},
|}

Second, we need a define the issuance of new shares:

type SharesIssue = {|
  shareholderId: string,
  date: Date,
  amount: number,
  pricePerShare?: number,  // USD
|}

Of course, there can be multiple share issues per shareholder.

So, here’s the task:

  • Write a single-page app that handles a local state of shareholders and share issues.
  • Provide pages and forms to manage shareholders and share issues.
  • Visualize the resulting cap table, consisting of: name and address of each shareholder, number of shares, percentage, and invested amount.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment