Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nishant-jain-94/nodejs-questions

Solutions to interview questions
https://github.com/nishant-jain-94/nodejs-questions

Last synced: 5 days ago
JSON representation

Solutions to interview questions

Awesome Lists containing this project

README

        

# Interview Questions

## Questions and their corresponding files

1. Given an array, rotate the array to the right by k steps, where k is non-negative.
Example:
Input: [1,2,7,8,9] & k=3 (3 steps)
Output: [7,8,9,1,2]

**SolutionFiles: [rotate-array.js](./rotate-array.js), [rotate-array.test.js](./rotate-array.js)**

1. Given a binary tree, find the height of the binary tree. (Mandatory)
Input: Root node of the tree
Output: Height of the tree

**SolutionFiles: [node.js](./node.js), [binary-tree-height.js](./binary-tree-height.js), [binary-tree-height.test.js](./binary-tree-height.test.js)**

1. Find all combinations of a given string.
Example:
Input: “abc”
Output: {“”, a, b, c, ab, bc, ac, abc}
**SolutionFiles: [string-combinations.js](string-combinations.js), [string-combinations.test.js](string-combinations.test.js)**

### Install all the dependencies

```bash
# Install all the dependencies
npm install
```

### Run all the test cases

```bash
# Runs all the test cases
npm run test -- *.test.js
```