高級軟件工程師面試問題 Interview SeniorSoftwareEngineers

Posted by – 2011年02月23日

hanselman這篇文章很有意思,盡管不是每個(gè)問題都很值得作為面試問題出現(xiàn),但是很多都值得去仔細(xì)想想。

 

一個(gè)優(yōu)秀的面試問題,尤其是針對Senior Engineer的面試問題,不應(yīng)該僅僅是問某個(gè)api的用法,某個(gè)很容易從幫助中找到的內(nèi)容。有發(fā)散性,可以基于問題進(jìn)行擴(kuò)展的問題才是一個(gè)比較好的問題。

 

下面是一個(gè)非常長的問題列表,主要是關(guān)于面向?qū)ο笤O(shè)計(jì),設(shè)計(jì)模式,以及一些實(shí)際工程中會用到概念,都是比較基本的,但是也非常能考察一個(gè)高級工程師的水平,因?yàn)闀可娴椒浅6喾矫妗?/p>

 

另外要說明的是下面很多概念性問題可以直接從wiki維基百科上找到答案。另外我會標(biāo)記出個(gè)人覺得比較值得問的問題。

 

原文在這里 http://www./blog/NewInterviewQuestionsForSeniorSoftwareEngineers.aspx

 

# What is something substantive that you’ve done to improve as a developer in your career?

有沒有做過什么比較實(shí)質(zhì)性的事情來提升你的程序員職業(yè)水平?

 

好問題。我的回答:這個(gè)很難說,我的做法是堅(jiān)持學(xué)習(xí),堅(jiān)持寫技術(shù)類博客。另外有些經(jīng)驗(yàn)在這里提到過http:///?p=1799

 

# Would you call yourself a craftsman (craftsperson) and what does that word mean to you?

不敢叫自己大師啊,那得多牛逼?!

 

# Implement a <basic data structure> using <some language> on <paper|whiteboard|notepad>.

用某種語言在紙面上實(shí)現(xiàn)一個(gè)基本的數(shù)據(jù)結(jié)構(gòu)。(用近似真實(shí)格式的偽代碼來表達(dá)?)

 

好問題。我的回答,找一本基礎(chǔ)的數(shù)據(jù)結(jié)構(gòu)書籍吧,比如這一本《數(shù)據(jù)結(jié)構(gòu)與算法分析:C語言描述(原書第2版)》

 

# What is SOLID?

參考http://en./wiki/Solid_%28object-oriented_design%29

這個(gè)solid不是說“結(jié)實(shí)的”,而是面向?qū)ο笪宕笤瓌t的簡稱:單一責(zé)任原則,開閉原則,萊西科夫替換原則,接口分離原則,依賴倒置原則。

好問題。這幾個(gè)原則的確應(yīng)該背下來,太基礎(chǔ)了。

 

# Why is the Single Responsibility Principle important?

為什么單一責(zé)任原則重要?

 

好問題。我的回答,因?yàn)槁氊?zé)明確,設(shè)計(jì)就不容易混亂,即使有后續(xù)變化也是可控的。

 

# What is Inversion of Control? How does that relate to dependency injection?

參考http://en./wiki/Inversion_of_control

實(shí)際中的例子,通知開會,一種可以打電話通知到每個(gè)人(這屬于中心控制型的,必須有個(gè)controller/manager之類的);也可張貼一個(gè)告示,大家自己來看,這屬于事件響應(yīng)型的。

 

# How does a 3 tier application differ from a 2 tier one?

三層應(yīng)用與兩層應(yīng)用的區(qū)別是什么?

 

我只知道MVC三層應(yīng)用。

 

# Why are interfaces important?

為什么接口重要?

 

好問題。接口的重要在于消費(fèi)者(客戶端)不需要了解生產(chǎn)者(服務(wù)端)的細(xì)節(jié),接口相當(dāng)于合同,當(dāng)合同不變的時(shí)候,誰生產(chǎn)如何生產(chǎn)都不是消費(fèi)者關(guān)心的問題。

 

# What is the Repository pattern? The Factory Pattern? Why are patterns important?

關(guān)于設(shè)計(jì)模式的問題,

第一個(gè)參考http://msdn.microsoft.com/en-us/library/ff649690.aspx

工廠模式基本上是眾人皆知的模式了。

為何模式重要?我不覺得模式重要,模式的重要性在于讓你能“喔!原來是這個(gè)”。但是對于一個(gè)沒有幾年編程經(jīng)驗(yàn)的開發(fā)者而言,模式只能讓你更混亂。

 

設(shè)計(jì)模式很多情況下是通過加入一個(gè)抽象層來解決耦合之類的問題,但是層次越多越復(fù)雜,就好比單位中領(lǐng)導(dǎo)的級別越多越官僚一樣。

 

# What are some examples of anti-patterns?

反模式?少用模式,多寫點(diǎn)清晰的代碼吧。

 

# Who are the Gang of Four? Why should you care?

四人組,名字叫不上來,但是他們是設(shè)計(jì)模式的總結(jié)者。

 

# How do the MVP, MVC, and MVVM patterns relate? When are they appropriate?

這也是微軟特色,大家只要知道MVC就行了,其實(shí)大家現(xiàn)在用的都是MVC,但是由于水平高低,效果就是千差萬別。

啥MVP,MVVM我不知?。ㄒ膊皇遣恢?,只知道MVVM是wpf的一個(gè)概念,可我也不用wpf?。?/p>

 

# Explain the concept of Separation of Concerns and it’s pros and cons.

參考http://en./wiki/Separation_of_concerns

我也不是了解的很細(xì)。

 

# Name three primary attributes of object-oriented design. Describe what they mean and why they’re important.

封裝/繼承/多態(tài)?

參考這里吧http://en./wiki/Object-oriented_programming

學(xué)C++這幾個(gè)概念是基礎(chǔ)啊

 

# Describe a pattern that is NOT the Factory Pattern? How is it used and when?

不是工廠模式,我知道個(gè)單件模式。還有模板模式/facade模式/strategy模式,具體也要翻翻書,很少有意識的套用。

 

# You have just been put in charge of a legacy code project with maintainability problems. What kind of things would you look to improve to get the project on a stable footing?

第一步,先把代碼用最大警告級別編譯一遍,然后fix所有值得fix的warning。

好問題。

 

# Show me a portfolio of all the applications you worked on, and tell me how you contributed to design them.

如果光是看文檔,很難說到實(shí)質(zhì)上。

好問題。

 

# What are some alternate ways to store data other than a relational database? Why would you do that, and what are the trade-offs?

好問題,很多啦,內(nèi)存/文件/云存儲/nosql等等。tradeoff就看你的應(yīng)用需求了。blabla。。。

 

# Explain the concept of convention over configuration, and talk about an example of convention over configuration you have seen in the wild.

好問題。

我能想到的就是買車開車,很少有人買到車以后,拿著說明書調(diào)試這個(gè)那個(gè),一般都是直接上路,因?yàn)槠噺S會給你一個(gè)比較不錯(cuò)的默認(rèn)配置,也就是所謂的“方便”。

這個(gè)方便也保證了你開其它車,基本上都差不多,不用重新配置或者學(xué)習(xí)什么。

所謂方便”convention“就是把相對不錯(cuò)/比較普遍適用的配置都內(nèi)置好了,用就是了。

 

# Explain the differences between stateless and stateful systems, and impacts of state on parallelism.

解釋有狀態(tài)與無狀態(tài)系統(tǒng),以及有狀態(tài)系統(tǒng)在并行上的影響。

 

好問題。這個(gè)說不好。有狀態(tài)系統(tǒng)因?yàn)楸3譅顟B(tài),并發(fā)運(yùn)行時(shí)的訪問/修改需要有鎖同步機(jī)制。

 

# Discuss the differences between Mocks and Stubs/Fakes and where you might use them (answers aren’t that important here, just the discussion that would ensue).

跟TDD相關(guān)的問題。不會哦。

 

# Discuss the concept of YAGNI and explain something you did recently that adhered to this practice.

解釋“YAGNI”。

最簡單的例子是當(dāng)我們定義接口,會特意預(yù)留出一兩個(gè)參數(shù),說是為了將來使用,其實(shí),沒有將來。屁嘞!你根本不需要它!

不是說不考慮可擴(kuò)展性,但是要基于可預(yù)測的基礎(chǔ)上。

 

# Explain what is meant by a sandbox, why you would use one, and identify examples of sandboxes in the wild.

比如把虛擬機(jī)比如vmware virtualbox作為沙箱,用起來可以隔離風(fēng)險(xiǎn)。大不了重啟,或者刪除之。

 

# Concurrency

* What’s the difference between Locking and Lockless (Optimistic and Pessimistic) concurrency models?

* What kinds of problems can you hit with locking model? And a lockless model?

* What trade offs do you have for resource contention?

* How might a task-based model differ from a threaded model?

* What’s the difference between asynchrony and concurrency?

 

這些問題不錯(cuò)。并發(fā)相關(guān)的問題,設(shè)計(jì)多用戶高性能系統(tǒng)必知。

 

# Are you still writing code? Do you love it?

我喜歡編程。

 

# You’ve just been assigned to a project in a new technology how would you get started?

如果是我,先了解這個(gè)技術(shù)的風(fēng)險(xiǎn)。小心求證,盡量縮小使用范圍,否則是很致命的。

 

# How does the addition of Service Orientation change systems? When is it appropriate to use?

不懂。

 

# What do you do to stay abreast of the latest technologies and tools?

我跟的很緊哦!

 

# What is the difference between "set" logic, and "procedural" logic. When would you use each one and why?

不懂要問什么。

 

# What Source Control systems have you worked with?

ClearCase.很難用。最近不少問題都是跟CC相關(guān)的。

 

# What is Continuous Integration? Have you used it and why is it important?

持續(xù)集成。這個(gè)概念跟TDD也掛鉤。

 

# Describe a software development life cycle that you’ve managed.

涉及的還是傳統(tǒng)模型,不是scrum型的。

 

# How do you react to people criticizing your code/documents?

批評沒問題,但是要有道理有根據(jù)。

 

# Whose blogs or podcasts do you follow? Do you blog or podcast?

這就很多了,看我以前寫的文章吧。

 

# Tell me about some of your hobby projects that you’ve written in your off time.

主要是Lua和Py的,appengine上的比較多。

 

# What is the last programming book you read?

最近看得是《C++ FAQs》中文版。翻譯的一般,內(nèi)容也比較陳舊。更堅(jiān)定了我使用C風(fēng)格的C++的決心。

 

# Describe, in as much detail as you think is relevant, as deeply as you can, what happens when I type "cnn.com" into a browser and press "Go".

盡可能詳細(xì)深入的描述,當(dāng)你在瀏覽器敲網(wǎng)址然后go后面的技術(shù)細(xì)節(jié)。

 

好問題。很發(fā)散,絕對能看出面試者的技術(shù)厚度。

 

# Describe the structure and contents of a design document, or a set of design documents, for a multi-tiered web application.

 

# What’s so great about <cool web technology of the day>?

 

# How can you stop your DBA from making off with a list of your users’ passwords?

 

# What do you do when you get stuck with a problem you can’t solve?

參考這里計(jì)算機(jī)編程新人入行指導(dǎo) 

http:///?p=961

 

# If your database was under a lot of strain, what are the first few things you might consider to speed it up?

先profiling哦!

 

# What is SQL injection?

 

# What’s the difference between unit test and integration test?

單元測試應(yīng)該是程序員做。集成測試就牽扯到tester了。

 

# Tell me about 3 times you failed.

 

# What is Refactoring ? Have you used it and it is important? Name three common refactorings.

我一直在重構(gòu)自己的代碼。重構(gòu)原則參考這里

C++項(xiàng)目代碼規(guī)范(偶自用)http:///?p=1787

 

# You have two computers, and you want to get data from one to the other. How could you do it?

命名管道,socket,共享文件夾,路子還是很多的。

 

# Left to your own devices, what would you create?

 

# Given Time, Cost, Client satisfaction and Best Practices, how will you prioritize them for a project you are working on? Explain why.

這個(gè)很值得問。

 

# What’s the difference between a web server, web farm and web garden? How would your web application need to change for each?

 

# What value do daily builds, automated testing, and peer reviews add to a project? What disadvantages are there?

都是為了提升代碼質(zhì)量,但是會延長工期。

 

# What elements of OO design are most prone to abuse? How would you mitigate that?

 

# When do you know your code is ready for production?

看bug fix的統(tǒng)計(jì)曲線。