Ranking Interview Questions by Cram Score
An opinionated list of SDE interview questions, organized by priority
Sunday March 11, 2018
Like many aspiring software devs, I've prepped for interviews using Leetcode and
HackerRank. While there is no shortage of questions, I find that they don't
address head-on what you should be studying.
Leetcode ranks based on difficulty,
but it's a suboptimal metric when you just want to study for an upcoming interview.
Studying for a particular company? That feature is behind a paywall.
HackerRank's Cracking the Coding Interview Course
comes close, but I think the questions are mostly too rudimentary.
Rather than organizing by topic or difficulty, I've organized these questions
based on what I'd study before an interview. Level 1 concepts are so common
that understanding the solution will often help address variants you'll
see in an interview. On the other end Level 3 concepts may come up more
rarely, but they're nice to have in your back pocket.
I still think there's a ton of value in the more verbose sources out there. But
if you're lost this is a good place to start.
Also, If you're having trouble solving these, I highly recommend you look at
my algorithm guide, which
contains interactive code that can solve many of these questions.
Cram Level 1Study these even if your interview is tomorrow and it's 12 AM
Given a 2-D Array, count the number of islands in it, where land is connected in the NSEW direction
Given a target of N cents and a collection of coins, how many ways can you form N cents?
Given a string and a collection of characters, find the shortest substring that contains all the characters
Given a list of starting and ending days for a stock, maximize your profit
Efficiently compute the sum of the numbers between two indexes of an array
Given a list of intervals with a start and end value, merge the intervals
Given an array, find the subarray with the maximum sum
Cram Level 2Study these if you have a week to prepare
Given a mutable array of integers, find the sum of elements between i and j
Count the number of inversions in a unsorted array
Given a 2-D array of characters and a list of valid words, find the number of words on the board
Given an array of tasks an a cooldown period, given an efficient ordering
Given a collection of intervals, find the number of intervals you need to remove to make the rest of the intervals non-overlapping
Given a particular kind of preorder serialization of a binary tree, verify that it's valid
Cram Level 3Study these if you want to be generally prepared with a "6th sense" of what to do
Find the duplicate number in an array AND use O(1) space
Given the preorder and inorder serialization of a binary tree, construct a tree data structure
Given an infinitely sized sorted list (no visible end index), find a particular number
Given an encoding from letters to numbers, count the number of ways to decode a string of numbers
Given a non-negative integer array where each index represents the maxmimum you can iterate forward, minimize the number of jumps to reach the end of the array
Given two words, find the minimum number of edits to mutate one word into the other