website: add sidebar structure

pull/268/head
Yangshun 3 years ago
parent 6e47fceef4
commit 7eccc0db17

@ -21,14 +21,14 @@ Not everyone has the time to do a few hundred LeetCode questions. Here are _free
Besides the usual algorithm questions, other **awesome** stuff includes:
- [Best practice questions](https://techinterviewhandbook.org/best-practice-questions/) for coding interviews
- [How to prepare](https://www.techinterviewhandbook.org/coding-interview/) for coding interviews
- [Coding interview cheatsheet](https://www.techinterviewhandbook.org/cheatsheet/) - Straight-to-the-point Do's and Don'ts
- [Algorithm tips](https://www.techinterviewhandbook.org/algorithms/introduction/) categorized by topic
- [Best practice questions](https://www.techinterviewhandbook.org/coding-interview-study-plan/) for coding interviews
- [How to prepare](https://www.techinterviewhandbook.org/coding-interview-prep/) for coding interviews
- [Coding interview best practices](https://www.techinterviewhandbook.org/coding-interview-best-practices/) - Straight-to-the-point Do's and Don'ts
- [Algorithm cheatsheets and tips](https://www.techinterviewhandbook.org/algorithms/study-cheatsheet/) categorized by topic
- [Interview formats](https://www.techinterviewhandbook.org/interview-formats/) of the top tech companies
- [Step-by-step resume guide](https://www.techinterviewhandbook.org/resume/guide/) to prepare a FAANG-ready resume
- [Behavioral questions](https://www.techinterviewhandbook.org/behavioral-questions/) asked by the top tech companies
- [Good questions to ask your interviewers](https://www.techinterviewhandbook.org/questions-to-ask/) at the end of the interviews
- [Step-by-step resume guide](https://www.techinterviewhandbook.org/resume/) to prepare a FAANG-ready resume
- [Behavioral questions](https://www.techinterviewhandbook.org/behavioral-interview-questions/) asked by the top tech companies
- [Good questions to ask your interviewers](https://www.techinterviewhandbook.org/final-questions/) at the end of the interviews
- [Front end interview preparation](https://www.frontendinterviewhandbook.com)
Help from you in contributing content would be very much appreciated!

@ -1,5 +1,5 @@
# Algorithms
The contents have been moved to the [website](https://www.techinterviewhandbook.org/algorithms/introduction).
The contents have been moved to the [website](https://www.techinterviewhandbook.org/algorithms/study-cheatsheet).
<!-- TODO: Remove in future -->

File diff suppressed because it is too large Load Diff

@ -0,0 +1,42 @@
import React from 'react';
import QuestionGroups from './QuestionGroups.json';
export default function QuestionList() {
return (
<div className="padding-vert--lg">
{Object.entries(QuestionGroups).map(
([sectionTitle, questions], index) => (
<div className="margin-bottom--lg" key={sectionTitle}>
<h4>Week {index + 5}</h4>
<table>
<thead>
<tr>
<th>Problem</th>
<th>Difficulty</th>
<th>Duration</th>
</tr>
</thead>
<tbody>
{questions.map((question) => (
<tr key={question.slug}>
<td>
<a
href={question.url}
target="_blank"
rel="noopener noreferer">
{question.title}
</a>
</td>
<td>{question.difficulty}</td>
<td>{question.duration} mins</td>
</tr>
))}
</tbody>
</table>
</div>
),
)}
</div>
);
}

@ -4,7 +4,7 @@ AlgoMonster aims to help you ace the technical interview **in the shortest time
### [Grokking the Coding Interview: Patterns for Coding Questions](https://www.educative.io/courses/grokking-the-coding-interview?aff=x23W)
This course on Educative 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!** [**Join today for a 10% discount →**](https://www.educative.io/courses/grokking-the-coding-interview?aff=x23W)
This course on Educative 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 along with step-by-step visualizations. **Learn and understand patterns, not memorize answers!** [**Join today for a 10% discount →**](https://www.educative.io/courses/grokking-the-coding-interview?aff=x23W)
### [Master the Coding Interview: Data Structures + Algorithms](https://fxo.co/DQpY)

@ -1,6 +1,17 @@
---
id: array
title: Array
title: Array cheatsheet for coding interviews
description: Array study guide for coding interviews, including practice questions, techniques, time complexity, and recommended resources
keywords:
[
array coding interview study guide,
array tips for coding interviews,
array practice questions,
array useful techniques,
array time complexity,
array recommended study resources,
]
sidebar_label: Array
toc_max_heading_level: 2
---

@ -1,6 +1,17 @@
---
id: binary
title: Binary
title: Binary cheatsheet for coding interviews
description: binary study guide for coding interviews, including practice questions, techniques, time complexity, and recommended resources
keywords:
[
binary coding interview study guide,
binary tips for coding interviews,
binary practice questions,
binary useful techniques,
binary time complexity,
binary recommended study resources,
]
sidebar_label: Binary
toc_max_heading_level: 2
---

@ -1,6 +1,17 @@
---
id: dynamic-programming
title: Dynamic programming
title: Dynamic programming cheatsheet for coding interviews
description: Dynamic programming study guide for coding interviews, including practice questions, techniques, time complexity, and recommended resources
keywords:
[
dynamic programming coding interview study guide,
dynamic programming tips for coding interviews,
dynamic programming practice questions,
dynamic programming useful techniques,
dynamic programming time complexity,
dynamic programming recommended study resources,
]
sidebar_label: Dynamic programming
toc_max_heading_level: 2
---

@ -1,6 +1,17 @@
---
id: geometry
title: Geometry
title: Geometry cheatsheet for coding interviews
description: Geometry study guide for coding interviews, including practice questions, techniques, time complexity, and recommended resources
keywords:
[
geometry coding interview study guide,
geometry tips for coding interviews,
geometry practice questions,
geometry useful techniques,
geometry time complexity,
geometry recommended study resources,
]
sidebar_label: Geometry
toc_max_heading_level: 2
---

@ -1,6 +1,17 @@
---
id: graph
title: Graph
title: Graph cheatsheet for coding interviews
description: Graph study guide for coding interviews, including practice questions, techniques, time complexity, and recommended resources
keywords:
[
graph coding interview study guide,
graph tips for coding interviews,
graph practice questions,
graph useful techniques,
graph time complexity,
graph recommended study resources,
]
sidebar_label: Graph
toc_max_heading_level: 2
---

@ -1,6 +1,17 @@
---
id: hash-table
title: Hash Table
title: Hash table cheatsheet for coding interviews
description: Hash table study guide for coding interviews, including practice questions, techniques, time complexity, and recommended resources
keywords:
[
hash table coding interview study guide,
hash table tips for coding interviews,
hash table practice questions,
hash table useful techniques,
hash table time complexity,
hash table recommended study resources,
]
sidebar_label: Hash table
toc_max_heading_level: 2
---

@ -1,6 +1,17 @@
---
id: heap
title: Heap
title: Heap cheatsheet for coding interviews
description: Heap study guide for coding interviews, including practice questions, techniques, time complexity, and recommended resources
keywords:
[
heap coding interview study guide,
heap tips for coding interviews,
heap practice questions,
heap useful techniques,
heap time complexity,
heap recommended study resources,
]
sidebar_label: Heap
toc_max_heading_level: 2
---

@ -1,6 +1,17 @@
---
id: interval
title: Interval
title: Interval cheatsheet for coding interviews
description: Interval study guide for coding interviews, including practice questions, techniques, time complexity, and recommended resources
keywords:
[
interval coding interview study guide,
interval tips for coding interviews,
interval practice questions,
interval useful techniques,
interval time complexity,
interval recommended study resources,
]
sidebar_label: Interval
toc_max_heading_level: 2
---

@ -1,6 +1,17 @@
---
id: linked-list
title: Linked list
title: Linked list cheatsheet for coding interviews
description: Linked list study guide for coding interviews, including practice questions, techniques, time complexity, and recommended resources
keywords:
[
linked list coding interview study guide,
linked list tips for coding interviews,
linked list practice questions,
linked list useful techniques,
linked list time complexity,
linked list recommended study resources,
]
sidebar_label: Linked list
toc_max_heading_level: 2
---

@ -1,6 +1,17 @@
---
id: math
title: Math
title: Math cheatsheet for coding interviews
description: Math study guide for coding interviews, including practice questions, techniques, time complexity, and recommended resources
keywords:
[
math coding interview study guide,
math tips for coding interviews,
math practice questions,
math useful techniques,
math time complexity,
math recommended study resources,
]
sidebar_label: Math
toc_max_heading_level: 2
---

@ -1,6 +1,17 @@
---
id: matrix
title: Matrix
title: Matrix cheatsheet for coding interviews
description: Matrix study guide for coding interviews, including practice questions, techniques, time complexity, and recommended resources
keywords:
[
matrix coding interview study guide,
matrix tips for coding interviews,
matrix practice questions,
matrix useful techniques,
matrix time complexity,
matrix recommended study resources,
]
sidebar_label: Matrix
toc_max_heading_level: 2
---

@ -1,6 +1,17 @@
---
id: queue
title: Queue
title: Queue cheatsheet for coding interviews
description: Queue study guide for coding interviews, including practice questions, techniques, time complexity, and recommended resources
keywords:
[
queue coding interview study guide,
queue tips for coding interviews,
queue practice questions,
queue useful techniques,
queue time complexity,
queue recommended study resources,
]
sidebar_label: Queue
toc_max_heading_level: 2
---

@ -1,6 +1,17 @@
---
id: recursion
title: Recursion
title: Recursion cheatsheet for coding interviews
description: Recursion study guide for coding interviews, including practice questions, techniques, time complexity, and recommended resources
keywords:
[
recursion coding interview study guide,
recursion tips for coding interviews,
recursion practice questions,
recursion useful techniques,
recursion time complexity,
recursion recommended study resources,
]
sidebar_label: Recursion
toc_max_heading_level: 2
---

@ -1,6 +1,17 @@
---
id: sorting-searching
title: Sorting and searching
title: Sorting and searching cheatsheet for coding interviews
description: Sorting and searching study guide for coding interviews, including practice questions, techniques, time complexity, and recommended resources
keywords:
[
sorting searching coding interview study guide,
sorting searching tips for coding interviews,
sorting searching practice questions,
sorting searching useful techniques,
sorting searching time complexity,
sorting searching recommended study resources,
]
sidebar_label: Sorting and searching
toc_max_heading_level: 2
---

@ -1,6 +1,17 @@
---
id: stack
title: Stack
title: Stack cheatsheet for coding interviews
description: Stack study guide for coding interviews, including practice questions, techniques, time complexity, and recommended resources
keywords:
[
stack coding interview study guide,
stack tips for coding interviews,
stack practice questions,
stack useful techniques,
stack time complexity,
stack recommended study resources,
]
sidebar_label: Stack
toc_max_heading_level: 2
---

@ -1,6 +1,17 @@
---
id: string
title: String
title: String cheatsheet for coding interviews
description: String study guide for coding interviews, including practice questions, techniques, time complexity, and recommended resources
keywords:
[
string coding interview study guide,
string tips for coding interviews,
string practice questions,
string useful techniques,
string time complexity,
string recommended study resources,
]
sidebar_label: String
toc_max_heading_level: 2
---

@ -1,18 +1,53 @@
---
id: algorithms-introduction
title: Algorithms tips
description: Here are practical tips for each algorithm topic and data structure which appear frequently in coding interviews
id: study-cheatsheet
title: Data structures and algorithms study cheatsheets for coding interviews
description: Study guides for coding interviews with focus on data structures and algorithms, including practice questions, techniques, time complexity and recommended resources
keywords: [coding interview algorithms, coding interview data structures]
sidebar_label: Introduction
slug: introduction
---
import InDocAd from '../\_components/InDocAd';
This section dives deep into practical knowledge and techniques for algorithms and data structures which appear frequently in algorithm interviews. The more techniques you have in your arsenal, the higher the chances of passing the interview. They may lead you to discover corner cases you might have missed out or even lead you towards the optimal approach!
## What is this
For each topic, a brief introduction is given, along with language-specific libraries to use, time complexities cheatsheet, things to look out for during interviews, corner cases, useful techniques, and recommended resources to help you master the topic. Lastly, there is a list of recommended common questions to practice which in my opinion is highly valuable for mastering the core concepts for the topic.
This section dives deep into practical knowledge and techniques for algorithms and data structures which appear frequently in algorithm interviews. The more techniques you have in your arsenal, the higher the chances of passing the interview. They may lead you to discover corner cases you might have missed out or even lead you towards the optimal approach!
If you are interested in how data structures are implemented, check out [Lago](https://github.com/yangshun/lago), a Data Structures and Algorithms library for JavaScript.
## Contents of each study guide
For each topic, you can expect to find:
1. A brief overview
1. Learning resources
1. Language-specific libraries to use
1. Time complexities cheatsheet
1. Things to look out for during interviews
1. Corner cases
1. Useful techniques vRecommended questions to practice
## Study guides list
Here is the list of data structures and algorithms you should prepare for coding interviews and their corresponding study guides:
| Topic | Priority |
| ---------------------------------------------------------- | -------- |
| [Array](./algorithms/array.md) | High |
| [String](./algorithms/string.md) | High |
| [Hash Table](./algorithms/hash-table.md) | Mid |
| [Recursion](./algorithms/recursion.md) | Mid |
| [Sorting and searching](./algorithms/sorting-searching.md) | High |
| [Matrix](./algorithms/matrix.md) | High |
| [Linked List](./algorithms/linked-list.md) | Mid |
| [Queue](./algorithms/queue.md) | Mid |
| [Stack](./algorithms/stack.md) | Mid |
| [Tree](./algorithms/tree.md) | High |
| [Graph](./algorithms/graph.md) | High |
| [Heap](./algorithms/heap.md) | Mid |
| [Trie](./algorithms/trie.md) | Mid |
| [Interval](./algorithms/interval.md) | Mid |
| [Dynamic programming](./algorithms/dynamic-programming.md) | Low |
| [Binary](./algorithms/binary.md) | Low |
| [Math](./algorithms/math.md) | Low |
| [Geometry](./algorithms/geometry.md) | Low |
## General interview tips

@ -1,6 +1,17 @@
---
id: tree
title: Tree
title: Tree cheatsheet for coding interviews
description: Tree study guide for coding interviews, including practice questions, techniques, time complexity, and recommended resources
keywords:
[
tree coding interview study guide,
tree tips for coding interviews,
tree practice questions,
tree useful techniques,
tree time complexity,
tree recommended study resources,
]
sidebar_label: Tree
toc_max_heading_level: 2
---

@ -1,6 +1,17 @@
---
id: trie
title: Trie
title: Trie cheatsheet for coding interviews
description: Trie study guide for coding interviews, including practice questions, techniques, time complexity, and recommended resources
keywords:
[
trie coding interview study guide,
trie tips for coding interviews,
trie practice questions,
trie useful techniques,
trie time complexity,
trie recommended study resources,
]
sidebar_label: Trie
toc_max_heading_level: 2
---

@ -0,0 +1,201 @@
---
id: behavioral-interview-questions
title: The 30 most common Software Engineer behavioral interview questions
description: How to prepare for Software Engineer behavioral interviews
keywords:
[
software engineer behavioral interview questions,
software engineering behavioral questions,
software developer behavioral interview questions,
software engineer behavioral questions,
amazon software engineer behavioral interview questions,
behavioral interview software engineer,
how to prepare for behavioral interview software engineer,
]
sidebar_label: Most common behavioral questions to prepare
---
In the software engineer interview process, behavioral interviews may seem so much more varied and unstructured as compared to technical interviews. However, in most cases, the interviewer is actually just trying to get to know you better and there's always a set of common questions that need to be asked to achieve that.
## Most commonly asked behavioral questions across top tech companies
Here are some of the 30 most commonly asked behavioral interview questions across top tech companies:
1. Why do you want to work for X company?
1. Why do you want to leave your current/last company?
1. What are you looking for in your next role?
1. Tell me about a time when you had a conflict with a co-worker.
1. Tell me about a time in which you had a conflict and needed to influence somebody else.
1. What project are you currently working on?
1. What is the most challenging aspect of your current project?
1. What was the most difficult bug that you fixed in the past 6 months?
1. How do you tackle challenges? Name a difficult challenge you faced while working on a project, how you overcame it, and what you learned.
1. What are you excited about?
1. What frustrates you?
1. Imagine it is your first day here at the company. What do you want to work on? What features would you improve on?
1. What are the most interesting projects you have worked on and how might they be relevant to this company's environment?
1. Tell me about a time you had a disagreement with your manager.
1. Talk about a project you are most passionate about, or one where you did your best work.
1. What does your best day of work look like?
1. What is something that you had to push for in your previous projects?
1. What is the most constructive feedback you have received in your career?
1. What is something you had to persevere at for multiple months?
1. Tell me about a time you met a tight deadline.
1. If this were your first annual review with our company, what would I be telling you right now?
1. Time management has become a necessary factor in productivity. Give an example of a time-management skill you've learned and applied at work.
1. Tell me about a problem you've had getting along with a work associate.
1. What aspects of your work are most often criticized?
1. How have you handled criticism of your work?
1. What strengths do you think are most important for _your job position_?
1. What words would your colleagues use to describe you?
1. What would you hope to achieve in the first six months after being hired?
1. Tell me why you will be a good fit for the position.
## Airbnb Software Engineer behavioral interview questions
While loving to travel or appreciating Airbnb's growth may be good answers, try to demonstrate the deep connection you have with the product.
- What does "belong anywhere" mean to you?
- What large problems in the world would you solve today?
- Why do you like Airbnb?
- If you had an unlimited budget and you could buy one gift for one person, what would you buy and who would you buy it for?
- If you had an unlimited budget and you could go somewhere, where would you go?
- Share one of your trips with us.
- What is the most challenging project in or out of school that you have worked on in the last 6 months.
- What is something that you don't want from your last internship/job?
- Give me an example of when you've been a good host.
- What's something you'd like to remove from the Airbnb experience?
- What is something new that you can teach your interviewer in a few minutes?
- Tell me about why you want to work here.
- What is the best gift you have ever given or received?
- Tell me about a time you were uncomfortable and how you dealt with it.
- Explain a project that you worked on recently.
- What do you think of Airbnb?
- Tell me something about yourself and why you'd be a good fit for the position.
- Name a situation where you were impressed by a company's customer service.
- How did you work with senior management on large projects as well as multiple internal teams?
- Tell me about a time you had to give someone terrible news.
- If you were a gerbil, which gerbil would you be?
- What excites you about the company?
- How does Airbnb impact our guests and hosts?
- What part of our mission resonates the most with you?
Source: [Glassdoor](https://www.glassdoor.com/Interview/Airbnb-Interview-Questions-E391850.htm)
## Amazon Software Engineer behavioral interview questions
- How do you deal with a failed deadline?
- Why do you want to work for Amazon?
- Tell me about a situation where you had a conflict with a teammate.
- In your professional experience have you worked on something without getting approval from your manager?
- Tell me a situation where you would have done something differently from what you actually did.
- What is the most exceedingly bad misstep you've made at any point?
- Describe what Human Resources means to you.
- How would you improve Amazon's website?
Source: [Glassdoor](https://www.glassdoor.com/Interview/Amazon-Interview-Questions-E6036.htm)
## ByteDance Software Engineer behavioral interview questions
- What do you know about &lt;role&gt; and why?
- Take me through a product you launched from start to end
- What's the biggest achievement in your previous projects?
- Tell me about a recent failure and what you learned from the experience
- Why do you want to work at ByteDance?
- What makes you a good fit for this position?
- What excites you about the role?
Source: [Glassdoor](https://www.glassdoor.sg/Interview/ByteDance-Interview-Questions-E1624196.htm)
## Dropbox Software Engineer behavioral interview questions
- Talk about your favorite project.
- If you were hired here what would you do?
- State an experience about how you solved a technical problem. Be specific about the diagnosis and process.
Source: [Glassdoor](https://www.glassdoor.com/Interview/Dropbox-Interview-Questions-E415350.htm)
<InDocAd />
## Hired Software Engineer behavioral interview questions
- Tell me about yourself.
- What is your biggest strength and area of growth?
- Why are you interested in this opportunity?
- What are your salary expectations?
- Why are you looking to leave your current company?
- Tell me about a time your work responsibilities got a little overwhelming. What did you do?
- Give me an example of a time when you had a difference of opinion with a team member. How did you handle that?
- Tell me about a challenge you faced recently in your role. How did you tackle it? What was the outcome?
- Where do you want to be in five years?
- Tell me about a time you needed information from someone who wasn't responsive. What did you do?
Source: [Glassdoor](https://hired.com/blog/candidates/10-top-interview-questions-how-to-answer/)
## Lyft Software Engineer behavioral interview questions
- Tell me about your most interesting/challenging project to date.
- Why Lyft? What are you looking for in the next role?
Source: [Glassdoor](https://www.glassdoor.com/Interview/Lyft-Interview-Questions-E700614.htm)
## Palantir Software Engineer behavioral interview questions
- **What is something 90% of people disagree with you about?**
- **What is broken around you?**
- How do you deal with difficult coworkers? Think about specific instances where you resolved conflicts.
- How did you win over the difficult employees?
- Tell me about an analytical problem that you have worked on in the past.
- What are your three strengths and three weaknesses?
- If you were in charge of picking projects for Palantir, what problem would you try to solve?
- What are some of the best and worst things about your current company?
- What would your manager say about you?
- Describe Palantir to your grandmother.
- Teach me something you've learned.
- Tell me a time when you predicted something.
- If your supervisors were to rate you on a scale of 1-10, what would they rate you?
- What was the most fun thing you did recently?
- Tell me the story of how you became who you are today and what made you apply to Palantir.
Source: [Glassdoor](https://www.glassdoor.com/Interview/Palantir-Technologies-Interview-Questions-E236375.htm)
<InDocAd/>
## Slack Software Engineer behavioral interview questions
- Tell me something about your internship.
- Why do you want to join Slack?
- Tell me about your past projects.
- Explain me your toughest project and the working architecture.
- Apart from technical knowledge, what did you learn during your internship?
- If someone has a different viewpoint to do a project like different programming language, how would handle this situation?
- What are your most interesting subjects and why?
- Did you find any bugs in Slack?
- What is your favorite feature and why?
Source: [Glassdoor](https://www.glassdoor.com/Interview/Slack-Interview-Questions-E950758.htm)
## Stack Overflow Software Engineer behavioral interview questions
- What have you built?
- What is the hardest technical problem you have run into?
- How did you solve it?
- Where do you see yourself in 5 years?
- Why do you want to work here?
- How do you handle disagreements with co-workers?
Source: [Glassdoor](https://hired.com/blog/candidates/10-top-interview-questions-how-to-answer/)
## Stripe Software Engineer behavioral interview questions
- How do you stay up to date with the latest technologies?
- Explain a project that you worked on recently that was difficult.
- Where do you see yourself in five years?
Source: [Glassdoor](https://www.glassdoor.com/Interview/Stripe-Interview-Questions-E671932.htm)
## Twitter Software Engineer behavioral interview questions
- What would your previous boss say your biggest strength was?
Source: [Glassdoor](https://www.glassdoor.com/Interview/Twitter-Interview-Questions-E100569.htm)

@ -1,30 +1,102 @@
---
id: behavioral-interview
title: Behavorial interview
sidebar_label: Overview
title: 'Behavioral interviews for Software Engineers: How to prepare'
description: How to prepare for Software Engineer behavioral interviews
keywords:
[
software engineer behavioral interview prep,
software developer behavioral interview prep,
behavioral interview software engineer,
how to prepare for behavioral interview software engineer,
google behavioral interview,
facebook behavioral interview,
amazon behavioral interview,
microsoft behavioral interview,
]
sidebar_label: 'Behavioral interviews: How to prepare'
---
Succeeding in an engineering career involves more than just technical skills. Behavioral interviews (aka people skills) become more important as an engineer becomes more senior. Senior engineers should have the ability to lead and influence, resolve conflicts, anticipate risks, plan the roadmap, and more.
## What are behavioral interviews
Succeeding in an engineering career involves more than just technical skills. People skills become more important as an engineer becomes more senior. Senior engineers should have the ability to lead and influence, resolve conflicts, anticipate risks, plan the roadmap, and more.
Hiring a talented engineer that cannot work with others can ultimately be a net deficit for companies. Companies don't want to hire [brilliant jerks](http://www.brendangregg.com/blog/2017-11-13/brilliant-jerks.html). The company is better off not hiring a very talented engineer who refuses to work with others or causes an entire team to be unproductive. Companies want to hire the right person that will work well with the existing employees and help the team and company achieve greater heights, and behavioral interviews are one way of determining if someone will be good to work with from a non-technical standpoint.
## Most companies evaluate behavioral skills
Typically, behavioral interview questions can be split into several types:
1. Getting to know your career preferences, ambitions and plans
1. Discuss details of experiences or projects written in your resume
1. "Tell me about a time where you" type of questions where you describe how you demonstrated certain traits or responded to a situation
## The importance of behavioral interviews
Companies value behavioral skills and do evaluate candidates on them. At the time of writing, Facebook has one round (out of four) dedicated to behavioral interviews. Airbnb has TWO rounds (out of six) dedicated to behavioral interviews/company fit. Lyft has one round (out of five) dedicated to past experience and situational questions by a hiring manager.
## What Facebook looks for in behavioral interviews
## How are behavioral interviews evaluated
Unlike technical interviews, behavioral interviews have a lot more variance in terms of evaluation criteria. However, most top tech companies use their company values to evaluate candidates. Interviewers typically have to fill in a section evaluating how a candidate has displayed behaviors in line with company values. It is for this reason that you should search up a company's culture and values and ensure that you embody them within your answers. You'd also find it useful to speak with one of your connections currently working at the company you are applying for to find out more about which values are typically valued in the team.
Some examples of common values evaluated are:
- **Empathy** - Puts themselves in the shoes of others and tries to understand others' reasoning
- **Proactivity and willingness to wear multiple hats** - Steps up when the situation requires it
- **Project management** - Able to orchestrate multiple work streams to meet timelines and unblock tasks
- **Conflict management** - Able to manage conflict between themselves and or between other parties, by explaining and ensuring no hard feelings remain
## How to prepare for behavioral interviews
1. Learn the STAR answer format
1. Prepare your answers to commonly asked questions
1. Prepare experiences to showcase fit to the company's culture / core values
1. Try out mock behavioral interviews
1. Use structured courses
### 1. Learn the STAR answer format
The [STAR](https://en.wikipedia.org/wiki/Situation,_task,_action,_result) format is a framework to help you organize answers to behavioral questions - especially ones requiring you to discuss previous experiences
- **Situation** - The interviewer wants you to present a recent challenge and situation which you found yourself in
- **Task** - What were you required to achieve? The interviewer will be looking to see what you were trying to achieve from the situation. Some performance development methods use "Target" rather than "Task". Job interview candidates who describe a "Target" they set themselves instead of an externally imposed "Task" emphasize their own intrinsic motivation to perform and to develop their performance
- **Action** - What did you do? The interviewer will be looking for information on what you did, why you did it, and what the alternatives were
- **Results** - What was the outcome of your actions? What did you achieve through your actions and did you
#### Example of how to apply STAR to a behavioral interview question
Here's an example of how the STAR format can be used to answer the question: "Tell me about a time in which you had a conflict and needed to influence somebody else".
#### Situation
> "I was the team lead of a school project about building a social network mobile web app. Our designer's midterms were approaching and didn't have time to produce the mockups. Our front-end person was rushing him for the mockups so that he could proceed with his work, and that was stressing the designer out. The atmosphere in the team was tense."
#### Task
> "As the team lead, I had to resolve the tension between the front-end developer and the designer so that the team could work together peacefully and complete the project on time."
#### Action
> "I spoke to the front-end developer to ask him why he was rushing the designer for the designs. He said that he wanted the designs early because it would be a waste of time rebuilding if the designer designed something different eventually. I explained to him that the midterm dates were out of the designer's control and we had to be more understanding about each other's schedules. I spoke to the designer to get a rough idea of what he had in mind and asked him when he could commit to producing the high-fidelity designs. He replied that he could start on them as soon as his midterms were over. I explained to him why the front-end developer was pushing him for the mockups, and that the front-end developer had no ill intentions and simply wanted the project to succeed. As someone with some experience in UI/UX design, I came up with wireframe mocks, ran them by the designer for approval, then passed them to the front-end developer to start building. I encouraged the front-end developer to use placeholders and not be too concerned about the details for now. We could build the non-UI parts first (authentication, hook up with APIs) and tweak pixels and add polish later on. The front-end developer agreed and went ahead with the approach. I explained to the front-end developer that the designer will pass us the mockups after his midterm, by &lt;DATE&gt;."
#### Result
> "When our designer ended midterms, he came back with beautiful mockups that fit well into the wireframes. Our front-end developer implemented them with great care to detail. We ended up scoring top marks for the project and became a great team."
### 2. Prepare your answers to commonly asked questions
The next natural step is to start preparing your answers for commonly asked behavioral interview questions. You may refer to [my list of 30 questions](./behavioral-interview-questions.md) which were collated across top tech companies for this.
While most people might be inclined towards memorization, it's much better to pen down bullet points to each question and practice verbalizing them near to the interviews, so that your answers will come out more naturally.
### 3. Prepare experiences to showcase fit to the company's culture / core values
As aforementioned, most top tech companies use their company values to evaluate candidates in behavioral interviews. As such, you should do your research to find out what those values are and ensure you have prepared experiences that showcase fit.
- Discuss anything that's on your resume, including current projects and details
- Provide specific examples about what you did and the resulting impact
- Critique yourself and share what you learned from a past situation
- Talk about what you like about your current role and/or being a developer
- Discuss why you'd like to make a change
### 4. Try out mock behavioral interviews
_Source: [Preparing for your Onsite Interview at Facebook](https://www.facebook.com/careers/swe-prep-onsite)_
If you would like to practice behavioral interviews with professional interviewers from top tech companies, schedule one with [interviewing.io](https://iio.sh/r/DMCa). Interviewing.io boasts a large pool of interviewers from Facebook, Amazon, Apply, Google and Microsoft. I have used [interviewing.io](https://iio.sh/r/DMCa) both as an interviewer and interviewee and can guarantee a good experience with this platform.
## Quality courses
### 5. Use structured courses
I really don't think one needs to attend a course on behavioral interviews, but your mileage may vary. I've seen candidates get rejected for failing the behavioral round even though they did super well on the coding and system design interviews. If you want to take a course on behavioral interviews, I'd recommend the following courses:
I don't really think one needs to attend a course on behavioral interviews, but your mileage may vary. I've seen candidates get rejected for failing the behavioral round even though they did super well on the coding and system design interviews. If you want to take a course on behavioral interviews, I'd recommend the following courses:
- ["Behavioral Interviews" by Exponent](https://www.tryexponent.com/courses/behavioral?ref=techinterviewhandbook) - While Exponent also has courses on technical content, what really makes them stand out from the other interview preparation platform is their availability of content for non-software engineering roles such as Product Management and Product Marketing. Their behavioral interview course is a mix of videos (by the Exponent CEO himself!) and text, going through the most common questions and imparting you with techniques to help you ace the interview. To top it off, they also have an interview question bank for behavioral questions with responses from the platform's helpful community. While the subscription might be a little pricey for just the behavioral interviews content, they also offer quality technical content for [System Design](https://www.tryexponent.com/courses/system-design-interview?ref=techinterviewhandbook), [Data Structures](https://www.tryexponent.com/courses/swe-practice?ref=techinterviewhandbook) and [Algorithms](https://www.tryexponent.com/courses/algorithms?ref=techinterviewhandbook). The convenience of a one-stop platform which covers all aspects of technical interview preparation is very enticing.
- ["Grokking the Behavioral Interview" on Educative](https://www.educative.io/courses/grokking-the-behavioral-interview?aff=x23W) - As per other courses on Educative, this course is text-based and they believe that text-based courses are the more efficient than video courses. One thing that stands out about this course is that they teach you **patterns** for behavioral interviews, not just about memorizing questions and preparing answers.

@ -55,7 +55,7 @@ This is a straight-to-the-point, distilled list of technical interview Do's and
| ✅ | Explain a high level approach even if it is a brute force one. |
| ✅ | Improve upon the approach and optimize. Reduce duplicated work and cache repeated computations. |
| ✅ | Think carefully, then state and explain the time and space complexity of your approaches. |
| ✅ | If stuck, think about related problems you have seen before and how they were solved. Check out the [tips](algorithms/introduction.md) in this section. |
| ✅ | If stuck, think about related problems you have seen before and how they were solved. Check out the [tips](/algorithms/study-cheatsheet.md) in this section. |
| ❌ | Ignore information given to you. Every piece is important. |
| ❌ | Jump into coding straightaway. |
| ❌ | Start coding without interviewer's green light. |

@ -0,0 +1,186 @@
---
id: coding-interview-best-practices
title: 'Coding interview best practices: What to do to display hire signals'
description: Tips on what to do before, during and after coding interviews to display hire signals according to coding interview evaluation criteria
keywords:
[
coding interview best practices,
best practices for coding interviews,
what to do during coding interview,
what to do after coding interview,
what to do before coding interview,
how to display hire behavior in coding interview,
how to pass coding interview,
]
sidebar_label: Best practices during coding interviews
---
As coding interviews mature over the years, there are now firmer expectations on how candidates should behave during a coding interview. Some of these practices also help you to exhibit "hire" signals to the interviewer by displaying your ability to communicate well and deal with roadblocks.
Deriving the best practices from top candidates and also based on [how you will be evaluated during a coding interview](./coding-interview-rubrics.md), we have summarized some of the top tips for how to behave during a coding interview in an exhaustive checklist - including top mistakes to avoid.
You should read and familiarize with this guide even before you start practicing your coding interview questions. Accompanying LeetCode grinding with this guide will allow you to ingrain these important coding interview behaviors early on.
## What to do _before_ your coding interview
- ✅ Dress comfortably.
> Usually you do not need to wear smart clothes, casual should be fine. T-shirts and jeans are acceptable at most places.
- ✅ Ensure you have read and prepared for your [self introduction](./self-introduction.md) and [final questions to ask](./final-questions.md).
### For virtual onsite coding interviews
<div className="text--center margin-vert--lg">
<figure>
<img alt="Summary of what to do before a virtual onsite coding interview"
title="Summary of what to do before a virtual onsite coding interview" className="shadow--md" src={require('@site/static/img/what-to-do-before-a-virtual-onsite-coding-interview.jpg').default} style={{maxWidth: 'min(100%, 420px)'}} />
<figcaption>What to do before a virtual onsite coding interview</figcaption>
</figure>
</div>
- ✅ Prepare pen and paper.
> In case you need to jot and visualize stuff. Drawings are especially helpful for trees / graphs questions
- ✅ Use earphones or headphones and make sure you are in a quiet environment.
> Avoid using speakers because if the echo is loud, communication is harder and participants repeating themselves will just result in loss of valuable time.
- ✅ Check that your internet connection is working.
- ✅ Check that your webcam and audio are working.
- ✅ Familiarize and set up shortcuts in the coding environment (CoderPad / CodePen).
> Set up the editor shortcuts, turn on autocompletion, tab spacing, etc. Interviewers are impressed if you know the shortcuts and use them well
- ✅ Turn off the webcam if possible.
> Most remote interviews will not require video chat and leaving it on only serves as a distraction and hogs network bandwidth.
### For phone screen coding interviews
<div className="text--center margin-vert--lg">
<figure>
<img alt="Summary of what to do before a phone screen coding interview"
title="Summary of what to do before a phone screen coding interview" className="shadow--md" src={require('@site/static/img/what-to-do-before-a-phone-screen-coding-interview.jpg').default} style={{maxWidth: 'min(100%, 420px)'}} />
<figcaption>What to do before a phone screen coding interview</figcaption>
</figure>
</div>
- ✅ Use earphones and put the phone on the table.
> Avoid holding a phone in one hand and only having one other hand to type
- ✅ Request for the option to use Zoom/Google Meet/Hangouts or Skype instead of a phone call.
> It is easier to send links or text across.
## For onsite whiteboarding coding interviews
- ✅ Learn about whiteboard space management.
> Leave space between lines of code in case you need to insert lines between existing code.
## What to do _during_ your coding interview
<div className="text--center margin-vert--lg">
<figure>
<img alt="Summary of what to do during a coding interview"
title="Summary of what to do during a coding interview" className="shadow--md" src={require('@site/static/img/what-to-do-during-a-coding-interview.jpg').default} style={{maxWidth: 'min(100%, 420px)'}} />
<figcaption>What to do during a coding interview</figcaption>
</figure>
</div>
### 1. Make a good self introduction at the start of the interview
- ✅ Introduce yourself in a few sentences under a minute or 2.
> Follow our guide on how to make a good self introduction for software engineers
- ✅ Sound enthusiastic!
> Speak with a smile and you will naturally sound more engaging.
- ❌ Do not spend too long on your self introduction as you will have less time left to code.
### 2. Upon receiving the question, make clarifications
**Do not jump into coding right away.** Coding questions tend to be vague and underspecified on purpose to allow the interviewer to gauge the candidate's attention to detail and carefulness. Ask at least 2-3 clarifying questions.
- ✅ Paraphrase and repeat the question back at the interviewer.
> Make sure you understand exactly what they are asking.
- ✅ Clarify assumptions (Refer to [algorithms cheatsheets](.//algorithms/study-cheatsheet.md) for common assumptions)
- > A tree-like diagram could very well be a graph that allows for cycles and a naive recursive solution would not work. Clarify if the given diagram is a tree or a graph.
- > Can you modify the original array / graph / data structure in any way?
- > How is the input stored?
- > If you are given a dictionary of words, is it a list of strings or a Trie?
- > Is the input array sorted? (e.g. for deciding between binary / linear search)
- ✅ Clarify input value range.
> Inputs: how big and what is the range?
- ✅ Clarify input value format
> Values: Negative? Floating points? Empty? Null? Duplicates? Extremely large?
- ✅ Work through a simplified example to ensure you understood the question.
> E.g., you are asked to write a palindrome checker, before coding, come up with simple test cases like "KAYAK" => true, "MOUSE" => false, then check with the interviewer if those example cases are in line with their expectations
- ❌ Do not jump into coding right away or before the interviewer gives you the green light to do so.
### 3. Work out and optimize your approach with the interviewer
The worst thing you can do next is jump straight to coding - interviewers expect there to be some time for a 2-way discussion on the correct approach to take for the question, including analysis of the time and space complexity.
This discussion can range from a few minutes to up to 5-10 minutes depending on the complexity of the question. This also gives interviewers a chance to provide you with hints to guide you towards an acceptable solution.
- ✅ If you get stuck on the approach or optimization, use [this structured way](./coding-interview-techniques.md) to jog your memory / find a good approach
- ✅ Explain a few approaches that you could take at a high level (don't go too much into implementation details). Discuss the tradeoffs of each approach with your interviewer as if the interviewer was your coworker and you all are collaborating on a problem.
> For algorithmic questions, space/time is a common tradeoff. Let's take the famous [Two Sum](https://leetcode.com/problems/two-sum/) question for example. There are two common solutions - (1) use nested for loops. This would be O(n<sup>2</sup>) in terms of time complexity and O(1) in terms of space. (2) In one pass of the array, you would hash a value to its index into a hashmap. For subsequent values, look up the hashmap to see if you can find an existing value that can sum up to the target. This approach is O(N) in terms of both time and space. Discuss both solutions, mention the tradeoffs and conclude on which solution is better (typically the one with lower time complexity)
- ✅ State and explain the time and space complexity of your proposed approach(es).
> Mention the Big O complexity for time and explain why (e.g O(n<sup>2</sup>) for time because there are nested for loops, O(n) for space because an extra array is created). Master all the time and space complexity using the [algorithm optimization techniques](./coding-interview-techniques.md#how-to-optimize-your-approach-or-solution).
- ✅ Agree on the most ideal approach and optimize it. Identify repeated/duplicated/overlapping computations and reduce them via caching. Refer to the page on [optimizing your solution](./coding-interview-techniques.md#how-to-optimize-your-approach-or-solution).
- ❌ Do not jump into coding right away or before the interviewer gives you the green light to do so.
- ❌ Do not ignore any piece of information given.
- ❌ Do not appear unsure about your approach or analysis.
### 4. Code out your solution while talking through it
- ✅ Only start coding after you have explained your approach and the interviewer has given you the green light.
- ✅ Explain what you are trying to achieve as you are coding / writing. Compare different coding approaches where relevant.
> In so doing, demonstrate mastery of your chosen programming language.
- ✅ Code / write at a reasonable speed so you can talk through it - but not too slow.
> You want to type slow enough so you can explain the code, but not too slow as you may run out of time to answer all questions
- ✅ Write actual compilable, working code where possible, not pseudocode.
- ✅ Write clean, straightforward and neat code with as few syntax errors / bugs as possible.
> Always go for a clean, straightforward implementation than a complex, messy one. Ensure you adopt a neat coding style and good coding practices as per language paradigms and constructs. Syntax errors and bugs should be avoided as much as possible.
- ✅ Use variable names that explain your code.
> Good variable names are important because you need to explain your code to the interviewer. It's better to use long variable names that explain themselves. Let's say you need to find the multiples of 3 in an array of numbers. Name your results array `multiplesOfThree` instead of array/numbers.
- ✅ Ask for permission to use trivial functions without having to implement them.
> E.g. `reduce`, `filter`, `min`, `max` should all be ok to use
- ✅ Write in a modular fashion, going from higher-level functions and breaking them down into smaller helper functions.
> Let's say you're asked to build a car. You can just write a few high level functions first: `gatherMaterials()`, `assemble()`. Then break down `assemble()` into smaller functions, `makeEngine()`, `polishWheels()`, `constructCarFrame()`. You could even ask the interviewer if it's ok to not code out some trivial helper functions.
- ✅ If you are cutting corners in your code, state that out loud to your interviewer and say what you would do in a non-interview setting (no time constraints).
> E.g., "Under non-interview settings, I would write a regex to parse this string rather than using `split()` which may not cover certain edge cases."
- ✅ [Onsite / Whiteboarding] Practice whiteboard space management
- ❌ Do not interrupt your interviewer when they are talking. Usually if they speak, they are trying to give you hints or steer you in the right direction.
- ❌ Do not spend too much time writing comments.
- ❌ Do not repeat yourself
- ❌ Do not use bad variable names.
- Do not use extremely verbose or single-character variable names, (unless they're common like `i`, `n`) variable names
- ❌ Do not copy and paste code without checking (e.g. some variables might need to be renamed after pasting).
### 5. After coding, check your code and add test cases
Once you are done coding, do not announce that you are done. Interviewers expect you to start scanning for mistakes and adding test cases to improve on your code.
- ✅ Scan through your code for mistakes - such as off-by-one errors.
> Read through your code with a fresh pair of eyes - as if it's your first time seeing a piece of code written by someone else - and talk through your process of finding mistakes
- ✅ Brainstorm edge cases with the interviewer and add additional test cases. (Refer to [algorithms cheatsheets](.//algorithms/study-cheatsheet.md) for common corner cases)
> Given test cases are usually simple by design. Brainstorm on possible edge cases such as large sized inputs, empty sets, single item sets, negative numbers.
- ✅ Step through your code with those test cases.
- ✅ Look out for places where you can refactor.
- ✅ Reiterate the time and space complexity of your code.
> This allows you to remind yourself to spot issues within your code that could deviate from the original time and space complexity.
- ✅ Explain trade-offs and how the code / approach can be improved if given more time.
- ❌ Do not immediately announce that you are done coding. Do the above first!
- ❌ Do not argue with the interviewer. They may be wrong but that is very unlikely given that they are familiar with the question.
### 6. At the end of the interview, leave a good impression
- ✅Ask good final questions that are tailored to the company.
> Read tips and [sample final questions to ask](./final-questions.md).
- ✅ Thank the interviewer
- ❌ Do not end the interview without asking any questions.
## What to do _after_ your coding interview
<div className="text--center margin-vert--lg">
<figure>
<img alt="Summary of what to do after a coding interview"
title="Summary of what to do after a coding interview" className="shadow--md" src={require('@site/static/img/what-to-do-after-a-coding-interview.jpg').default} style={{maxWidth: 'min(100%, 420px)'}} />
<figcaption>What to do after a coding interview</figcaption>
</figure>
</div>
- ✅ Record the interview questions and answers down as these can be useful for future reference.
- ✅ Send a follow up email or Linkedin invitation to your interviewer(s) thanking them for their time and the opportunity to interview with them.
> As an interviewer myself, these can leave a lasting impression on me.

@ -0,0 +1,155 @@
---
id: coding-interview-prep
title: 'Coding interviews: Everything you need to prepare'
description: What to expect, how to prepare and how to excel in software Engineer coding interviews
keywords:
[
coding interview prep,
coding interview,
software engineer interview prep,
software engineer coding interview,
technical interview prep,
technical interview,
questions to practice,
topics to study,
how to prepare for coding interview,
how to prepare for technical interview,
]
sidebar_label: 'Coding interviews: Step-by-step'
---
_The ultimate guide on how to efficiently prepare for your software engineering technical interview - coding test round._
If you have decided to embark on the arduous process of preparing for your coding interviews and you don't know how to maximize your time, this is the only guide you need to go from zero to hero on your coding test.
## What is a Software Engineering coding interview?
Coding interviews are a form of technical interviews used to access a potential software engineer candidate's competencies through presenting them with programming problems. Typically, coding interviews have a focus on data structures and algorithms, while other technical rounds may encompass [system design](./system-design.md) (especially for middle to senior level candidates).
A coding interview round is typically 30 - 45 minutes. You will be given a technical question (or questions) by the interviewer, and will be expected to write code in a real-time collaborative editor such as CodePen or CoderPad (phone screen / virtual onsite) or on a whiteboard (onsite) to solve the problem within 3045 minutes.
## How will you be evaluated during a coding interview?
I have collated evaluation criteria across top tech companies and generalized them into a [coding interview evaluation rubric](./coding-interview-rubrics.md) you can use. Specific terminology or weightages may differ across companies, top tech companies always include the following criteria in their evaluation:
1. **Communication** - Asking clarifying questions, communication of approach and tradeoffs clearly such that the interviewer has no trouble following.
1. **Problem solving** - Understanding the problem and approaching it systemically, logically and accurately, discussing multiple potential approaches and tradeoffs. Ability to accurately determine time and space complexity and optimize them.
1. **Technical competency** - Translating discussed solutions to working code with no significant struggle. Clean, correct implementation with strong knowledge of language constructs.
1. **Testing** - Ability to test code against normal and corner cases, self-correcting issues in code.
Read more about [how you should behave in a coding interview to display hire signals](./coding-interview-best-practices.md).
## How to best prepare for a coding interview?
LeetCode by itself is actually not enough to prepare you well for your coding interviews. Diving straight into LeetCode and thinking you can complete all of the thousands of questions is a bad use of your time and will never prepare you as well as a structured approach.
Given 30 min per question and an average of 3 hours practice a day, the average person will only manage to complete 160 questions within 3-4 weeks, and may not internalize the right approach or remember the questions they have practiced before.
Instead, this is how to prepare for your Software Engineer coding interview:
1. [Pick a good programming language to use](#pick-programming-language)
1. [Plan your time and tackle topics and questions in order of importance](#plan)
1. [Combine studying and practicing for a single topic](#study-and-practice)
1. [Accompany practice with coding interview cheat sheets to internalize the must-dos and must-remembers](#practice-with-cheatsheets)
1. [Prepare a good self introduction and final questions](#prepare-self-introduction)
1. [Try out mock coding interviews (with Google and Facebook engineers)](#mock-interviews)
1. [(If you have extra time) Internalize key tech interview question patterns](#question-patterns)
### 1. Pick a good programming language to use {#pick-programming-language}
A good programming language to use for coding interviews is one you are familiar with and is suitable for interviews.
What determines if a programming language should be used for interviews? Generally, we want higher level languages that have many standard library functions and data structures and are therefore "easier" to code in.
Recommended programming languages to use for coding interviews: Python, C++, Java, JavaScript
Read more about [considerations for picking a programming language](./programming-languages-for-coding-interviews.md) here.
### 2. Plan your time and tackle topics and questions in order of importance {#plan}
How long does it take to prepare for a coding interview? It actually depends on how well prepared you want to be. On average, it takes about [30 hours to cover the bare minimum and ~100 hours to be well prepared](./coding-interview-study-plan.md).
To start preparing for your coding interviews, always begin with a plan. Calculate the amount of time you have left to realistically prepare for your interview from now till the day of the coding test, and carefully make a plan of the topics and questions you will cover per day, prioritizing the most important ones first.
But how do you know which are the most important topics and questions to practice based on the time you have left? You may use the free [Grind 75 tool](https://www.techinterviewhandbook.org/grind75) (built by me) which produces coding interview study plans for varying lengths of preparation time. The algorithm behind it includes a ranking of questions by priority and also a balance between breadth and depth of topics covered.
If you have the luxury of time to prepare, it is recommended to spend around 3 months (2-3 hours per day) to prepare more holistically. I have outlined my personal 3-month study plan here, which takes you from start to finish on which topics and questions to complete.
### 3. Combine studying and practicing for a single topic {#study-and-practice}
For the sake of memory retention and efficiency, it is best to study for a single concept and then immediately do relevant practice questions for that topic.
Fortunately, there are already excellent coding interview preparation resources which enable you to do this very easily and systematically:
1. [AlgoMonster](https://shareasale.com/r.cfm?b=1873647&u=3114753&m=114505&urllink=&afftrack=)
1. [Grokking the Coding Interview: Patterns for Coding Questions](https://www.educative.io/courses/grokking-the-coding-interview?aff=x23W)
#### [AlgoMonster](https://shareasale.com/r.cfm?b=1873647&u=3114753&m=114505&urllink=&afftrack=)
Apart from helping you master important coding interview data structures and algorithm questions through practice and easy to understand guides, AlgoMonster has the added perk of synthesizing [common interview question patterns](https://algo.monster/problems/stats) that you could apply to solve any other questions you have never encountered before. Made by Google engineers, this is definitely a quality platform to use as compared to the unstructured nature of LeetCode grinding. Data structures and algorithms questions are covered in all the common languages - Python, Java, C#, JavaScript, C++, Golang, and more. [**Join today for a 70% discount →**](https://shareasale.com/r.cfm?b=1873647&u=3114753&m=114505&urllink=&afftrack=)
#### [Grokking the Coding Interview: Patterns for Coding Questions](https://www.educative.io/courses/grokking-the-coding-interview?aff=x23W)
This course on Educative 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 along with step-by-step visualizations. **Learn and understand patterns, not memorize answers!** [**Join today for a 10% discount →**](https://www.educative.io/courses/grokking-the-coding-interview?aff=x23W)
### 4. Accompany practice with coding interview cheatsheets to internalize the must-dos and must-remembers {#practice-with-cheatsheets}
To maximize what you get out of your practice, I recommend referring to the following coding interview cheatsheets _while_ you are studying and practicing:
- **Coding interview techniques** - how to find a solution and optimize your approach
- **Coding interview best practices** - how to behave through the interview to exhibit hire signals
- **Algorithms study cheatsheets** - covers the best learning resources, must remembers (tips, corner cases) and must do practice questions for every data structure and algorithm
#### Coding interview techniques
This cheatsheet provides you with ~10 techniques to do the 2 most important things you need to do in a coding interview: finding approaches to solve the problem presented, and optimizing the time and space complexity of your approaches.
These techniques are useful to apply when you are given questions which you have never encountered before, and to get out of being stuck.
#### Coding interview best practices
Top tech companies evaluate candidates on 4 main criteria: communication, problem solving, technical competency and testing. To exhibit behaviors that fulfill these criteria, I have prepared a coding interview best practices cheatsheet which outlines what you should do before, during and after coding interviews. This is based on my personal experience as an interviewee as well as my observation of top candidates as an interviewer at Facebook.
Using this guide to accompany practice ensures that you cultivate good habits and muscle memory with regards to interviews right from the beginning.
#### Algorithms study cheatsheets for coding interviews
These are actually the notes I personally collated for my own coding interview preparation. I have organized them into 1-pagers of the best study resources, best LeetCode questions to practice, and must-remembers (tips, corner cases) for every data structure and algorithm. They ensure that you internalize the most important concepts and get the most out of your preparation.
--
### 5. Prepare a good self introduction and final questions {#prepare-self-introduction}
Self introductions and final questions to ask are almost always required at the start and end of any software engineering interview. As such, you should always spend some time to craft an excellent self introduction and set of final questions to ask. When done well, these can leave a good impression with the interviewer that can turn things to your favor.
For the best software self introduction samples and tips, check out this [self introduction guide for software engineers](./self-introduction.md). Also check out samples of the best final questions to ask for software engineers in this [final questions guide](./final-questions.md).
### 6. Try out mock coding interviews {#mock-interviews}
Coding right in front of your interviewer can be a nerve-wracking experience especially if you have never done it before - which is why getting hands-on experience is so important.
[interviewing.io](https://iio.sh/r/DMCa) is currently the best mock technical interview resource in the market currently. It allows you to book mock coding interviews with real Google and Facebook engineers, albeit anonymously. You could even book interviews for specific roles like Mobile, Front End, Engineering Management. Even better - if you want to have an easier transition into real world coding interview - you could view recorded interviews and see what phone interviews are like.
Moreover, if you were to do very well on your mock interviews, you will be able to unlock the "jobs page" which allows you to book interviews directly with top companies like Uber, Lyft, Quora, Asana and more. I've used [interviewing.io](https://iio.sh/r/DMCa) both as an interviewer and an interviewee and found the experience to be excellent.
Read more about [different mock coding interview platforms here](./mock-interviews.md).
### 7. (If you have extra time) Internalize key tech interview question patterns {#question-patterns}
Many coding interview solutions actually involve a similar set of key patterns - and learning them will help you solve any long tail problem that is outside the set of commonly asked coding interview questions.
#### AlgoMonster
Out of the resources on the internet - AlgoMonster is an excellent platform created by Google engineers. It uses a data-driven approach to condense software engineering coding interview questions into a set of key patterns, and summarized them into a structured, easy to digest course. Imagine LeetCode, but with only the key patterns you need to know.
Best of all, AlgoMonster is not subscription-based - pay a one-time fee and get lifetime access. [Join today for a 70% discount →](https://shareasale.com/r.cfm?b=1873647&u=3114753&m=114505&urllink=&afftrack=)
#### Grokking the Coding Interview: Patterns for Coding Questions
This course on Educative 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! [Join today for a 10% discount →](https://www.educative.io/courses/grokking-the-coding-interview?aff=x23W)
---
And that is all from me - for more detail on each step of the software engineer coding interview preparation process, do dive into each topic within my handbook through the sidebar or by navigating to the next page!

@ -0,0 +1,145 @@
---
id: coding-interview-rubrics
title: How candidates are evaluated in coding interviews at top tech companies
description: Detailed coding interview rubrics collated from Google, Amazon, Apple, Netflix
keywords:
[
coding interview rubric,
coding interview evaluation criteria,
coding interview criteria,
coding interview grading rubric,
technical interview rubric,
]
sidebar_label: Coding interview rubrics
---
Ever wondered how coding interviews are evaluated at top tech companies like Google, Amazon, Apple and Netflix?
Across top tech companies, coding interview evaluation criteria actually does not differ to a great extent. While the exact terms used in the rubric could be different, the dimensions evaluated are roughly similar.
I will go into detail on the general coding interview evaluation process across big tech companies in this guide. I've also included an [example rubric](./coding-interview-rubrics.md) you can use while practicing on your own or with your peers.
If you haven't done so already, do refer to my [Coding interview best practices cheatsheet](./coding-interview-best-practices.md) which basically synthesizes what candidates should do to fulfill the evaluated criteria in coding interviews.
## Candidate scoring methodology
Generally across FAANG / MANGA companies, coding interview evaluation rubrics can be split broadly into 4 dimensions:
1. Communication - Does the candidate make clarifications, communicate their approach and explain while coding?
1. Problem Solving - Does the candidate show they understand the problem and are able to come up with a sound approach, conduct trade-offs analysis and optimize their approach?
1. Technical Competency - How fast and accurate is the implementation? Were there syntax errors?
1. Testing - Was the code tested for common and corner cases? Did they self-correct bugs?
There are 2 general methods of candidate scoring in coding interviews:
1. Provide a score (e.g. 1-4) for every dimension and sum them up into an overall score
1. Provide an overall score (e.g. 1-4) based on overall performance across dimensions
Regardless of the method used, the scoring bands are generally:
- Strong hire
- Hire
- No hire
- Strong no hire
Some companies may have a middle band for indecision when the interviewer feels that the candidate requires more assessment.
## How does your score impact the result?
Regardless of the scoring methodology, the final score is based on the overall performance across evaluated criteria (not purely through a certain mathematical cut-off).
For each phone screen round, there's typically only 1 interviewer, hence if they don't give you a "pass" equivalent to "Leaning hire" and above, you would not proceed to the full interview loop. If there were no clear signals obtained from the round, you might be asked to do a follow up phone screen round.
Most top tech companies allow candidates to go through every interview round in the full interview loop before making a decision based on the final package. If a candidate receives mixed results (some "pass" and some "fail") from different rounds, interviewers will convene for a discussion based on the signals you displayed. This is why your performance throughout the interview loop is important.
In certain cases, like follow up phone screen rounds, candidates may be invited for additional assessment rounds if:
- There were aspects that were missed out in the assessment e.g. 2 coding round interviewers gave very similar questions
- Candidate displayed mixed signals in particular areas and additional rounds are required to obtain more reliable signals
Generally, your scores and feedback for each round are visible to all interviewers. Sometimes, interviewers can even see feedback from your interviews at the same company in the past to avoid asking the same question again. Companies want to see that you have grown as compared to the past. So if you got rejected in the past by a company, reflect on possible reasons and address them if/when you interview with that company again.
## Detailed explanation of each evaluated criteria
### 1. Communication
Basic communication signals:
- Asks appropriate clarifying questions
- Communicates approach, rationale and tradeoffs
- Constantly communicating, even while coding
- Well organized, succinct, clear communication
| Score | Overall evaluation |
| --- | --- |
| Strong hire | Throughout the interview, communication was thorough, well-organized, succinct and clear in terms of thought process - including how they understand the question, their approach, trade-offs.<br/>Interviewer had no challenge following and understanding the candidate's thought process at all. |
| Leaning hire | Throughout the interview, communication was sufficient, clear and organized.<br/>However, the interviewer had to ask follow-up questions to understand the candidate on certain aspects such as their approach or thought process. |
| Leaning no hire | Throughout the interview, communication was (1 or more of the following): (1) Insufficient (e.g. jumped into coding without explaining), (2) Disorganized or unclear<br/>Interviewer had difficulty following the candidate's thought process. |
| Strong no hire | Could not communicate with any clarity or stayed silent even when addressed by the interviewer.<br/>Interviewer had extreme difficulty following the candidate's thought process. |
### 2. Problem solving
Basic problem solving signals:
- Understands the problem quickly by asking good clarifying questions
- Approached the problem systematically and logically
- Was able to come up with an optimized solution
- Determined time and space complexity accurately
- Did not require any major hints from the interviewer
Advanced problem solving signals:
- Came up with multiple solutions
- Explained trade-offs of each solution clearly and correctly, concluded on which of them are most suitable for the current scenario
- Had time to discuss follow up problems/extensions
| Score | Overall evaluation |
| --- | --- |
| Strong hire | Demonstrated testing signals effortlessly. |
| Leaning hire | Had some difficulty demonstrating testing signals, such as not being able to identify all the relevant corner cases. |
| Leaning no hire | Conducted testing but did not handle corner cases. Not able to identify or correct bugs in code. |
| Strong no hire | Did not even test code against typical cases. Did not spot glaring bugs in the code and announced they are done |
### 3. Technical competency
Basic technical competency signals:
- Translates discussed solution into working code with minimal to no bugs
- Clean and straightforward implementation with no syntax errors and unnecessary code, good coding practices e.g. DRY (Don't repeat yourself), uses proper abstractions
- Neat coding style (proper indentation, spacing, variable naming, etc)
Advanced technical competency signals:
- Compares several coding approaches
- Demonstrates strong knowledge of language constructs and paradigms
| Score | Overall evaluation |
| --- | --- |
| Strong hire | Demonstrated testing signals effortlessly. |
| Leaning hire | Had some difficulty demonstrating testing signals, such as not being able to identify all the relevant corner cases. |
| Leaning no hire | Conducted testing but did not handle corner cases. Not able to identify or correct bugs in code. |
| Strong no hire | Did not even test code against typical cases. Did not spot glaring bugs in the code and announced they are done |
### 4. Testing
Testing signals
- Came up with more typical cases and tested their code against it
- Found and handled corner cases
- Identified and self-corrected bugs in code
- Able to verify correctness of the code in a systematic manner (e.g. acting like a debugger and stepping through each line, updating the program's state at each step)
| Score | Overall evaluation |
| --- | --- |
| Strong hire | Demonstrated testing signals effortlessly. |
| Leaning hire | Had some difficulty demonstrating testing signals, such as not being able to identify all the relevant corner cases. |
| Leaning no hire | Conducted testing but did not handle corner cases. Not able to identify or correct bugs in code. |
| Strong no hire | Did not even test code against typical cases. Did not spot glaring bugs in the code and announced they are done |
<div className="text--center margin-vert--lg">
<figure>
<img alt="Coding interview evaluation rubric for software engineers"
title="Coding interview evaluation rubric for software engineers" className="shadow--md" src={require('@site/static/img/coding-interview-rubric-software-engineer.jpg').default} style={{maxWidth: 'min(100%, 500px)'}} />
<figcaption>Sample coding interview evaluation rubric, for practice</figcaption>
</figure>
</div>

@ -0,0 +1,116 @@
---
id: coding-interview-study-plan
title: Coding interview study plan - what to study and practice based on time left
description: Study topics and practice questions based on time left to prepare for Software Engineer coding interviews
keywords:
[
coding interview study plan,
what to study for coding interviews,
how to prepare for coding interviews,
what practice questions to do for coding interviews,
how to prepare for coding interviews in 3 months,
]
sidebar_label: Coding interview study and practice plan
---
import QuestionList from './\_components/QuestionList';
One of the most important questions to answer at the start of your coding interview preparation is: What study topics and practice questions should you do to most efficiently prepare for your coding interviews?
There are plenty of resources on the internet, but it can be hard to know how they fit into the time you have left to prepare. Thankfully, this article will help you with that.
I have personally gone through the dreaded Software Engineer interview process myself several times and prepared my own study plans, refining them each time.
In this article, I will share the 3 month study plan that I personally use to prepare for my coding interviews. You will find the exact topics to study (with recommended links) and exact questions to practice (with practice links).
<!--
Do check out these links for:
What to study and practice if you have 1 month left to coding interviews
What to study and practice if you have 1 week left to coding interviews
-->
## Recommended preparation time and approach
How much time do you need to prepare for your coding interviews? Generally, 3 months (if you can dedicate 11 hours a week) is the recommended period of time for a more holistic preparation. I will be sharing recommended study plans for 3 months (recommended period), but you can generate study plans for practice questions for any time frame you need via the Grind 75 tool (built by me). More options like filtering by difficulty, topics, alternative grouping of questions can be found there.
Regardless of how long you have, if you are unfamiliar with core data structures and algorithms knowledge, you are advised to revise them before starting on the coding interview questions practice. Different people have different styles of practicing and you should do what works best for you. The various possible approaches are:
1. **Breadth-first preparation** - Revise every topic and then start practicing a variety of questions across all topics. This strategy is recommended if you have around a month to spare.
1. **Depth-first preparation** - Tackle one topic at a time - revise materials for a topic, practice lots of questions for that topic. After ensuring mastery of a topic, move on to the next topic. Repeat for all or selected topics. If you don't have much time, this might be the best way to prepare. You can focus on the High priority topics in our recommended study plan.
1. **Depth-first-then-breadth preparation** - Tackle one topic at a time - revise materials for a topic, practice a few questions for that topic. After ensuring mastery, move on to the next topic. Repeat for all topics. At the end, practice a variety of questions across all topics. This strategy takes more time than others, so it's recommended if you have more than a month.
My personal recommendation would be the **Breadth-first preparation** or **Depth-first-then-breadth preparation**. It's important to have some form of breadth-level studying / practicing in your schedule so that you don't forget about the earlier topics as you move on to later topics.
## The 3 month study plan - with recommended study resources and practice question links
In each study plan, you will find a list of coding interview topics with resources and practice questions that you should work through **in order of priority** every week.
To best utilize it, you should create a template where you break down the dates left and hours left per day, so that you can later fill in the topics/questions to cover per day.
Keep the estimate relatively conservative so you don't end up burning out.
### Week 1 - 4: Topical study + practice
These are all the topics you should study, in order of priority. The learning resources linked are my algorithm cheatsheets - which give you an overview of must-remembers like time complexity, corner cases and topic-specific useful techniques, as well as must-do practice questions.
Don't forget to apply behaviors from [coding interview best practices](./coding-interview-best-practices.md) and methods from [coding interview techniques](./coding-interview-techniques.md) early on while you practice!
#### Week 1
| Topic | Priority | Time required |
| ---------------------------------------- | -------- | ------------- |
| [Array](./algorithms/array.md) | High | 2 hours |
| [String](./algorithms/string.md) | High | 3 hours |
| [Hash Table](./algorithms/hash-table.md) | Mid | 3 hours |
| [Recursion](./algorithms/recursion.md) | Mid | 3 hours |
#### Week 2
| Topic | Priority | Time required |
| --- | --- | --- |
| [Sorting and searching](./algorithms/sorting-searching.md) | High | 3 hours |
| [Matrix](./algorithms/matrix.md) | High | 1 hour |
| [Linked List](./algorithms/linked-list.md) | Mid | 3 hours |
| [Queue](./algorithms/queue.md) | Mid | 2 hours |
| [Stack](./algorithms/stack.md) | Mid | 2 hours |
#### Week 3
| Topic | Priority | Time required |
| ------------------------------ | -------- | ------------- |
| [Tree](./algorithms/tree.md) | High | 4 hours |
| [Graph](./algorithms/graph.md) | High | 4 hours |
| [Heap](./algorithms/heap.md) | Mid | 3 hours |
| [Trie](./algorithms/trie.md) | Mid | 3 hours |
#### Week 4
| Topic | Priority | Time required |
| --- | --- | --- |
| [Interval](./algorithms/interval.md) | Mid | 2 hours |
| [Dynamic programming](./algorithms/dynamic-programming.md) | Low | 4 hours |
| [Binary](./algorithms/binary.md) | Low | 2 hours |
| [Math](./algorithms/math.md) | Low | 1 hour |
| [Geometry](./algorithms/geometry.md) | Low | 1 hour |
### Week 5 - 12: In-depth practice
Here, I listed 75 questions that you should do to be fully prepared for your coding interviews. This list of questions are generated from the [**Grind 75 tool**](https://www.techinterviewhandbook.org/grind75/) (built by me), which generates recommended study plans for coding interviews based on the time you have left. More options like filtering by difficulty, topics, alternative grouping of questions can be found there.
Feel free to skip the dynamic programming questions if you haven't studied them or feel that they won't be relevant. Many dynamic programming questions can be solved with recursion / backtracking anyway.
Don't forget to apply behaviors from [coding interview best practices](./coding-interview-best-practices.md) and methods from [coding interview techniques](./coding-interview-techniques.md) early on while you practice!
<QuestionList />
## Factor time for your self introduction, final questions and mock coding interviews
Besides studying and practicing for coding interviews, you should also prepare your self introduction, final questions, and try out mock coding interviews.
### Prepare self introduction and final questions to ask
I would suggest around 3 hours to craft your self introduction and also prepare some final questions to ask. You may refer to this [self introduction guide](./self-introduction.md) and [final questions to ask guide](./final-questions.md) which should help you complete these steps fairly quickly.
### Schedule mock coding interviews
You should start scheduling for mock coding interviews when you are 60% through your coding interview studying and practicing plan. Interview slots are typically provided by interviewers, so you can view them in advance and book them. The platform I have personally used and recommend is [interviewing.io](https://iio.sh/r/DMCa). Read more about [different mock coding interview platforms here](./mock-interviews.md).

@ -0,0 +1,237 @@
---
id: coding-interview-techniques
title: Top techniques to approach and solve coding interview questions
description: Learn methods to find solutions for coding interview problems and optimize their time and space complexity
keywords:
[
how to approach a coding interview question,
how to solve any coding interview question,
coding interview practice,
coding interview questions,
optimize time complexity,
optimize space complexity,
optimize time and space complexity,
]
sidebar_label: Techniques to solve coding interview questions
---
The biggest fear most candidates will have during a coding interview is: what if I get stuck on the question and don't know how to do it? Fortunately, there are structured ways to approach coding interview questions that will increase your chances of solving them. From how to find a solution or approach, to optimizing time and space complexity, here are some of the top tips and best practices that will help you solve coding interview questions.
## How to find solutions to coding interview problems
When given a coding interview question, candidates should start by asking clarifying questions and discussing a few possible approaches with their interviewers. However, this is where most candidates tend to get stuck. Thankfully, there are ways to do this in a structured manner.
Note that not all techniques will apply to every coding interview problem. As you apply these techniques during your practice, you will develop the intuition for which technique will be useful for the problem at hand.
### 1. Visualize the problem by drawing it out
Ever wondered why coding interviews are traditionally done on whiteboards and videos explaining answers to coding questions tend to use diagrams? Whiteboards make it easy to draw diagrams which helps with problem solving! A huge part of coding is understanding how the internal state of a program changes and diagrams are super useful tools for representing the internal data structures state. If you are having a hard time understanding how the solution is obtained, come up with a visual representation of the problem and if necessary, the internal states at each step.
This technique is especially useful if the input involves trees, graphs, matrices, linked lists.
#### Example
How would you [return all elements of a matrix in spiral order](https://leetcode.com/problems/spiral-matrix/)? Drawing out the matrix and the path your iterator needs to take will help tremendously by allowing you to see the pattern.
### 2. Think about how you would solve the problem by hand
Solving the problem by hand is about solving the problem without writing any code, like how a non-programmer would. This already happens naturally most of the time when you are trying to understand the example given to you.
What some people don't realize is that sometimes a working solution is simply a code version of the manual approach. If you can come up with a concrete set of rules around the approach that works for every example, you can write the code for it. While you might not arrive at the most efficient solution by doing this, it's a start which will give you some credit.
#### Example
How do you [validate if a tree is a valid Binary Search Tree](https://leetcode.com/problems/validate-binary-search-tree/) without writing any code? You first check if the left subtree contains only values less than the root, then check that the right subtree contains only values bigger than the root, then repeat for each node. This process seems feasible. Now you just have to turn this process into code.
### 3. Come up with more examples
Coming up with more examples is something useful you can do regardless of whether you are stuck or not. It helps you to reinforce your understanding of the question, prevents you from prematurely jumping into coding, and having multiple examples is helpful when verifying your solution later. Coming up with more examples and then solving them by hand also helps you to identify a pattern which can be generalized to any input, which is the solution!
### 4. Break the question down into smaller independent parts
If the problem is large, start with a high-level function and break it down into smaller constituting functions, solving each one separately. This prevents you from getting overwhelmed with the details of doing everything at once and keeps your thinking structured.
Doing so also makes it clear to the interviewer that you have an approach, even if you don't manage to finish coding all of the smaller functions.
#### Example
The [Group Anagrams](https://leetcode.com/problems/group-anagrams/) problem can be broken down into two parts - hashing a string, grouping the strings together. Each part can be solved separately with independent implementation details. You could start off with this code:
```py
def group_anagrams(strings):
def hash(string):
pass
def group_strings(strings_hashes):
pass
strings_hashes = [(string, hash(string)) for string in strings]
return group_strings(strings_hashes)
```
And proceed to fill in the implementation of each function. However, do note that sometimes the most efficient solutions will require you to break some abstractions and do multiple operations in one pass of the input. If your interviewer asks you to optimize based on your well-abstracted solution, that is one possible path forward.
### 5. Apply common data structures and algorithms at the problem
Unlike real-world software engineering where the problems are usually open-ended and might not have clear solutions, coding interview problems tend to be smaller in nature and are designed to be solvable within the duration of the interview. You can also expect that the knowledge required to solve the problem is not out of this world and they would have been taught during college. Thankfully, the number of common data structures and algorithms is finite and a hacky approach which works from my experience is to try going through all the common data structures and applying them to the problem.
These are the data structures to keep in mind and try, in order of frequency they appear in coding interview questions:
- Hash Maps - Useful for making lookup efficient. This is the most common data structure used in interviews and you are guaranteed to have to use it
- Graphs - If the data is presented to you as associations between entities, you might be able to model the question as a graph and use some common graph algorithm to solve the problem
- Stack and Queue
- Heap - Question involves scheduling/ordering based on some priority. Also useful for finding the max K/min K/median elements in a set
- Tree/Trie - Do you need to store strings in a space-efficient manner and look for the existence of strings (or at least part of them) very quickly?
**Routines**
- Sorting
- Binary search - Useful if the input array is sorted and you need to do faster than O(n) searches
- Sliding window
- Two pointers
- Union find
- BFS/DFS
- Traverse from the back
- Topological Sorting
In future we will add tips on how to better identify the most relevant data structures and routines based on the problem.
## How to optimize your approach or solution
After you've come up with an initial solution to the coding interview problem, your interviewer would most likely prompt you to optimize the solution by asking "Can we do better". The following techniques help you further optimize the time and space complexity of your solution:
### How to optimize time complexity
#### 1. Identify the Best Theoretical Time Complexity of the solution
The Best Theoretical Time Complexity (BTTC) of a solution is a time complexity you know that you cannot beat.
Some simplified examples:
- The BTTC of finding the sum of numbers in array is O(n) because you have to look at every value in the array at least once
- The BTTC of finding the [number of groups of anagrams](https://leetcode.com/problems/group-anagrams/) is O(nk) where n is the number of words and k is the maximum number of letters in a word because you have to look at each word at least once and look at each character in each word at least once
- The BTTC of finding the number of islands in a matrix is O(nm) where n is the number of rows and m is the number of columns because you have to look at each cell in the matrix at least once
Why is it important to know the BTTC? So that you don't go down the rabbit hole of trying to find a solution that is faster than the BTTC. The fastest practical solution can only ever be as fast as the BTTC, not faster than the BTTC. The BTTC is not necessarily achievable in practice (hence theoretical), it just means you can never find a real solution that is faster than it. If your initial solution is slower than the BTTC, there could be opportunities to improve such that you can attain the BTTC (but not always the case). It wouldn't hurt to mention the BTTC to your interviewer, which will be taken as a positive signal and also to remind yourself that you should not try to come up with something faster than the BTTC.
Some people might think that the BTTC is simply the total number of elements in a data structure, because you need to go through each element once. This is **not always true**. The most famous example would be finding a number in a sorted array of numbers. The sorted property changes things a whole lot:
- Finding a number would be O(log(n)) because you can use a binary search.
- Finding the largest number would be O(1) because it is the last value in the array.
This is why it is important to pay attention to every detail given about the question. Be careful not to determine the incorrect BTTC due to lack of attention to the question details!
With the correct BTTC determined, you now know the time complexity of the optimal solution lies between your initial solution and the BTTC and can work your way towards it. If your solution already has the BTTC and the interviewer is asking you to optimize further, there are usually two things they are looking out for:
- Do even less work. Your solution could be O(n) but making two passes of the array and the interviewer is looking for the solution that uses a single pass.
- Use less space. Refer to the section below on optimizing space complexity.
#### 2. Identify overlapping and repeated computation
A naive/brute force solution often executes the same operation over and over again. When the code is doing an expensive operation that has been done before, take a moment to step back and consider if you can reuse results from previous computations. Dynamic programming (DP) is the most obvious type of questions you can entirely leverage past computations. There are non-DP questions that can leverage this technique too, although not as straightforward and might require a preprocessing step.
##### Example
The [Product of Array Except Self](https://leetcode.com/problems/product-of-array-except-self/) question is a good example of a problem which contains overlapping/repeated work. To get the value for an index, you need to multiply the values at all other positions. Doing this for every value in the array would take O(n<sup>2</sup>) time. However, see that:
- `result[n]`: `Product(nums[0] … nums[n-1]) * Product(nums[n + 1] … nums[N - 1])`
- `result[n + 1]`: `Product(nums[0] … nums[n]) * Product(num[n + 2] … nums[N - 1])`
There's a ton of duplicated work in computing the `result[n]` vs `result[n + 1]`! This is an opportunity to reuse earlier computations made while computing `result[n]` to compute `result[n + 1]`. Indeed, we can make use of a prefix array to help us arrive at the final solution in O(n) time at the cost of more space.
#### 3. Try different data structures
Choice of data structures is key to coding interviews. It can help you to reach a solution for the problem, it can also help you to optimize your existing solution. Sometimes it's worth going through the exercise of iterating through the data structures you know once again.
Is lookup time slowing your algorithm down? In general, most lookup operations should be O(1) with the help of a hashmap. If the lookup operation in your solution is the bottleneck to your solution's time complexity, more often than not, you can use a hashmap to optimize the lookup.
##### Example
The [K Closest Points to Origin](https://leetcode.com/problems/k-closest-points-to-origin/) question can be solved in a naive manner by calculating the distance of each point, sorting them and then taking the K smallest values. This takes O(nlog(n)) time because of the sorting. However, by using a Heap data structure, the time complexity can be reduced to O(nlog(k)) as adding/removing from the heap only takes O(log(k)) time when the size of the heap is capped at K elements. Changing the data structure made a whole ton of difference to the efficiency of the algorithm!
#### 4. Identify redundant work
Here are a few examples of code which is doing redundant work. Although making these mistakes might not change the overall time complexity of your code, you are also evaluated on coding abilities, so it is important to write as efficient code as possible.
##### Example
<!-- TODO elaborate on examples -->
Don't check conditions unnecessarily. These are examples where the second check is redundant.
- `if not arr and len(arr) == 0`
- `x < 5 and x < 10`
Don't invoke methods unnecessarily
- `len(arr)` in many parts of the function. If the len doesn't change, declare a variable at the start
Minimize work inside loops / Don't redo work you have already done
- Transforming a string within a for loop. Transform the string outside the for loop!
Be lazy. Use lazy evaluation - only evaluate expressions when you need it
- `slow() or fast()`
- `likely() and unlikely()`
Lazy initialization - only create objects when you know you're going to need them
Do early termination. Stop after you already know the answer.
Consider this basic question "Determine if an array contains an even number" and the code for it:
```py
def has_even(nums):
has_even = False
for num in nums:
if num % 2 == 0:
has_even = True
return has_even
```
Does this code work? Definitely. Is this code as efficient as it can be? Nope. We only need to know if an even value exists in the array. We can stop iterating as soon as we know that there exists an even value.
```py
def has_even(nums):
for num in nums:
if num % 2 == 0:
return True
return False
```
Most people already know this and already do this outside of an interview. However, in a stressful interview environment, people tend to forget the most obvious things. Terminate early from loops where you can.
### How to optimize space complexity
Most of the time, time complexity is more important than space complexity. But when you have already reached the optimal time complexity, the interviewer might ask you to optimize the space your solution is using (if it is using extra space). Here are some techniques you can use to improve the space complexity of your code.
#### 1. Changing data in-place/overwriting input data
If your solution contains code to create new data structures to do intermediate processing/caching, memory space is being allocated and can sometimes be seen as a negative. A trick to get around this is by overwriting values in the original input array so that you are not allocating any new space in your code. However, be careful not to destroy the input data in irreversible ways if you need to use it in subsequent parts of your code.
A possible way which works (but you should never use outside of coding interviews) is to mutate the original array and use it as a hashmap to store intermediate data. Refer to the example below.
Note that in Software Engineering, mutating input data is generally frowned upon and makes your code harder to read and maintain, so changing data in-place is mostly something you should do only in coding interviews.
#### Example
The [Dutch National Flag](https://leetcode.com/problems/sort-colors/) problem could be easily solved with O(n) time and O(n) space by creating a new array and filling it up with the respective values in a sorted fashion. As an added challenge and space optimization, the interviewer will usually ask for an O(n) time and O(1) space solution which involves sorting the input array in-place.
An example of using the original array as a hash table is the [First Missing Positive](https://leetcode.com/problems/first-missing-positive) question. After the first for loop, all the values in the array are positive, and you can indicate presence of a number by negating the value at the index corresponding to the number. To indicate 4 is present, negate `nums[4]`.
#### 2. Change a data structure
Data structures again!? Yes, data structures again! Data structures are so fundamental to coding interviews and mastery of it makes or breaks your interview performance. Are you using the best data structure possible for the problem?
#### Example
You're given a list of strings and want to find how many of these strings start with a certain prefix. What's an efficient way to store the strings so that you can compute your answer quickly? A [Trie](https://leetcode.com/problems/implement-trie-prefix-tree/) is a tree-like data structure that is very efficient for storing strings and also allows you to quickly compute how many strings start with a prefix.
## Next Steps
If you haven't already, I recommend you check out my [free structured guide for coding interviews](./software-engineering-interview-guide.md), which contains step by step guidance such as:
- [How to make an efficient plan for your coding interview preparation](./coding-interview-study-plan.md) - including priority of topics and questions to study, based on the time you have left
- [Coding interview best practices cheatsheet](./coding-interview-best-practices.md) - including how to behave during a coding interview to exhibit hire signals
- [Algorithms cheatsheets](.//algorithms/study-cheatsheet.md) - including the must-remembers that you should internalize for every data structure

@ -38,7 +38,7 @@ If you are new to coding interviews (e.g. first time interviewing for an interns
1. Decide on a [programming language](./picking-a-language.md)
1. Study and revise
- Revise your [Computer Science fundamentals](./study-and-practice.md)
- Go over the [algorithm tips](./algorithms/introduction.md)
- Go over the [algorithm tips](.//algorithms/study-cheatsheet.md)
- Take [online courses](./best-coding-interview-courses.md) if you need more materials
1. Practice solving algorithm questions
- Do the [best practice questions](./best-practice-questions.md)
@ -56,7 +56,7 @@ You have successfully passed coding interviews before and it is not your first t
1. Study and revise
- Revise your [Computer Science fundamentals](./study-and-practice.md)
- Go over the [algorithm tips](./algorithms/introduction.md)
- Go over the [algorithm tips](.//algorithms/study-cheatsheet.md)
- Take [online courses](./best-coding-interview-courses.md) if you need more materials
1. Practice solving algorithm questions
- Do the [best practice questions](./best-practice-questions.md)

@ -0,0 +1,63 @@
---
id: final-questions
title: 'Software Engineer interviews: Best end of interview questions to ask'
description: The best questions to ask the interviewer at the end of a Software Engineer interview to leave a good impression
keywords:
[
questions to ask at the end of an interview software engineer,
questions to ask software engineer interview,
software engineer questions to ask interviewer,
software engineer interview questions to ask,
]
---
Something you can always count on to happen at the end of your Software Engineer interview - both technical and non-technical rounds - is for the interviewer to ask you if you "have any final questions?".
This question actually isn't a real question at all - candidates are generally expected to ask questions. As an interviewer myself, candidates who don't have any questions might come off as less interested in the role.
Besides that, the questions you ask reveal what you care about. If asked well, this can be a very predictable opportunity for you to leave a good impression while also knowing more about the role (including uncovering potential red flags).
Here, I present questions to ask at the end of your software engineer interviews, for every purpose:
## Best questions to ask for knowing more about technical work
- What is the most costly technical decision made early on that the company is living with now?
- What is the most fulfilling / exciting / technically complex project that you've worked on here so far?
- What has been the worst technical blunder that has happened in the recent past? How did you guys deal with it? What changes were implemented afterwards to make sure it didn't happen again?
- What is your stack? What is the rationale for/story behind this specific stack?
- Does your team use Agile or Waterfall dev methodology and why?
## Best questions to ask for knowing more about the role
- What qualities do you look out for when hiring for this role?
- What concerns / reservations do you have about me for this position?
- What does a typical day look like in this role?
- What would be the most important problem you would want me to solve if I joined your team?
- What are the strengths and weaknesses of the current team? What is being done to improve upon the weaknesses?
- What resources does the company have for new hires to study its product and processes? Are there specifications, requirements, documentation?
- What would I work on if I joined this team and who would I work most closely with?
## Best questions to ask for knowing more culture and welfare
- How is individual performance measured?
- What is the current team composition like?
- What do you like about working here?
- What is the most frustrating part about working here?
- What is unique about working at this company that you have not experienced elsewhere?
- What is your policy on working from home/remotely?
- What does the company do to nurture and train its employees?
- Does the company culture encourage entrepreneurship and creativity? Could you give me any specific examples?
## Best questions to ask to know more about team leadership or management
- How do you train/ramp up engineers who are new to the team?
- What is your management philosophy?
- How do you measure individual performance?
- How do your engineers know what to work on each day?
- What is your team's biggest challenge right now?
- Have you managed a poor performer at some point in your career before? What did you do and how did it work?
## Best questions to ask to know more about company direction
- What assurance do you have that this company will be successful?
- How does the company decide on what to work on next?

@ -1,23 +1,31 @@
---
id: mock-interviews
title: Mock interviews
title: Best mock coding interview platforms for Software Engineers
description: Review of top mock interview platforms for Software Engineer coding interviews
keywords:
[
mock interview,
best mock interview platforms,
best mock coding interview platforms,
best sites to use for mock coding interviews,
interviewing.io review,
pramp review,
coding mock interview,
mock tech interview,
]
sidebar_label: Mock coding interviews
---
<head>
<title>Improve your technical interviewing skills through mock interviews | Tech Interview Handbook</title>
<meta property="og:title" content="Improve your technical interviewing skills through mock interviews | Tech Interview Handbook"/>
</head>
Interviewing is a skill that you can get better at. The steps mentioned above can be rehearsed over and over again until you have fully internalized them and following those steps become second nature to you. A good way to practice is to find a friend to partner with and the both of you can take turns to interview each other.
## interviewing.io
## [interviewing.io](https://iio.sh/r/DMCa)
A great resource for practicing mock coding interviews would be [interviewing.io](https://iio.sh/r/DMCa). interviewing.io provides anonymous practice technical interviews with Google and Facebook engineers, which can lead to real jobs and internships. By virtue of being anonymous during the interview, the inclusive interview process is de-biased and low risk. At the end of the interview, both interviewer and interviewees can provide feedback to each other for the purpose of improvement. Doing well in your mock interviews will unlock the jobs page and allow candidates to book interviews (also anonymously) with top companies like Uber, Lyft, Quora, Asana and more. You can also book mock interviews for more specific roles such as Mobile, Front End, Engineering Management. For those who are totally new to technical interviews, you can even view [recorded interviews](https://interviewing.io/recordings) and see how phone interviews are like. Read more about them [here](https://techcrunch.com/2017/09/27/interviewing-io-hopes-to-close-the-engineer-diversity-gap-with-anonymous-interviews/).
A great resource for practicing mock coding interviews would be [interviewing.io](https://iio.sh/r/DMCa). [interviewing.io](https://iio.sh/r/DMCa) provides anonymous practice technical interviews with Google and Facebook engineers, which can lead to real jobs and internships. By virtue of being anonymous during the interview, the inclusive interview process is de-biased and low risk. At the end of the interview, both interviewer and interviewees can provide feedback to each other for the purpose of improvement. Doing well in your mock interviews will unlock the jobs page and allow candidates to book interviews (also anonymously) with top companies like Uber, Lyft, Quora, Asana and more. You can also book mock interviews for more specific roles such as Mobile, Front End, Engineering Management. For those who are totally new to technical interviews, you can even view [recorded interviews](https://interviewing.io/recordings) and see how phone interviews are like. Read more about them [here](https://techcrunch.com/2017/09/27/interviewing-io-hopes-to-close-the-engineer-diversity-gap-with-anonymous-interviews/).
I have used interviewing.io both as an interviewer and an interviewee and found the experience to be really great! [Aline Lerner](https://twitter.com/alinelernerLLC), the CEO and co-founder of interviewing.io and her team are passionate about revolutionizing the technical interview process and helping candidates to improve their skills at interviewing. She has also published a number of technical interview-related articles on the [interviewing.io blog](http://blog.interviewing.io/).
I have used [interviewing.io](https://iio.sh/r/DMCa) both as an interviewer and an interviewee and found the experience to be really great! [Aline Lerner](https://twitter.com/alinelernerLLC), the CEO and co-founder of [interviewing.io](https://iio.sh/r/DMCa) and her team are passionate about revolutionizing the technical interview process and helping candidates to improve their skills at interviewing. She has also published a number of technical interview-related articles on the [interviewing.io blog](http://blog.interviewing.io/).
## Pramp
Another platform that allows you to practice coding interviews is [Pramp](https://pramp.com/). Where interviewing.io matches potential job seekers with seasoned technical interviewers, Pramp takes a different approach. Pramp pairs you up with another peer who is also a job seeker and both of you take turns to assume the role of interviewer and interviewee. Pramp also prepares questions for you, along with suggested solutions and prompts to guide the interviewee.
Another platform that allows you to practice coding interviews is [Pramp](https://pramp.com). Where [interviewing.io](https://iio.sh/r/DMCa) matches potential job seekers with seasoned technical interviewers, Pramp takes a different approach. Pramp pairs you up with another peer who is also a job seeker and both of you take turns to assume the role of interviewer and interviewee. Pramp also prepares questions for you, along with suggested solutions and prompts to guide the interviewee.
Personally, I am not that fond of Pramp's approach because if I were to interview someone, I would rather choose a question I am familiar with. Also, many users of the platform do not have the experience of being interviewers and that can result in a horrible interview experience. There was once where my matched peer, as the interviewer, did not have the right understanding of the question and attempted to lead me down the wrong path of solving the question. However, this is more of a problem of the candidate than the platform though.

@ -0,0 +1,64 @@
---
id: programming-languages-for-coding-interviews
title: Which programming language to use for coding interviews
description: Considerations for deciding which programming language to use for coding interviews
keywords:
[
coding interview programming language,
which programming language should i use for coding interviews,
python coding interviews,
java coding interviews,
c# coding interviews,
javascript coding interviews,
]
sidebar_label: Picking a programming language
---
Does the programming language you use for coding interviews matter? The answer is yes.
Most languages let you code in any language you want - the only exception I know being Google, where they only allow candidates to pick from Java, C++, JavaScript or Python for their algorithmic coding interviews.
However, the choice you make can impact your performance much more than you'd like to believe - and this is why it is important to pick a suitable programming language early on in your coding interview preparation - and use regularly in practice.
There are 3 considerations when deciding on which programming language to use:
1. Suitability for interviews
1. Your familiarity with the language
1. Exceptions
## 1. Suitability for interviews
Some languages are just more suited for interviews - higher level languages like Python or Java provide standard library functions and data structures which allow you to translate solution to code more easily.
From my experience as an interviewer, most candidates pick Python or Java. Other commonly seen languages include JavaScript, Ruby and C++. I would absolutely avoid lower level languages like C or Go, simply because they lack many standard library functions and data structures and some may require manual memory management.
Personally, Python is my de facto choice for algorithm coding interviews because it is succinct and has a huge library of functions and data structures available. Python also uses consistent APIs that operate on different data structures, such as `len()`, `for ... in ...` and slicing notation on sequences (strings/lists/tuples). Getting the last element in a sequence is `arr[-1]` and reversing it is simply `arr[::-1]`. You can achieve a lot with minimal syntax in Python.
Java is a decent choice too but having to constantly declare types in your code means extra keystrokes which results in more typing which doesn't result in any benefit (in an interview setting). This issue will be more apparent when you have to write on a whiteboard during onsite interviews. The reasons for choosing/not choosing C++ are similar to Java. Ultimately, Python, Java and C++ are decent choices of languages.
- Recommended: Python, C++, Java, JavaScript
- Acceptable (but prefer recommended if you are familiar): Go, Ruby, PHP, C#, Swift, Kotlin
- Avoid: Haskell, Erlang, Perl, C, Matlab
- You must be mad: Brainfuck, Assembly
## 2. Your familiarity with the language
Most of the time, it is recommended that you use a language that you are extremely familiar with rather than picking up a new language just for using in interviews.
If you are under time constraints, picking up a new language just for interviewing is hardly a good idea. Languages take time to master and if you are already spending most of your time and effort on revising/mastering algorithms, there is barely spare energy left for mastering a new language. If you are familiar with using one of the mainstream languages, there isn't a strong reason to learn a new language just for interviewing.
If you have been using Java at work for a while now and do not have time to be comfortably familiar with another language, I would recommend just sticking to Java instead of picking up Python from scratch just for the sake of interviews. Doing so, you can avoid having to context switch between languages during work vs interviews. **Most of the time, the bottleneck is in the thinking and not the writing**. It takes some getting used to before one becomes fluent in a language and be able to wield it with ease.
Valid reasons to learn a new language:
- The interview requires usage of that language (domain-specific roles like mobile/front end/data science)
- You are not in a rush to start interviewing
Poor reasons to learn a new language:
- The company you are interviewing with uses that language heavily and you want to impress the interviewer/show that you fit in
- You want to show that you are trendy
## 3. Exceptions
One exception to the convention of allowing you to "pick any programming language you want" is when you are interviewing for a domain-specific position, such as Front End/iOS/Android Engineer roles, in which you would need to be familiar with coding in JavaScript, Objective-C/Swift and Java respectively. If you need to use a data structure that the language does not support, such as a Queue or Heap in JavaScript, perhaps try asking the interviewer whether you can assume that you have a data structure that implements certain methods with specified time complexities. If the implementation of that data structure is not crucial to solving the problem, the interviewer will usually allow this. In reality, being aware of existing data structures and selecting the appropriate ones to tackle the problem at hand is more important than knowing the intricate implementation details.

@ -0,0 +1,39 @@
---
id: resume-overview
title: Resume overview
sidebar_label: Overview
---
Resume screening is the first stage in the interview process. It doesn't matter how strong you are in CS, algorithms or LeetCode, if you submit a poorly-written resume that doesn't pass the resume screening stage, your hopes are dashed. Hence it is important to nail this stage.
The following content is by Christina Ng and rephrased for the purpose of this handbook. You can follow her on [Medium](https://medium.com/@christinang89) or [Quora](https://www.quora.com/profile/Christina-Ng).
## How your resume is screened
While many engineers can be rather qualified for the role they are applying for, they miss out on getting a shot at the interview as they might never get past resume screening. The main issue was that they do not understand how recruiters worked.
Before writing your resume, it is important to understand the recruiting structure and how recruiting is done.
## The skill set checklist
Before opening up a position/starting the search for candidates, I usually consult very closely with the team manager/decision maker to find out the specific skill sets that are relevant for the position. These skill sets are typically grouped into "Must have", "Good to have", and "Special bonus".
- "Must have"Typically, most of the must-haves include a degree (or not) in a relevant technical field, some years (or not) of experience in a particular programming language or technology
- "Good to have"Includes experience/familiarity with secondary languages/technologies which may not be directly relevant to what the candidate would be working on, but could be required due to some interfacing with other components of the project. It could also include softer skills such as being a good team player, clear communication, etc
- "Special bonus"Recognized skill sets/experiences which are difficult to come by. Probably not a requirement, but would definitely be useful for the position
Now that I am armed with this list, the search for candidates begin.
Typically, I do not seek that "one perfect candidate". What I seek for is the "best fit candidate". The search is essentially a numbers game. I know that for a specific job posting, there would perhaps be X applicants. At each stage of the interview process, some percentage of the candidates will be eliminated, leaving only a final Y% of the initial pool to choose from. Since Y tends to be a rather small number, recruiters will try to maximize X.
## The 10 seconds glance
When I am looking at your resume, I am doing a keyword match against the skill set checklist. If I see a good amount of the right keywords in your resume, it is a pass. If I need to spend more than 10 seconds trying to figure out what you are writing about, it is a fail. If I see an excessive amount of keywords (much looking like spam), it signals a red flag and goes into the "maybe". Depending on whether I think I have enough candidates for the day, you could eventually go into the pass or fail stack.
There are lots of articles writing about how recruiters only spend an average of about 10 seconds to screen each resume. The news is, this is true because resume screening is such a menial, robotic and repetitive task. In fact, many applicant tracking systems (ATS) now are so advanced that they can parse your resume automatically, search for specific keywords in your resume, and score your resume based on the weights pre-assigned to each keyword.
Finding a job is a two-way fitthe company wants someone with the relevant skills required, but it is also important for the applicant to fit in the company culture, and be able to gain something out of their stint. Hence, honesty is the single most important criteria in a resume.
There is a delicate balance between finding the right job vs. finding a job. Getting rejected does not always mean you are not good enough. Sometimes, it just means you are not a right fit for what the company is looking for.
When hiring fresh grads, I know that many of them will not have as much experience as someone who has years of industry experience. Hence, I would look out more for soft skills, such as attention to detail, initiative, passion, ability to get things done, etc. Note: this applies only if you have met the minimum threshold of proficiency/competency in the skill set checklist.

@ -1,39 +1,318 @@
---
id: resume
title: Resume overview
sidebar_label: Overview
title: Practical guide to writing FAANG-ready software engineer resumes
description: How to write a top-tier, ATS-friendly resume good enough to pass resume screenings by Google, Amazon, Facebook and Microsoft
keywords:
[
software engineer resume,
FAANG software engineer resume,
software engineer resume template,
software engineer resume examples,
software engineer resume sample,
software engineer resume best practices,
how to write software engineer resume,
]
sidebar_label: Writing your software engineer resume
---
Resume screening is the first stage in the interview process. It doesn't matter how strong you are in CS, algorithms or LeetCode, if you submit a poorly-written resume that doesn't pass the resume screening stage, your hopes are dashed. Hence it is important to nail this stage.
Not sure why you're still not getting shortlisted at some or all of the top tech companies? Your software engineer resume could be the issue.
The following content is by Christina Ng and rephrased for the purpose of this handbook. You can follow her on [Medium](https://medium.com/@christinang89) or [Quora](https://www.quora.com/profile/Christina-Ng).
Having read tons of software engineering resumes as a FAANG interviewer, even some of the most qualified candidates I know fail to get shortlisted due to bad resumes. The mistake most people make is to immediately assume that they weren't qualified enough - but that could be far from the truth.
## How your resume is screened
Thankfully, there are specific steps and requirements you can fulfill to write a good software engineer resume. From your resume structure, content, to free tools you can use to test your resume, I have collated a very concise summary of the best practices to prepare your resume for a FAANG software engineering job application:
While many engineers can be rather qualified for the role they are applying for, they miss out on getting a shot at the interview as they might never get past resume screening. The main issue was that they do not understand how recruiters worked.
1. Set up an ATS-friendly resume template
1. Fill up your template with well-framed content in a meaningful order
1. Optimize your resume with prioritization and keywords
1. Test out resume using free tools
Before writing your resume, it is important to understand the recruiting structure and how recruiting is done.
## How to set up an ATS-friendly software engineer resume
## The skill set checklist
Something most candidates may not realize is that most top tech companies are using some form of Applicant Tracking Systems (ATS) to parse and screen thousands of resumes even before they reach human eyes. In many companies, the ATS may even use certain rules to reject candidates automatically.
Before opening up a position/starting the search for candidates, I usually consult very closely with the team manager/decision maker to find out the specific skill sets that are relevant for the position. These skill sets are typically grouped into "Must have", "Good to have", and "Special bonus".
While different companies could be using different types of ATS, it is possible to ensure that your software engineer resume is read favorably by most ATS. This section ensures your resume is at least perfectly readable by the ATS, while the next few sections improve your chances of passing ATS screenings.
- "Must have"Typically, most of the must-haves include a degree (or not) in a relevant technical field, some years (or not) of experience in a particular programming language or technology
- "Good to have"Includes experience/familiarity with secondary languages/technologies which may not be directly relevant to what the candidate would be working on, but could be required due to some interfacing with other components of the project. It could also include softer skills such as being a good team player, clear communication, etc
- "Special bonus"Recognized skill sets/experiences which are difficult to come by. Probably not a requirement, but would definitely be useful for the position
:::tip Expert tip
Now that I am armed with this list, the search for candidates begin.
[FAANG Tech Leads](https://www.faangtechleads.com?utm_source=techinterviewhandbook&utm_medium=referral&utm_content=ats_template&aff=1e80c401fe7e2) is currently offering resume templates and examples at **70% off**.
Typically, I do not seek that "one perfect candidate". What I seek for is the "best fit candidate". The search is essentially a numbers game. I know that for a specific job posting, there would perhaps be X applicants. At each stage of the interview process, some percentage of the candidates will be eliminated, leaving only a final Y% of the initial pool to choose from. Since Y tends to be a rather small number, recruiters will try to maximize X.
Their templates:
## The 10 seconds glance
- Are created by ex-FAANG hiring managers based on top resumes received from hundreds of candidate applications
- Guarantee readability by FAANG ATS
- Cater to various experience levels
When I am looking at your resume, I am doing a keyword match against the skill set checklist. If I see a good amount of the right keywords in your resume, it is a pass. If I need to spend more than 10 seconds trying to figure out what you are writing about, it is a fail. If I see an excessive amount of keywords (much looking like spam), it signals a red flag and goes into the "maybe". Depending on whether I think I have enough candidates for the day, you could eventually go into the pass or fail stack.
They also offer resume examples/references from candidates who have received multiple offers from FAANG companies - which are helpful in helping you craft content that meets the same bar. [Check it out](https://www.faangtechleads.com?utm_source=techinterviewhandbook&utm_medium=referral&utm_content=ats_template&aff=1e80c401fe7e2)!
There are lots of articles writing about how recruiters only spend an average of about 10 seconds to screen each resume. The news is, this is true because resume screening is such a menial, robotic and repetitive task. In fact, many applicant tracking systems (ATS) now are so advanced that they can parse your resume automatically, search for specific keywords in your resume, and score your resume based on the weights pre-assigned to each keyword.
:::
Finding a job is a two-way fitthe company wants someone with the relevant skills required, but it is also important for the applicant to fit in the company culture, and be able to gain something out of their stint. Hence, honesty is the single most important criteria in a resume.
### Only use Microsoft Word or Google Docs to create and edit your resume
There is a delicate balance between finding the right job vs. finding a job. Getting rejected does not always mean you are not good enough. Sometimes, it just means you are not a right fit for what the company is looking for.
**Do's**
When hiring fresh grads, I know that many of them will not have as much experience as someone who has years of industry experience. Hence, I would look out more for soft skills, such as attention to detail, initiative, passion, ability to get things done, etc. Note: this applies only if you have met the minimum threshold of proficiency/competency in the skill set checklist.
- Submit your resume as a PDF file to preserve formatting, but always create it from Microsoft Word or Google Docs. It is important to ensure that the text in your resume is easily highlightable, which is a precondition for easy parsing.
- ATS tools are always trying to improve their readability of standard resume formats - hence the more commonplace your resume format is, the better.
- To maximize space on your resume, rather than using header or footers, reduce the margins of the page - narrow margins are 0.5 on each side.
**Don'ts**
- Do not use Photoshop, other graphic design tools or online resume builders to build your resume
- Do not use the header or footer sections in a Word/Google Docs file - reduce margins instead and just write the information in the body.
### Only use standard fonts of readable sizes
New fonts may convert letters into special characters which are not readable by the ATS. Fonts you should use - **Arial, Calibri, Garamond**.
Ensure your font size remains readable for humans later on in the hiring process - use a minimum size of **10px** for readability.
### Add sections with standard headings and ordering
ATS readers need to identify and parse standard types of information from your resume. Using standard header titles and ordering can help them do that better.
This is the order which has worked well for me and recommended by recruiters:
| Section | Heading Name |
| --- | --- |
| Professional summary | (Use resume headline as section title, for e.g. "Senior Software Engineer at Google with over 5 years of experience leading teams") |
| Contact information | "Contact Information" |
| Skills - programming languages, frameworks, etc. | "Skills" |
| Experience | "Work Experience" |
| Education (Note: if you are still in school or have less than 3 years of experience, you may put Education first) | "Education" |
| Projects | "Projects" |
| Other optional sections - e.g. Certifications, Awards, etc | "Awards and Accolades" / "Certifications" / "Awards, Accolades and Certifications" |
:::caution
Never add symbols to your headers to avoid ATS readability issues.
:::
## How to write good Software Engineer resume content
As software engineering is inherently different from other careers in terms of its required skills and experiences, the content expectations for a software engineer resume is also unique. Each of the following paragraphs will cover the content usually expected for software engineers within each resume section:
### How to write a professional summary for a software engineer
A good professional summary can be a game changer. Not only does it summarize your entire professional experience in a manner that individual sections cannot, it can also leave a pleasant impression on the hiring manager.
From my personal experience as a software engineering interviewer, I highly recommend professional summaries, as interviewers generally may not have the time to read into the detail - hence summaries which directly address why a candidate is a good fit for the job greatly improves their chances of capturing attention.
Here are my top tips for writing a great software engineering resume summary.
#### Before you start: List down your best selling points
From your entire professional experience, list down the most important points that fulfill the job descriptions that you are applying for. This can include job experiences or skills.
#### Summarize the selling points into your resume summary
Summarizing the selling points as much as possible, frame them into a short summary of less than 50 words:
Ensure you do these:
- ✅ Answer why you are a good fit for the job
- ✅ Use an active voice
- ✅ Use action words
- ✅ Start with the noun describing your job role e.g. "Software Engineer", "Front End Engineer"
#### Write a headline for your resume summary
Instead of writing "Professional Summary" as the title of the section, further concise your experience into a headline with fewer than 10 words. Treat it like a slightly more elaborate version of your LinkedIn profile headline. Some examples"
##### Software Engineer (Full Stack)
Software Engineer with X years of full stack web development experience specializing in Ruby on Rails and PostgreSQL. Domain expert in e-commerce and payments field as a result of working at multiple e-commerce companies.
##### Senior Front End Engineer
Front End Engineer with X years of experience and strong fundamentals in Front End technologies. Likes building scalable web infrastructure and making websites fast. Passionate about programming languages, compilers, and developer tooling.
##### Software Engineering Lead
Software Engineer with X years of experience in back end, scaling complex distributed systems, and various cloud platforms. Led over 5 engineering teams with an average size of 6 members across two companies and mentored over 20 junior members.
##### Senior at University X
Senior Year student at University X with a focus on Artificial Intelligence and Machine Learning (ML). Interned at X companies and worked on full stack development and ML engineering roles.
### How to write contact information for a Software Engineer
#### Must-haves
- Name (Should be included at the very top of the resume)
- Personal phone number
- Never include your work phone number here
- Location - City, State, Zip
- Just enough for recruiters to determine if you are a local or international candidate
- Email address
- Never include your work email here
- I recommend Gmail if you are using other email services
- LinkedIn profile
#### Good-to-haves
- GitHub profile URL
- Personal website URL
- Stack Overflow profile URL
- Medium profile URL
- Competitive coding profile
- Codechef
- Hackerrank
If a divider is required between information, use "|" or tabs
Where relevant, indicate achievements in coding platforms, for example, max ratings, ranking, number of stars, badges.
### How to write skills for a Software Engineer
Include programming languages and tech stacks:
Structure in the following manner:
> [Skill summary] : [List skills separated by "|"]
- Programming languages - If impressive, include your familiarity by the number of lines you have written, for example "Over 10,000 lines"
- Frameworks
- Databases
### How to write work experience for a Software Engineer
List your work experience in a familiar format and reverse chronological order. Every job listed should have:
The company, location, title, duration worked following this structure
> [Company or Organization], [Location] | [Job Title] | [Start and end dates formatted as MM/YYYY]
Example
> Facebook, Singapore | Front End Engineering Lead | 08/2018 - Present
List of top accomplishments, including:
- Scope of job and skills required
- Accomplishments listed following this structure
- > [Accomplishment summary] : [Action] that resulted in [quantifiable outcome]
### How to write education for a Software Engineer
Most software engineering jobs will require at least an undergraduate degree. However, unless you are a recent graduate or do not have much work experience, it should not be prioritized above your work experience.
Use the following format, eliminating information where it is not relevant:
> [Degree Name], [Year of Graduation - write expected graduation date if not graduated]<br/>[University Name], [Location]<br/>GPA: X.XX / 4.0 (List GPA if more than 3.50/4.00, or more than 4.3 under a 5-point system)<br/>List key achievements, including leadership positions, skills, societies, projects, awards, etc.
Example:
> BSc in Computing, Computer Science, Graduation Year 2015<br/> National University of Singapore, Singapore <br/>GPA: 3.82 / 4.00 (Magna cum laude)<br/>Dean's List, Valedictorian<br/>President of hacker society
### How to write projects for a Software Engineer
Include at least 2 projects you have contributed to, outlining your key contributions. Always try to link your project name to GitHub or somewhere the hiring manager can view your project.
> [facebook/docusaurus](https://github.com/facebook/docusaurus) <br/>Maintainer and lead engineer for Docusaurus v2, a static site generator which powers the documentation of many of Meta's Open Source Projects - React Native, Jest, Relay, Reason, etc. Used by 7.6k > projects on GitHub.
### How to write awards, accolades and certifications for a Software Engineer
Only include achievements related to the job application and try to quantify your achievements. A good format to use would be
> [Year] [Quantification] [Competition]
Example
> 2016 | Best All-Round Product out of 50 teams | Facebook Hackathon
## Optimize your resume with keywords
must-haves to optimize your content:
### Less is more
**Do's**
- Highlighting a few of your best achievements is better than including many "average" achievements in your resume
- Use only 1 page for your resume
**Don'ts**
- Do not list all your achievements just to showcase a greater quantity without filtering
### Keyword optimization
Imagine you are a hiring manager or recruiter screening a resume while juggling many other tasks in your job - you simply won't have much time on each resume! When a hiring manager looks at a resume, they are in fact quickly scanning for keywords of skills or experiences that they value, before paying any additional attention to your resume.
Recruiters and ATS do that as well, but based on the job description that the hiring manager helped to write. That is why optimizing your resume based on job descriptions is very important.
:::info
Some ATS will determine the strength of your skills based on the frequency of a keyword in your resume, and others assign an estimated amount of experience for a skill based on its placement in your resume.
For instance, if your previous job experience was 3 years long and you mentioned handling Search engine marketing (SEM), the ATS will assume 5 years of SEM experience.
:::
#### Include keywords from job descriptions into your resume
You should always analyze the job description for must-have and good-to-have skills or experiences and ensure the keywords are added to your resume.
Include them under the "Skills" section and pepper the same keywords into the "Work Experience" and "Education" sections. Be sure to closely imitate the language within the job description.
Remember to include the full version of common abbreviations as well. E.g. Amazon Web Services instead of AWS, Google Cloud Platform instead of GCP.
However, do not do keyword stuffing for the sake of it - always remember that the resume will be read by a recruiter or hiring manager eventually.
#### Optimize keyword frequency and placement
Analyze the job description and determine how important each skill and experience is, then optimize the frequency of the keyword according to its importance.
:::tip Expert tip
While optimizing for every application is ideal, you can generalize your resume to a type of position.
1. Collate 3 to 5 job descriptions for that position
1. Copy and paste them into a `.txt` file and upload it into a free "word and phrase" frequency tool like [Online-Utility.org's Text Analyzer](https://www.online-utility.org/text/analyzer.jsp) to identify regularly used keywords
1. Incorporate skills and experiences that you have into the resume
:::
## Free tools to review your resume
I recommend using these free tools to optimize your resume:
### 1. Free resume review
[Resume Worded](https://a.paddle.com/v2/click/29828/144522?link=1861) uses AI to give instant expert feedback on your resume.
We previously recommended [TopResume's free all-in-one review](https://tidd.ly/3GxVIs9) of your resume, but received some feedback that that their reviewers are not technical and do not give feedback relevant to engineering roles. In that regard, we recommend [FAANG Tech Leads' Resume Review service (paid)](https://www.faangtechleads.com?utm_source=techinterviewhandbook&utm_medium=referral&utm_content=ats_template&aff=1e80c401fe7e2) where your resume will be reviewed by ex-FAANG hiring managers and engineers, not random writers who don't understand technology.
### 2. Test readability with industry-standard ATS
Test the readability and formatting of your resume using . Most big companies use such resume scanners.
### 3. The plain text file test
Simply copy the content from your resume and paste it into a plain text document! Make edits if:
- There are points missing from your original resume
- Characters are displaying incorrectly in plain text
- Sections are disorganized
## Final tips
### Do not take job application forms lightly
If the company you are applying for requires you to fill in the "Work Experience" and "Education" sections into their own form, do not take it lightly! Most of the time, these are internal HR applications which help parse job applications and filter out candidates from the information provided. In fact, it is possible that your resume is never seen by the recruiter or hiring manager - only the information that you fill up in their forms!
### Do not apply to many jobs at the same company
The ATS also allows recruiters to see all the roles you have applied to at their company. Try not to apply to too many jobs as a recruiter wouldn't be able to tell if you're actually interested in or if you're self-aware about your abilities. E.g. applying for a Software Engineer and a Data Scientist role at the same company is not a good idea.
---
And that is it from me in terms of resume preparation - hope this helps! If you have any other tips you would like to share with others on Tech Interview Handbook, do reach out to me at contact@techinterviewhandbook.org or create a new [GitHub discussion item](https://github.com/yangshun/tech-interview-handbook/discussions).
<div className="text--center margin-vert--lg">
<figure>
<img alt="Summary of the 4 steps to create a great software engineering resume, in checklist format"
title="Summary checklist of the four key steps to create a great software engineering resume" className="shadow--md" src={require('@site/static/img/four-steps-to-create-a-software-engineer-resume.jpg').default} style={{maxWidth: 'min(100%, 420px)'}} />
<figcaption>Summary checklist of the four key steps to create a great software engineering resume</figcaption>
</figure>
</div>

@ -139,7 +139,7 @@ Example:
Include at least 2 projects you have contributed to, outlining your key contributions. Always try to link your project name to GitHub or somewhere the hiring manager can view your project.
> [facebook/docusaurus](https://github.com/facebook/docusaurus) <br/>Maintainer and lead engineer for Docusaurus v2, a static site generator which powers the documentation of many of Metas Open Source Projects - React Native, Jest, Relay, Reason, etc. Used by 7.6k > projects on GitHub.
> [facebook/docusaurus](https://github.com/facebook/docusaurus) <br/>Maintainer and lead engineer for Docusaurus v2, a static site generator which powers the documentation of many of Meta's Open Source Projects - React Native, Jest, Relay, Reason, etc. Used by 7.6k > projects on GitHub.
## 7. Awards, accolades and certifications

@ -1,26 +1,29 @@
---
id: self-introduction
title: Self introduction
description: Tips and techniques on how to leave a lasting impression on the interviewer through your self introduction
keywords: [interview, self introduction, impression, best]
title: 'Software Engineer interviews: Crafting the perfect self introduction'
description: How to answer "Tell me about yourself" for Software Engineer interviews
keywords:
[
tell me about yourself software engineer,
software engineer self introduction,
software engineer self introduction sample,
tell me about yourself software engineer example,
self introduction software engineer sample,
]
sidebar_label: Preparing a self introduction
---
<head>
<title>How to do a killer self introduction in an interview | Tech Interview Handbook</title>
<meta property="og:title" content="How to do a killer self introduction in an interview | Tech Interview Handbook"/>
</head>
import InDocAd from './\_components/InDocAd';
Interviewers want to work with candidates they like. Leave a good/deep impression and it will increase your chances of success. Most of us are not strangers to self introductions as we meet new people now and then and have to introduce ourselves every once in a while. However, self introductions in interviews are slightly different from real life - you need to tweak it to your advantage - tailor the self introduction to the role and company you are applying for! Your self introduction evolves as you grow and are at a different stage of your career.
"Tell me about yourself" or "give me a quick introduction of your profile" is almost always the first question encountered in your software engineer interviews. This guide teaches you how to maximize this chance to impress the interviewer by crafting the perfect self introduction.
When being asked to introduce yourself, you can rephrase the question into:
Interviewers want to work with candidates they like. Leave a good/deep impression and it will increase your chances of success. Most of us are not strangers to self introductions as we meet new people now and then and have to introduce ourselves every once in a while. However, self introductions in interviews are slightly different from real life - you need to tweak it to your advantage - tailor the self introduction to the role and company you are applying for! Your self introduction evolves as you grow and are at a different stage of your career.
> "Tell me about your journey into tech. How did you get interested in coding, and why was web development (or replace with other job-specific skills) a good fit for you? How is that applicable to our role or company goals?"
When answering "tell me about yourself", you can rephrase the question into:
It is probably not a good idea to spend valuable time talking about things which aren't relevant to the job!
> "Tell me about your journey into tech. How did you get interested in coding, and why was web development (or replace with other job-specific skills) a good fit for you? How is that applicable to our role or company goals?" It is probably not a good idea to spend valuable time talking about things which aren't relevant to the job!
## The elevator pitch
## Make an elevator pitch
An "elevator pitch" originates from a journalist trying to pitch an idea to an editor. The only time to catch the editor was in the elevator and she had only around 30 seconds to do so. The key elements of elevator pitches include:
@ -30,9 +33,9 @@ An "elevator pitch" originates from a journalist trying to pitch an idea to an e
Whether you're at a job fair with hundreds of other candidates and you have limited time or you are simply explaining who you are to a potential connection or client, it is important to be able to clearly and accurately describe your knowledge and skills quickly and succinctly. Your self introduction is an elevator pitch for yourself!
Here are some tips to develop a good elevator pitch for yourself:
Here are some tips to develop a good elevator pitch for your software engineer self introduction:
### Short basic background information
### 1. Start with basic background information
Include who you are, who you work for (or school and major), and what you do.
@ -41,34 +44,23 @@ Include who you are, who you work for (or school and major), and what you do.
Does this look familiar? It should be, because it is similar to your resume! Your resume is a condensed version of your knowledge and experiences and your self introduction is essentially a condensed version of your resume. As you grow older, professional experience becomes more important and school background becomes less important. Hence your self introduction changes as you become more senior.
### KISS (Keep It Simple and Sweet)
### 2. KISS (Keep It Simple and Sweet)
Tell them some highlights from your favorite/most impressive projects and including some numbers if they're impressive or challenges that you've overcome. Do not delve into the depths of how you reverse engineered a game and decrypted a packet to predict when to use your DKP on a drop. Tell them the executive summary: "I reverse engineered X game by decrypting Y packet to predict Z." If this catches their interest, they _might_ ask further questions on their own.
Tell them some highlights from your favorite/most impressive projects and including some numbers if they're impressive or challenges that you've overcome. Do not delve into the depths of how you reverse engineered a game and decrypted a packet to predict when to use your DKP on a drop. Tell them the executive summary: "I reverse engineered X game by decrypting Y packet to predict Z." If this catches their interest, they might ask further questions on their own.
### Why do they want you?
### 3. Why do they want you?
Tell the interviewer why you would make a good hire. Is your experience relevant to the company? Have you used a similar tech stack as the company or built relevant products? What unique talent(s) do you have that may give them confidence about your ability to contribute to the company?
### Practice!
### 4. Practice!
Lastly, you must practice your pitch! Having a great, succinct summary of your skills only helps if you can actually deliver it rapidly! You should practice keeping a quick but easy-to-follow pace that won't overwhelm them but won't bore them. It's a precarious balance, but can be ironed out with practice.
After coming up with your self introduction, keep it somewhere where you can refer/tweak in future. Memorize them and in future you can just use it when you need to But don't sound like you're recalling it from your memory when you're actually saying it out. Sound natural!
After coming up with your self introduction, keep it somewhere where you can refer/tweak in future. Memorize them and in future you can just use it when you need to but don't sound like you're recalling it from your memory when you're actually saying it out. Sound natural!
Having an elevator pitch on hand is a great way to create a network and chance upon new job opportunities. There will often be times when you can't prepare for an interview or meeting and it is incredibly handy to have a practiced pitch.
## Format
Prepare a self introduction that follows the following outline (inspired by "Cracking the Coding Interview" by Gayle McDowell):
1. A sentence about your current or most recent role.
1. A few sentences about your (academic) background. What did you focus on?
1. Some sentences about your professional experience after school/university. Where did you work? What projects did you deal with? What were the typical challenges and tasks? Which technologies did you use?
1. Finish with a statement saying why you are seeking a new job opportunity and why you are interested in the role you applied for.
<InDocAd/>
## Examples
## Good examples of software engineer self introductions
### Example 1: Front End Engineer at Meta
@ -101,9 +93,14 @@ Prepare a self introduction that follows the following outline (inspired by "Cra
#### Breakdown
- "I love to create beautiful and performant products with delightful user experiences."
- Same as above, qualities that a Front End engineer should possess.
- "I previously worked at Grab where I led the Grab for Work project."
- Lyft was Grab's sister company! In fact they even had a partnership in the past. Most Lyft engineers would have heard of Grab before and mentioning this catches their attention.
- "I built the project with another engineer over the period of 4 months on a React/Redux and Golang stack."
- Acknowledge that you work with others. Building a non-trivial system with just 2 people in 3 months is quite good for a non-trivial system. Lyft also uses Golang for their high performance systems.
> "I love to create beautiful and performant products with delightful user experiences."
Same as above, qualities that a Front End engineer should possess.
> "I previously worked at Grab where I led the Grab for Work project."
Lyft was Grab's sister company! In fact they even had a partnership in the past. Most Lyft engineers would have heard of Grab before and mentioning this catches their attention.
> "I built the project with another engineer over the period of 4 months on a React/Redux and Golang stack."
Acknowledge that you work with others. Building a non-trivial system with just 2 people in 3 months is quite good for a non-trivial system. Lyft also uses Golang for their high performance systems.

@ -0,0 +1,215 @@
---
id: software-engineering-interview-guide
title: 'Software Engineer interviews: Everything you need to prepare'
description: What to expect, how to prepare and how to excel in Software Engineering interviews
keywords:
[
software engineer interview preparation,
technical interview preparation,
how to prepare for your software engineer interview,
software developer interview,
coding interview preparation,
best leetcode questions,
coding interview questions,
software engineering interview questions,
]
sidebar_label: 'SWE interviews: What are they and how to prepare'
---
Nobody has time to grind hundreds of LeetCode questions, and the good news is that you don't need to do that many to actually get the job at FAANG!
I was frustrated at my job at Grab, a ridesharing company in South-east Asia and wanted to break into FAANG but I wasn't sure how to. After a few months of research, studying and practicing, I interviewed at 11 companies and managed to get 9 offers from top tech companies in the Bay Area - Facebook, Google, Airbnb, Palantir, Dropbox, Lyft, and some startups. It was a tedious process which I don't ever want to go through again. **I went through that process but with this guide, you don't have to.**
This guide will provide a **quick overview of the top tips on how to prepare for a software engineer interview** - both technical and non-technical interview rounds. Where relevant, you can delve into greater detail by accessing links in this overview article, or through the website's left sidebar.
How to prepare for your software engineering interview:
1. Maximize your chances of being shortlisted
1. Find out the interview format
1. Pick a programming language
1. Sharpen your Computer Science fundamentals for interviews
1. Practice for the coding interview
1. Prepare for the systems design interview (for mid/senior levels)
1. Prepare for the behavioral interview
1. Negotiating the offer package
## Maximize your chances of being shortlisted
Do you still have trouble getting shortlisted at some or all of the top tech companies? Your resume could be the issue.
Your resume is the single most important entry point to getting shortlisted in major tech companies like FAANG / MANGA. After getting shortlisted, your past achievements become markedly less important as compared to your coding interview skills - which as we know, can be methodically learnt. Being able to frame your past achievements well enough to get through the screening stage is hence very important.
Unfortunately, even the most qualified candidates I know personally don't know how to write a good resume and fail to get shortlisted. The truth is that when many of us don't get shortlisted at top tech companies like FAANG / MANGA, we tend to think that we were under-qualified - but in most cases, it's probably just the lack of good framing.
If you want to learn how to write a good software engineer resume, I've written a [step-by-step guide here on software engineering resume preparation](./resume.md) for companies like Google, Facebook, Amazon, Netflix, Apple, with examples for your reference as well.
## Find out the interview format
You may encounter various interview formats in your software engineer interviews (from early to late stage):
### 1. Quiz
Frequency: Occasional
Quizzes are meant to be a first-pass filter as a quick and dirty way of weeding out extremely weak (or even non-technical) candidates. They are structured questions and have clear-cut answers which makes them possible to be administered by recruiters/non-technical folks or automated graders. They are typically done early in the process.
Examples:
- What is 4 & 5 (in binary)? Answer: 4
- What is the time complexity of bubble sort? Answer: O(n<sup>2</sup>)
### 2. Online coding assessment
Frequency: Occasional
Like quizzes, online coding assessments are usually given early in the process. An algorithm problem is given with well-formed input and output and candidates are expected to write code in an online coding interface to solve the problem. [HackerRank](https://www.hackerrank.com) is a very common platform for conducting online coding assessments. LeetCode would be a good way to practice for the problem solving aspects of online coding assessments. However, in HackerRank you are typically expected to write code to read from stdin and also print to stdout, which can trip candidates up if they aren't familiar with the APIs.
### 3. Take home assignment
Frequency: Rare
There have been numerous debates on whether asking algorithm questions are a good way of assessing individual abilities as they aren't exactly the most relevant skills needed on a day-to-day basis at a job. Take home assignment is a format designed to address the shortcomings of the algorithm interview by getting candidates to work on larger projects which allow them to demonstrate software design skills.
However, this interview format takes up more time from both the candidates and the company and hence it is not as commonly seen in large companies where they have a high volume of candidates. This format is more common among startups and small companies. Examples
- Build a flights listing app
- Build a kanban app
- Build a snake game
### 4. Phone screen interviews
Frequency: Common
Phone interviews are the most common format and every candidate will face this at least once while interviewing. You will be asked to speak with an interviewer either over a phone call or VoIP (BlueJeans/Skype/Google Hangout). A question will be given to you and you will work on that question using an online collaborative editor (CoderPad/CodePen/Google Docs).
You are usually not allowed to execute the code even if the editor supports execution. So don't rely on that for verifying the correctness of your solution. Formats would differ slightly depending on the roles you are applying to. Many companies like to use [CoderPad](https://coderpad.io) for collaborative code editing. CoderPad supports running of the program, so it is possible that you will be asked to fix your code such that it can be run. For front end interviews, many companies like to use [CodePen](https://codepen.io), and it will be worth your time to familiarize yourself with the user interfaces of such web-based coding environments.
Check out [coding interview best practices](./coding-interview-best-practices.md) as well for do's and don'ts before your phone screen interviews.
### 5. Onsite
Frequency: Almost always
If you have made it to this stage, congratulations! This is usually the final stage before an offer decision. Candidates who made it to the onsite stage will be required to have an in-person interview at the office. If you are an overseas candidate, companies might even fly you in and pay for your accommodations!
The onsite stage usually consists of multiple rounds (coding, system design, behavioral) and is expected to last for a few hours. Since you are onsite, it is possible that you will be asked to do a whiteboard exercise with an interviewer, usually either solving an algorithm question or a system design question. It is also possible that you have to bring your own laptop and work on a project/solve a coding problem on the spot.
For onsite interviews at smaller (non-public) companies, most will allow (and prefer) that you use your own laptop. Hence it is important that you prepare your development environment in advance.
If the company provides lunch, you might also have a lunch session with an employee where you can find out more about the company culture.
## Pick a programming language
With your resume done, the next step of your software engineering interview journey is a simple one and won't take long - decide on a programming language. Unless you're interviewing for a specialist position like mobile or front end where there are domain-specific languages, you should be free to use any language you want for the algorithmic coding interviews.
Most of the time, you'd already have one in mind - pick the one you use the most and you're the most comfortable with. The most common programming languages used for coding interviews are Python, Java, C++, and JavaScript. I wouldn't recommend learning an entirely new language just for coding interviews as it takes a while (few weeks at least on average) to become proficient enough in a language to wield it comfortably in an interview setting, which is already stressful enough on its own. My personal programming language of choice is Python because of how terse it is and the functions/data structures the standard library provides.
Read more on programming languages for coding interviews: [Picking a programming language](./programming-languages-for-coding-interviews.md)
<!--
References (omit when publishing)
https://startupnextdoor.com/important-pick-one-language-for-the-coding-interview/
-->
## Study and practice for coding interviews
The next and most important step is to practice solving algorithm questions in your chosen programming language. While Cracking the Coding Interview is a great resource, I prefer learning by actually solving problems.
There are many platforms that can be used for this - such as LeetCode, HackerRank and CodeForces. From my personal experience, LeetCode questions are most suitable for interview preparation whereas HackerRank and CodeForces are more for competitive programming.
However, LeetCode has thousands of questions and it can be daunting to know where to begin, or how to structure your practice. I have provided recommended preparation plans and also structured resources here:
### Coding interview study plan
The recommended time period to set aside for coding interview preparation is 3 months (11 hours a week i.e. 2-3 hours a day) for a more holistic preparation. I shared my [3 month study plan here](./coding-interview-study-plan.md), which provides a list of coding interview topics with resources and practice questions that you should work through in order of priority every week. I will also be adding content on recommended 1 month and 1 week study plans soon.
If you have less than 3 months to prepare, you can generate your own study plans using the [Grind 75 tool](https://www.techinterviewhandbook.org/grind75) (built by me) which generates recommended study plans for coding interviews based on the time you have left. The algorithm behind it includes a ranking of questions by priority and also a balance between breadth and depth of topics covered.
### Resources to use in your practice
In the market, there are plenty of resources vying for your attention, plenty of them just vying for your money but not providing any value. If I had to prioritize - these are the top coding interview preparation resources I would use in tandem:
1. [AlgoMonster](https://shareasale.com/r.cfm?b=1873647&u=3114753&m=114505&urllink=&afftrack=)
1. [Grokking the Coding Interview: Patterns for Coding Questions](https://www.educative.io/courses/grokking-the-coding-interview?aff=x23W)
1. My (free) coding interview best practices guide
1. My (free) coding interview techniques guide
1. My (free) algorithms study guide
#### [AlgoMonster](https://shareasale.com/r.cfm?b=1873647&u=3114753&m=114505&urllink=&afftrack=)
Apart from helping you master important coding interview data structures and algorithm questions through practice and easy to understand guides, AlgoMonster has the added perk of synthesizing [common interview question patterns](https://algo.monster/problems/stats) that you could apply to solve any other questions you have never encountered before. Made by Google engineers, this is definitely a quality platform to use as compared to the unstructured nature of LeetCode grinding. Data structures and algorithms questions are covered in all the common languages - Python, Java, C#, JavaScript, C++, Golang, and more. [**Join today for a 70% discount →**](https://shareasale.com/r.cfm?b=1873647&u=3114753&m=114505&urllink=&afftrack=)
#### [Grokking the Coding Interview: Patterns for Coding Questions](https://www.educative.io/courses/grokking-the-coding-interview?aff=x23W)
This course on Educative 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 along with step-by-step visualizations. **Learn and understand patterns, not memorize answers!** [**Join today for a 10% discount →**](https://www.educative.io/courses/grokking-the-coding-interview?aff=x23W)
#### My (free) coding interview best practices guide
If you have read the [coding interview evaluation rubric](./coding-interview-rubrics.md) used at top tech companies, you may be overwhelmed by the number of items evaluated and how to demonstrate hire behaviors consistently.
This [coding interview best practices guide](./coding-interview-best-practices.md) synthesizes actionable recommendations of what to do before, during and after your coding interviews to demonstrate hire signals.
I recommend to internalize and use the guide as an accompaniment while you practice coding interview questions - to ensure that you cultivate good habits and muscle memory with regards to interviews right from the beginning.
#### My (free) coding interview techniques guide
Is there a structured method to increase your chances of finding a good solution to the coding interview question? How about optimizing your approach's time and space complexity? My coding interview techniques guide teaches you a few techniques for handling questions that you have never encountered before - such as problem visualizing, solving by hand, breaking the problem into subproblems, etc.
#### My (free) algorithms study cheatsheets
I'm not sure if these would qualify as an in-depth guide - they are more like 1-page "study cheatsheets" of the **best resources to study, best LeetCode questions to practice and the things to remember**. However, they ensure you cover all the most important grounds, especially when you have no time. Because these are also the notes that helped me clinch top tech offers - they definitely work.
For more tips on coding interview preparation, refer to my [full coding interview preparation guide](./coding-interview-prep.md) here.
### Try out mock coding interviews (with Google and Facebook engineers)
Coding right in front of your interviewer can be a nerve-wracking experience especially if you have never done it before - which is why getting hands-on experience is so important.
[interviewing.io](https://iio.sh/r/DMCa) is currently the best mock technical interview resource in the market currently. It allows you to book mock coding interviews with real Google and Facebook engineers, albeit anonymously. You could even book interviews for specific roles like Mobile, Front End, Engineering Management. Even better - if you want to have an easier transition into real world coding interview - you could view recorded interviews and see what phone interviews are like.
Moreover, if you were to do well on your mock interviews, you will be able to unlock the "jobs page" which allows you to book interviews directly with top companies like Uber, Lyft, Quora, Asana and more. I've used [interviewing.io](https://iio.sh/r/DMCa) both as an interviewer and an interviewee and found the experience to be excellent.
## Prepare for the system design interview
If you are a mid or senior-level candidate, you may expect system design questions as part of your technical interview. They aren't covered adequately by LeetCode and good resources are still harder to come by.
The objective of system design interviews is to evaluate a candidate's skill at designing real-world software systems involving multiple components.
### Utilize the best system design interview preparation resources
Some of the best system design interview preparation resources include:
1. ["Grokking the System Design Interview" on Educative](https://www.educative.io/courses/grokking-the-system-design-interview?aff=x23W) - This is probably the most famous system design interview course on the internet and what makes it different from most other courses out there is that it is purely text-based, which is great for people who prefer reading over watching videos (such as myself!). It contains a repository of the popular system design problems along with a glossary of system design basics. I've personally completed this course and have recommended many others to use this. Highly recommended!
2. ["System Design Interview Course" by Exponent](https://www.tryexponent.com/courses/system-design-interview?ref=techinterviewhandbook) - This course covers system designs basics and has a huge database of popular system design questions with videos of mock interviews. Some of the questions have text answers and a database schema and APIs for reference (which I find helpful). While the subscription might be a little pricey for just the system design interviews content, they also offer quality technical content for [Data Structures](https://www.tryexponent.com/courses/swe-practice?ref=techinterviewhandbook), [Algorithms](https://www.tryexponent.com/courses/algorithms?ref=techinterviewhandbook) and [Behavioral Interviews](https://www.tryexponent.com/courses/behavioral?ref=techinterviewhandbook). The convenience of a one-stop platform which covers all aspects of technical interview preparation is very enticing.
3. ["Grokking the Advanced System Design Interview" on Educative](https://www.educative.io/courses/grokking-adv-system-design-intvw?aff=x23W) - I haven't tried this but it's by the same people who created "Grokking the System Design Interview", so it should be good! In my opinion you probably wouldn't need this unless you're very senior or going for a specialist position.
[Check out other Systems Design preparation guides and resources here.](./system-design.md)
## Prepare for the behavioral interview
Every top tech company has at least one round of behavioral interviews for software engineers. Typically, behavioral interviews for software engineers include: Sharing about details of previous experiences on resume Providing examples of past situations and behavior that demonstrate certain behavioral attributes (e.g. conflict management, data driven) Sharing of ambitions and career plans
As much as these interviews seem "fluffy" or unstructured, there is actually a structured way to prepare for behavioral interviews:
### 1. Know the STAR format for answering them
The STAR format helps you to organize your answers to behavioral questions. This is most applicable to questions that require you to recount past experiences or behavior. Situation: Share details about the situation that gave rise to the task Task: Explain what you needed to achieve or the problems you had to solve, focusing on the scope, severity or specific benchmarks or outcomes you had to hit Action: Explain what you did to meet your objectives, describing options you had and how you made decisions Results: Describe the outcome of your actions and what you learnt
Read more: The STAR format for answering behavioral questions
### 2. Practice the most common behavioral questions for software engineers
Refer to the [top 30 most common behavioral questions](./behavioral-interview-questions.md) for Software Engineers
For more tips on behavioral interview preparation, refer to my [full behavioral interview preparation guide](./behavioral-interview.md) here.
<!-- which can be broken down into the following steps (these steps are covered in detail in my behavioral interview step-by-step guide):
Understand how software engineers are evaluated during behavioral interviews
Learn effective answer formats and tactics
Practice the most commonly asked questions -->
## Negotiating the software engineer offer package
Finally, the last thing you absolutely need to prepare for before your interview is salary negotiation for software engineers. At any point during the interview process, conversation about salary may crop up. We also have in-depth guides about [negotiation strategies](./negotiation.md) and [software engineer compensation](./understanding-compensation.md).
And that is all from me - for more detail on each step of the software engineer interview preparation process, do dive into each topic within my handbook through the sidebar or by navigating to the next page!

@ -29,7 +29,7 @@ If you have been out of college for a while, it is highly advisable to review Co
- [DSA Revision](https://dsarevision.com/) - Free 100-page PDF with question patterns and example questions
- [Top 50 Data Structure and Algorithms Interview Questions for Programmers](https://medium.com/javarevisited/50-data-structure-and-algorithms-interview-questions-for-programmers-b4b1ac61f5b0)
After you have revised the basic concepts at least once, you can find a list of practical tips I collated for the common algorithm and data structure topics under the [Algorithms tips](./algorithms/introduction.md) section.
After you have revised the basic concepts at least once, you can find a list of practical tips I collated for the common algorithm and data structure topics under the [Algorithms tips](.//algorithms/study-cheatsheet.md) section.
## Mastery through practice

@ -1,7 +1,14 @@
---
id: system-design
title: System design interviews
sidebar_label: 🔥 System design interviews
title: System design interview guide for Software Engineers
description: How to prepare for system design interviews for Software Engineers
keywords:
[
system design interview guide,
how to prepare for system design interview,
system design interview software engineer,
]
sidebar_label: System design interview preparation guide
---
The objective of system design interviews is to evaluate a candidate's skill at designing real-world software systems involving multiple components. System design questions are typically given to more senior candidates (with a few years of experience). Interns aren't typically given system design questions as it is hard to expect interns to have sufficient and relevant industry experience to answer this type of questions well.

@ -1,5 +1,3 @@
# Cheatsheet
The contents have been moved to the [website](https://www.techinterviewhandbook.org/cheatsheet).
<!-- TODO: Remove in future -->

@ -144,7 +144,7 @@ Implementation rounds feel very similar to algorithms, as you need to actively f
## Algorithm Rounds
As software engineers, we are not unfamiliar with algorithm questions. Leetcode and Hackerrank are common resources used for practicing such questions.
As software engineers, we are not unfamiliar with algorithm questions. LeetCode and Hackerrank are common resources used for practicing such questions.
As I knew this was my weakness, this was where I spent the most time. It may be a little ironic that I chose Python over JavaScript as my language of choice for tackling algorithms. JavaScript's lack of a native minheap and binary search implementation made it a slightly worse choice.

@ -28,16 +28,16 @@ module.exports = {
items: [
{
label: 'Start reading',
href: '/introduction',
href: '/software-engineering-interview-guide/',
position: 'left',
},
{
label: 'Coding',
href: '/coding-interview',
href: '/coding-interview-prep/',
},
{
label: 'Algorithms',
href: '/algorithms/introduction',
href: '/algorithms/study-cheatsheet',
},
{label: 'Blog', to: 'blog', position: 'left'},
{
@ -80,15 +80,15 @@ module.exports = {
items: [
{
label: 'Start reading',
href: '/introduction',
href: '/software-engineering-interview-guide/',
},
{
label: 'Resume preparation',
href: '/resume/guide',
href: '/resume/',
},
{
label: 'Algorithms',
href: '/algorithms/introduction',
href: '/algorithms/study-cheatsheet',
},
{
label: 'Blog',
@ -100,20 +100,20 @@ module.exports = {
title: 'Interviews',
items: [
{
label: 'Interview cheatsheet',
href: '/cheatsheet',
label: 'Coding interviews',
href: '/coding-interview-prep/',
},
{
label: 'Coding interviews',
href: '/coding-interview',
label: 'Study plan',
href: '/coding-interview-study-plan/',
},
{
label: 'System design interviews',
href: '/system-design',
href: '/system-design/',
},
{
label: 'Behavioral interviews',
href: '/behavioral-interview',
href: '/behavioral-interview/',
},
],
},

@ -66,7 +66,7 @@ module.exports = {
},
{
'Algorithms cheatsheets': [
'algorithms/algorithms-introduction',
'algorithms/study-cheatsheet',
{
Basics: [
'algorithms/array',
@ -101,4 +101,80 @@ module.exports = {
Misc: ['interviewer-cheatsheet'],
},
],
docsRevamp: [
{
type: 'category',
label: 'Introduction',
collapsible: false,
items: ['software-engineering-interview-guide'],
},
{
type: 'category',
label: 'Getting an interview',
collapsible: false,
items: ['resume'],
},
{
type: 'category',
label: 'Coding interview preparation',
collapsible: false,
items: [
'coding-interview-prep',
'programming-languages-for-coding-interviews',
'coding-interview-study-plan',
'coding-interview-best-practices',
'coding-interview-techniques',
'mock-interviews',
'coding-interview-rubrics',
],
},
{
type: 'category',
label: 'System design interview preparation',
collapsible: false,
items: ['system-design'],
},
{
type: 'category',
label: 'Behavioral interview preparation',
collapsible: false,
items: [
'behavioral-interview',
'behavioral-interview-questions',
'self-introduction',
'final-questions',
],
},
{
'Salary and offer negotiation preparation': [
'understanding-compensation',
'negotiation',
'negotiation-rules',
'choosing-between-companies',
],
},
{
'Algorithms study cheatsheets': [
'algorithms/study-cheatsheet',
'algorithms/array',
'algorithms/string',
'algorithms/hash-table',
'algorithms/recursion',
'algorithms/sorting-searching',
'algorithms/matrix',
'algorithms/linked-list',
'algorithms/queue',
'algorithms/stack',
'algorithms/tree',
'algorithms/graph',
'algorithms/heap',
'algorithms/trie',
'algorithms/interval',
'algorithms/dynamic-programming',
'algorithms/binary',
'algorithms/math',
'algorithms/geometry',
],
},
],
};

@ -56,7 +56,32 @@ html[data-theme='dark'] {
}
.markdown h1 {
margin-top: 1rem;
font-size: 2.25em;
margin-top: 1em;
}
.markdown h2 {
font-size: 1.5em;
margin-top: 2em;
margin-bottom: 1em;
}
.markdown h3 {
font-size: 1.25em;
font-weight: 600;
margin-top: 1.6em;
margin-bottom: 0.6em;
}
.markdown blockquote {
border-left-color: var(--ifm-color-emphasis-200);
border-left-width: 0.5rem;
color: var(--ifm-color-emphasis-600);
}
.markdown ul blockquote {
font-size: 0.9em;
margin-top: 0.5em;
}
@media screen and (max-width: 767px) {
@ -163,4 +188,3 @@ html[data-theme='dark'] .navbar-icon-telegram:before {
height: 28px;
width: 24px;
}

@ -11,7 +11,7 @@ export default [
wasn't sure what to expect and where to start. This handbook together
with the{' '}
<a
href="https://frontendinterviewhandbook.com"
href="https://www.frontendinterviewhandbook.com"
target="_blank"
rel="noreferrer noopener">
Front End Interview Handbook

@ -23,7 +23,7 @@ const FEATURES = [
interview experience needed.
</>
),
link: '/introduction',
link: '/software-engineering-interview-guide/',
},
{
title: <>📝 Curated practice questions</>,
@ -36,17 +36,17 @@ const FEATURES = [
to tell you which the best questions are.
</>
),
link: '/best-practice-questions',
link: '/coding-interview-study-plan/',
},
{
title: <>📋 Interview cheatsheet</>,
title: <>📋 Interview best practices</>,
description: (
<>
Straight-to-the-point Do's and Don'ts during an interview. The battle is
already half won.
</>
),
link: '/cheatsheet',
link: '/coding-interview-best-practices/',
},
{
title: <>💁 Practical algorithm tips</>,
@ -56,7 +56,7 @@ const FEATURES = [
cases to look out for.
</>
),
link: '/algorithms/introduction',
link: '/algorithms/study-cheatsheet/',
},
{
title: <>💬 Behavioral questions</>,
@ -66,7 +66,7 @@ const FEATURES = [
prepare your answers ahead of time.
</>
),
link: '/behavioral-questions',
link: '/behavioral-interview-questions/',
},
{
title: <>🧪 Tested and proven</>,
@ -145,7 +145,7 @@ function HeroSection() {
<div className={styles.buttons}>
<Link
className={classnames('button button--primary button--lg')}
to="/introduction">
to="/software-engineering-interview-guide/">
Start reading now&nbsp;&nbsp;
</Link>
</div>
@ -324,7 +324,7 @@ function HowToUseSection() {
<>Software engineering specific resume content</>,
<>Optimizing and and testing your resume</>,
]}
ctaLink="/resume/guide"
ctaLink="/resume/"
/>
</div>
<div
@ -342,7 +342,7 @@ function HowToUseSection() {
<>System design interview preparation</>,
<>Behavioral interview preparation</>,
]}
ctaLink="/interview-formats"
ctaLink="/coding-interview-prep/"
/>
</div>
<div
@ -358,7 +358,7 @@ function HowToUseSection() {
<>Negotiation strategies for software engineers</>,
<>Guide on how compensation works for software engineers</>,
]}
ctaLink="/understanding-compensation"
ctaLink="/understanding-compensation/"
/>
</div>
<div
@ -818,7 +818,7 @@ function PreFooterSection() {
</p>
<Link
className={classnames('button button--primary button--lg')}
to="/introduction">
to="/software-engineering-interview-guide/">
Start reading now&nbsp;&nbsp;
</Link>
</div>

@ -107,7 +107,7 @@ function DocItemContent(props) {
</div>
</div>
{renderTocDesktop && (
<div className="col col--4">
<div className="col col--3">
<TOC
toc={DocContent.toc}
minHeadingLevel={tocMinHeadingLevel}

@ -0,0 +1,265 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import React, {useEffect, useMemo} from 'react';
import clsx from 'clsx';
import {
isActiveSidebarItem,
usePrevious,
Collapsible,
useCollapsible,
findFirstCategoryLink,
ThemeClassNames,
useThemeConfig,
useDocSidebarItemsExpandedState,
isSamePath,
} from '@docusaurus/theme-common';
import Link from '@docusaurus/Link';
import isInternalUrl from '@docusaurus/isInternalUrl';
import {translate} from '@docusaurus/Translate';
import IconExternalLink from '@theme/IconExternalLink';
import DocSidebarItems from '@theme/DocSidebarItems';
import styles from './styles.module.css';
import useIsBrowser from '@docusaurus/useIsBrowser';
export default function DocSidebarItem({item, ...props}) {
switch (item.type) {
case 'category':
return <DocSidebarItemCategory item={item} {...props} />;
case 'html':
return <DocSidebarItemHtml item={item} {...props} />;
case 'link':
default:
return <DocSidebarItemLink item={item} {...props} />;
}
} // If we navigate to a category and it becomes active, it should automatically
// expand itself
function useAutoExpandActiveCategory({isActive, collapsed, setCollapsed}) {
const wasActive = usePrevious(isActive);
useEffect(() => {
const justBecameActive = isActive && !wasActive;
if (justBecameActive && collapsed) {
setCollapsed(false);
}
}, [isActive, wasActive, collapsed, setCollapsed]);
}
/**
* When a collapsible category has no link, we still link it to its first child
* during SSR as a temporary fallback. This allows to be able to navigate inside
* the category even when JS fails to load, is delayed or simply disabled
* React hydration becomes an optional progressive enhancement
* see https://github.com/facebookincubator/infima/issues/36#issuecomment-772543188
* see https://github.com/facebook/docusaurus/issues/3030
*/
function useCategoryHrefWithSSRFallback(item) {
const isBrowser = useIsBrowser();
return useMemo(() => {
if (item.href) {
return item.href;
} // In these cases, it's not necessary to render a fallback
// We skip the "findFirstCategoryLink" computation
if (isBrowser || !item.collapsible) {
return undefined;
}
return findFirstCategoryLink(item);
}, [item, isBrowser]);
}
function DocSidebarItemCategory({
item,
onItemClick,
activePath,
level,
index,
...props
}) {
const {items, label, collapsible, className, href} = item;
const hrefWithSSRFallback = useCategoryHrefWithSSRFallback(item);
const isActive = isActiveSidebarItem(item, activePath);
const isCurrentPage = isSamePath(href, activePath);
const {collapsed, setCollapsed} = useCollapsible({
// active categories are always initialized as expanded
// the default (item.collapsed) is only used for non-active categories
initialState: () => {
if (!collapsible) {
return false;
}
return isActive ? false : item.collapsed;
},
});
useAutoExpandActiveCategory({
isActive,
collapsed,
setCollapsed,
});
const {expandedItem, setExpandedItem} = useDocSidebarItemsExpandedState();
function updateCollapsed(toCollapsed = !collapsed) {
setExpandedItem(toCollapsed ? null : index);
setCollapsed(toCollapsed);
}
const {autoCollapseSidebarCategories} = useThemeConfig();
useEffect(() => {
if (
collapsible &&
expandedItem &&
expandedItem !== index &&
autoCollapseSidebarCategories
) {
setCollapsed(true);
}
}, [
collapsible,
expandedItem,
index,
setCollapsed,
autoCollapseSidebarCategories,
]);
return (
<li
className={clsx(
ThemeClassNames.docs.docSidebarItemCategory,
ThemeClassNames.docs.docSidebarItemCategoryLevel(level),
'menu__list-item',
{
'menu__list-item--collapsed': collapsed,
},
className,
)}>
<div
className={clsx('menu__list-item-collapsible', {
'menu__list-item-collapsible--active': isCurrentPage,
})}>
<Link
className={clsx('menu__link', {
'menu__link--sublist': collapsible,
'menu__link--sublist-caret': !href && collapsible,
'menu__link--active': isActive,
})}
onClick={
collapsible
? (e) => {
onItemClick?.(item);
if (href) {
updateCollapsed(false);
} else {
e.preventDefault();
updateCollapsed();
}
}
: () => {
onItemClick?.(item);
}
}
aria-current={isCurrentPage ? 'page' : undefined}
aria-expanded={collapsible ? !collapsed : undefined}
href={collapsible ? hrefWithSSRFallback ?? '#' : hrefWithSSRFallback}
{...props}>
{label}
</Link>
{href && collapsible && (
<button
aria-label={translate(
{
id: 'theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel',
message: "Toggle the collapsible sidebar category '{label}'",
description:
'The ARIA label to toggle the collapsible sidebar category',
},
{
label,
},
)}
type="button"
className="clean-btn menu__caret"
onClick={(e) => {
e.preventDefault();
updateCollapsed();
}}
/>
)}
</div>
<Collapsible lazy as="ul" className="menu__list" collapsed={collapsed}>
<DocSidebarItems
items={items}
tabIndex={collapsed ? -1 : 0}
onItemClick={onItemClick}
activePath={activePath}
level={level + 1}
/>
</Collapsible>
</li>
);
}
function DocSidebarItemHtml({item, level, index}) {
const {value, defaultStyle, className} = item;
return (
<li
className={clsx(
ThemeClassNames.docs.docSidebarItemLink,
ThemeClassNames.docs.docSidebarItemLinkLevel(level),
defaultStyle && `${styles.menuHtmlItem} menu__list-item`,
className,
)}
key={index} // eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{
__html: value,
}}
/>
);
}
function DocSidebarItemLink({
item,
onItemClick,
activePath,
level,
index,
...props
}) {
const {href, label, className} = item;
const isActive = isActiveSidebarItem(item, activePath);
const isInternalLink = isInternalUrl(href);
return (
<li
className={clsx(
ThemeClassNames.docs.docSidebarItemLink,
ThemeClassNames.docs.docSidebarItemLinkLevel(level),
'menu__list-item',
className,
)}
key={label}>
<Link
className={clsx(
'menu__link',
!isInternalLink && styles.menuExternalLink,
{
'menu__link--active': isActive,
},
)}
aria-current={isActive ? 'page' : undefined}
to={href}
{...(isInternalLink && {
onClick: onItemClick ? () => onItemClick(item) : undefined,
})}
{...props}>
{label}
{!isInternalLink && <IconExternalLink />}
</Link>
</li>
);
}

@ -0,0 +1,17 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
@media (min-width: 997px) {
.menuHtmlItem {
padding: var(--ifm-menu-link-padding-vertical)
var(--ifm-menu-link-padding-horizontal);
}
}
.menuExternalLink {
align-items: center;
}

@ -14,7 +14,14 @@ function TOC({className, ...props}) {
<div className="margin--md">
<SidebarAd position="table_of_contents" />
</div>
<h3 className="padding-left--md padding-top--md margin-bottom--none">
<h3
className="padding-left--md padding-top--md margin-bottom--none"
style={{
textTransform: 'uppercase',
fontSize: '0.75em',
color: 'var(--ifm-color-emphasis-700)',
letterSpacing: '0.5px',
}}>
Table of Contents
</h3>
<TOCItems

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

Loading…
Cancel
Save