Vivid Theory Coding Challenge

Welcome to the Vivid Theory coding challenge. This challenge is meant to test your foundational TypeScript knowledge along with your problem solving abilities. This code challenge is made up of various independent tests that are set out to evaluate your knowledge of specific patterns and common problems.

Vivid Theory Contact

If you require further information please reach out kevin@vividtheory.com or alfath@vividtheory.com.


Before you get started

  • This challenge is to be completed in TypeScript
  • This repo contains a package.json which has all required dependencies to complete the challenge. Feel free to add any additional packages you see fit.
  • yarn and npm are both acceptable package managers
  • The package.json contains all required scripts to individually run each challenge. Add more scripts as you see fit.
  • Each challenge should be able to be complete in under 1 hour
  • Focus on quality over speed, each challenge has multiple solutions
  • We have provided a tsconfig.json

What we expect from you

  1. Create a new GitHub repo that can be shared with the Vivid Theory Team
  2. Pick 2-3 challenges to solve (Unless discussed otherwise)
  3. Commit Often
  4. Submit challenge upon completion

Time Estimate

This challenge is estimated to take 1-4 hours, but this is not a set limit. You will have three business days from the time you receive the challenge to submit your final entry. Submissions are due by 8:00 AM (Mountain Standard Time) on the forth business day following receipt of the challenge.


Getting Started

This challenge is made up of 6 parts that can be completed in any order. The challenge itself is not made to get fully finished, focus on getting through the questions you know. Each part within this test is built such that the questions get progressively more difficult, that is Challenge 1.5 is going to be more difficult than challenge 1.1. Use all resources available, including our hiring team, if you have a question reach out to us and we will get back to you when we can. Throughtout the challenges you will see the type IMPLEMENT being used, this represents areas that you must replace IMPLEMENT with a different type. In other areas you will encounter commented out code, this code should be used as a guide.


Dog Or Cat

In this challenge you are to create a data type that represents a Dog OR a Cat. This data type will then be used to perform either Dog behaviour or Cat behaviour.

  1. IDogOrCat - 1.1
  2. dogOrCat - 1.2
  3. barkOrMeow - 1.3
  4. dogOrCatMatch - 1.4
  5. dogOrCatMatchBarkOrMeow - 1.5

FizzBuzz

In this challenge you are to create functions to play and validate a game of FizzBuzz.

  1. fizzBuzz - 2.1
  2. equal - 2.2
  3. validateFizzBuzz - 2.3
  4. isValidAnswer - 2.4
  5. validateFizzBuzzGame - 2.5
  6. validateRemoteFizzBuzzGame - 2.6

Generics

In this challenge you are to implement generic types and functions.

  1. genericConcat - 3.1
  2. valueType - 3.2
  3. nameValueType - 3.3
  4. keyValueMap - 3.4
  5. valueGetter - 3.5
  6. compose - 3.6

Partial Application

In this challenge you are to use partial application to implment custom logging functionality.

  1. customLogger - 4.1
  2. customLoggerFactory - 4.2
  3. errorLogger - 4.3
  4. customLoggerCurried - 4.4
  5. callCustomLoggerCurried - 4.5

Duplicates

In this challenge you are to create functions that deal with duplication.

  1. dedupe - 5.1
  2. findDuplicates - 5.2
  3. filterOutDuplicates - 5.3
  4. countDuplicates - 5.4

Reduce

In this challenge you are to work with and create built in array methods such as reduce, map, filter.

  1. mapNames - 6.1
  2. filterNames - 6.2
  3. reduceNames - 6.3
  4. mapFilterReduceNames - 6.4
  5. map - 6.5
  6. filter - 6.6
  7. reduce - 6.7

Pair

In this challenge you must create the functionality to properly pair/zip together two arrays, and perform operations on these arrays.

  1. createPairs - 7.1
  2. updatePair - 7.2
  3. removePair - 7.3
  4. removePairWithoutIndex - 7.4
  5. joinPairs - 7.5
  6. createPairsWithPartialPairs - 7.6

Stack

In this challenge you must implement methods of a stack.

  1. pop - 8.1
  2. isEmpty - 8.2
  3. isFull - 8.3
  4. push - 8.4
  5. peek - 8.5
  6. peekAt - 8.6
  7. drain - 8.7

This document is an overview of each challenge, more specific details are within the respective challenge files themselves.

Submission

Once you have completed the coding challenge, commit your code to a public GitHub repository. Then, contact us with the link to your repository to let us know you have completed the challenge.

Feel free to make any reasonable assumptions about this assignment, innovate, and add your personal touches as you see fit. Please reach out if you have any questions!