diff --git a/packages/front-end-interview-guidebook/contents/algorithms/en-US.mdx b/packages/front-end-interview-guidebook/contents/algorithms/en-US.mdx new file mode 100644 index 000000000..3fc7bd9db --- /dev/null +++ b/packages/front-end-interview-guidebook/contents/algorithms/en-US.mdx @@ -0,0 +1,118 @@ +--- +title: Front End Interview Algorithmic Coding Questions — How to Prepare +description: 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. Algorithmic questions usually have the following traits: + +- 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 encountered such a problem during real world development. Who ever had to flip a binary tree or count the number of palindromic substrings in a string? +- Efficiency of the code (time and space complexity) is important and producing the most efficient solution requires solid knowledge of data structures and algorithms. + +Although algorithmic coding questions aren't specific to front end, the skills needed to excel in these questions — strong analytical thinking, effective communication, a solid grasp of the common data structures and algorithms, good code hygiene, are still crucial skills good Front End Engineers should possess. Good Front End Engineers are also good Software Engineers and good Software Engineers should have mastery over basic DSA. Hence it's no surprise that many companies still ask algorithmic coding questions during the interview process. Familiarity with data structures and algorithms is also helpful for solving JavaScript coding questions and User Interface coding questions. + +There are a ton of resources out there that 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](https://www.techinterviewhandbook.org) as a free resource if you would like to learn more about algorithmic coding interviews. + +## Examples + +- Reverse a linked list. +- Determine if a string contains balanced brackets. +- Determine how many substrings in a string are palindromes. + +## How to Prepare + +1. Pick a good programming language to use. If you want to save preparation time you should probably stick with JavaScript for algorithmic questions, although note that the JavaScript language doesn't contain certain common useful data structures and algorithms whereas other languages like Python, Java, and C++ do. Personally I use Python for solving algorithmic interview questions. +1. Plan your time and tackle topics and questions in order of importance. +1. Combine studying and practicing for a single topic. +1. 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](https://www.techinterviewhandbook.org/coding-interview-prep/). + +## Important Concepts + +Although you can still be asked any algorithmic question, companies tend to go easier on Front End Engineer candidates and probably will not ask questions involving hard topics like dynamic programming or complex graph algorithms. + +Since the DOM is a tree, prioritize learning about trees and the various tree traversal algorithms. + +| Category | Important Topics | +| --- | --- | +| Data Structures | Arrays, Maps, Stacks, Trees, Graphs, Matrix (2D Arrays), Sets | +| Algorithms | Binary Search, Breadth-first Search, Depth-first Search, Topological Sorting, Recursion | + +## Common JavaScript Operations + +### `Array` + +| Operation | Time Complexity | +| --------------------------- | --------------- | +| `Array.prototype.concat()` | O(m + n) | +| `Array.prototype.every()` | O(n) | +| `Array.prototype.fill()` | O(n) | +| `Array.prototype.filter()` | O(n) | +| `Array.prototype.find()` | O(n) | +| `Array.prototype.pop()` | O(1) | +| `Array.prototype.push()` | O(1) | +| `Array.prototype.reduce()` | O(n) | +| `Array.prototype.reverse()` | O(n) | +| `Array.prototype.shift()` | O(n) | +| `Array.prototype.slice()` | O(n) | +| `Array.prototype.some()` | O(n) | +| `Array.prototype.sort()` | O(nlgn) | +| `Array.prototype.splice()` | O(n) | +| `Array.prototype.unshift()` | O(m + n) | + +* `n` is the number of elements in the array and `m`` is the number of +elements to be added. + +### `Map` + +| Operation | Time Complexity | +| --- | --- | +| `Map.prototype.clear()` | O(n) | +| `Map.prototype.delete()` | O(1) | +| `Map.prototype.entries()` | O(1) because it returns an iterator. Getting all the entries will take O(n) time. | +| `Map.prototype.forEach()` | O(n) | +| `Map.prototype.get()` | O(1) | +| `Map.prototype.has()` | O(1) | +| `Map.prototype.keys()` | O(1) because it returns an iterator. Getting all the keys will take O(n) time. | +| `Map.prototype.set()` | O(1) | +| `Map.prototype.values()` | O(1) because it returns an iterator. Getting all the values will take O(n) time. | + +* `n` is the number of keys in the map. + +### `Set` + +| Operation | Time Complexity | +| --- | --- | +| `Set.prototype.add()` | O(1) | +| `Set.prototype.clear()` | O(n) | +| `Set.prototype.delete()` | O(1) | +| `Set.prototype.entries()` | O(1) because it returns an iterator. Getting all the entries will take O(n) time. | +| `Set.prototype.forEach()` | O(n) | +| `Set.prototype.has()` | O(1) | +| `Set.prototype.keys()` | O(1) because it returns an iterator. Getting all the keys will take O(n) time. | +| `Set.prototype.values()` | O(1) because it returns an iterator. Getting all the values will take O(n) time. | + +* `n` is the number of elements in the set. + +## Algorithmic Coding Interview Rubrics + +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. + +## Useful Tips + +- **Wishful thinking**. JavaScript's standard library doesn't have some useful data structures and algorithms like queue, heap, binary search, which can make your life easier during JavaScript coding interviews. However, you can ask the interviewer if you can pretend such a data structure/algorithm exists and use it directly in your solution without implementing it. +- **Pure functions**. 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. +- **Choose data structures wisely.** Pay attention to your choice of data structures and be aware of the time complexities of the code. Be familiar with the time/space complexities of the basic JavaScript Array, Object, Set, Map operations should you want to use them in your solution. Some of these time/space complexities differ across languages. Don't write code that runs in O(n2) if it can accomplished in O(n) runtime with the use of hash maps. +- **Recursion edge cases**. + - If you have identified that solving the question requires 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. + - Nested deep data structures can have recursive references to itself, which makes certain operations like serialization much trickier. Ask the interviewer if you have to handle such cases. Usually you won't have to handle it but raising this issue is a good signal. + +## Practice Questions + +Currently the best platform to practice algorithmic questions is undeniably LeetCode. However, GreatFrontEnd provides some [practice questions for Data Structures and Algorithms](/questions/js/coding/data-structures-algorithms) where you can practice implementing common data structures ([Stack](/questions/javascript/stack), [Queue](/questions/javascript/queue)) and algorithms ([Binary Search](/questions/javascript/binary-search), [Merge Sort](/questions/javascript/merge-sort)), etc in JavaScript. diff --git a/packages/front-end-interview-guidebook/contents/coding/en-US.mdx b/packages/front-end-interview-guidebook/contents/coding/en-US.mdx new file mode 100644 index 000000000..45ec9f2d4 --- /dev/null +++ b/packages/front-end-interview-guidebook/contents/coding/en-US.mdx @@ -0,0 +1,72 @@ +--- +title: Front End Interview Coding Questions — How to Prepare +description: Guide to preparing for coding questions in front end / web developer interviews — What to expect, coding tips, and 100+ important practice questions. +--- + +Coding interviews is the primary way in which Front End Engineers are being evaluated and can span across multiple rounds and stages of the interviews, hence it is super important to practice for coding interviews. To recap, here are the three types of coding questions you can be asked: + +- **Algorithmic Coding**: Solve tricky algorithmic questions that evaluates your understanding of data structures, algorithms and time complexity. +- **JavaScript Coding**: Implement functions or data structures in JavaScript that are related to front end domain and commonly used during front end development. +- **User Interface Coding**: Build user interfaces (components, widgets, apps) using HTML, CSS, and JavaScript, sometimes even using JavaScript frameworks. + +## Coding Environment + +You could be asked to complete a question by coding using one or more of the following environments: + +### Online Basic Code Editor + +You will be given a URL of an in-browser code editor. The editor either has real-time collaboration capabilities or you will be asked to share your screen. These basic code editors usually only have one pane because the question doesn't need using more than one language to complete, e.g. algorithmic/JavaScript coding questions. You may or may not be allowed to execute your code. An example of online basic code editors is [CoderPad](https://coderpad.io/). + +### Integrated Development Environments (IDE) + +The difference between basic code editor and IDEs is that IDEs allow toggling between multiple files. They can either be in-browser or native apps on your laptop. You will usually be asked to use IDEs when you have to build user interfaces and have to use multiple files or type in more than just a single language. This is the best environment available as it closely resembles how most engineers develop. Subject to interviewer approval, you should be able to: + +- Preview the in-progress UI and see updates live. +- Use the browser console for debugging. +- Use IDE features like syntax highlighting, keyboard shortcuts, autocomplete, intellisense, extensions to boost your productivity. +- Add any necessary 3rd party dependencies. + +Always choose to use an IDE if you are given a choice. + +Examples of online IDEs include [JSFiddle](https://jsfiddle.net/), [CodePen](https://codepen.io/), [CodeSandbox](https://codesandbox.io/), and [StackBlitz](https://stackblitz.com/). + +### Whiteboard + +At certain companies, you could be asked to write all required code on the whiteboard. Imagine writing HTML and CSS on the board without being able to preview it! This is a candidate's nightmare and big tech companies like Google and Meta/Facebook are known to do this during onsite interviews. Most other companies either get you to bring your own laptop and you code on your local IDE or an online code editor/IDE within a web browser. + +--- + +Here's a summary of the various coding environments and what you can do: + +| Environment | Preview | Execute Code | Add 3rd Party Dependencies | +| ------------------ | ------- | ------------ | -------------------------- | +| Online code editor | No | Situational | Usually no | +| IDEs | Yes | Yes | Yes | +| Whiteboard | No | No | No | + +## General Coding Tips + +- Be familiar with the useful editor keyboard shortcuts because time is of essence during interviews and every keystroke counts. Know how to: + - Jump to start/end of line. + - Shift lines up/down. + - Duplicate a line. + - Rename a symbol easily. +- Find out beforehand if you will be coding on your own laptop, a laptop given to you, or the whiteboard. + - If you will be coding on your own laptop and can use your own IDE, ensure that the IDE is functioning properly, Node.js and npm are installed correctly, and that you can run local web servers on `localhost` and access them within your browser. +- Do not be too reliant on preview and execution of code. This suggests to your interviewer that you aren't sure of what you typed and develop via trial-and-error, which is not a positive signal. + +## Type-specific Tips + +Read on for tips for each coding interview type: + +- [Algorithmic Coding](/front-end-interview-guidebook/algorithms) +- [JavaScript Coding](/front-end-interview-guidebook/javascript) +- [User Interface Coding](/front-end-interview-guidebook/user-interface) + +## Practice Questions + +GreatFrontEnd has a long list of [coding questions](/prepare/coding) you can practice and you should definitely take the time to check them out. + +Note that we are intentionally vague in some of the questions and don't present the full requirements in the question. This is to train you to think ahead and consider what possible things you have to take note of when working on the solution. + +However, we'll cover as much ground as possible in the solution. It may be frustrating while reading the solutions to realize that you've missed out some stuff, but it's a learning experience with the ultimate goal of helping you improve. Better to learn during preparation than during actual interviews. diff --git a/packages/front-end-interview-guidebook/contents/javascript/en-US.mdx b/packages/front-end-interview-guidebook/contents/javascript/en-US.mdx new file mode 100644 index 000000000..e8792d1f9 --- /dev/null +++ b/packages/front-end-interview-guidebook/contents/javascript/en-US.mdx @@ -0,0 +1,119 @@ +--- +title: Front End Interview JavaScript Questions — How to Prepare +description: Guide to preparing for JavaScript questions in front end / web developer interviews — Concepts to know, interview rubrics, and 70+ important practice questions. +--- + +The difference between coding JavaScript coding questions vs algorithmic coding questions is that the former is usually specific to the front end domain and it makes the most sense to use JavaScript (or [TypeScript](https://www.typescriptlang.org/)) to complete them. You will also probably need to make use of browser/JavaScript-specific APIs and/or utilize HTML/CSS/JavaScript knowledge. + +These JavaScript coding questions tend to be practical in nature and can come in one or more of the following categories: + +1. Implement standard built-in classes or methods in the JavaScript language. +1. Implement a utility function/class commonly found in popular libraries. + +## Examples + +### JavaScript Standard Built-in Classes/methods + +It may seem redundant to implement standard classes/methods when they are already part of the language. However, browsers inconsistencies used to be a rampant problem and some language APIs are not found in older browsers. Hence developers had to resort to polyfilling, the act of providing modern functionality on older browsers that do not natively support it by implementing these APIs in downloaded JavaScript. Being able to implement these native functions also shows good understanding of front end fundamentals. + +- `Array` methods: [`Array.prototype.map`](/questions/javascript/array-map), [`Array.prototype.reduce`](/questions/javascript/array-reduce), [`Array.prototype.filter`](/questions/javascript/array-filter). +- `Promise` and other `Promise`-related functions: [`Promise.all`](/questions/javascript/promise-all), [`Promise.any`](/questions/javascript/promise-any). +- DOM methods: [`document.getElementsByTagName`](/questions/javascript/get-elements-by-tag-name), [`document.getElementsByClassName`](/questions/javascript/get-elements-by-class-name). + +There's more to these functions than meets the eye. Let's take the innocent `Array.prototype.map` for example. Are you aware that: + +1. It passes 4 arguments to the callback, including the `index` and `this`? +1. It keeps the "holes" in sparse arrays, aka `[1, 2, , 4].map(val => val * val) === [1, 4, , 16]`. +1. The range of elements processed by `map` is set before the first call to _callbackfn_. Elements which are appended to the array after the call to `map` begins will not be visited by _callbackfn_. If existing elements of the array are changed, their value as passed to _callbackfn_ will be the value at the time `map` visits them; elements that are deleted after the call to `map` begins and before being visited are not visited. Source: [`Array.prototype.map` ECMAScript specification](https://tc39.es/ecma262/multipage/indexed-collections.html#sec-array.prototype.map) + +Your implementation doesn't have to handle all of these cases, especially the array mutation one. However, it's a positive signal if you mentioned these cases. The closer your implementation is to the specification, the more senior/experienced you will appear to be. + +### Utility Function/Class from Popular Libraries + +These functions/classes are commonly needed when building software with JavaScript but aren't in the standard language (for now). + +- Lodash/Underscore functions: [`debounce`](/questions/javascript/debounce), [`throttle`](/questions/javascript/throttle), [`flatten`](/questions/javascript/flatten), [`curry`](/questions/javascript/curry), [`cloneDeep`](/questions/javascript/deep-clone). +- jQuery methods: [`jQuery.css`](/questions/javascript/jquery-css), [`jQuery.toggleClass`](/questions/javascript/jquery-class-manipulation). +- Popular libraries: + - [`classnames`](/questions/javascript/classnames) + - `test`/`expect` functions from testing frameworks like [Jest](https://jestjs.io/)/[Mocha](https://mochajs.org/) + - [`Emitter`](/questions/javascript/event-emitter) (which exists as part of Node.js and many third party libraries) + - [Immutable.js](https://immutable-js.com/) + - [Backbone.js](https://backbonejs.org/) + +If you take a look at the source code of these libraries, you might find some of the implementation to be quite complex. This is because there are lots of obscure real world use cases that the library has to support. Similar to the standard functions, you're not expected to handle all of these edge cases within an interview setting but you get points for calling them out. + +## What to do during JavaScript Coding Interviews + +JavaScript coding interviews share a lot of similarities with algorithmic coding interviews. In general, you should: + +1. Find out what platform you are coding on and familiarize yourself with the coding environment: + - The supported editor shortcuts. + - Whether you can execute code. + - Whether you can install 3rd party dependencies. +1. Make your self introduction under a minute. Unless requested, do not take longer than this otherwise you might not have enough time to code. +1. Ask clarifying questions upon receiving the question. Clarify the following: + - Can you use newer JavaScript syntax (ES2016 and beyond)? + - Whether the code is meant to run in the browser or on the server (e.g. Node.js). + - Browser support, as this will affect the browser APIs you can use. +1. Propose a solution to your interviewer. Unlike coding interviews, the focus of JavaScript coding interviews is usually not on complex data structures and algorithms. It's possible and likely you can jump straight to the optimal solution with the best choice of data structures and algorithms. +1. Code out your solution and explain your code to your interviewer while you are coding. +1. After coding, read through your code once and try to spot basic errors like typos, using variables before initializing them, using APIs incorrectly, etc. +1. Outline some basic test cases and some edge cases. Test your code with these cases and determine if your code passes them. If it fails, debug the issue(s) and fix them. +1. Optional: Explain the time/space complexity if the code involved algorithmic optimizations and smart choice of data structures. +1. Explain any tradeoffs you made, cases you explicitly didn't handle, and how you would improve the code if you had more time. +1. The interview might not end here, the interviewer might have follow-up questions for you on this question or give you another question. Be prepared for them. + +## How to Prepare for JavaScript Coding Interviews + +1. Be familiar with HTML, CSS, JavaScript, and DOM concepts by referring to the "Important Concepts" below. The [Quiz section](/front-end-interview-guidebook/quiz) can also be a good start since you might be asked on these concepts in the form of quiz questions during coding. +1. Pick a [study plan](/get-started) and practice the [JavaScript coding questions](/questions/js/coding/utilities) recommended for the selected study plan. It's also alright to study for a certain topic as you are doing the questions. + +## Important Concepts + +| Category | Important Topics | +| --- | --- | +| Data Structures | Arrays, Maps, Stacks, Trees, Sets | +| Algorithms | Binary Search, Breadth-first Search, Depth-first Search, Recursion | +| JavaScript Language | Data types (checking for types, type coercion), Scope, Closures, Callbacks, How `this` keyword works, Object-oriented Programming in JavaScript (prototypes, classes, methods), Arrow functions vs normal functions, Invoking functions via `Function.prototype.apply()`/`Function.prototype.call()`, `Promise`, Handling variadic arguments | +| DOM | DOM traversal, DOM creation, DOM manipulation, Accessing element/node properties, Event delegation | +| Runtime APIs | Timer (`setTimeout`, `setInterval`) | + +## JavaScript Coding Interview Rubrics + +JavaScript coding interviews are similar to algorithmic coding interviews and the way to go about the interviews should be similar. Naturally, there will be some overlaps with algorithmic coding interviews regarding how candidates are evaluated during JavaScript coding interviews. + +- **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. +- **Software Engineering Foundation**: Familiarity with data structures, algorithms, runtime complexity analysis, use of design patterns, design solution with clean abstractions. +- **Domain Expertise**: Understanding of the front end domain and the relevant languages: Browser (DOM and DOM APIs), HTML, CSS, JavaScript, Performance. +- **Communication**: Ask questions to clarify details and clearly explaining 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. + +## Useful Tips + +- **Wishful thinking**. JavaScript's standard library doesn't have some useful data structures and algorithms like queue, heap, binary search, which can make your life easier during JavaScript coding interviews. However, you can ask the interviewer if you can pretend such a data structure/algorithm exists and use it directly in your solution without implementing it. +- **Pure functions**. 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. +- **Choose data structures wisely.** Pay attention to your choice of data structures and be aware of the time complexities of the code. Be familiar with the time/space complexities of the basic JavaScript Array, Object, Set, Map operations should you want to use them in your solution. Some of these time/space complexities differ across languages. Don't write code that runs in O(n2) if it can accomplished in O(n) runtime with the use of hash maps. +- **`this` matters**. If a function accepts a callback function as a parameter, consider how the `this` variable should behave. For many built-in functions, `this` is provided as one of the arguments the callback function is invoked with. +- **Mutations within callback functions.** Beware of callback functions mutating the data structure it is operating on. You probably do not need to handle this case during interviews but you should explicitly mention such cases if it's relevant. +- **Recursion edge cases**. + - If you have identified that solving the question requires 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. + - Nested deep data structures can have recursive references to itself, which makes certain operations like serialization much trickier. Ask the interviewer if you have to handle such cases. Usually you won't have to handle it but raising this issue is a good signal. + +## Best Practice Questions + +From experience, the best JavaScript coding interview questions to practice, as determined by frequency and important concepts covered are: + +- [Debounce](/questions/javascript/debounce) +- [Throttle](/questions/javascript/throttle) +- [Array.prototype.filter](/questions/javascript/array-filter) +- [Promise.all](/questions/javascript/promise-all) +- [Curry](/questions/javascript/curry) +- [Flatten](/questions/javascript/flatten) +- [getElementsByTagName](/questions/javascript/get-elements-by-class-name) +- [Deep Clone](/questions/javascript/deep-clone) +- [Data Selection](/questions/javascript/data-selection) + +GreatFrontEnd has a [comprehensive list of JavaScript coding questions](/questions/js/coding/utilities) that you can practice. There are also automated tests cases you can run your code against to verify the correctness and solutions written by ex-FAANG Senior Engineers. + +Note that we are intentionally vague in some of the questions and don't present the full requirements upfront in the question description. However, we'll cover as much ground as possible in the solution. It may be frustrating while reading the solutions to see that you've missed out some things, but this trains you to think ahead and consider what are the possible areas you have to take note of when working on the solution. Better to find out during practice than during actual interviews. diff --git a/packages/front-end-interview-guidebook/contents/overview/en-US.mdx b/packages/front-end-interview-guidebook/contents/overview/en-US.mdx new file mode 100644 index 000000000..2361bd971 --- /dev/null +++ b/packages/front-end-interview-guidebook/contents/overview/en-US.mdx @@ -0,0 +1,143 @@ +--- +title: Front End Interviews — Definitive Overview and Preparation Guide +description: The definitive guide to front end / web developer interviews from ex-interviewers at FAANG. Find out everything — what to expect, types of interview questions, and how to prepare. +--- + +Front End Interviews are notoriously hard to prepare for. There are many possible interview formats and there isn't a standardized structure across the industry for evaluating front end engineers. Some companies use the same interview process for Front End Engineers as they do for generalist Software Engineers while some companies (e.g. Google and Amazon) do a mix where they have both general software engineering rounds and front end domain-specific rounds. + +In recent years, the industry is gradually shifting away from asking front end interview candidates to solve data structures and algorithms (DSA) questions. Instead, candidates will have to implement common front end library functions and/or build practical UI components/apps which tests their understanding of practical and relevant front end concepts. This is an encouraging trend because unlike most DSA questions, front end interview questions are highly relevant to a front end engineer's day-to-day responsibilities and is a more accurate assessment. + +However, many existing software engineering interview resources are geared towards general software engineering roles instead of Front End Engineers which is a much smaller and niche field; you can barely find any resources on Front End System Design. These factors combined with the breadth of possible domain topics makes preparing for front end interviews a long, tedious, and tough process. + +Fear not! GreatFrontEnd aims to be the best resource for Front End Engineers to ace their front end interviews by being a one-stop platform to equip Front End Engineers with the necessary knowledge and practice. On GreatFrontEnd, readers can: + +1. Learn how to create an [**awesome resume tailored for Front End Engineering job listings**](/front-end-interview-guidebook/resume). +1. Learn **important front end concepts and techniques** that apply to all question types. +1. Prepare for the most common **front end interview question types** (coding, system design, quiz, behavioral). +1. [**Practice questions**](/questions) across the most common front end interview formats along with **high quality solutions** written by ex-FAANG Senior Engineers. +1. Browse suggested [**study plans**](/get-started) and adopt a **structured preparation approach**. + +## Prepare an Awesome Resume + +Your resume is the first opportunity to make an impression on potential employers and is crucial for getting shortlisted at your dream companies. + +If you are facing difficulties getting interviews for jobs you apply to despite having the necessary qualifications, it could be because of your resume. Even highly qualified candidates may not know how to effectively present their accomplishments in their resume and therefore may not get shortlisted. It is important to remember that being underqualified is not always the reason for not being selected; sometimes it is simply a matter of poor presentation and not including the important content. Once you have made it through the resume screening process, your past achievements are secondary and your technical skills become paramount, which can be learned and improved upon. Hence getting your foot in the door by submitting a great resume that represents you well is extremely important. + +While there are existing resources on how to make a good Software Engineering resume such as the [Tech Interview Handbook](https://www.techinterviewhandbook.org/resume/) and [FAANG Tech Leads' Resume Handbook](https://www.faangtechleads.com/resume/handbook), they are general and not specific to Front End Engineers. We have written some [tips on how to tailor your resume for Front End Engineering positions](/front-end-interview-guidebook/resume). + +## Prepare by Question Types + +There are many different formats a front end interview loop can be conducted and each company does things differently. To be efficient in your preparation, you should find out the different interview stages of the companies you are interviewing with, the various rounds within each stage, and the question types you will be asked in each round. + +Each question format has its own challenges and quirks. We'll introduce you to the various formats and you can read the dedicated pages for each type if you'd like to find out more. + +### Coding Questions + +Coding questions will involve writing code (duh!). However, the code you will be required to write and the platforms you will write the code on can vary wildly. You could be asked about: + +1. **Algorithmic Coding**: Solve tricky algorithmic questions that evaluates your understanding of data structures, algorithms and time complexity. [Read about Algorithmic Coding Interviews](/front-end-interview-guidebook/algorithms). +1. **JavaScript Coding**: Implement functions or data structures in JavaScript that are related to front end domain and commonly used during front end development. [Read about JavaScript Coding Interviews](/front-end-interview-guidebook/javascript). +1. **User Interface Coding**: Build user interfaces (components, widgets, apps) using HTML, CSS, and JavaScript, sometimes even using JavaScript frameworks. [Read about User Interface Coding Interviews](/front-end-interview-guidebook/user-interface). + +Companies are trending towards using domain-specific coding questions and less on testing about algorithms and data structures as the former is more relevant for evaluating the core skills needed for front end engineering work. + +### System Design Questions + +System Design interviews are highly open-ended interviews that involve coming up with a software system design to solve a vague problem or scenario. Candidates will have to break down a system into smaller components, draw architecture diagrams, design APIs, dive into certain parts of the system and discuss tradeoffs in order to succeed. + +System design interviews are usually only given to senior level candidates and the required systems can be one of the following types and examples: + +1. **Distributed systems**: Twitter back end, URL shortener +1. **Client applications**: Newsfeed, Photo sharing applications +1. **Complex user interface components**: Autocomplete, Dropdown menu, Modal + +Most of the time, Front End Engineers will be asked to design client applications and complex user interface components as those products are more relevant to front end engineering. + +[Read more about Front End System Design](/front-end-interview-guidebook/system-design) + +### Quiz Questions + +Quiz questions, also known as trivia questions, are short questions meant to test your understanding of the domain. Each question shouldn't take more than a minute or two to answer. + +There usually wouldn't be entire interview rounds just asking you quiz questions, but they could be sprung onto you in the middle of other interview rounds. + +[Read more about Quiz Questions](/front-end-interview-guidebook/quiz). + +## Behavioral Questions/Interviews + +In behavioral interviews, interviewer asks questions about your past behaviors and experiences in order to evaluate your suitability for the job and maturity level. + +The idea behind behavioral interviews is that past behaviors and experiences are good indicators of how someone will behave in the future, so the interviewer will ask questions that are designed to get you to describe specific situations you have faced and how you have dealt with them in order to get a better understanding about you beyond your technical capabilities. + +Behavioral interviews is a large topic on its own and we have [written an entire guidebook on it](/behavioral-interview-guidebook). + +## Typical Hiring Process + +Most companies will have a process resembling: + +1. **Initial screen** + - Recruiter call (Quiz questions may be asked) + - Autograded online assessments or take home projects +2. **Phone screen** + - Coding (Implementing algorithms, JavaScript functions, or building user interfaces) +3. **Full loop** + - Coding round (Implementing algorithms, JavaScript functions, or building user interfaces) + - System design round + - Behavioral round + +The surest way to know what to expect is to ask the company recruiter about their interview process for the role. Good companies will even prepare a detailed document to explain each stage of the interview process along with resources to guide the candidates to prepare for the interviews. For big companies that see a large volume of applicants, there's a good chance that some candidates who have interviewed with them will share their experience on platforms like [Glassdoor](https://www.glassdoor.com/), [Blind](https://www.teamblind.com/), and [Reddit](https://www.reddit.com/). + +**You must know what question types to expect in interviews, otherwise you'll be flying blind and not be able to prepare effectively.** + +### Round-Type Matrix + +The following matrix shows the relevance/likelihood of each question type during each interview round. It's possible that an interview round can include questions from different question types. + +| Round | Quiz | Algorithms | UI | JavaScript | System Design | +| ----------------- | ------ | ---------- | ---- | ---------- | ------------- | +| Online Assessment | Medium | High | High | High | None | +| Recruiter Call | Medium | None | None | None | None | +| Take Home Project | None | None | High | Medium | Medium | +| Coding | Low | High | High | High | Low | +| Behavioral | Low | None | None | None | None | +| System Design | Low | None | Low | None | High | +| Hiring Manager | Low | None | None | None | Low | + +### Question Types Asked by Companies + +Here's a summary of the question types asked by the top US companies. + +| Company | Quiz | Algorithms | JavaScript | UI | System Design | Behavioral | +| :-- | :-: | :-: | :-: | :-: | :-: | :-: | +| Airbnb | No | Yes | Yes | Yes | No | Yes | +| Amazon | Yes | Yes | Yes | Yes | Yes | Yes | +| Apple | Yes | Yes | Yes | Yes | Unknown | Yes | +| ByteDance | Yes | Yes | Yes | Yes | No | Yes | +| Dropbox | No | Yes | Yes | Yes | Yes | Yes | +| Facebook/Meta | Yes | No | Yes | No | Yes | Yes | +| Google | Yes | Yes | Yes | Yes | Yes | Yes | +| LinkedIn | Yes | Yes | Yes | Yes | Unknown | Yes | +| Lyft | No | No | Yes | Yes | Yes | Yes | +| Microsoft | Yes | Yes | Yes | Yes | Yes | Yes | +| Twitter | Yes | Yes | Yes | Yes | Yes | Yes | +| Uber | Unknown | Unknown | Yes | Yes | Unknown | Yes | + +**Question Type Legend** + +- **Quiz**: Closed ended quiz/trivia-style question. +- **Algorithms**: Implement a function that solves an algorithmic problem. It is usually not front end domain specific. +- **JavaScript**: Implement a function/class in JavaScript that is related to the front end domain. +- **UI**: Build a user interface using HTML/CSS/JavaScript. Some companies allow you to use a framework of your choice while some only allow Vanilla JS/certain frameworks. +- **System Design**: Design a system and discuss the architecture and its components. +- **Behavioral**: Discuss specific your experience working with others and how you handled difficult scenarios. + +## Study and Practice + +Read on to find out how to prepare for the following front end interview formats/questions types: + +- [Coding Questions](/front-end-interview-guidebook/coding) + - [Algorithmic Questions](/front-end-interview-guidebook/algorithms) + - [JavaScript Questions](/front-end-interview-guidebook/javascript) + - [User Interface Questions](/front-end-interview-guidebook/user-interface) +- [System Design Questions](/front-end-interview-guidebook/system-design) +- [Quiz Questions](/front-end-interview-guidebook/quiz) diff --git a/packages/front-end-interview-guidebook/contents/quiz/en-US.mdx b/packages/front-end-interview-guidebook/contents/quiz/en-US.mdx new file mode 100644 index 000000000..48c5b9181 --- /dev/null +++ b/packages/front-end-interview-guidebook/contents/quiz/en-US.mdx @@ -0,0 +1,56 @@ +--- +title: Front End Interview Quiz Questions — How to Prepare +description: Guide to preparing for quiz-style front end interview questions — What to expect, concepts to learn, and 100+ important practice questions. +--- + +Quiz questions, also known as trivia questions, are short close-ended questions meant to test your understanding of the domain. Each question shouldn't take more than a minute or two to answer, however, further discussions can be spawned from your answers. Hence it's important to have good understanding of the concepts behind the answers you give and not blindly memorize and regurgitating. + +## Examples + +- [Explain what the CSS box model is.](/questions/quiz/explain-your-understanding-of-the-box-model-and-how-you-would-tell-the-browser-in-css-to-render-your-layout-in-different-box-models) +- [What is CSS selector specificity?](/questions/quiz/what-is-css-selector-specificity-and-how-does-it-work) +- [What are the differences between variables created using `let`, `var` or `const`?](/questions/quiz/what-are-the-differences-between-variables-created-using-let-var-or-const) +- [Explain how `this` works in JavaScript.](/questions/quiz/explain-how-this-works-in-javascript) + +Beyond getting asked on front end fundamentals (HTML, CSS, JavaScript), you could be asked on framework-specific questions if you claim to have knowledge of them (either verbally during interviews or when interviewers go through your resume): + +- What problems do X technology solve? +- What are the advantages and disadvantages of X technology? +- How does X technology work under the hood? +- What does X technology compare with Y technology? + +## Relevant Rounds + +There usually wouldn't be interview rounds just asking you solely quiz questions. However, interviewers could spring questions onto you while in the middle of interviews focused on other formats like coding and system design. + +- **Recruiter call**: Due to the close-ended nature of quiz questions, they can even be asked by non-technical personnel such as recruiters. Thankfully, non-engineers are probably not able to evaluate the accuracy and are probably just matching the keywords in your answers with the solutions handed to them. In the worst scenarios, you can probably still pass by replying something that sounds sensible and includes the right keywords. +- **Online assessment**: While uncommon, it is possible that you are given multiple choice questions and have to pick a correct answer from them. +- **Coding round**: Interviewers might ask you a few quiz questions before any coding has started to warm you up. Or while you are coding and explaining your code, the interviewer might want to dive deeper into something you just mentioned. Hence it's best to have a good understanding of everything you say/do. +- **System design round**: Like in the coding round, the interviewer can ask further questions on the things you say. +- **Hiring manager round**: Hiring manager are rounds are usually not meant to be technical but they could be going over your resume and asking you related quiz questions on technologies/projects mentioned in your resume. + +As you can see, you can be expect to be asked quiz questions in almost every possible round. Be prepared at all times. + +## Important Concepts + +| Area | Topics | +| --- | --- | +| HTML | Semantic HTML, Block vs inline elements, `
`, ` +``` + +**jQuery refresher**: jQuery UI's `slider()` method (constructor) takes in a JavaScript object which serves as customization options. Doing `$('#slider')` selects the `