Technical Interview Cheat Sheet
Few people look forward to a job interview. Even though itâs obviously nice to find a new career and end unemployment, the process of being judged and scrutinized based on your skills and personality is enough to make anyone uncomfortable. Worse still is when you know that you have the skills and experience you need for a job, but youâre not sure whether you can adequately communicate this to your interviewer.
Itâs a sad fact that sometimes people are better at a job interview than they are at the actual job. This is especially true during technical interviews, where people who have memorized certain strategies will often excel. With this being said, interviewing is a skill, and you can learn it in the same way that youâve learned how to code. Use this Technical Interview Cheat Sheet to understand the many ways that you can give yourself an edge during the interview processâand then demonstrate your skills in your dream job.
Interview Doâs and Donâts
To begin with, there are some pointers that have commonality between technical and non-technical interviews. You should look your best, prepare adequately, and be congenial towards your interviewer. People are going to judge you primarily on your talent, but they also want to work with people that they like and who are easy to work with. Even if youâre not sure you can memorize all of the technical information further down this list, you can still maximize your personal appeal to give yourself a better chance of getting hired.
Environment Control
DO: Neaten your surroundings
Letâs assume that interviews are going to be remote-only for the foreseeable future. Therefore, the background of your video call is something that you need to control. Make sure that your background shows a neat, well-organized spaceâor use a filter that blurs is all out if thatâs not possible.
DO: Test your setup
Make a test call to a friend of yours using the interviewerâs videoconferencing application choice. This will ensure that your webcam, mic, and internet connection are in working order.
DONâT: Assume that youâll be familiar with the coding environment
Interviewers are going beyond simple text editors during technical interviews. If your interviewer uses a solution like CoderPad, youâll find that it contains useful features like highlighting and autocompleteâif you donât familiarize yourself beforehand, you may miss out on a vital tool.
DONâT: Dress too informally
Although itâs true that weâve all spent 2020 in sweatpants, interviewers will think better of you if you wear something other than pajamas. That being said, itâs likely that youâll be sitting for a long time, so wear clothes that are comfortable, but not too casual.
DO: Expect behavioral questions
Even though this is a technical interview, you may expect to hear some questions like, âtell me about yourselfâ or âwhere do you see yourself in five years.â Make sure that you have a few prepared answers to questions like this, so you donât get caught off guard. In addition, you should make sure that you have a prepared list of intelligent questions about the organization.
DONâT: Forget to Repeat the Question
Thereâs a lot of pressure to start demonstrating your skills as fast as possible during a technical interview, but listening is also a skill. If you start coding right away without being sure that youâve fully understood the interview question, then thereâs a chance that youâll start trying to answer the question you thought you heard, and not the question your interviewer had in mind. Always read the interview question and then repeat the question back to the interviewer to ensure youâre on the same page.
DO: Clarify Understanding of inputs, outputs, and side effects
In the course of this technical interview cheat sheet, weâd like to stress two important things:
1. Youâll never hurt your chances by asking for more information
2. Coding in an interview is only an approximation of coding in real life
This means that if youâre not sure what your input is supposed to be, you wonât lose points by askingâand youâll lose a lot more points if you donât ask and get it wrong. In the same vein, if your code generates a side effect that youâre not sure aboutâask. Side effects in the technical interview IDE may not be the same as side effects in the production environment.
DO: Go through an example to ensure understanding
Finally, technical interview questions are often left deliberately vague. To ensure your thorough understanding of the question, create a quick example that encapsulates the question. The interviewer should be able to tell you whether you have the right idea.
DO: Consider algorithms in niche cases
Algorithms are tough, but in the niche cases where they’re relevant, can be important to keep in mind. We’ve included a long list of useful resources to remember when dealing with algorithm interviews later on. Keep in mind, however, that most interviewers won’t expect you to memorize algorithms off-the-bat. Don’t be afraid to ask questions during the interview and vocalize your questions throughout the interview process.
DONâT: Forget to test your code logic
Itâs worth saying againâcheck your work. Audibly review the code youâve created. Not only does this help prevent mistakes, but it also helps demonstrate your thought process to your interviewer.
Code behavior extends far beyond algorithms, which this advice is relevant for. Further, for people who have studied algorithms ahead-of-time, it’s likely that another part of their logic is broken, not algorithms.
DONâT: Neglect to discuss the time and space complexity of your approach
Computers donât have infinite resources, and good code economizes on time and space. Even if youâre created a relatively time and space-intensive program for the interview, you can still score points by discussing how youâre optimizing your program given additional resources. Likewise, some portions of development may not have the same requirements of complexity as others. Feel free to highlight when you’re simplifying code for maintainability.
DO: Point out when youâre cutting corners
Sometimesâespecially if youâre running out of timeâyouâll have to finish your program in ways that youâd consider to be less than idea, such as by writing pseudocode. This isnât necessarily a dealbreaker, as long as you tell your interviewer what youâre doing (and again, discuss how youâd improve your process in an actual workplace environment).
DO: Manage whiteboard space
Coderpad contains a helpful Drawing Mode, allowing candidates to sketch out a system or describe technical architecture. When using this, remember to try and make everything legibleâdonât cram elements too close together or make things too small to read, as your interviewer will probably look at your diagram after the interview is concluded.
Coding Review
Now that weâve gotten the doâs and donât of our technical interview cheat sheet out of the way, letâs start reviewing code. A lot of people memorize coding methods for technical interviews, but thatâs not necessary with CoderPad. Thatâs because CoderPad lets you run the code you write during technical interviews, so if you donât memorize something fully, you can go back, check your work, and fix it. This simulates an actual workplace environment a lot more closely than the alternative.
Even though you donât need to fully memorize data structures and algorithms, it still helps to review the fundamentals. Hereâs what you need to know.
Data Structures
Data structures can often be a major part of optimizing and organizing your codebase. While deep-dives on each of these concepts are outside the scope of this article, weâve provided a cheat-sheet for your next technical interview below. Find any that sound interesting? We encourage further reading to master them!
Heap
This kind of binary tree places the smallest value at the top. Helpful when creating priority queues.
Array
A data structure that places items sequentially. Offers fast lookups and appends, but its fixed size requires careful planning.
Dynamic Array
Similar to an ordinary array, except that a dynamic array expands to fit additional elements as needed.
Linked List
A flexibly-sized list in which each item contains a pointer for the next element. Although the list is easy to expand, lookups can take a lot of time.
Queue
A data structure in which each item is stored in the order itâs received.
Stack
A data structure in which the last item to be stored is the first item to be addressed.
Graph
Not an X/Y chart. Graphs are formed by nodes, and the relationships between the nodes are denoted via lines (edges). Good for creating functional diagrams, but difficult to scale.
Trie
Also known as a prefix tree, the trie is designed to store strings in a compact mannerâmostly in cases where youâre storing words with a large number of shared prefixes.
Priority Queue
Distinct from a regular queue. Each item in the queue is given a priority, and higher-priority items are addressed first regardless of when they entered the queue. See also: Heap.
Bloom Filter
A probabilistic data structure that allows administrators to understand whether a set contains a given itemâsometimes.
LRU Cache
Here, LRU stands for âLeast Recently Used.â Itâs a data structure that shows which item has gone unused for longest.
Hash Table
Also known as a hash table, this data structure stores hashed items for quick lookup.
Binary Tree (AKA Binary Search Tree or BST)
A tree in which the nodes to the left are always smaller than the nodes to the right. Balanced trees offer the best performance.
Red-Black Tree
A tree in which the black values remain constant, and the red values may change.
B-Tree
A self-balancing BST variant in which nodes are allowed to have more than two children.
Union Find
Also known as disjoint set structure. Stores non-overlapping sets.
Search
Candidates asked to implement search will most likely encounter one of two search methods in a technical interviewâbreadth first search and depth first search.
Breadth first search (BFS) searches across the tiers of a treeâfirst the top node, then the layer of nodes beneath it, then the nodes beneath that, and so on. The primary advantage of BFS is that it can be used to find the shortest path between any two nodes.
Meanwhile, depth first search (DFS) searches down pathways. Starting at the root of a data tree, it then searches all the way down one branch before moving on to the next. DFS is easy to implement and requires less memory most of the time.
Efficient Sorting
Sorting algorithms are another huge component of creating efficient code. Again, you donât need to memorize the algorithms below, but you should be aware of their time and space complexity.
Selection Sort
The cursor scrolls left to right through a dataset. Every time the right number is smaller than the left number, the right number gets moved to the all the way to the left until the whole data set is sorted. Simple but inefficient.
Insertion Sort
The cursor compares itself to numbers on the left. If smaller, it changes places with the leftmost number and iterates until the data set is sorted.
Merge Sort
Divides the data set in half, then continues dividing until each item is an individual subset. Once this action is complete, the algorithm recombines the data set, sorting as it does.
Quicksort
An algorithm that recursively divides a data set into two halves, placing smaller elements to the left and larger elements to the right, until the whole data set is sorted.
Bubble Sort
Scrolls through a data set comparing every pair of numbers, placing the larger number on the right and the smaller number on the left, until the entire data set is sorted.
Heapsort
A âmax heapâ is created from a data set by comparing parent nodes with child nodes and then swapping them until the largest number is at the root. By deleting the root, swapping the first and last node, and starting the max heap again, youâll eventually sort all numbers from least to greatest.
Types of Algorithms
Lastly, you should know the basic types of algorithms.
A recursive algorithm triggers itself repeatedly until it reaches whatâs known as a base case, which is when the algorithm stops.
An iterative algorithm also loops repeatedly, but only while a certain condition is true. These can be somewhat more efficient than recursive algorithms, but recursive algorithms can solve more complex problems.
A greedy algorithm is given a set of specific criteria and then selects data that matches those criteria. This algorithm can improve the time efficiency of an application, but only in cases where thereâs a small amount of matching data in a large data set.
Asymptotic Notation
Refer back to the âReview time and space constraintsâ section of the Doâs and Donâts above. Asymptotic notation is used to describe how long your algorithm will run when given different inputs. There are three symbols youâll need to remember:
¡ Big O: Under the worst-case scenario, this is how long the algorithm will run
¡ Big Omega (Ί): This is the best-case scenario for runtime
¡ Big Theta (Î): The runtime value is the same in the best-case and worst-case scenarios
In a multi-part algorithm, the runtime is always calculated using its slowest part. Please note: you can always communicate your applications’ performance constraints if you’re unfamiliar with this terminology in a pinch.
Conclusion
Thatâs it! Using the tools, algorithms, and strategies in this technical interview cheat sheet, you should be able to master the application process. Before you begin, make sure to stretch your legs. Check out CoderPad, try out a few coding challenges, and neaten up your roomâitâs time for a technical interview!