甚至在你开始练习你的编码面试问题之前，你应该阅读并熟悉这个指南。伴随着这个指南的 LeetCode grinding 将会让你在早期就牢牢记住这些重要的编码面试行为。
Usually you don't need to wear beautiful clothes, just relax. T-shirts and jeans are acceptable in most places.
What to do before a virtual onsite coding interview
Prepare pen and paper.
In case you need to record and imagine something. It is especially helpful for drawing trees/figures
Use earphones or headphones and make sure you are in a quiet environment.
Avoid using speakers, because if the echo is loud, communication will be difficult, and repetition by participants will only lead to the loss of valuable time.
Familiarize and set up shortcuts in the coding environment (code rpad/code pen).
Set the shortcut keys of the editor, turn on auto-completion, tab spacing, etc. If you know shortcuts and make good use of them, the interviewer will be impressed with you
Turn off the web cam if possible.
Most remote interviews don't need video chat, and having video chat on will only distract attention and take up network bandwidth.
What to do before a phone screen coding interview
Use earphones and put the phone on the table.
Avoid holding the phone with one hand and typing with the other hand
✅请求使用 Zoom/Google Meet/Hangouts 或 Skype 代替电话。
Learn about whiteboard space management.
Leave space between lines of code in case you need to insert lines between existing codes.
What to do during a coding interview*
*Introduce yourself in a few sentences under a minute or 2.
How to introduce yourself for software engineers according to our guide * ✅ Sound enthusiastic!
Smile and talk, and you will naturally sound more attractive. * ❌，不要在自我介绍上花太多时间，因为你剩下的编码时间会更少。*
不要马上开始编码。编码问题往往含糊不清、不够具体，目的是让面试官衡量求职者对细节和细心的关注程度。至少问 2-3 个澄清性问题。
T3】 * ✅阐明假设(参考算法备忘单了解常见假设)
The tree graph is probably a graph that allows circulation, and a simple recursive solution won't work. Clarify whether a 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 were given a word dictionary, would it be a list of strings or a Trie?
Is the input array sorted? (for example, for deciding between binary/linear searches)*
T3】 * Clarify input value format
values: negative? Floating point? Empty? Null？ Repeat? Oversized? * Work through a simplified example to assure you under the question.
For example, you are asked to write a palindrome checker, and before coding, come up with simple test cases, such as "kayak" = > true, "mouse" = > false, and then check with the interviewer whether these examples meet their expectations * ❌不要马上开始编程，或者在面试官给你开绿灯之前就开始。*
根据问题的复杂程度，讨论时间从几分钟到 5-10 分钟不等。这也给面试官一个机会给你提示，引导你找到一个可以接受的解决方案。
*✅ Explain a few approaches that you could take at a high level (don't go too much into implementation details) . discuss the trade offers of each approach with your interviewer as if the interviewer was your coworker and you are all collaborating on a problem.
For algorithm problems, space/time is a common trade-off. Let's take the famous 2 and problems as examples. There are two common solutions-(1) using nested for loops. This is O (n 2 ) in terms of time complexity and O(1) in terms of space. (2) In one pass of the array, you can hash a value to the index in the hash table. For subsequent values, look up the hash table to see if you can find an existing value that can be added to the target value. This method is O(N) in time and space. Discuss these two solutions, propose a compromise, and summarize which solution is better (usually the one with lower time complexity) * And explain the time and space complexity of your proposed approach (es).
Mention the great complexity of time and explain the reasons (for example, O (n 2 means time because there are nested for loops; O(n) for space, because an extra array is created). Use algorithm optimization technology to master all the time and space complexity. * ✅同意最理想的方法，并对其进行优化。识别重复/重复/重叠的计算，并通过缓存减少它们。请参阅第页优化您的解决方案。 * ❌不要马上开始编程，或者在面试官给你开绿灯之前就开始。 * ❌不会忽视任何一条给定的信息。 * ❌似乎对你的方法和分析没有把握。*
T3】 * Code/write at a rational speed so you can talk through it-but not too slow.
You want to type slowly enough to explain the code, but not too slow, because you may not have time to answer all the questions * ✅写实际的可编译的工作代码，而不是伪代码。 * Write clean, straight forward and neat code with as few syntax errors/bugs as possible.
Always choose a clean and simple implementation instead of a complicated and chaotic one. Ensure that neat coding style and good coding practice are adopted according to language examples and structures. Grammatical 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 is best to use a long variable name that can explain the problem. Suppose you need to find multiples of 3 in a set of numbers. Name the result as array
multiplesOfThreeinstead of array/number. * ✅请求允许使用琐碎函数，而不必实现它们。
max应该都可以使用 * Write in a modular fashion, going from higher-level functions and breaking them down into smaller helper functions.
Suppose you are asked to make a car. You can just write a few advanced functions:
assemble(). Then decompose
assemble()into smaller functions,
constructCarFrame(). You can even ask the interviewer if you can not write 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).
For example, "In a non-interview setting, I will write a regular expression to parse this string instead of using
split()which may not cover some marginal situations." * ✅ 【现场/白板】练习白板空间管理 * ❌:当你的面试官在说话的时候，不要打断他们。通常，如果他们说话，他们是在试图给你暗示或引导你到正确的方向。 * ❌不花太多时间写评论。 * ❌不要重复自己 * ❌不使用不好的变量名。
*Scan through your code for mistakes-such as off-by-one errors.
Read through your code with a pair of fresh eyes-just like the first time you saw a piece of code written by someone else-and discuss the process of finding your mistakes * Brain edge cases with the interviewer and add additional test cases. (refer to algorithms cheat cases for common corner cases)
The given test cases are usually designed simply. Brainstorm possible edge situations, such as large size input, empty set, single item set, negative number. * ✅用那些测试用例一步一步地检查你的代码。 * ✅寻找可以重构的地方。 * Reiterate the time and space complexity of your code.
This allows you to remind yourself of problems in your code that may deviate from the original time and space complexity. * ✅解释了权衡，以及如果给更多的时间，代码/方法可以如何改进。 * ❌不要马上宣布你完成了编码。先做到以上！ * ❌不与面试官争论。他们可能是错的，但这是不太可能的，因为他们对这个问题很熟悉。*
T5】 * ✅感谢面试官 * ❌不会不问任何问题就结束面试。*
What to do after a coding interview*
*✅给你的面试官发一封跟进邮件或 Linkedin 邀请，感谢他们抽出时间给你面试的机会。