重点 (Top highlight)

I’m writing this article because I never want someone to put in hundreds of hours into Leetcode and for them to get a false sense of confidence that they can pass any coding interview. Then, when they get rejected from all of their interviews because they don’t understand the technical interview process or the criteria being assessed, to have that crushing feeling of remorse, thinking, “I wasted hundreds of hours and/or hundreds of dollars on Leetcode.” I’ve had painful first-hand experience of this.

我之所以写这篇文章,是因为我从不希望有人花数百个小时来研究Leetcode,并让他们对他们可以通过任何编码面试产生一种错误的信心。 然后,当他们由于不了解技术面试过程或所评估的标准而被所有面试拒绝时,要有一种crush悔的feeling悔感,心想:“我浪费了数百小时和/或数百美元用于Leetcode。” 我对此有第一手的痛苦经历。

I think it’s great to practice your problem-solving coding skills with Leetcode or even AlgoExpert, especially if you are unfamiliar with data structures like stacks, queues, heaps, tries, etc. In the past, I’ve purchased monthly subscriptions for both when I was actively interviewing for internships in college. However, I think there’s a lot of value in understanding what interviewers are expecting in a technical interview. Even if you were to get the most optimal solution for a given problem, that’s not all we are looking for (which surprises many people).

我认为与Leetcode甚至AlgoExpert一起练习解决问题的编码技能非常好,尤其是如果您不熟悉堆栈,队列,堆,尝试等数据结构时。过去,我在两个月都购买了月度订阅我正在积极面试大学实习机会。 但是,我认为了解面试官对技术面试的期望有很多价值。 即使您要为给定的问题获得最佳的解决方案,也不是我们一直在寻找(这使很多人感到惊讶)。

From an interviewer’s perspective, we evaluate candidates on five different axes during a coding interview. Some of the specifics may vary from company to company, but the overall criteria remain the same. I’ll use a trivial coding question as an example, but you can imagine that the same concepts apply as the questions get harder or more complex.

从面试官的角度来看,我们在编码面试过程中在五个不同的轴上评估候选人。 某些细节可能因公司而异,但总体标准保持不变。 我将以一个简单的编码问题为例,但是您可以想象,随着问题变得越来越难或更复杂,同样的概念也适用。

1.澄清歧义 (1. Clarifying Ambiguity)

Suppose I gave you a question like, “given a collection of numbers, return the largest number,” in an interview. Do you immediately start coding, or do you spend some time (5, 10, or even 15 minutes) asking some questions upfront and try to identify some of the edge cases? Over time, you will get better at asking questions and identifying edge cases. If you have never done this before, next time, when you are solving a Leetcode problem, start thinking about some of the test cases, Leetcode may be running against your solution behind the scenes. Clarifying questions you may want to ask for the problem above (I purposely left the question vague since you may face this type of wording in an interview) are:

假设我在一次采访中给您一个问题,例如“给出一个数字集合,返回最大数字”。 您是立即开始编码,还是花一些时间(5、10甚至15分钟)预先询问一些问题并尝试确定一些边缘情况? 随着时间的流逝,您将能够更好地提出问题并确定极端情况。 如果您之前从未做过此事,那么下次在解决Leetcode问题时,请开始考虑一些测试用例,Leetcode可能会在幕后与您的解决方案对立。 澄清您可能想问上述问题的问题(我故意使这个问题含糊不清,因为您可能在面试中会遇到这种措词):

  • “How will my input be given to me, will it be in a list, set, etc., of numbers?”“我的输入将如何提供给我,是否会出现在数字列表,集合等中?”
  • “What should I return? The largest value or the index of the largest value”?”“我应该返回什么? 最大值或最大值的索引“?”
  • “If the list is empty, what should I return?”“如果列表为空,我应该返回什么?”
  • “Can I assume that the list of numbers will fit into memory” (Not a super crucial question, but it shows that you have some understanding of the limitation of memory).“我可以假设数字列表适合内存吗”(这不是一个至关重要的问题,但是它表明您对内存的局限性有所了解)。

I find it useful to spend ten minutes thinking about your solution. You never want to be in a position where you are in a 45-minute interview, and for 30 minutes you’ve been coding out your solution. Once you finish coding, the interviewer may say something like, “your solution doesn’t seem to work for this edge case, how can we change your solution to work here?” Maybe it’s a simple fix, but what if your algorithm is fundamentally wrong? You’ll then only have 15 minutes left to rethink your whole solution, which can be highly stressful and probably means you won’t be passing the round.

我发现花十分钟思考您的解决方案很有用。 您永远都不想待在45分钟的采访中,而且30年来您一直在编写解决方案。 完成编码后,面试官可能会说:“您的解决方案似乎不适用于这种极端情况,我们如何更改您的解决方案以在此处使用?” 也许这是一个简单的解决方法,但是如果您的算法从根本上错了怎么办? 然后,您只剩下15分钟的时间来重新考虑您的整个解决方案,这可能会给您带来很大的压力,并且可能意味着您不会通过此回合。

2.您如何回应反馈? (2. How Do You Respond to Feedback?)

If you start coding out your solution, and I say something like “instead of using this data structure, do you think we could solve this question with this other data structure”?

如果您开始编写解决方案的编码,而我说的是“代替使用此数据结构,您是否认为我们可以使用其他数据结构解决此问题”?

There are two ways to respond. Either you can say something like, “No, I think you’re wrong,” or you could say, “Sure, let me think about how we could use that data structure.”

有两种应对方法。 您可以说“不,我认为您错了”,也可以说“当然,让我考虑一下如何使用该数据结构。”

The actual response I gave may sound a bit exaggerated, but the overall premise is to make sure if the interviewer offers some advice, you don’t immediately disregard it. The interviewer probably knows about 95% of all the different solutions for the problem, so they may be helping you by steering you away from a solution that might not work for a couple of edge cases, which will save you time.

我给出的实际回答可能有点夸张,但总体前提是要确保面试官是否提供了一些建议,您不要立即忽略它。 面试官大概知道所有95%的问题解决方案,因此他们可能会帮助您摆脱可能在少数情况下不起作用的解决方案,从而为您节省了时间。

Sometimes when interviewees don’t know the answer to something or get frustrated because they can’t figure out the solution, they may take that frustration out on the interviewer by giving snappy answers or ignoring feedback. The problem is that the person interviewing you will likely be working with you if you were to get hired. If you act badly in the interview, your interviewer may wonder how you’ll respond when working on a real project or new feature when there isn’t a lot of clarity around what to do.

有时,当受访者不知道某个问题的答案或因为无法解决问题而感到沮丧时,他们可能会给出快速的答案或忽略反馈,从而使受访者感到沮丧。 问题是,如果您被录用,面试您的人可能会与您一起工作。 如果您在面试中表现不佳,您的面试官可能会想知道,当您对实际工作或新功能进行不清楚的工作时,您将如何应对。

3. 沟通 (3. Communication)

Do you tell me (as the interviewer) your whole solution aloud before you start coding, or do you immediately start coding your answer in silence? I’ve been in interviews where the interviewee doesn’t say a word for 45 minutes (or however long the conversation is) and, in the end, tell me that their solution works and the corresponding time/space complexity. You can imagine that can be pretty awkward for interviewers, since we don’t know what you’re thinking and don’t know how we can help if you get stuck. You don’t have to make it sound like you’re teaching me something, but make sure every minute or two minutes you give some audible cues about what you’re doing or whether you’re stuck on something.

您是在开始编码之前大声告诉我(作为面试官)您的整个解决方案,还是立即开始默默地对答案进行编码? 我去过的访谈中,受访者在45分钟之内不说话(或者对话时间很长),最后告诉我他们的解决方案有效,并且时空复杂。 您可以想象这对面试官来说可能很尴尬,因为我们不知道您在想什么,也不知道如果您遇到困难,我们将如何提供帮助。 您不必听起来像是在教我一些东西,但请确保每隔一两分钟就对您正在做的事情或是否被某个东西卡住提出一些可听见的提示。

When you’re first given the problem (or even throughout the interview), it’s perfectly okay to ask the interviewer, “Can I take a couple of minutes to think about the problem?” Just make sure you tell me something before you stop talking for three or more minutes. When talking about your solution out loud, you may not know how to implement something, and it’s okay to stub out the functionality. You could say something like, “I don’t know how to implement this specific portion of my algorithm, but suppose I had a function that will give back this output and will have this space/time complexity when given a specific input.”

当您第一次遇到问题时(甚至在整个面试中),完全可以问问面试官:“我可以花几分钟时间思考问题吗?” 在停止讲话三分钟或更长时间之前,只需确保告诉我一些事情即可。 当大声谈论您的解决方案时,您可能不知道如何实现某些功能,也可以保留其功能。 您可以这样说:“我不知道如何实现算法的这一特定部分,但是假设我有一个函数可以返回该输出,并在给出特定输入时具有这种时空复杂性。”

4. 编码能力 (4. Coding Ability)

This can encompass everything from:

它可以包含以下所有内容:

  • Do you type quickly?您会快速打字吗?
  • Do you have a good understanding of the built-in methods and libraries in the programming language you use, or do you continuously have to lookup documentation during the interview?您是否对使用的编程语言中的内置方法和库有很好的了解,还是在面试过程中不断需要查找文档?
  • Do you use meaningful variable/function names and create helper methods when some of your logic is starting to get complicated?当某些逻辑开始变得复杂时,您是否使用有意义的变量/函数名称并创建辅助方法?
  • Do you mindlessly click the run button every time you make a small change to your code, or can you write 20 lines of syntax free code and then click run to see what your program does?

    您是在每次对代码进行少量更改时都无意识地单击运行按钮,还是可以编写20行不含语法的代码,然后单击运行以查看程序的作用?

  • If applicable, do you use classes or some OOO concepts?如果适用,您使用类还是某些OOO概念?
  • Did you write tests (especially with edge cases) to test the function you created?您是否编写了测试(尤其是带有边缘案例的测试)来测试您创建的功能?

5. 了解权衡 (5. Understanding Tradeoffs)

Every coding problem probably has many different solutions from the brute force way to the most optimal way. It’s always great to say things like, “One way we could solve this problem is by using this solution which will have this time/space complexity.” or “Another solution that would have a higher time complexity, but lower space complexity is … “. Like I said before, this is something that you will get better at over time.

从蛮力方式到最佳方式,每个编码问题可能都有许多不同的解决方案。 总是这样说:“解决这个问题的一种方法是使用这种具有时间/空间复杂性的解决方案。” 或“另一种解决方案,它的时间复杂度更高,但空间复杂度更低……”。 就像我之前说过的,随着时间的推移,您会逐渐变得更好。

我对Leetcode的特定抱怨,以及如何使用它优化时间 (My Specific Gripes with Leetcode and How To Optimize Your Time Using It)

One thing that you may notice is that the actual process of writing code is only one of the things we look for. When I conduct an interview, at the end of the day, I want to hire a candidate with great problem solving, coding, and communication skills. Technical coding interviews are far from perfect, but some talent is shown when a candidate can do well in them. The reasons why I’m on the fence about outright recommending Leetcode are:

您可能会注意到的一件事是,编写代码的实际过程只是我们所追求的目标之一。 最终,当我进行面试时,我想聘用一个具有解决问题,编码和沟通能力强的候选人。 技术编码面试远非完美,但是当候选人能在其中表现出色时,就会显示出一些才能。 我对直接推荐Leetcode持反对态度的原因是:

  • Leetcode doesn’t make you explain your algorithm out loud before you start writing code. I think this is important because if you can’t clearly articulate your algorithm, maybe you need to spend a couple more minutes thinking about it. I’d rather have a candidate do that then start naively coding up a solution for 30 minutes, hit a roadblock, and have no working solution at the end of the interview. Remember, the brute force solution is better than no answer. First, get a working solution, then a better solution.Leetcode不会使您在开始编写代码之前大声地解释算法。 我认为这很重要,因为如果您不能清楚地阐明自己的算法,也许您需要花一些时间来思考它。 我宁愿让候选人这样做,然后开始天真地编写解决方案30分钟,遇到障碍,在面试结束时没有可行的解决方案。 请记住,强力解决方案总比没有答案要好。 首先,找到一个可行的解决方案,然后是一个更好的解决方案。
  • Leetcode doesn’t make you say what the time and space complexity of your algorithm is. You will be asked this question in any technical interview where you write code since that’s how we are objectively able to measure two solutions and say which one is better from time, space, readability, etc. perspective. Additionally, if you say something like the time complexity is O(n), tell me what n (and any other variable you use) means. Does n represent the number of characters in a list, the number of items in a list, or what?

    Leetcode不会让您说算法的时间和空间复杂度。 在您编写代码的任何技术面试中都会询问您这个问题,因为这是我们客观地能够衡量两种解决方案的方式,并从时间,空间,可读性等角度说哪种解决方案更好。 另外,如果您说时间复杂度为O(n),请告诉我n(以及您使用的任何其他变量)的含义。 n是否代表列表中的字符数,列表中的项目数或什么?

  • In Leetcode, you can run your code many times and not get punished, but in an interview setting, you probably will only be able to click the “Execute Code” button four or five times. So make sure you’re more critical of syntax errors or logic errors before testing your code. I think Google was the only company I applied for where they don’t even give you a button to run your code, since you have to write it all in a Google doc. You don’t have to be that extreme, but make sure you don’t rely too much on the run button when creating a solution.在Leetcode中,您可以多次运行代码而不会受到惩罚,但是在面试设置中,您可能只能单击“执行代码”按钮四到五次。 因此,在测试代码之前,请确保您对语法错误或逻辑错误的批评更为严格。 我认为Google是我申请的唯一一家公司,他们甚至没有为您提供运行代码的按钮,因为您必须将所有内容都写在Google文档中。 您不必那么极端,但是请确保在创建解决方案时不要过多地依赖运行按钮。
  • Leetcode doesn’t force you to think of edge cases or ask clarifying questions since all of that information is given to you in advance.Leetcode不会强迫您考虑极端情况或提出澄清问题,因为所有这些信息都是事先提供给您的。
  • Leetcode doesn’t ask follow-up questions like “how would your solution change if we introduced this new requirement,” or “what’s the bottleneck in your algorithm.”Leetcode不会提出后续问题,例如“如果我们引入这一新要求,您的解决方案将如何更改”或“算法的瓶颈是什么”。
  • Leetcode doesn’t penalize you if you have lousy variable names or have 100 line methods. Readable code is something you don’t see very often on the Leetcode submissions for problems.如果变量名称不好或有100行方法,Leetcode不会对您造成不利影响。 易读代码是您在Leetcode提交中经常遇到的问题。

结论 (Conclusion)

To recap, Leetcode is not inherently bad. I think that Leetcode is kind of like riding your bike with training wheels, and in an interview, you won’t have those training wheels for support.

回顾一下,Leetcode本质上并不是很糟糕。 我认为Leetcode有点像带训练轮的自行车骑行,在采访中,您不会得到那些训练轮的支持。

It’s always great to practice in an environment that mirrors what the real setting will be like. More often than not, the people interviewing you will probably be the same people you’ll be working with if you were to get the offer. You interviewers want to make sure you are smart, but also want to make sure you don’t have a big ego and are reasonably easy to work with.

在能够真实反映真实环境的环境中进行练习总是很棒的。 如果要获得要约,面试您的人通常会和您一起工作的人更多。 面试官既要确保自己很聪明,又要确保自己没有很大的自负,并且很容易相处。

Additionally, it’s 100% completely okay if you can’t solve a LeetCode problem and look at the solution. At the end of the day, we do all of this practice for a real technical interview, and I want to showcase what you can expect.

此外,如果您不能解决LeetCode问题并查看解决方案,那是100%完全可以的。 归根结底,我们将对所有这些练习进行一次真正的技术面试,我想展示您可以期望的。

Data structures and coding questions being asked haven’t changed that much in the past couple of decades, nor will they change any time soon. Any effort you put in preparing for technical or behavioral interviews today will help you down the road when you interview again (or even at your job/making side projects.)

在过去的几十年中,被询问的数据结构和编码问题并没有太大变化,也不会很快改变。 您在今天准备进行技术或行为面试时所做的任何努力都会在您再次面试(甚至在您的工作/制作方面的项目)时帮助您。

The next time you are practicing Leetcode questions, try remembering some of the points above and start treating practice like an actual interview. I used to record myself when I did Leetcode to see how I sounded. I had a bad habit of rambling or making stuff up (saying “Ummm” or “ugh”) when I didn’t know the answer. Over time I’ve gotten better at it, but I would have never noticed it without recording myself. It’s probably going to be awkward watching yourself, but self-reflection is arguably one of the best ways to get better at these things.

下次您在练习Leetcode问题时,请尝试记住上面的几点,并开始将练习像实际面试一样对待。 我在做Leetcode时会记录自己的声音,以了解自己的声音。 当我不知道答案时,我有个坏习惯,四处乱逛或编造东西(说“ Ummm”或“ ugh”)。 随着时间的流逝,我的处境越来越好,但是如果不记录自己,我永远不会注意到它。 看着自己可能很尴尬,但是自我反省可以说是在这些事情上变得更好的最好方法之一。

Just a couple of disclaimers and FYIs. As always, the ideas and thoughts I share are in no way endorsed or supported by Salesforce (nor any other company I have worked at in the past). Also, there’s nothing wrong with doing LeetCode (since any time practicing writing code is better than not writing any code, especially for bootcamp grads or new grads who haven’t been coding for a long time).

只是一些免责声明和FYI。 与往常一样,我所分享的想法和想法绝不受Salesforce(以及我过去工作过的任何其他公司)的认可或支持。 另外,做LeetCode也没有错(因为任何时候练习编写代码总比不编写任何代码好,尤其是对于训练营的毕业生或已经很长时间没有编码的新毕业生而言)。

翻译自: https://medium.com/better-programming/how-you-practice-with-leetcode-for-interviews-is-probably-bad-d4ee2bd7b05f


http://www.taodudu.cc/news/show-4450966.html

相关文章:

  • 前后加编码_如何不加思考地编码?
  • angular技巧_提升Angular技能的5个技巧
  • 二年级计算机课,小学二年级信息技术课程教案三篇
  • Eclipse美观化代码
  • elementui表格如何自定义表头内容,让表头变得更美观
  • 强大的python中如何画出美观的散点图
  • 如何让word中代码更优雅美观【图解】【可微调】
  • MATLAB面板布局—便捷美观
  • 广东移动魔百盒M411A _905L3_线刷固件包
  • 黑龙江移动新魔百盒M411A_2+8_S905L3A_线刷固件包
  • The ES9038Q2M SABRE DAC
  • java 批量爬取国图 marc信息,用txt和excel保存
  • MSC Marc英文界面汉化
  • 2022年索尼A7R4A与A7R3A如何选择?
  • S/4 HANA标准表MARC增强字段
  • Msc.Marc安装和使用过程中遇到证书错误——处理办法
  • marc简单介绍
  • 计算机网络——应用层之万维网(WWW)
  • 通过z39.50协议用YAZ软件获取Marc数据(JAVA版)
  • 免费MARC软件
  • ABAP在Eclipse中做abap cds视图(marc表增强字段增强)
  • 使用python导出msc.marc后处理数据——PyPost介绍
  • 网页marc数据采集器(国图marc数据批量下载)
  • HL7 标准及实现指南 必看的网址
  • marc数据
  • Msc.Marc的python开发#1
  • java-图书Marc文件导入处理
  • elixir 读取 marc条目 目次区字段信
  • Java读取MARC元数据 代码
  • MARC21与CNMARC对应关系

您如何用leetcode进行面试很不好相关推荐

  1. 最近的状态很不好,需要调整

    懈怠,懈怠,最近的状态很不好.什么都不想做,提不起精神做事.没有阶段性目标,目标太遥远,以至于不想去完成.生活中的欲望太多,不能静下心来,一旦失去平静,人就会焦虑,焦虑的多了,影响了休息,难以集中精力 ...

  2. 现在手机用什么浏览器比较好,以前都是用UC,现在感觉UC很不好,内容旧?广告多?

    现在手机用什么浏览器比较好,以前都是用UC,现在感觉UC很不好,内容旧?广告多? 求知_时光 2019-09-2 第一类,国内主流浏览器 像QQ浏览器,UC浏览器,百度浏览器,手机自带浏览器这些浏览器 ...

  3. 重来之大学版|卸负篇-对自己大学很失望怎么办?觉得自己大学很不好怎么办?刚到大学不适应怎么办?

    说是对大学感到失望,不如说,是对自己感到失望. 一.为什么对自己大学很失望? 十多年的寒窗苦读,多年的勤奋学习,考场上的伏案疾书,志愿填报时的惴惴不安,等待录取的心神不宁,终究会让你与一所大学结下不解 ...

  4. 世界五百强的人力资源面试--很精彩

    一位世界500强人力资源总监的六轮面试经历 转自:http://blog.sina.com.cn/s/blog_5e82d3a10101m07n.html     (丰富的实战经历.超强的应变能力.优 ...

  5. LeetCode 309: 一个很清晰的DP解题思路

    问题来源 题目来源链接见下方: https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/descript ...

  6. 听说面试很少有人答出:距离最近点对问题

    作者 | 梁唐 来源 | TechFlow(ID:techflow2019) 头图 |  CSDN 下载自东方IC 大家好,我们今天来看一道非常非常经典的算法题--最近点对问题. 这个问题经常在各种面 ...

  7. 进Java大厂面试很难吗?借鉴京东大咖这套架构,面试后我能拿8w

    最近有不少小伙伴在后台留言,说 Java 的面试越来越难了,尤其是技术面,考察得越来越细,越来越底层.疫情期间虽说某些大厂高薪放低标准进行招聘,但很多小伙伴还是含泪转身.因为目前新老程序员更替严重,跳 ...

  8. “大厂面试很难吗,我觉着还行啊”,Android开发4+年,面试网易定薪25k*14.5,涨薪50%!

    我的情况 本人很愚笨,坚持梦想才是最重要的,最后你会得到应有的回报. 之前面经中的大神说道"重要的事情说三遍,心态最重要,心态最重要,心态最重要". 在这里我就不谈心态了,说说硬件 ...

  9. 一起谈.NET技术,Visual Studio对程序集签名时一个很不好用的地方

    由于我们的项目底层使用到一个通过LogicalCallContext实现的上下文数据管理框架,导致所有的Unit Test不能正常运行.具体的现象在<只在UnitTest和WebHost中的出现 ...

最新文章

  1. leetCode 46. Permutations 回溯问题 | Medium
  2. java android统计图_Android统计图表之柱状图(条形图)
  3. ubuntu 12.04解决Broadcom STA无线网卡驱动安装失败解决
  4. Codeforces Round #211 (Div. 2)
  5. howdoi 简单分析
  6. vim: vimrc
  7. Spring Cloud Hystrix的请求合并
  8. css如何让不确定宽度的div水平居中
  9. SharePoint Portal Server之常见问题
  10. Win10/Server2016镜像集成离线补丁
  11. 阿里云ddns解决动态IP问题
  12. 研磨java系列_研磨设计模式 之 工厂系列(一)简单工厂模式
  13. 火影忍者ol服务器维护中,火影忍者ol3月31日更新了什么?维护到几点?新增神无毗桥模拟战...
  14. Sass Module 介绍
  15. 小园丁与老司机_疲倦的园丁
  16. 如何创建属于你自己的域名邮箱
  17. IM 即时通讯系统【源码好优多】
  18. 信息安全实习:实习一 古典加密算法 Swing图形化 (报告+详细代码)
  19. vue从服务器获取csv文件,前端 VUE 解析 CSV 文件
  20. python将中文汉字转换成拼音

热门文章

  1. 决定网站打开速度的是服务器内存还是带宽,决定数据中心服务器速度的七个要素...
  2. 把JavaScript单独写成文件,开头怎么写
  3. Kibana 使用 KQL 查询语法-kibana 常用查询语法
  4. matlab中的聚类算法,kmeans聚类算法matlab matlab 聚类算法silhouette
  5. python计算利率贷款_用Python获取银行网站上的存贷款利率表
  6. 假如银行利率如下所示,请分别计算存款10000元,活期1年、活期2年、定期1年、定期2年后的本息合计。(结果四舍五入,不保留小数位。使用Math.round(double d)实现
  7. Lync 2013兼容性
  8. 【VUE】图片预览放大缩小插件(推荐阅读)
  9. python 图像批量png转jpg格式
  10. 学习WordPress必须知道的函数(转)