这道面试题是从 HarrisonHao 的一篇博文中看到的:原文链接
我看到之后,感觉此题十分有趣,遂自己用 node.js 以不同的思路实现了一遍,实现中使用了 lodash
原题比较长,而且是英文的,就不粘过来了,完整题目和代码可见github

原题大意

你正在准备一场大型的开发者会议,但是有一点点麻烦……
这场会议为期两天,每天上午从九点开始,上午的会议安排到中午12点之前必须结束;
中午12点到下午1点之间是午餐时间,下午1点开始进行下午的会议,到下午5点前必须结束;
现在你有一个清单,上面写明了所有要安排的议题,和每个议题会占用的时间;
清单如下
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
清单中

网友评论