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)。 基本上,您可以通過幾種方式解決此問題:
- Put all the nodes into an array and then sort it. Then, create a pointer and link every element in the array together. 將所有節點放入數組,然后對其進行排序。 然后,創建一個指針并將數組中的每個元素鏈接在一起。
- 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.
我認為,右側看起來更清潔,更容易理解。 然后,我可以花一些時間實現getNeighbors
或isEmpty
,具體取決于我的要求。
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/