编程面试中需要了解的5件事

This article is intended for those who are trying to start their programming career, or are preparing to interview for their dream job. As someone who’s been on both sides of the interviewing table, I understand how it feels to be the interviewee.

本文适用于那些试图开始其编程职业或者准备为他们的理想工作进行面试的人。 作为面试双方的人 ,我了解成为受访者的感觉。

This non-exhaustive list of questions floated through my mind all the time.

这个无穷尽的问题清单一直浮现在我的脑海。

  • “Am I supposed to talk through my code?”

    “我应该讲讲我的代码吗?”
  • “How often should I communicate with the interviewer?”

    “我应该多久与面试官沟通一次?”
  • “Oh god, I forgot to instantiate my variable! Am I doomed?!”

    “天哪,我忘了实例化变量! 我注定要死吗?!”
  • “What does the interviewer think of my answer?”

    “面试官对我的回答有何看法?”
  • “Is it OK if I do this?”

    “如果我这样做可以吗?”

… And the list goes on…

… 而这样的例子不胜枚举…

It is a very scary experience. It is very difficult. And it is extremely hard to operate within this vacuum when you’re being scrutinized for every single thing you say and every thing you write.

这是一个非常可怕的经历。 这非常困难。 当您仔细检查您所说的每句话和编写的每件事时,要在这种真空中进行操作都非常困难。

You’re interviewing for your dream job, something you’ve dreamed of since you were 12. And it all comes down to impressing someone you’ve never met within 60 minutes.

您正在为自己梦dream以求的工作进行面试,这是您从12岁起就梦dream以求的事情,而这一切都会给您留下深刻印象,让您在60分钟内从未遇到过。

The struggle is real.

奋斗 是真实的。

1.永远思考 (1. Always think ahead)

Often, you’ll hear an interviewer ask this: “OK, I think that looks good. Now, how would you improve this code?”

通常,您会听到一个面试官问这个问题:“好的,我认为这看起来不错。 现在,您将如何改进此代码?”

This is a killer question. And this is because it isn’t just a filler to pass time. The interviewer is trying to assess how you think about:

这是一个致命的问题 。 这是因为它不仅仅是时间的补充。 面试官正在尝试评估您的想法:

  • code quality

    代码质量
  • some concerns/bottlenecks that weren’t raised in the algorithm planning session

    算法规划会议中未提出的一些关注/瓶颈
  • how you would scale the solution at hand.

    您如何扩展手头的解决方案。

Just because you solved the problem doesn’t mean you’ll automatically get an offer.

仅仅因为您解决了问题,并不意味着您会自动获得要约。

For example, when you look at this piece of code below, what does it do? How would you improve it? What might cause it to break?

例如,当您查看下面的这段代码时,它有什么作用? 您将如何改善? 是什么导致它破裂?

Let me know in the comments below. I’d love to hear your thoughts.

在下面的评论中让我知道。 我很想听听您的想法。

Surprise?: Being able to come up with a working solution is the bare minimum to be considered for the position. These questions are basic competency tests. What separates the good candidates from great is the ability to think beyond what’s required.

惊喜?:能够提出一个可行的解决方案是该职位的最低要求。 牛逼 HESE问题是基本能力测试。 优秀候选人与优秀候选人的区别在于思考能力超出了要求。

在编码会话中这意味着什么 (What this means in a coding session)

Think about edge cases, scaling issues, problem areas. Always think one step ahead. If you’re using a recursive approach, what would happen if you have a large data set? If you’re using a hashing algorithm, how do you handle collisions? How likely is that to happen, and what’s the worst case scenario?

考虑一下极端情况,扩展问题,问题领域。 总是想向前一步。 如果您使用的是递归方法,那么如果您的数据集很大,会发生什么? 如果您使用的是哈希算法,那么如何处理冲突? 这发生的可能性有多大?最坏的情况是什么?

2.答案不只一个 (2. There’s more than one answer)

There is always more than one way to solve a programming interview problem. Always. There are usually multiple ways of tackling a problem, some of which might not be optimal.

解决编程面试问题总是有不止一种方法。 总是 。 通常有多种解决问题的方法,其中有些可能不是最佳方法。

One of my favorite tech Youtubers taught me that a coding interview is a mental exercise to see how a candidate thinks. From an interviewer perspective, I’m not looking to check if you know what the right answer is. Yes, it is important that you can write a working solution, but it’s not the only thing.

我最喜欢的一项技术,Youtubers告诉我,编码面试是一种心理锻炼,旨在了解候选人的想法。 从采访者的角度来看,我不是要检查您是否知道正确的答案。 是的,您可以编写一个有效的解决方案很重要,但这不是唯一的事情。

More than that, I’m looking for how smart this person is, how the solution is derived, and what other creative solutions this person might be thinking about.

不仅如此,我还在寻找这个人有多聪明,解决方案是如何派生的,以及这个人可能在想什么其他创造性的解决方案。

A programming exercise to illustrate my point:

一个编程练习来说明我的观点:

Merge two sorted linked lists. (It’s linked to Leetcode if you’d like to try solving). Basically you can tackle this in several ways:

合并两个排序的链表 。 (如果您想尝试解决,它链接到Leetcode)。 基本上,您可以通过几种方式解决此问题:

  1. Put all the nodes into an array and then sort it. Then, create a pointer and link every element in the array together.

    将所有节点放入数组,然后对其进行排序。 然后,创建一个指针并将数组中的每个元素链接在一起。
  2. Merge them using pointer manipulation. Compare the two, keeping track of which is smaller, and then return the results at the end.

    使用指针操作合并它们。 比较两个,跟踪较小的两个,然后最后返回结果。

What other ways can you think of?

您还能想到什么其他方式?

3. OOP还没有死 (3. OOP is not dead)

Object-oriented programming is not dead. It’s a love-hate relationship for some people, yet it’s a valuable skill to have. This is one of the fundamental skills — a programming technique every programmer should know.

面向对象的编程还没有结束。 对某些人来说,这是一种爱恨交加的关系,但拥有却是一项宝贵的技能。 这是基本技能之一,这是每个程序员都应该知道的编程技术。

Many candidates jump head-first into a programming problem without putting further thought into simplifying the code. I used to be in this bunch and, admittedly, I still do it sometimes.

许多候选人没有解决简化代码的问题就直接进入编程问题。 我曾经是一群人,但坦率地说,我有时还是这样做。

However, the ability to turn complex problems into simpler, manageable chunks by object-oriented programming is a rare and treasured skill.

但是,通过面向对象的编程将复杂的问题转换为更简单,可管理的块的能力是一种罕见且宝贵的技能。

Writing code for computers to understand is easy. Writing code for humans is hard.

编写代码让计算机易于理解。 为人类编写代码很难。

4.制作简历 (4. Craft your résumé)

Imagine you’re heading to prom night with the person of your dreams, and you show up at their doorstep in flip flops and a sleeveless t-shirt.

想象一下,您将与自己梦person以求的人一起参加舞会之夜,并且穿着拖鞋和无袖T恤出现在他们家门口。

Your résumé is your business card. It’s the company’s first impression of you.

您的简历就是您的名片。 这是公司对您的第一印象。

If you’re starting out on your job search, then the very first thing you should do is prepare a great résumé. That’s the number one thing that is often overlooked by job seekers and, arguably, is the lowest hanging fruit.

如果您正在寻找工作,那么您应该做的第一件事就是准备一份不错的简历 。 这求职者经常忽略第一件事,并且可以说是悬念最少的事情

I see a lot of candidates who spent weeks, if not months, preparing for coding interviews. But the time they spent on crafting their résumé pales in comparison.

我看到很多候选人花了数周甚至数月的时间准备面试。 但是相比之下,他们花在编写简历上的时间却相形见pale。

5.尽早沟通并经常沟通 (5. Communicate early and communicate often)

When I first started interviewing, I was erring on the side of over-communicating. This meant I was trying to talk through every single line of code I was writing, even if it was a simple for-loop.

当我第一次开始面试时,我有点过分交流 这意味着我试图遍历正在编写的每一行代码,即使这是一个简单的for循环。

I’m not the type who is able to talk and think at the same time. Some people are gifted in the way that they’re able to think out loud, but I can’t.

我不是那种能够同时讲话和思考的人。 有些人有天赋的能力,他们能够大声思考,但我不能。

Communicate as often as you need. I tried to communicate early and often. Whenever there was an issue, I would raise it with the interviewer and let them know. It helped me determine if I was heading in the right direction, and course-correct if I was not.

根据需要进行交流 。 我试图尽早和经常交流。 每当有问题时,我都会向面试官提出,并告知他们。 它帮助我确定我是否朝着正确的方向前进,如果我没有朝正确的方向前进,则可以正确地进行。

A programming interview is looking for both hard and soft skills. Lacking one or the other means a definite no. For further information, I wrote a more detailed article about how improve a software engineer’s soft skills here.

编程采访正在寻找硬技能软技能。 缺少一个意味着另一个。 如需进一步信息,我写了一篇关于如何提高软件工程师的软技能更详细的文章在这里 。

Don’t pressure yourself into talking through every single line of code. If you’re using some esoteric features of a programming language, you can explain it once you’re done writing the whole thing.

不要强迫自己遍历每一行代码。 如果您正在使用某种编程语言的深奥特性,那么在编写完全部内容之后就可以对其进行解释。

在编码会话中这意味着什么 (What this means in a coding session)

If you have already established some way of solving the problem, then you can just politely let the interviewer know that you’ll be diving deep into writing the code. Don’t feel that you need to explain every single line of code.

如果您已经建立了解决问题的方法,则可以礼貌地让面试官知道您将深入研究代码。 不必觉得您需要解释每一行代码。

6. [额外]使用抽象 (6. [Extra] Use abstraction)

Here’s another extra tip I picked up that helped tremendously when I was interviewing: use abstraction for complex methods.

这是我在面试时获得的另一条非常有用的技巧: 将抽象用于复杂的方法。

Using abstraction to hide the complicated implementation details doesn’t mean that you’re shoving the dirty details under the rug. It means that you understand less is more. Remember, you are writing code for humans to understand. Showing good judgement here will definitely earn you extra brownie points with the interviewer.

使用抽象来隐藏复杂的实现细节并不意味着您将肮脏的细节推到了地毯下。 这意味着您了解的少即是多。 请记住,您正在编写供人类理解的代码。 在这里表现出良好的判断力,一定会与面试官一起获得额外的布朗尼积分。

在编码会话中这意味着什么 (What this means in a coding session)

Let’s compare and contrast these two pieces of code:

让我们比较和对比这两段代码:

In my opinion, I think the right side looks much cleaner, and much easier to understand. I can then take the time to implement getNeighbors, or isEmpty, depending on what is requested of me.

我认为,右侧看起来更清洁,更容易理解。 然后,我可以花一些时间实现getNeighborsisEmpty ,具体取决于我的要求。

The important thing here is that abstraction has now helped keep my code clean, easy to read, and easy to understand. Who doesn’t like to have their cake and eat it too?

这里重要的是,现在抽象已使我的代码保持整洁,易于阅读和易于理解。 谁不喜欢吃蛋糕呢?

我为什么要分享我的经验? (Why do I want to share my experience?)

I’ve somehow miraculously managed to overcome the obstacles and find my way to my dream job. This is by no means my way of bragging. It is not my intention at all.

我以某种方式奇迹般地设法克服了障碍,并找到了自己梦想的工作之路。 这绝不是我吹牛的方式。 这根本不是我的意图。

I truly want to help others like me who are struggling to land their dream job. I’ve been through it. I understand the hardship, the sweat and tears of preparing for a programming interview. I believe that the world isn’t a zero-sum game — the more people who do better in life, the better our society becomes, and the more prosperous we’ll all be as a result of that. It’s a win-win situation.

我真的想帮助像我这样的努力工作的其他人。 我经历过了。 我了解准备参加编程面试的艰辛,汗水和眼泪。 我相信世界不是一场零和游戏-生活水平提高的人越多,我们的社会就会变得越好,因此,我们所有人都会越富裕。 这是双赢的局面。

Hopefully these tips are able to help another job seeker out there! Good luck! ?

希望这些技巧能够帮助其他求职者! 祝好运! ?

If you enjoyed this article, here are a few more recommended articles I wrote:

如果您喜欢本文,这里还有我写的一些推荐文章:

  • How I landed offers from Microsoft, Amazon and Twitter without an Ivy-league degree

    我如何在没有常春藤联盟学位的情况下从Microsoft,Amazon和Twitter获得报价

  • How to write a great resume for software engineers

    如何为软件工程师撰写出色的简历

  • How I automated my job search by building a web crawler

    我如何通过构建网络爬虫来自动进行求职

  • How to System Design

    如何进行系统设计

我推荐的资源和工具 (Resources and tools I recommend)

  • Elements of Programming Interviews: Great for more difficult coding problems

    编程面试的要素 :适用于更困难的编码问题

  • Cracking The Coding Interview: Great for covering foundational CS

    破解编码面试 :非常适合覆盖基础CS

  • OneNote: I use this to store all code snippets

    OneNote :我用它来存储所有代码片段

  • Evernote: For everything else

    印象笔记 :其他

  • CodeRunner: I love this Mac app! I used this multiple times to run ad-hoc Python scripts/functions and it just works amazingly well. ?

    CodeRunner :我喜欢这个Mac应用程序! 我多次使用它来运行特定的Python脚本/函数,并且效果非常好。 ?

  • Jobscan: A friend runs this company. I’ve heard many cool things about it, and you should try them out for their résumé screening tool.

    Jobscan :一位朋友经营这家公司。 我听说过很多很棒的事情,您应该尝试使用他们的简历筛选工具。

  • Refdash: Run by a bunch of ex-Googlers. The quality of mock interviews here is ?. The interviewers are ex-Googlers. I highly recommend trying them out.

    Refdash :由一群前Google员工经营。 这里的模拟面试质量为?。 面试官是前Google员工。 我强烈建议您尝试一下。

  • CodePath: A non-profit org that helps people prepare for a career in tech. Nathan and Tim are great people and I have learned a lot from them. The community is very helpful and everyone is willing to give a hand.

    CodePath :一个非盈利性组织,可以帮助人们为从事技术职业做准备。 内森(Nathan)和蒂姆(Tim)都是很棒的人,我从他们身上学到了很多东西。 社区非常有帮助,每个人都愿意伸出援手。

  • Fine-point markers: Bring these to your interview. I highly recommend them!

    重点标记 :将它们带入您的面试。 我强烈推荐他们!

Zhia Chong is a software engineer at Twitter. He works on the Ads Measurement team in Seattle, measuring ads impact and ROI for advertisers.

Zhia Chong是Twitter的软件工程师。 他在西雅图的广告衡量团队工作,为广告客户衡量广告影响和投资回报率。

You can find him on Twitter and LinkedIn.

您可以在Twitter和LinkedIn上找到他。

翻译自: https://www.freecodecamp.org/news/the-most-important-things-you-need-to-know-for-a-programming-interview-3429ac2454b/

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/394190.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

多线程的基础知识

1、程序、进程、线程的基本概念 程序:为了完成某种任务用某一种语言编写的一组指令的集合就叫程序。程序就是一段静态的代码。 进程:进程是程序的依次执行过程,或者说是正在运行的一个程序。这是一个动态的过程,有它自身的产生运行…

springboot实现单点登录_什么是单点登录,php是如何实现单点登录的

文章来自:php中文网链接:https://www.php.cn/php-weizijiaocheng-429869.html作者:中文网商务合作:请加微信(QQ):2230304070视频教程分享码农网:http://www.mano100.cn/rjyfk_url-url.html ,升级终身会员即…

背景图处理,这是个好东西记录一下

背景图处理 rgba (),前3个是三原色,第四个参数是透明度转载于:https://www.cnblogs.com/ChineseLiao/p/7479207.html

python使用GUI(图形用户界面)

打开后: File→New File(Ctrl N) 转载于:https://www.cnblogs.com/ly123456/p/6269859.html

Altium Designer(AD24)新工程复用设计文件图文教程及视频演示

🏡《专栏目录》 目录 1,概述2,复用方法一视频演示2.1,创建工程2.2,复用设计文件 3,复用方法二视频演示4,总结 欢迎点击浏览更多高清视频演示 1,概述 本文简述使用AD软件复用设计文件…

两点定标法_一种两点校正红外热像仪的非均匀性的模块及方法

一种两点校正红外热像仪的非均匀性的模块及方法【技术领域】[0001] 本发明属于红外热成像系统的非均匀性校正领域,特别是一种两点校正红外热像 仪的非均匀性的模块及方法。【背景技术】[0002] 在过去的几十年中,红外探测器件的元数不断增加,由…

leetcode851. 喧闹和富有(dfs)

在一组 N 个人(编号为 0, 1, 2, …, N-1)中,每个人都有不同数目的钱,以及不同程度的安静(quietness)。 为了方便起见,我们将编号为 x 的人简称为 "person x "。 如果能够肯定 perso…

如何选择正确的容器编排以及如何进行部署

by Michael Douglass迈克尔道格拉斯(Michael Douglass) 如何选择正确的容器编排以及如何进行部署 (How to choose the right container orchestration and how to deploy it) Running server processes inside containers is here to stay. If your environment is small with…

Oracle 学习笔记(三)

oracle 表查询 oracle 表基本查询 在此,基于 scott 用户存在的 emp,dept 表演示学习。 emp 雇员表 clerk 员工 salesman 销售 manager 经理 analyst 分析师 president 总裁 mgr 上级的编号 hiredate 入职时间 sal 工资 comm 奖金 deptno 部…

html meta标签使用总结(转)

之前学习前端中&#xff0c;对meta标签的了解仅仅只是这一句。 <meta charset"UTF-8"> 但是打开任意的网站&#xff0c;其head标签内都有一列的meta标签。比如我博客的。 但是自己却很不熟悉&#xff0c;于是把meta标签加入了寒假学习计划的最前方。 简介 在查…

bzoj 4009 接水果 整体二分

Description 先给出一些盘子, 用路径x-y表示, 有权值 再有Q个询问, 表示水果, 用路径x-y表示 如果盘子是水果的子路径, 可以接住 对于每个水果, 输出可以接住它的盘子的第k小权 Solution 对于x-lca-y的盘子&#xff0c;水果一定一个在x子树&#xff0c;一个在y子树 对于x-lca的…

离散元 python_刚开始学习离散元软件Yade,有什么建议?

用Yade-DEM 做过博士期间的部分工作&#xff0c;也是从毫无所知到算是入门&#xff0c;分享一点我的学习过程&#xff0c;为那些刚接触Yade的同学提供些许参考&#xff0c;希望对大家有帮助。0. Yade 简介Yade 是一个用于离散元分析的开源平台&#xff0c;是法国Lab 3SR-Grenob…

leetcode529. 扫雷游戏(dfs)

让我们一起来玩扫雷游戏&#xff01; 给定一个代表游戏板的二维字符矩阵。 ‘M’ 代表一个未挖出的地雷&#xff0c;‘E’ 代表一个未挖出的空方块&#xff0c;‘B’ 代表没有相邻&#xff08;上&#xff0c;下&#xff0c;左&#xff0c;右&#xff0c;和所有4个对角线&#…

redhat6 删除mysql_Red Hat enterprise linux 6卸载默认安装的 mysql

因为Red Hat enterprise linux 6 自带了一个mysql&#xff0c;所以当你安装新的mysql时&#xff0c;就会提示错误如&#xff1a;error&#xff1a;Failed dependencies&#xff1a;MySQL conflicts with mysql-5.1.47-4.el6.i686rmp -qa mysql 可以看到安装的mysql于是将自带的…

swift通知栏推送_如何使用Swift使用推送通知构建食品交付应用

swift通知栏推送by Neo Ighodaro由新Ighodaro 如何使用Swift使用推送通知构建食品交付应用 (How to build a food delivery app with push notifications using Swift) A basic understanding of Swift and Node.js is needed to follow this tutorial.要学习本教程&#xff0…

Jenkins持续集成实践之java项目自动化部署

关于Linux安装Jenkins可以参考我的这篇博文Ubuntu16.04环境安装jenkins 1.安装部署插件 进入插件管理&#xff0c;并搜索该插件Deploy to container Plugin进行安装 &#xff0c;下载地址为&#xff1a;https://wiki.jenkins-ci.org/display/JENKINS/DeployPlugin 2.安装完后&a…

云计算时代企业内部IT人员的新定位

本文讲的是云计算时代企业内部IT人员的新定位&#xff0c;【IT168 云计算频道】渐渐的云计算热起来&#xff0c;但是怎么去严格定义云计算&#xff0c;还是没有一个统一的说法&#xff0c;最常用的就是举例子的方式来说什么是云计算&#xff0c;最常用来打比方的是电力&#xf…

Java 多线程 笔记 转自http://www.cnblogs.com/lwbqqyumidi/p/3804883.html

多线程作为Java中很重要的一个知识点&#xff0c; 一.线程的生命周期及五种基本状态 关于Java中线程的生命周期&#xff0c;首先看一下下面这张较为经典的图&#xff1a; 上图中基本上囊括了Java中多线程各重要知识点。掌握了上图中的各知识点&#xff0c;Java中的多线程也就基…

leetcode207. 课程表(dfs/bfs)

你这个学期必须选修 numCourse 门课程&#xff0c;记为 0 到 numCourse-1 。 在选修某些课程之前需要一些先修课程。 例如&#xff0c;想要学习课程 0 &#xff0c;你需要先完成课程 1 &#xff0c;我们用一个匹配来表示他们&#xff1a;[0,1] 给定课程总量以及它们的先决条件…

r.java是什么_R.java文件介绍

http://blog.chinaunix.net/uid-21411227-id-4133828.html注意&#xff1a;R.java文件不能手动修改。1. HelloWorld工程中的R.java文件解析package com.android.hellworld;public final class R {public static final class attr {}public static final class drawable {public…