JavaScript Review
Interview Practice - Algorithms
01. Ask clarifying questions
02. Pseudo-code/ code in english
03. Brute force a solution
04. Test, test, test.
05. Optimize and refactor.
Interview Steps
Groups of 2-3
Each group is assigned a question. You are going to be given exactly 20 minutes to come up with a solution.
After 20 minutes each group will come up individually and each person in the group will present a portion of the 5 interview steps.
We'll have 3-5 minutes after each group to give feedback. 2-3 things they did really well, 1 thing they could improve on.
The point is to intentionally pull you out of your comfort zone and get you ready for doing it alone in front of an actual interviewer.
Round One
01. Is Unique
02. Palindrome
03. URLify
04. String Compression
Implement an algorithm to determine if a string as all unique characters.
Two solutions, one with a data structure and one without.
Given a string, write a function to check if it is a permutation of a palindrome.
Write a function that replaces all spaces in a string with "%20".
Implement a method to perform basic string compression using the counts of repeated characters.
Input: Tact Coa
Output: True ("taco cat", "atco cta")Input: "Mr John Smith"
Output: "Mr%20John%20Smith"Input: "aabcccccaaa"
Output: "a2b1c5a3"Round Two
01. Sorted Merge
02. Sparse Search
03. One Away
04. Group Anagrams
You are given two sorted arrays, A and B. Write a function to merge B into A in sorted order.
Given a sorted array of strings that is interspersed with empty strings, write a function to find the location of a given string.
There are three types of edits that can be performed on strings: insert a character, remove a char, or replace a char. Given two strings, write a function to check if they are one edit or zero away.
Write a function to sort an array of strings so that all the anagrams are next to each other.
pale, ple -> true
pales, pale -> true
pale, bale -> true
pale, bake -> trueJavaScript Review - Algorithms
By Alec Ortega
JavaScript Review - Algorithms
Group interview practice for algorithm questions.
- 454