您的位置:首页 > 职场人生

编码 面试_通过您的高级工程编码面试

2020-08-21 14:13 726 查看

编码 面试

重点 (Top highlight)

Love them or hate them, coding interviews are often a necessary part of getting a software engineering job. The format used to be writing solutions to algorithmic problems on a whiteboard. Lately, with the pandemic, this has all moved to online platforms. Many people despise this part of the interview since the questions asked can be very different from the day to day work of a typical engineer.

爱他们还是恨他们,编码面试通常是获得软件工程工作的必要部分。 该格式过去是在白板上编写算法问题的解决方案。 最近,随着大流行,这一切都转移到了在线平台上。 许多人鄙视面试的这部分内容,因为所提问题与典型工程师的日常工作可能大不相同。

For senior engineering positions, the questions are more challenging, and interviewers expect a higher standard. I enjoy this extra challenge and received several offers for senior positions during my last round of interviews. As a result, I keep getting asked for advice on how to pass these harder interviews. Now, after forwarding my friends the same email a bunch of times in the past year, I’m sharing my advice more broadly.

对于高级工程职位,问题更具挑战性,访问员期望更高的标准。 我喜欢这个额外的挑战,在上一轮面试中收到了几份高级职位的邀请。 结果,我不断被问到如何通过这些艰苦的采访的建议。 现在,在过去一年中多次转发给我的朋友相同的电子邮件之后,我将更广泛地分享我的建议。

The intended audience for this post is people who have passed basic coding interviews before but want to up their skills. Therefore I’ll skip the discussion of the interview format and instead focus on:

这篇文章的目标读者是以前通过基本编码面试但想提高自己技能的人。 因此,我将跳过对面试形式的讨论,而将重点放在:

  • How to get prepared

    如何做好准备
  • Choosing the right practice problems

    选择正确的练习题

    (plus my list of the 12 best problems to practice with)

    (加上我列出的要练习的12个最佳问题的清单)

  • Knowing the right things

    知道正确的事情
  • A recommended study plan

    推荐的学习计划

如何做好准备 (How to get prepared)

There are many online interviewing platforms out there, but I highly recommend using Leetcode for the following reasons:

有许多在线面试平台,但出于以下原因,我强烈建议使用Leetcode

  • It has 1000s of sample problems

    它有数千个样本问题
  • Many of the problems have come up in real interviews

    许多问题都出现在真实的采访中
  • Most problems include multiple sample solutions with detailed explanations to help you sharpen your skills

    大多数问题包括多个示例解决方案,并附有详细的说明,以帮助您提高技能
  • There is a grading scale which you can use to identify the harder problems more likely to come up in a senior engineering interview

    有一个等级量表,您可以使用它来确定更可能在高级工程访谈中出现的较难问题。
Leetcode’s difficulty levels Leetcode的难度等级

Leetcode classifies its problems into three difficulty levels: easy, medium, and hard. The classification system isn’t perfect. It depends on your background/strengths as to what you consider easy or hard. I’ve encountered “easy” problems that I got completely stuck on and couldn’t solve, and I’ve also encountered “hard” problems that I blazed through no problem. Still, these classifications are a good starting point. You can also always look at the number of solves vs. number of attempts to get additional info on the difficulty level.

Leetcode将其问题分为三个难度级别:容易,中等和困难。 分类系统并不完美。 这取决于您的背景/优势,即您认为容易还是很难。 我遇到了一些“棘手”的问题,这些问题我完全陷入了困境,无法解决,而且我也遇到了一些“棘手的”问题,这些问题我都没遇到过。 这些分类仍然是一个很好的起点。 您也可以随时查看解决次数与尝试次数的比较,以获取有关难度级别的更多信息。

Where should you focus your time? Solve many easy problems or focus on a few hard ones? In my experience interviewing at 15 companies, I’ve never encountered more than a Leetcode medium question, even when interviewing for L6 level positions. The hard problems usually have one of three flaws which prevent them from being good candidates for an actual interview question:

您应该把时间集中在哪里? 解决许多简单的问题还是专注于一些困难的问题? 根据我在15家公司面试的经验即使面试L6级职位 ,我也从来没有遇到过Leetcode中等问题 。 困难的问题通常具有以下三个缺陷之一,这些缺陷使它们无法成为实际面试问题的良好候选人:

  1. The problem takes too long to describe

    该问题描述时间过长
  2. The solution requires a lot of code

    该解决方案需要大量代码
  3. The solution requires knowledge of a relatively obscure data structure or mathematical theorem, or it requires a “trick” which you either see or you don’t

    该解决方案需要了解相对模糊的数据结构或数学定理,或者需要一个“技巧”,而无论您看到还是不知道

Should you just avoid the Leetcode hard questions entirely? Not at all! Just because they won’t come up in a real-world setting doesn’t mean there is no value to practicing them. In fact, in my opinion, solving a couple of hard problems was a better use of my time preparing for interviews than churning through many medium problems. There are a few reasons for this:

您是否应该完全避免Leetcode难题? 一点也不! 仅仅因为它们不会出现在现实环境中并不意味着实践它们没有任何价值。 实际上,在我看来, 解决一些棘手的问题比花时间解决许多中等的问题更好地利用了我准备面试的时间 。 这有几个原因:

  1. The hard problems often teach you multiple concepts at once. Rather than just using a single data structure, you’ll need to combine various data structures creatively.

    困难的问题通常会一次教会您多个概念。 您不仅需要使用单个数据结构,还需要创造性地组合各种数据结构。
  2. Solving hard problems gives you a huge confidence boost. If you solve a few hard problems, you’ll be shocked at how easy the actual interview questions feel.

    解决难题可以极大地增强您的信心。 如果您解决了一些棘手的问题,您将对实际的面试问题感到如此轻松而感到震惊。

Overall, I advise starting with medium problems, then adding harder problems as time permits. If you don’t have time to progress beyond medium problems, you should be fine — that’s all you’re likely to see in an interview. However, if you make an effort to solve harder problems, you will boost your understanding and confidence — making your interview success inevitable.

总体而言,我建议从中级问题开始,然后在时间允许的情况下添加更难的问题。 如果您没有时间解决中等问题,那么您应该没问题-那就是您在面试中可能看到的全部。 但是,如果您努力解决更棘手的问题,则将增进您的理解和信心-使面试成功不可避免。

选择正确的练习题 (Choosing the right practice problems)

Not all problems are created equal. As I mentioned above, some hard problems are either improperly classified or they require a trick/esoteric knowledge. It is not worth wasting your time on these problems.

并非所有问题都是平等的。 正如我上面提到的,一些困难的问题要么分类不当,要么需要技巧/深奥的知识。 浪费您的时间在这些问题上是不值得的。

How do you know which problems are the ones worth solving? Unfortunately, it’s not possible to know ahead of seeing the solution. That’s why I kept a list of my favorite problems. I’ve been sharing this with anyone who emails me for advice.

您如何知道哪些问题值得解决? 不幸的是,在看到解决方案之前不可能知道。 这就是为什么我列出了我最喜欢的问题的原因。 我一直在和给我发电子邮件寻求建议的任何人分享。

Here are some questions I would recommend because they are both adequately categorized as hard, and solving them is hugely beneficial for learning:

以下是一些我要推荐的问题,因为它们都被归类为难,解决它们对学习非常有益:

Here are some questions that, in my opinion, are even harder than the others and maybe ought to be in a “very hard” category. I wouldn’t recommend doing these until you’ve done most of the others, but they can be extremely valuable for building confidence and knowledge:

在我看来,有些问题比其他问题更难解决,也许应该归为“非常难”一类。 在您完成大多数其他工作之前,我不建议您这样做,但是它们对于建立信心和知识非常有价值:

Finally, here are some hard problems which I would not recommend as they required a trick or relatively obscure knowledge. Don’t waste your time on any of these problems.

最后,这是一些棘手的问题,我不建议这样做,因为它们需要技巧或相对晦涩的知识。 不要在任何这些问题上浪费时间。

None of these lists are complete, of course. They are simply all of the hard problems I solved in my last round of interview practice — so I can speak about them based on experience.

当然,这些列表都不完整。 它们只是我在上一轮面试练习中解决的所有难题,因此我可以根据经验谈谈它们。

知道正确的事情 (Knowing the right things)

All of the above-recommended problems should be solvable provided you have the right background knowledge. This may require some review. Fortunately, Leetcode lets you filter medium problems by data structure to give yourself extra practice on any unfamiliar areas.

只要您具有正确的背景知识,所有上述建议的问题都应该可以解决。 这可能需要一些审查。 幸运的是,Leetcode允许您按数据结构过滤中等问题,以便在任何不熟悉的领域进行额外的练习。

Know your data structures really well. This means being super comfortable with the “big 5”: Lists, Arrays, Sets, Trees, and Maps (arguably the most essential data structure in computer science). With Hard problems you need to know a few more. In order of priority: Heaps, Tries, Doubly-Linked Lists, Union-Find, and for bonus points self-balancing binary trees.

非常了解您的数据结构。 这意味着对“五大”超级满意:列表,数组,集合,树和地图(可以说是计算机科学中最重要的数据结构)。 遇到难题时,您需要了解更多信息。 优先顺序为:堆,尝试,双链表,联合查找,并为奖励积分自平衡二叉树。

On top of data structures, you also have to know when to recognize a dynamic programming problem. The trick I use is to check “does my next choice depend on my previous choices?” If the answer is no, then it is perfect for dynamic programming. The textbook example is the “how many ways can I make change for you given these coins?” The number of ways to make change for a particular dollar value is not affected by the fact that you might have already given some change before. Also, keep in mind that you can almost always write dynamic programming using recursion with memoization which, in my opinion, makes the code easier to follow.

在数据结构之上,您还必须知道何时识别动态编程问题。 我使用的技巧是检查“我的下一个选择是否取决于以前的选择?” 如果答案是否定的,那么它非常适合动态编程。 教科书的例子是“在给定这些硬币的情况下,我能为您做出几种改变?” 更改特定美元价值的方法数量不受之前可能已经进行过一些更改的事实的影响。 另外,请记住,您几乎总是可以使用带有备忘录的递归来编写动态编程,我认为这使代码更易于遵循。

推荐的学习计划 (A recommended study plan)

To conclude, here are my recommendations to prepare for a senior coding interview:

总结一下,这是我为高级编码面试做准备的建议:

  1. Review the “big 5” data structures and solve some medium problems that use those data structures

    复习“五大”数据结构,并解决一些使用这些数据结构的中等问题
  2. Practice a couple of medium dynamic programming problems

    练习一些中等动态编程问题
  3. Move on to the hard problems listed above where you will gain experience using less common data structures

    继续上面列出的难题,您将在其中使用不太常见的数据结构获得经验
  4. Finally, solve the “very hard” problems listed above to boost your confidence in your problem-solving ability

    最后,解决上面列出的“非常困难”的问题,以增强您对解决问题能力的信心

The harder problems take time, but the effort does pay off when you are in the interview.

较棘手的问题需要花费时间,但是在面试中,付出的努力是有回报的。

Feel free to reach out if you have questions or want additional advice. If there’s enough interest, I will keep writing further blog posts on other interviewing modules, soft skills, and extra tricks to dazzle your interviewers.

如果您有任何疑问或需要其他建议,请随时与我们联系。 如果有足够的兴趣,我将继续在其他面试模块,软技能和其他技巧上写下更多博客文章,以使面试官眼花azz乱。

Good luck!

祝好运!

翻译自: https://medium.com/@stevenheidel/passing-your-senior-engineering-coding-interview-5a6b30261f68

编码 面试

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: