Algorithms Interview Questions (Machine Coding) in Front End Interviews
Find the latest version of this page on GreatFrontEnd's Front End Interview Playbook.
Front End Engineers are also Software Engineers after all, and it's expected that Front End Engineers have basic competency in algorithms and data structures. It is reasonable and possible that you will be asked to solve algorithmic questions during your front end interviews.
That said, companies tend to go easy on Front End Engineer candidates when it comes to algorithms questions; you most likely won't get very tough or obscure algorithm problems.
Other than the common data structures like arrays, sets, and maps, trees are a commonly-encountered data structure in front end development because the DOM is a tree, so if you have to prioritize, definitely focus on being good at tree data structures and common traversal algorithms for trees, such as breadth-first search, depth-first search, and level-first traversal.
The Tech Interview Handbook goes into great detail about preparing for Algorithms questions.
Go to Tech Interview Handbook →Free practice questions
GreatFrontEnd
GreatFrontEnd provides free questions for you to practice implementing Data Structures and Algorithms in JavaScript/TypeScript. You can practice implementing common data structures (e.g. Stacks, Queues) and algorithms (e.g. Binary Search, Merge Sort).
Algorithm courses
AlgoMonster
AlgoMonster aims to help you ace the technical interview in the shortest time possible. By Google engineers, AlgoMonster uses a data-driven approach to teach you the most useful key question patterns and has contents to help you quickly revise basic data structures and algorithms. Best of all, AlgoMonster is not subscription-based - pay a one-time fee and get lifetime access.
Grokking the Coding Interview: Patterns for Coding Questions
This course by Design Gurus expands upon the questions on the recommended practice questions but approaches the practicing from a questions pattern perspective, which is an approach I also agree with for learning and have personally used to get better at coding interviews. The course allows you to practice selected questions in Java, Python, C++, JavaScript and also provides sample solutions in those languages. Learn and understand patterns, not memorize answers!
Check out Grokking the Coding Interview
JavaScript courses
If you want more structured algorithms practice which are targeted at JavaScript, check out the following courses.
Course | Platform | Reviews | Duration | Price | Contents |
---|---|---|---|---|---|
Ace the JavaScript Coding Interview | Educative | - | 87h | $ | Basic data structures and algorithms, system design, object-oriented design |
Master the Coding Interview: Data Structures + Algorithms | Udemy | 4.6/5 | 19.5h | $$ | Basic data structures and algorithms, job application, behavioral interview, negotiation |
JavaScript Data Structures and Algorithms Masterclass | Udemy | 4.5/5 | 45h | $ | Basic and advanced data structures and algorithms |