• Stars
    star
    3,114
  • Rank 14,434 (Top 0.3 %)
  • Language
    JavaScript
  • Created almost 9 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Cracking the Coding Interview 6th Ed. JavaScript Solutions

Cracking the Coding Interview 6th Edition - JavaScript

Instructions

  • This repository contains JavaScript attempts on questions listed in the book.

  • So far, code or short writeups are available for the first 10 chapters.

  • At Gayle's request, the files only contain code, and do not contain the actual questions. For the questions, please support Gayle by purchasing the book.

  • Under each JavaScript file, there are tests to check that the code is working as expected. For convenience, simple logging is used to test the functions. To run the tests, just cd into the folder containing the .js file and run node <fileName>.js to run the tests.

  • Contributions welcome

List of Coding Questions:

Chapter 1

  • 1.1 - Is Unique
  • 1.2 - Check Permutation
  • 1.3 - URLify
  • 1.4 - Palindrome Permutation
  • 1.5 - One Away
  • 1.6 - String Compression
  • 1.7 - Rotate Matrix
  • 1.8 - Zero Matrix
  • 1.9 - String Rotation

Chapter 2

  • 2.1 - Remove Dups
  • 2.2 - Return Kth to Last
  • 2.3 - Delete Middle Node
  • 2.4 - Partition
  • 2.5 - Sum Lists
  • 2.6 - Palindrome
  • 2.7 - Intersection
  • 2.8 - Loop Detection

Chapter 3

  • 3.1 - Three in One
  • 3.2 - Stack Min
  • 3.3 - Stack of Plates
  • 3.4 - Queue via Stacks
  • 3.5 - Sort Stack
  • 3.6 - Animal Shelter

Chapter 4

  • 4.1 - Route Between Nodes
  • 4.2 - Minimal Tree
  • 4.3 - List of Depths
  • 4.4 - Check Balanced
  • 4.5 - Validate BST
  • 4.6 - Successor
  • 4.7 - Build Order
  • 4.8 - First Common Ancestor
  • 4.9 - BST Sequences
  • 4.10 - Check Subtree
  • 4.11 - Random Node
  • 4.12 - Paths with Sum

Chapter 5

  • 5.1 - Insertion
  • 5.2 - Binary to String
  • 5.3 - Flip Bit To Win
  • 5.4 - Next Number
  • 5.5 - Debugger
  • 5.6 - Conversion
  • 5.7 - Pairwise Swap
  • 5.8 - Draw Line

Chapter 6

  • 6.1 - Heavy Pill
  • 6.2 - Basketball
  • 6.3 - Dominos
  • 6.4 - Ants on a Triangle
  • 6.5 - Jugs of Water
  • 6.6 - Blue-Eyed Island
  • 6.7 - The Apocalypse
  • 6.8 - The Egg Drop Problem
  • 6.9 - 100 Lockers
  • 6.10 - Poison

Chapter 7

  • 7.1 - Deck of Cards
  • 7.2 - Call Center
  • 7.3 - Jukebox
  • 7.4 - Parking Lot
  • 7.5 - Online Book Reader
  • 7.6 - Jigsaw
  • 7.7 - Chat Server
  • 7.8 - Othello
  • 7.9 - Circular Array
  • 7.10 - Minesweeper
  • 7.11 - File System
  • 7.12 - Hash Table

Chapter 8

  • 8.1 - Triple Step
  • 8.2 - Robot in a Grid
  • 8.3 - Magic Index
  • 8.4 - Power Set
  • 8.5 - Recursive Multiply
  • 8.6 - Towers of Hanoi
  • 8.7 - Permutations without Dups
  • 8.8 - Permutations with Dups
  • 8.9 - Parens
  • 8.10 - Paint Fill
  • 8.11 - Coins
  • 8.12 - Eight Queens
  • 8.13 - Stack Boxes
  • 8.14 - Boolean Eval

Chapter 9

  • 9.1 - Stock Data
  • 9.2 - Social Network
  • 9.3 - Web Crawler
  • 9.4 - Duplicate URLs
  • 9.5 - Cache
  • 9.6 - Sales Rank
  • 9.7 - Personal Financial Manager
  • 9.8 - Paste Bin

Chapter 10

  • 10.1 - Sorted Merge
  • 10.2 - Group Anagrams
  • 10.3 - Search In Rotated Array
  • 10.4 - Sorted Search No Size
  • 10.5 - Sparse Search
  • 10.6 - Sort Big File
  • 10.7 - Missing Int
  • 10.8 - Find Duplicates
  • 10.9 - Sorted Matrix Search
  • 10.10 - Rank From Stream
  • 10.11 - Peaks And Valleys

Test

npm test

More Repositories

1

CtCI-6th-Edition

Cracking the Coding Interview 6th Ed. Solutions
Java
11,236
star
2

ctci

Cracking the Coding Interview, 5th Edition
Java
5,134
star
3

CtCI-6th-Edition-Python

Cracking the Coding Interview 6th Ed. Python Solutions
Python
4,958
star
4

CtCI-6th-Edition-cpp

Cracking the Coding Interview 6th Ed. C++ Solutions
C++
1,352
star
5

CtCI-6th-Edition-JavaScript-ES2015

Cracking the Coding Interview 6th Ed. JavaScript ES2015 Solutions
JavaScript
829
star
6

CtCI-6th-Edition-Swift

Cracking the Coding Interview 6th Ed. Swift Solutions
Swift
461
star
7

CtCI-6th-Edition-CSharp

Cracking the Coding Interview 6th Ed. Solutions (C# Port)
C#
327
star
8

CtCI-6th-Edition-Go

Cracking the Coding Interview 6th Ed. Go Solutions
Go
119
star
9

CtCI-6th-Edition-Ruby

Ruby
91
star
10

CtCI-6th-Edition-php

Cracking the Coding Interview 6th Ed. PHP Solutions
PHP
88
star
11

CtCI-6th-Edition-Clojure

Cracking the Coding Interview 6th Ed. Clojure Solutions
Clojure
74
star
12

CtCI-6th-Edition-C

Cracking the Coding Interview 6th Ed. C Solutions
C
62
star
13

CtCI-6th-Edition-Kotlin

Cracking the Coding Interview with Kotlin
Kotlin
57
star
14

CtCI-6th-Edition-Haskell

Cracking the Coding Interview 6th Ed. Haskell Solutions
Haskell
21
star
15

CtCI-6th-Edition-Objective-C

Cracking the Coding Interview 6th Ed. Objective-C Solutions
Objective-C
11
star
16

CtCI-6th-Edition-Julia

Solutions for Cracking the Coding Interview 6th Edition by Gayle Laakmann McDowell (in Julia programming language)
Julia
9
star
17

CtCI-6th-Edition-Groovy

Cracking the Coding Interview 6th Ed. Groovy Solutions
Groovy
5
star