轉自:http://www.noop.nl/2009/01/100-interview-questions-for-software-developers.html
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?
譯文轉自:http://www.infoq.com/cn/articles/programmer-interview
想僱到搞軟體開發的聰明人可不容易。萬一一不小心,就會搞到一堆低能大狒狒。我去年就碰到這種事了。你肯定不想這樣吧。聽我的,沒錯。在樹上開站立會議門都沒有。
問點有難度的問題能幫你把聰明人跟狒狒們分開。我決定把我自己整理出來的軟體開發人員面試百問發出來,希望能幫到你們的忙。
這個列表涵蓋了軟體工程知識體系中定義的大多數知識域。當然,如果你只想找出類拔萃的程式員,便只需涉及結構、演算法、資料結構、測試這幾個話題。如果想雇架構師,也可以只考慮需求、功能設計、技術設計這些地方。
不過不管你怎麼做,都要牢記一點:
這裡大多數問題的答案都沒有對錯之分!
你可以把我的這些問題作為引子,展開討論。例如下面有個問題是使用靜態方法或是單例的緣由。如果那個面試的就此展開長篇大論,那他很有可能是個聰明能乾的傢伙!如果他一臉茫然的看著你,發出這種聲音,很明顯這就是只狒狒了。同樣,想知道一個數是不是2的乘方也有很多方法,不過要是面試的人想用mod運算子,嗯……你知道我的意思吧。(你不知道也沒關係,來根香蕉?)
需求
- 你能給出一些非功能性(或者品質)需求的例子嗎?
- 如果客戶需要高效能、使用極其方便而又高度安全,你會給他什麼建議?
- 你能給出一些用來描述需求的不同技術嗎?它們各自適用於什麼情境?
- 需求跟蹤是什麼意思?什麼是向前追溯,什麼是向後追溯?
- 你喜歡用什麼工具跟蹤需求?
- 你怎麼看待需求變化?它是好是壞?給出你的理由。
- 你怎樣研究需求,發現需求?有哪些資源可以用到?
- 你怎麼給需求制定優先順序?有哪些技術?
- 在需求過程中,使用者、客戶、開發人員各自的職責是什嗎?
- 你怎麼對待不完整或是令人費解的需求?
功能設計
- 在功能設計中有哪些隱喻?給出幾個成功的例子。
- 如果有些功能的執行時間很長,怎麼能讓使用者感覺不到太長的等待?
- 如果使用者必須要在一個很小的地區內,從一個常常的列表中選擇多個條目,你會用什麼控制項?
- 有哪些方法可以保證資料項目的完整?
- 建立系統原型有哪些技術?
- 應用程式怎樣建立對使用者行為的預期?給出一些例子。
- 如何入手設計一組數量龐大而又複雜的特性,你能舉出一些設計思路嗎?
- 有一個列表,其中有10個元素,每個元素都有20個欄位可以編輯,你怎樣設計這種情況?如果是1000個元素,每個元素有3個欄位呢?
- 用不同的顏色對一段文本中的文字標記高亮,這種做法有什麼問題?
- Web環境和Windows環境各有些什麼限制?
技術設計
- 什麼是低耦合和高彙總?封裝原則又是什麼意思?
- 在Web應用中,你怎樣避免幾個人編輯同一段資料所造成的衝突?
- 你知道設計模式嗎?你用過哪些設計模式?在什麼場合下用的?
- 是否瞭解什麼是無狀態的業務層?長事務如何與之相適應?
- 在搭建一個架構,或是技術設計時,你用過幾種圖?
- 在N層架構中都有哪些層?它們各自的職責是什嗎?
- 有哪些方法可以確保架構中資料的正確和健壯?
- 物件導向設計和面向組件設計有哪些不同之處?
- 怎樣在資料庫中對使用者授權、使用者配置、許可權管理這幾項功能建模?
- 怎樣按照等級制度給動物王國(包括各種物種和各自的行為)建模?
程式設計
- 你怎樣保證你的代碼可以處理各種錯誤事件?
- 解釋一下什麼是測試驅動開發,舉出極限編程中的一些原則。
- 看別人代碼的時候,你最關心什麼地方?
- 什麼時候使用抽象類別,什麼時候使用介面?
- 除了IDE以外,你還喜歡哪些必不可少的工具?
- 你怎麼保證代碼執行速度快,而又不出問題?
- 什麼時候用多態,什麼時候用委派?
- 什麼時候使用帶有靜態成員的類,什麼時候使用單例?
- 你在代碼裡面怎麼提前處理需求的變化?給一些例子。
- 描述一下實現一段代碼的過程,從需求到最終交付。
演算法
- 怎樣知道一個數字是不是2的乘方?怎樣判斷一個數是不是奇數?
- 怎樣找出鏈表中間的元素?
- 怎樣改變10,000個靜態HTML頁面中所有電話號碼的格式?
- 舉出一個你所用過的遞迴的例子。
- 在散列表和排序後的列表中找一個元素,哪個尋找速度最快?
- 不管是書、雜誌還是網路,你從中所學到的最後一點演算法知識是什嗎?
- 怎樣把字串反轉?你能不用臨時的字串嗎?
- 你願意用什麼類型的語言來編寫複雜的演算法?
- 有一個數組,裡面是從1到1,000,000的整數,其中有一個數字出現了兩次,你怎麼找出那個重複的數字?
- 你知道“旅行商問題(Traveling Salesman Problem)”嗎?
資料結構
- 怎樣在記憶體中實現倫敦地鐵的結構?
- 怎樣以最有效方式在資料庫中儲存顏色值?
- 隊列和堆棧區別是什嗎?
- 用堆或者棧儲存資料的區別是什嗎?
- 怎樣在資料庫中儲存N維向量?
- 你傾向於用哪種類型的語言編寫複雜的資料結構?
- 21的二進位值是什嗎?十六制值呢?
- 不管是書、雜誌還是網路,你從中所學到的最後一點資料結構的知識是什嗎?
- 怎樣在XML文檔中儲存足球比賽結果(包括隊伍和比分)?
- 有哪些文字格式設定可以儲存Unicode字元?
測試
- 什麼是迴歸測試?怎樣知道新引入的變化沒有給現有的功能造成破壞?
- 如果業務層和資料層之間有依賴關係,你該怎麼寫單元測試?
- 你用哪些工具測試代碼品質?
- 在產品部署之後,你最常碰到的是什麼類型的問題?
- 什麼是程式碼涵蓋範圍?有多少種程式碼涵蓋範圍?
- 功能測試和探索性測試的區別是什嗎?你怎麼對網站進行測試?
- 測試套件、測試案例、測試計劃,這三者之間的區別是什嗎?你怎麼組織測試?
- 要對電子商務網站做煙霧測試 (Smoke Test),你會做哪些類型的測試?
- 客戶在驗收測試中會發現不滿意的東西,怎樣減少這種情況的發生?
- 你去年在測試和品質保證方面學到了哪些東西?
維護
- 你用哪些工具在維護階段對產品進行監控?
- 要想對一個正在產品環境中被使用的產品進行升級,該注意哪些重要事項?
- 如果在一個龐大的檔案中有錯誤,而代碼又無法逐步跟蹤,你怎麼找出錯誤?
- 你怎樣保證代碼中的變化不會影響產品的其他部分?
- 你怎樣為產品編寫技術文檔?
- 你用過哪些方式保證軟體產品容易維護?
- 怎樣在產品啟動並執行環境中進行系統調試?
- 什麼是負載平衡?負載平衡的方式有哪些種?
- 為什麼在應用程式的生命週期中,軟體維護費用所佔的份額最高?
- 再造工程(re-engineering)和逆向工程(reverse engineering)的區別是什嗎?
組態管理
- 你知道組態管理中基準的含義嗎?怎樣把項目中某個重要的時刻凍結?
- 你一般會把哪些東西納入版本控制?
- 怎樣可以保證團隊中每個人都知道誰改變了哪些東西?
- Tag和Branch的區別是什嗎?在什麼情況下該使用tag,什麼時候用branch?
- 怎樣管理技術文檔——如產品架構文檔——的變化?
- 你用什麼侗劇管理項目中所有數字資訊的狀態?你最喜歡哪種工具?
- 如果客戶想要對一款已經發布的產品做出變動,你怎麼處理?
- 版本管理和發行管理有什麼差異?
- 對文字檔的變化和二進位檔案的變化進行管理,這二者有什麼不同?
- 同時處理多個變更請求,或是同時進行漸進式開發和維護,這種事情你怎麼看待?
專案管理
- 範圍、時間、成本,這三項中哪些是可以由客戶控制的?
- 誰該對項目中所要付出的一切做出估算?誰有權設定期限?
- 減少交付的次數,或是減少每個每個交付中的工作量,你喜歡哪種做法?
- 你喜歡用哪種圖來跟蹤項目進度?
- 迭代和增量的區別在哪裡?
- 試著解釋一下風險管理中用到的實踐。風險該如何管理?
- 你喜歡任務分解還是滾動式計劃?
- 你需要哪些東西協助你判斷項目是否符合時間要求,在預算範圍內運作?
- DSDM、Prince2、Scrum,這三者之間有哪些區別?
- 如果客戶想要的東西太多,你在範圍和時間上怎樣跟他達成一致呢?