#back-end #interview #practice #node #javascript #technical-interview #test #training #vanilla
🔬 TangoMan Node Lab is a Javascript coding project for practicing common interview questions and coding challenges.
There are various Javascript scripts in the root directory that implement different algorithms and solutions to coding problems:
- 🔄 Ackermann
Implements the Ackermann function, which is a classic example of a recursive function that can be used to test compilers and illustrate the concept of recursion.
- 🔍 BinarySearch
Implements binary search to find an element in a sorted array. Binary search is an efficient algorithm for searching sorted data sets and relies on the divide-and-conquer technique.
- ➕ Factorial
Calculates factorials recursively. Factorials are used in combinatorics and provide good examples of recursive functions.
- 🔢 Fibonacci
Generates Fibonacci numbers recursively. The Fibonacci sequence illustrates recursion and has applications in mathematics and nature.
- 💬 FizzBuzz
Prints numbers 1 to 100, but prints "Fizz" for multiples of 3, "Buzz" for multiples of 5, and "FizzBuzz" for multiples of both. This is a common interview screening question.
- 👋 HelloWorld
Prints "Hello world!" - the traditional first program for beginner programmers.
- ❄️ MinTemperature
Finds minimum temperature value from temperature data. Demonstrates algorithms for finding minimum/maximum values.
- 🧑🏼💻 Multisoft
Swedish software company technical test solver.
- 🔄 Palindrome
Checks if a string is a palindrome. Palindromes illustrate recursion and string manipulation.
- ✔️ Perfect
Checks if a number is a perfect number, where the number equals the sum of its divisors. Interesting math and recursion example.
- 🃏 Poker
Evaluates poker hands. Involves evaluating combinations and ranks of cards.
- 🥇 PrimeNumbers
Checks if a number is prime, where a natural number greater than 1 has no positive divisors other than 1 and itself.
- 🔄 Rot13
Encodes/decodes a string using the ROT13 cipher, a simple letter substitution cipher. Basic encryption example.
- 🔑 SimpleJWT
Implements JSON Web Token (JWT) encoding and decoding.
- 💹 Stocks
Return an array holding the names of the top three stocks with the best average performance given two separate arrays containing stocks names and prices.
- 🔢 Syracuse
Implements the Syracuse algorithm/sequence. Interesting recursion and number theory example.
- 🏗️ TowerOfHanoi
Implements the Tower of Hanoi algorithm. A classic algorithm that illustrates recursion and dynamic programming.
- 🔄 VonNeumann
Generates Von Neumann ordinal numbers. Illustrates generating recursive sequences.
The tests directory in each folder contains test cases for testing the implementations of each algorithm.
This project uses Github Actions for continuous integration and testing. The .github/workflows directory contains YAML workflow definitions for:
- Linting: Runs
ESLintto check code style and quality on every push and pull request. - Testing: Runs
mochaunit tests.
The workflows help maintain code quality and ensure the tests pass on latest node version.
Chai documentation is available here: https://www.chaijs.com/guide
Mocha documentation is available here: https://mochajs.org/
ESLint documentation is available here: https://eslint.org/docs/latest/use/getting-started
The following YouTube videos inspired the Node Lab project:
- FizzBuzz: One Simple Interview Question
- Solve This Coding Question To Win $200
- The Most Difficult Program to Compute? - Computerphile
TangoMan Node Lab requires the following dependencies:
- Node.js
- npm
On linux machine install node globally with the following commands (requires curl):
$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
$ sudo apt-get install --assume-yes nodejsDownload and install recommended LTS version from here: Node.js
Download and install recommended LTS version from here: Node.js
Run sh entrypoint.sh to print help
Run tests:
sh entrypoint.sh unitLint code:
sh entrypoint.sh lintFix lint errors:
sh entrypoint.sh lint --fixUninstall:
sh entrypoint.sh uninstallThank you for your interest in contributing to TangoMan Node Lab.
Please review the code of conduct and contribution guidelines before starting to work on any features.
If you want to open an issue, please check first if it was not reported already before creating a new one.
Copyrights (c) 2024 "Matthias Morin" <mat@tangoman.io>
Distributed under the MIT license.
If you like TangoMan Node Lab please star, follow or tweet about it:
... And check my other cool projects.