Rushing
急匆匆
Coding is not a race, and neither is interviewing Take your time in a coding problem - don’trush! Rushing leads to mistakes, and reveals you to be careless Go slowly and methodically,testing often and thinking through the problem thoroughly You’ll finish the problem in lesstime in the end, and with fewer mistakes
寫代碼不是比賽,面試也一樣不是。面試寫代碼的時候千萬不要匆匆忙忙的。寫的太快容易出錯,錯誤會讓面試官覺得你粗心大意。慢慢寫代碼,系統(tǒng)的測試自己寫的代碼,吃透問題。慢慢寫最后會讓你完成得更快,而錯誤更少。
Not Debugging
不調(diào)試
Would you ever write code and not run it or test it? I would hope not! So why do that in aninterview? When you finish writing code in an interview, “run” (or walk through) the code totest it Or, on more complicated problems, test the code while writing it
你平時寫完代碼就直接完事的嗎?我想肯定不是吧。那面試的時候?qū)懙拇a也一樣對待吧。面試的時候雖然沒有電腦讓你“Run”,但是過一遍代碼。如果代碼復雜一些的話,最好能設計一兩個測試用例來,邊寫邊測。
Sloppy Coding
爛代碼
Did you know that you can write bug-free code while still doing horribly on a coding question? It’s true! Duplicated code, messy data structures (i e , lack of object oriented design),etc Bad, bad, bad! When you write code, imagine you’re writing for real-world maintain-ability Break code into sub-routines, and design data structures to link appropriate data
你覺得你在解決一個難題的時候,能不能寫出沒有錯誤代碼嗎?肯定不行吧!重復代碼,混亂的數(shù)據(jù)結(jié)構(gòu),等等不好的代碼習慣。在面試的時候就假設自己真正的在開發(fā)。什么提取含函數(shù)啦,設計模式啦能用上的就別不好意思用!
Giving Up
放棄
Have you ever taken a computer adaptive test? These are tests that give you harder ques-tions the better you do Take it from me - they’re not fun Regardless of how well you’re actually doing, you suddenly find yourself stumbling through problems Yikes!
你做過這樣的測試嗎?測試題的難度根據(jù)你的表現(xiàn)一步一步提高。告訴你這樣的測試沒有意思的。別以為你自己平時有多厲害,你也會突然卡在一個難題上的。
Interviewing is sort of like this If you whiz through the easy problems, you’re going to getmore and harder problems Or, the questions might have just started out hard to begin with!Either way, struggling on a question does not mean that you’re doing badly So Don’t give up or get discouraged You’re doing great!
面試也是這樣的。如果你秒了簡單題,那么接下來迎接你的就是難題了。還有可能你上來就碰到一個巨難的問題。不管什么樣情況,努力的解題并不說明你做的不好。所以千萬別在做題的時候氣餒和放棄。你做的很好!