Front End Interview Algorithmic Coding Questions — How to Prepare
Guide to preparing for algorithmic coding questions in front end / web developer interviews — Concepts to know, interview rubrics, and important practice questions.
Algorithmic coding questions are exactly the questions you can find on LeetCode. The traits of algorithmic questions are as follows:
- They aren't specific to the front end domain; they can be solved in most mainstream programming languages.
- Usually accompanied with impractical scenarios. You would not have had to solve such a problem before during real world development.
- Efficiency of the code (time and space) is important and producing the most efficient solution requires solid knowledge of data structures and algorithms.
There are a ton of resources out there which cover algorithmic coding interviews and since they are not specific to front end, we won't go into too much detail on this page. We recommend referring to Tech Interview Handbook as a free resource if you would like to learn more about algorithmic coding interviews.
- Reverse a linked list.
- Check for balanced brackets in a string.
- Determine how many substrings in a string are palindromes.
- Plan your time and tackle topics and questions in order of importance.
- Combine studying and practicing for a single topic.
- Accompany practice with coding interview cheat sheets to internalize the must-dos and must-remembers.
Refer to Tech Interview Handbook's step-by-step guide on how to prepare for algorithmic coding interviews.
Although you can still be asked any algorithmic question, companies tend to go easy on Front End Engineer candidates and probably will not ask questions involving hard topics like dynamic programming.
Since the DOM is a tree, prioritize learning about trees and the various tree traversal algorithms.
|Data Structures||Arrays, Maps, Stacks, Trees, Graphs, Matrix (2D Arrays), Sets|
|Algorithms||Binary Search, Breadth-first Search, Depth-first Search, Topological Sorting, Recursion|
During algorithmic coding interviews, interviewers are evaluating candidates on the following skills:
- Problem Solving: Use a systematic and logical approach to understanding and addressing a problem. Break down the problem into smaller independent problems. Evaluate different approaches and their tradeoffs.
- Technical Competence: Ability to translate solutions into working code and demonstrating a strong understanding of the language being used.
- Communication: Ask questions to clarify details and clearly explain one's approach and considerations.
- Verification: Identify various scenarios to test the code against, including edge cases. Be able to diagnose and fix any issues that arise.
- Aim to write pure functions which have the benefit of reusability and modularity. aka functions which don't rely on state outside of the function and doesn't cause side effects.
- If you have identified the function to require recursion, ask about the input size and how to handle the case of recursion stack overflow. Usually you won't have to handle it but raising this issue is a good signal.