/js-goodtasks

This repository for good tasks

Primary LanguageTypeScriptThe UnlicenseUnlicense

Good tasks for interview on JavaScript

Here are some good tasks that I have met on the Internet or in interviews. For a long time, I didn't create a repository to collect such tasks and show my solutions. Some of the tasks are already exist on Codewars or Leetcode, here is my own selection of tasks.

Used Practice

Tasks

All tasks divided by subjective level of complexity from 1 to 10

Task Description Level of complexity
maximalSquare You have a 2D binary matrix that's filled with 0s and 1s. In the matrix, find the largest square that contains only 1s and return its area. 5
firstDuplicate Given an array a that contains only numbers in the range from 1 to a.length, find the first duplicate number for which the second occurrence has the minimal index. 2
findDeadlock Write a function that returns True if connections describes a graph with a directed cycle, or False otherwise. 6
findRepeatedDNASequences Write a function to find all the 10-letter sequences (substrings) that occur more than once in a DNA molecule s, and return them in lexicographical order. These sequences can overlap. 4
groupingDishes Return an array where each element is a list beginning with the ingredient name, followed by the names of all the dishes that contain this ingredient. The dishes inside each list should be sorted lexicographically, and the result array should be sorted lexicographically by the names of the ingredients. 4

Books or platforms that will help

Platforms:

Books:

How setup

Node and npm are required to continue setup.

Note: The best alternative npm is yarn. I use yarn because yarn supoorts workspaces, which i use in most of my projects.

First step

Execute in console yarn or npm install

Run tests

Default mode: Execute in console yarn test or npm run test

Watch mode: Execute in console yarn test:watch or npm run test:watch

TLDR

My solutions do not claim to be perfect implementation. I will be glad if you give your opinion on the best solution or add your interesting task(s)