想雇到搞軟件開發(fā)的聰明人可不容易。萬一一不小心,就會搞到一堆低能大狒狒。我去年就碰到這種事了。你肯定不想這樣吧。聽我的,沒錯。在樹上開站立會議門都沒有。
問點(diǎn)有難度的問題能幫你把聰明人跟狒狒們分開。我決定把我自己整理出來的軟件開發(fā)者面試百問發(fā)出來,希望能幫到你們的忙。
這個列表涵蓋了軟件開發(fā)知識體系中定義的大多數(shù)知識域。當(dāng)然,如果你只想找出類拔萃的程序員,便只需涉及結(jié)構(gòu)、算法、數(shù)據(jù)結(jié)構(gòu)、測試這幾個話題。如果想雇架構(gòu)師,也可以只考慮需求、功能設(shè)計(jì)、技術(shù)設(shè)計(jì)這些地方。
不過不管你怎么做,都要牢記一點(diǎn):
這里大多數(shù)問題的答案都沒有對錯之分!
你可以把我的這些問題作為引子,展開討論。例如下面有個問題是使用靜態(tài)方法或是單例的緣由。如果那個面試的就此展開長篇大論,那他很有可能是個聰明能干的家伙!如果他一臉茫然的看著你,發(fā)出這種聲音,很明顯這就是只狒狒了。同樣,想知道一個數(shù)是不是2的乘方也有很多方法,不過要是面試的人想用mod運(yùn)算符,嗯……你知道我的意思吧。(你不知道也沒關(guān)系,來根香蕉?)
需求
- 你能給出一些非功能性(或者質(zhì)量)需求的例子么?
- 如果客戶需要高性能、使用極其方便而又高度安全,你會給他什么建議?
- 你能給出一些用來描述需求的不同技術(shù)么?它們各自適用于什么場景?
- 需求跟蹤是什么意思?什么是向前追溯,什么是向后追溯?
- 你喜歡用什么工具跟蹤需求?
- 你怎么看待需求變化?它是好是壞?給出你的理由。
- 你怎樣研究需求,發(fā)現(xiàn)需求?有哪些資源可以用到?
- 你怎么給需求制定優(yōu)先級?有哪些技術(shù)?
- 在需求過程中,用戶、客戶、開發(fā)人員各自的職責(zé)是什么?
- 你怎么對待不完整或是令人費(fèi)解的需求?
功能設(shè)計(jì)
- 在功能設(shè)計(jì)中有哪些隱喻?給出幾個成功的例子。
- 如果有些功能的執(zhí)行時間很長,怎么能讓用戶感覺不到太長的等待?
- 如果用戶必須要在一個很小的區(qū)域內(nèi),從一個常常的列表中選擇多個條目,你會用什么控件?
- 有哪些方法可以保證數(shù)據(jù)項(xiàng)的完整?
- 建立系統(tǒng)原型有哪些技術(shù)?
- 應(yīng)用程序怎樣建立對用戶行為的預(yù)期?給出一些例子。
- 如何入手設(shè)計(jì)一組數(shù)量龐大而又復(fù)雜的特性,你能舉出一些設(shè)計(jì)思路嗎?
- 有一個列表,其中有10個元素,每個元素都有20個字段可以編輯,你怎樣設(shè)計(jì)這種情況?如果是1000個元素,每個元素有3個字段呢?
- 用不同的顏色對一段文本中的文字標(biāo)記高亮,這種做法有什么問題?
- Web環(huán)境和Windows環(huán)境各有些什么限制?
技術(shù)設(shè)計(jì)
- 什么是低耦合和高聚合?封裝原則又是什么意思?
- 在Web應(yīng)用中,你怎樣避免幾個人編輯同一段數(shù)據(jù)所造成的沖突?
- 你知道設(shè)計(jì)模式嗎?你用過哪些設(shè)計(jì)模式?在什么場合下用的?
- 是否了解什么是無狀態(tài)的業(yè)務(wù)層?長事務(wù)如何與之相適應(yīng)?
- 在搭建一個架構(gòu),或是技術(shù)設(shè)計(jì)時,你用過幾種圖?
- 在N層架構(gòu)中都有哪些層?它們各自的職責(zé)是什么?
- 有哪些方法可以確保架構(gòu)中數(shù)據(jù)的正確和健壯?
- 面向?qū)ο笤O(shè)計(jì)和面向組件設(shè)計(jì)有哪些不同之處?
- 怎樣在數(shù)據(jù)庫中對用戶授權(quán)、用戶配置、權(quán)限管理這幾項(xiàng)功能建模?
- 怎樣按照等級制度給動物王國(包括各種物種和各自的行為)建模?
結(jié)構(gòu)
- 你怎樣保證你的代碼可以處理各種錯誤事件?
- 解釋一下什么是測試驅(qū)動開發(fā),舉出極限編程中的一些原則。
- 看別人代碼的時候,你最關(guān)心什么地方?
- 什么時候使用抽象類,什么時候使用接口?
- 除了IDE以外,你還喜歡哪些必不可少的工具?
- 你怎么保證代碼執(zhí)行速度快,而又不出問題?
- 什么時候用多態(tài),什么時候用委派?
- 什么時候使用帶有靜態(tài)成員的類,什么時候使用單例?
- 你在代碼里面怎么提前處理需求的變化?給一些例子。
- 描述一下實(shí)現(xiàn)一段代碼的過程,從需求到最終交付。
算法
- 怎樣知道一個數(shù)字是不是2的乘方?怎樣判斷一個數(shù)是不是奇數(shù)?
- 怎樣找出鏈表中間的元素?
- 怎樣改變10,000個靜態(tài)HTML頁面中所有電話號碼的格式?
- 舉出一個你所用過的遞歸的例子。
- 在哈希表和排序后的列表中找一個元素,哪個查找速度最快?
- 不管是書、雜志還是網(wǎng)絡(luò),你從中所學(xué)到的最后一點(diǎn)算法知識是什么?
- 怎樣把字符串反轉(zhuǎn)?你能不用臨時的字符串么?
- 你愿意用什么類型的語言來編寫復(fù)雜的算法?
- 有一個數(shù)組,里面是從1到1,000,000的整數(shù),其中有一個數(shù)字出現(xiàn)了兩次,你怎么找出那個重復(fù)的數(shù)字?
- 你知道“旅行商問題(Traveling Salesman Problem)”么?
數(shù)據(jù)結(jié)構(gòu)
- 怎樣在內(nèi)存中實(shí)現(xiàn)倫敦地鐵的結(jié)構(gòu)?
- 怎樣以最有效的方式在數(shù)據(jù)庫中存儲顏色值?
- 隊(duì)列和堆棧區(qū)別是什么?
- 用堆或者堆棧存儲數(shù)據(jù)的區(qū)別是什么?
- 怎樣在數(shù)據(jù)庫中存儲N維向量?
- 你傾向于用哪種類型的語言編寫復(fù)雜的數(shù)據(jù)結(jié)構(gòu)?
- 21的二進(jìn)制值是什么?十六制值呢?
- 不管是書、雜志還是網(wǎng)絡(luò),你從中所學(xué)到的最后一點(diǎn)數(shù)據(jù)結(jié)構(gòu)的知識是什么?
- 怎樣在XML文檔中存儲足球比賽結(jié)果(包括隊(duì)伍和比分)?
- 有哪些文本格式可以保存Unicode字符?
測試
- 什么是回歸測試?怎樣知道新引入的變化沒有給現(xiàn)有的功能造成破壞?
- 如果業(yè)務(wù)層和數(shù)據(jù)層之間有依賴關(guān)系,你該怎么寫單元測試?
- 你用哪些工具測試代碼質(zhì)量?
- 在產(chǎn)品部署之后,你最常碰到的是什么類型的問題?
- 什么是代碼覆蓋率?有多少種代碼覆蓋率?
- 功能測試和探索性測試的區(qū)別是什么?你怎么對網(wǎng)站進(jìn)行測試?
- 測試棧、測試用例、測試計(jì)劃,這三者之間的區(qū)別是什么?你怎么組織測試?
- 要對電子商務(wù)網(wǎng)站做冒煙測試,你會做哪些類型的測試?
- 客戶在驗(yàn)收測試中會發(fā)現(xiàn)不滿意的東西,怎樣減少這種情況的發(fā)生?
- 你去年在測試和質(zhì)量保證方面學(xué)到了哪些東西?
維護(hù)
- 你用哪些工具在維護(hù)階段對產(chǎn)品進(jìn)行監(jiān)控?
- 要想對一個正在產(chǎn)品環(huán)境中被使用的產(chǎn)品進(jìn)行升級,該注意哪些重要事項(xiàng)?
- 如果在一個龐大的文件中有錯誤,而代碼又無法逐步跟蹤,你怎么找出錯誤?
- 你怎樣保證代碼中的變化不會影響產(chǎn)品的其他部分?
- 你怎樣為產(chǎn)品編寫技術(shù)文檔?
- 你用過哪些方式保證軟件產(chǎn)品容易維護(hù)?
- 怎樣在產(chǎn)品運(yùn)行的環(huán)境中進(jìn)行系統(tǒng)調(diào)試?
- 什么是負(fù)載均衡?負(fù)載均衡的方式有哪些種?
- 為什么在應(yīng)用程序的生命周期中,軟件維護(hù)費(fèi)用所占的份額最高?
- re-engineering和reverse engineering的區(qū)別是什么?
配置管理
- 你知道配置管理中基線的含義么?怎樣把項(xiàng)目中某個重要的時刻凍結(jié)?
- 你一般會把哪些東西納入版本控制?
- 怎樣可以保證團(tuán)隊(duì)中每個人都知道誰改變了哪些東西?
- Tag和Branch的區(qū)別是什么?在什么情況下該使用tag,什么時候用branch?
- 怎樣管理技術(shù)文檔——如產(chǎn)品架構(gòu)文檔——的變化?
- 你用什么侗劇管理項(xiàng)目中所有數(shù)字信息的狀態(tài)?你最喜歡哪種工具?
- 如果客戶想要對一款已經(jīng)發(fā)布的產(chǎn)品做出變動,你怎么處理?
- 版本管理和發(fā)布管理有什么差異?
- 對文本文件的變化和二進(jìn)制文件的變化進(jìn)行管理,這二者有什么不同?
- 同時處理多個變更請求,或是同時進(jìn)行增量開發(fā)和維護(hù),這種事情你怎么看待?
項(xiàng)目管理
- 范圍、時間、成本,這三項(xiàng)中哪些是可以由客戶控制的?
- 誰該對項(xiàng)目中所要付出的一切做出估算?誰有權(quán)設(shè)置最后期限?
- 減少交付的次數(shù),或是減少每個每個交付中的工作量,你喜歡哪種做法?
- 你喜歡用哪種圖來跟蹤項(xiàng)目進(jìn)度?
- 迭代和增量的區(qū)別在哪里?
- 試著解釋一下風(fēng)險管理中用到的實(shí)踐。風(fēng)險該如何管理?
- 你喜歡任務(wù)分解還是滾動式計(jì)劃?
- 你需要哪些東西幫助你判斷項(xiàng)目是否符合時間要求,在預(yù)算范圍內(nèi)運(yùn)作?
- DSDM、Prince2、Scrum,這三者之間有哪些區(qū)別?
- 如果客戶想要的東西太多,你在范圍和時間上怎樣跟他達(dá)成一致呢?
譯文來自: http://www./cn/articles/programmer-interview
譯者
李劍 作者
Jurgen Appelo
閱讀英文原文:100 Interview Questions for Software Developers。
Hiring smart software developers is not easy.
If you're not careful you might end up hiring a bunch of moronic
mandrills, like I did last year. And you don't want that. Trust me.
Stand-up meetings are very hard to do in a tree.
The key is to ask challenging questions
that enable you to distinguish the smart software developers from the
moronic mandrills. And to help you with that, I decided to publish my
private list of 100 interview questions for software developers.
This list covers most of the knowledge areas as defined by the Software Engineering Body of Knowledge. Of course, if you're just looking for brilliant programmers, you may want to limit the topics to Construction, Algorithms, Data Structures and Testing. And if you're looking for architects, you can just consider the questions under the headings Requirements, Functional Design and Technical Design.
But whatever you do, keep this in mind:
For most of the questions in this list there are no right and wrong answers!
My questions are simply starting points for interesting discussions. For example: there is a question about reasons to use static methods vs. singletons. If this triggers your candidate to start a tirade againt both static methods and singletons,
there's a good chance you're dealing with a smart software developer!
But if the candidate can produce nothing more than a blank stare and this sound,
then he might very well be a moronic mandrill. Likewise, there are many
correct ways to find out whether a number is a power of 2. But if the
candidate suggests using the mod operator, well... you know what I mean. (And if you don't, no problem. Fancy a banana?)
Requirements
- Can you name a number of non-functional (or quality) requirements?
- What is your advice when a customer wants high performance, high usability and high security?
- Can you name a number of different techniques for specifying requirements? What works best in which case?
- What is requirements tracing? What is backward tracing vs. forward tracing?
- Which tools do you like to use for keeping track of requirements?
- How do you treat changing requirements? Are they good or bad? Why?
- How do you search and find requirements? What are possible sources?
- How do you prioritize requirements? Do you know different techniques?
- Can you name the responsibilities of the user, the customer and the developer in the requirements process?
- What do you do with requirements that are incomplete or incomprehensible?
Functional Design
- What are metaphors used for in functional design? Can you name some successful examples?
- How can you reduce the user's perception of waiting when some functions take a lot of time?
- Which controls would you use when a user must select multiple items from a big list, in a minimal amount of space?
- Can you name different measures to guarantee correctness of data entry?
- Can you name different techniques for prototyping an application?
- Can you name examples of how an application can anticipate user behavior?
- Can you name different ways of designing access to a large and complex list of features?
- How would you design editing twenty fields for a list of 10 items? And editing 3 fields for a list of 1000 items?
- What is the problem of using different colors when highlighting pieces of a text?
- Can you name some limitations of a web environment vs. a Windows environment?
Technical Design
- What do low coupling and high cohesion mean? What does the principle of encapsulation mean?
- How do you manage conflicts in a web application when different people are editing the same data?
- Do you know about design patterns? Which design patterns have you used, and in what situations?
- Do you know what a stateless business layer is? Where do long-running transactions fit into that picture?
- What kinds of diagrams have you used in designing parts of an architecture, or a technical design?
- Can you name the different tiers and responsibilities in an N-tier architecture?
- Can you name different measures to guarantee correctness and robustness of data in an architecture?
- Can you name any differences between object-oriented design and component-based design?
- How would you model user authorization, user profiles and permissions in a database?
- How would you model the animal kingdom (with species and their behavior) as a class system?
Construction
- How do you make sure that your code can handle different kinds of error situations?
- Can you explain what Test-Driven Development is? Can you name some principles of Extreme Programming?
- What do you care about most when reviewing somebody else's code?
- When do you use an abstract class and when do you use an interface?
- Apart from the IDE, which other favorite tools do you use that you think are essential to you?
- How do you make sure that your code is both safe and fast?
- When do you use polymorphism and when do you use delegates?
- When would you use a class with static members and when would you use a Singleton class?
- Can you name examples of anticipating changing requirements in your code?
- Can you describe the process you use for writing a piece of code, from requirements to delivery?
Algorithms
- How do you find out if a number is a power of 2? And how do you know if it is an odd number?
- How do you find the middle item in a linked list?
- How would you change the format of all the phone numbers in 10,000 static html web pages?
- Can you name an example of a recursive solution that you created?
- Which is faster: finding an item in a hashtable or in a sorted list?
- What is the last thing you learned about algorithms from a book, magazine or web site?
- How would you write a function to reverse a string? And can you do that without a temporary string?
- What type of language do you prefer for writing complex algorithms?
- In an array with integers between 1 and 1,000,000 one value is in the array twice. How do you determine which one?
- Do you know about the Traveling Salesman Problem?
Data Structures
- How would you implement the structure of the London underground in a computer's memory?
- How would you store the value of a color in a database, as efficiently as possible?
- What is the difference between a queue and a stack?
- What is the difference between storing data on the heap vs. on the stack?
- How would you store a vector in N dimensions in a datatable?
- What type of language do you prefer for writing complex data structures?
- What is the number 21 in binary format? And in hex?
- What is the last thing you learned about data structures from a book, magazine or web site?
- How would you store the results of a soccer/football competition (with teams and scores) in an XML document?
- Can you name some different text file formats for storing unicode characters?
Testing
- Do you know what a regression test is? How do you verify that new changes have not broken existing features?
- How can you implement unit testing when there are dependencies between a business layer and a data layer?
- Which tools are essential to you for testing the quality of your code?
- What types of problems have you encountered most often in your products after deployment?
- Do you know what code coverage is? What types of code coverage are there?
- Do you know the difference between functional testing and exploratory testing? How would you test a web site?
- What is the difference between a test suite, a test case and a test plan? How would you organize testing?
- What kind of tests would you include for a smoke test of an ecommerce web site?
- What can you do reduce the chance that a customer finds things that he doesn't like during acceptance testing?
- Can you tell me something that you have learned about testing and quality assurance in the last year?
Maintenance
- What kind of tools are important to you for monitoring a product during maintenance?
- What is important when updating a product that is in production and is being used?
- How do you find an error in a large file with code that you cannot step through?
- How can you make sure that changes in code will not affect any other parts of the product?
- How do you create technical documentation for your products?
- What measures have you taken to make your software products more easily maintainable?
- How can you debug a system in a production environment, while it is being used?
- Do you know what load balancing is? Can you name different types of load balancing?
- Can you name reasons why maintenance of software is the biggest/most expensive part of an application's life cycle?
- What is the difference between re-engineering and reverse engineering?
Configuration Management
- Do you know what a baseline is in configuration management? How do you freeze an important moment in a project?
- Which items do you normally place under version control?
- How can you make sure that team members know who changed what in a software project?
- Do you know the differences between tags and branches? When do you use which?
- How would you manage changes to technical documentation, like the architecture of a product?
- Which tools do you need to manage the state of all digital information in a project? Which tools do you like best?
- How do you deal with changes that a customer wants in a released product?
- Are there differences in managing versions and releases?
- What is the difference between managing changes in text files vs. managing changes in binary files?
- How would you treat simultaneous development of multiple RfC's or increments and maintenance issues?
Project Management
- How many of the three variables scope, time and cost can be fixed by the customer?
- Who should make estimates for the effort of a project? Who is allowed to set the deadline?
- Do you prefer minimization of the number of releases or minimization of the amount of work-in-progress?
- Which kind of diagrams do you use to track progress in a project?
- What is the difference between an iteration and an increment?
- Can you explain the practice of risk management? How should risks be managed?
- Do you prefer a work breakdown structure or a rolling wave planning?
- What do you need to be able to determine if a project is on time and within budget?
- Can you name some differences between DSDM, Prince2 and Scrum?
- How do you agree on scope and time with the customer, when the customer wants too much?