Ace your next Javascript coding interview by mastering data structures and algorithms.
Overview
Comments
-
#10 Two Sided Steps Pyramids
Description Write a function that accepts a positive number N. The function should console log a pyramid shape with N levels using the # character. Make sure the pyramid has spaces on both the left and right-hand sides
Examples
- pyramid(1) '#'
- pyramid(2) ' # ' '###'
- pyramid(3) ' # ' ' ### ' '#####'
-
#9 Printing Steps
Description Write a function that accepts a positive number N. The function should console log a step shape with N levels using the # character. Make sure the step has spaces on the right hand side!
Examples
- steps(2) '# ' '##'
- steps(3) '# ' '## ' '###'
- steps(4) '# ' '## ' '### ' '####'
-
#8 Sentence Capitalization
Description Write a function that accepts a string. The function should capitalize the first letter of each word in the string then return the capitalized string.
Examples
- capitalize('a short sentence') --> 'A Short Sentence'
- capitalize('a lazy fox') --> 'A Lazy Fox'
- capitalize('look, it is working!') --> 'Look, It Is Working!'
-
#7 Anagrams
Description Check to see if two provided strings are anagrams of each other. One string is an anagram of another if it uses the same characters in the same quantity. Only consider characters, not spaces or punctuation. Consider capital letters to be the same as lower case
Examples
- anagrams('rail safety', 'fairy tales') --> True
- anagrams('RAIL! SAFETY!', 'fairy tales') --> True
- anagrams('Hi there', 'Bye there') --> False
-
#6 Array Chunking
Description Given an array and chunk size, divide the array into many subarrays where each subarray is of length size
Examples
- chunk([1, 2, 3, 4], 2) --> [[ 1, 2], [3, 4]]
- chunk([1, 2, 3, 4, 5], 2) --> [[ 1, 2], [3, 4], [5]]
- chunk([1, 2, 3, 4, 5, 6, 7, 8], 3) --> [[ 1, 2, 3], [4, 5, 6], [7, 8]]
- chunk([1, 2, 3, 4, 5], 4) --> [[ 1, 2, 3, 4], [5]]
- chunk([1, 2, 3, 4, 5], 10) --> [[ 1, 2, 3, 4, 5]]
-
#5 The classic FlizzBuzz
Description Write a program that console logs the numbers from 1 to n. But for multiples of three print “fizz” instead of the number and for the multiples of five print “buzz”. For numbers which are multiples of both three and five print “fizzbuzz”.
Example fizzBuzz(5); 1 2 fizz 4 buzz
enhancement -
#4 Max Chars
Implement test and solution for the problem that returns the character that is mostly used in a string
Description Given a string, return the character that is most commonly used in the string. Examples
- maxChar("abcccccccd") === "c"
- maxChar("apple 1231111") === "1"
-
#3 Integer Reversal
Description Given an integer, return an integer that is the reverse ordering of numbers.
Examples
- reverseInt(15) === 51
- reverseInt(981) === 189
- reverseInt(500) === 5
- reverseInt(-15) === -51
- reverseInt(-90) === -9
-
#2 Palindrome
Description Given a string, return true if the string is a palindrome or false if it is not. Palindromes are strings that form the same word if it is reversed. Do include spaces and punctuation in determining if the string is a palindrome.
Examples:
- palindrome("abba") === true
- palindrome("abcdefg") === false
-
#01 String reverse - Write test and problem solutions
Description Given a string, return a new string with the reversed order of characters
Examples
- reverse('apple') === 'leppa'
- reverse('hello') === 'olleh'
- reverse('Greetings!') === '!sgniteerG'
Solution 1
Solution 2
enhancement -
#24 Tree Width with Level Width
Description Given the root node of a tree, return an array where each element is the width of the tree at each level.
Example Given: 0 / |
enhancement
1 2 3 | | 4 5 Answer: [1, 3, 2] -
#21 Circular lists
Description Given a linked list, return true if the list is circular, false if it is not.
Examples const l = new List(); const a = new Node('a'); const b = new Node('b'); const c = new Node('c'); l.head = a; a.next = b; b.next = c; c.next = b; circular(l) // true
enhancement
Owner
Wallflower
A curated collection of common interview questions to help you prepare for your next interview.
30 Seconds of Interviews A curated collection of common interview questions to help you prepare for your next interview. This README is built using ma
📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings
?? Algorithms and data structures implemented in JavaScript with explanations and links to further readings
🥞Data Structures and Algorithms explained and implemented in JavaScript + eBook
Data Structures and Algorithms in JavaScript This is the coding implementations of the DSA.js book and the repo for the NPM package. In this repositor
💯 Materials to help you rock your next coding interview
Tech Interview Handbook Credits: Illustration by @leftaligned Read on the website Black Lives Matter. Support the Equal Justice Initiative What is thi
Bringing an all Open-Source Platform to study Data Structures and Algorithms ⚡
NeoAlgo-Docs Bringing an all Open-Source Platform to study Data Structures and Algorithms ⚡ ?? Installation You will need to have NodeJS and Yarn inst
A Typescript companion to the book A Common-Sense Guide to Data Structures and Algorithms by Jay Wengrow
This repository aims to be a companion to the book A Common-Sense Guide to Data Structures and Algorithms by Jay Wengrow. I rewrote most of the data s
Algorithms and Data Structures implemented in TypeScript for beginners, following best practices.
The Algorithms - TypeScript TypeScript Repository of TheAlgorithms, which implements various algorithms and data structures in TypeScript. These imple
Coding Interview Questions solved with Javascript 💡
©️ Coding Interview Questions Coding Interview Questions solved with Javascript ?? ?? Problems Name Description Tag Code Balanced Parentheses Check if
Mastering Ethereum, by Andreas M. Antonopoulos, Gavin Wood
Mastering Ethereum Mastering Ethereum is a book for developers, offering a guide to the operation and use of the Ethereum, Ethereum Classic, RootStock
A collection of all the data structures implemented in javascript code
Data structures A collection of all the data structures implemented in javascript code, interview questions & problems ( with solutions ) Contributors
Serialization library for data-oriented design structures in JavaScript
Data-oriented Serialization for SoA/AoA A zero-dependency serialization library for data-oriented design structures like SoA (Structure of Arrays) and
The basics data structures implemented with javascript.
Estrutura de Dados com Javascript Tudo que está escrito e codificado aqui dentro desse repositório foi retirado do livro Estrutura de dados e algoritm
easily building data structures that are serializable, validatable, and fully typed.
@davecode/structures [beta/wip] Structures is a TypeScript library for easily building data structure classes that are Serializable: Can convert rich
⚡️ 100 Days of DS Algo for interview preparation (C++ and Javascript)
100 days of Problem Solving for Tech Interviews ⚡️ For the next 100 Days, I'l code at least one problem everyday in Javascript (and maybe C++?). Might
Code accompanying my illustrated Data structures video series on YouTube
Code accompanying my illustrated Data structures video series on YouTube
Data Structures
Data-Structures Data structures implementaion using Javascript ???? Data-Structures is a Github repository that contains the implementaion of most of
Weirdest JavaScript Interview Questions & Answers
Part 3 - JavaScript Pro Tips - Learn with Sumit Table of Contents How to run Contact How to run Different lessons taught in the Youtube Tutorial are o
List of 1000 JavaScript Interview Questions
JavaScript Interview Questions & Answers Click ⭐ if you like the project. Pull Requests are highly appreciated. Follow me @SudheerJonna for technical
A high-resolution local database that uses precise algorithms to easily record data in local files within a project with persistent JSON and YAML support designed to be easy to set up and use
About A high-resolution local database that uses precise algorithms to easily record data in local files within a project with persistent JSON and YML