MCPcopy
hub / github.com/careercup/CtCI-6th-Edition-JavaScript

github.com/careercup/CtCI-6th-Edition-JavaScript @main sqlite

repository ↗ · DeepWiki ↗
306 symbols 591 edges 127 files 0 documented · 0%
README

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

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

Chapter 2

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

Chapter 3

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

Chapter 4

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

Chapter 5

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

Chapter 6

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

Chapter 7

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

Chapter 8

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

Chapter 9

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

Chapter 10

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

Test

npm test

Core symbols most depended-on inside this repo

push
called by 43
chapter07/util/Stack.js
insert
called by 42
chapter10/10.10 - Rank From Stream/rankFromStream.js
add
called by 39
chapter03/3.4 - Queue via Stacks/queueViaStacks.js
push
called by 23
chapter03/3.2 - Stack Min/stackMin.js
remove
called by 22
chapter03/3.4 - Queue via Stacks/queueViaStacks.js
pop
called by 16
chapter03/3.2 - Stack Min/stackMin.js
mysteriousFunction
called by 15
chapter05/5.5 - Debugger/debugger.js
push
called by 14
chapter03/3.3 - Stack of Plates/stackOfPlates.js

Shape

Function 161
Method 107
Class 38

Languages

TypeScript100%

Modules by API surface

chapter07/util/LinkedList.js15 symbols
chapter04/util/LinkedList.js15 symbols
chapter03/util/LinkedList.js15 symbols
chapter02/util/LinkedListX.js15 symbols
chapter10/10.10 - Rank From Stream/rankFromStream.js12 symbols
chapter03/util/Stack.js9 symbols
chapter03/3.3 - Stack of Plates/stackOfPlates.js9 symbols
chapter07/util/Stack.js8 symbols
chapter07/util/Queue.js8 symbols
chapter04/util/Stack.js8 symbols
chapter04/util/Queue.js8 symbols
chapter03/util/Queue.js8 symbols

Dependencies from manifests, versioned

eslint6.6.0 · 1×

For agents

$ claude mcp add CtCI-6th-Edition-JavaScript \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact