這道面試題是從 HarrisonHao 的一篇博文中看到的:原文鏈接
我看到之后,感覺此題十分有趣,遂自己用 node.js 以不同的思路實(shí)現(xiàn)了一遍,實(shí)現(xiàn)中使用了 lodash
原題比較長,而且是英文的,就不粘過來了,完整題目和代碼可見github
原題大意
你正在準(zhǔn)備一場大型的開發(fā)者會(huì)議,但是有一點(diǎn)點(diǎn)麻煩……
這場會(huì)議為期兩天,每天上午從九點(diǎn)開始,上午的會(huì)議安排到中午12點(diǎn)之前必須結(jié)束;
中午12點(diǎn)到下午1點(diǎn)之間是午餐時(shí)間,下午1點(diǎn)開始進(jìn)行下午的會(huì)議,到下午5點(diǎn)前必須結(jié)束;
現(xiàn)在你有一個(gè)清單,上面寫明了所有要安排的議題,和每個(gè)議題會(huì)占用的時(shí)間;
清單如下
Writing Fast Tests Against Enterprise Rails 60min
Overdoing it in Python 45min
Lua for the Masses 30min
Ruby Errors from Mismatched Gem Versions 45min
Common Ruby Errors 45min
Rails for Python Developers lightning
Communicating Over Distance 60min
Accounting-Driven Development 45min
Woah 30min
Sit Down and Write 30min
Pair Programming vs Noise 45min
Rails Magic 60min
Ruby on Rails: Why We Should Move On 60min
Clojure Ate Scala (on my project) 45min
Programming in the Boondocks of Seattle 30min
Ruby vs. Clojure for Back-End Development 30min
Ruby on Rails Legacy App Maintenance 60min
A World Without HackerNews 30min
User Interface CSS in Rails Apps 30min
清單中
網(wǎng)友評論