Skip to content

JoshuaRogan/js-cs-tasks

Repository files navigation

JS ES6 Solutions to CS Questions

Solutions in ES6 to common interview questions for CS positions.

Cracking the Coding Interview Reddit List of CS Questions

Solutions

Most Frequent

Return the most frequent item in a given array.

nth Fibonacci

Recursive and iterative approaches to generate the nth Fibonacci number.

Algorithm Big O
Recursive O(2n)
Iterative O(n)

Iterative is significantly faster for the node engine. Function calls require state and preservation and restoration while iteration jumps around in one function.

Compare Test Results

Test results from Node V5.0.0

Compute n = 0 to 50
Recursive approach took 554220ms
Iterative approach took 2ms
Difference (Rec - Intr) =  554218ms

About

Simple solutions using ES6 for CS interview type questions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published