ThoughtWorks笔试题汇总

ThoughtWorks电话面试过后,会给三个题目,三个工作日后提交到指定目录即可。
相关题目如下:
Problem one: Trains

The local commuter railroad services a number of towns in Kiwiland. Because of monetary concerns, all of the tracks are ‘one-way.’ That is, a route from Kaitaia to Invercargill does not imply the existence of a route from Invercargill to Kaitaia. In fact, even if both of these routes do happen to exist, they are distinct and are not necessarily the same distance!

The purpose of this problem is to help the railroad provide its customers with information about the routes. In particular, you will compute the distance along a certain route, the number of different routes between two towns, and the shortest route between two towns.

Input: A directed graph where a node represents a town and an edge represents a route between two towns. The weighting of the edge represents the distance between the two towns. A given route will never appear more than once, and for a given route, the starting and ending town will not be the same town.

Output: For test input 1 through 5, if no such route exists, output ‘NO SUCH ROUTE’. Otherwise, follow the route as given; do not make any extra stops! For example, the first problem means to start at city A, then travel directly to city B (a distance of 5), then directly to city C (a distance of 4).

1.The distance of the route A-B-C.
2.The distance of the route A-D.
3.The distance of the route A-D-C.
4.The distance of the route A-E-B-C-D.
5.The distance of the route A-E-D.
6.The number of trips starting at C and ending at C with a maximum of 3 stops. In the sample data below, there are two such trips: C-D-C (2 stops). and C-E-B-C (3 stops).
7.The number of trips starting at A and ending at C with exactly 4 stops. In the sample data below, there are three such trips: A to C (via B,C,D); A to C (via D,C,D); and A to C (via D,E,B).
8.The length of the shortest route (in terms of distance to travel) from A to C.
9.The length of the shortest route (in terms of distance to travel) from B to B.
10.The number of different routes from C to C with a distance of less than 30. In the sample data, the trips are: CDC, CEBC, CEBCDC, CDCEBC, CDEBC, CEBCEBC, CEBCEBCEBC.

Test Input:

For the test input, the towns are named using the first few letters of the alphabet from A to D. A route between two towns (A to B) with a distance of 5 is represented as AB5.

Graph: AB5, BC4, CD8, DC8, DE6, AD5, CE2, EB3, AE7

Expected Output:

Output #1: 9

Output #2: 5

Output #3: 13

Output #4: 22

Output #5: NO SUCH ROUTE

Output #6: 2

Output #7: 3

Output #8: 9

Output #9: 9

Output #10: 7

Problem Two: Conference Track Management

You are planning a big programming conference and have received many proposals which have passed the initial screen process but you’re having trouble fitting them into the time constraints of the day – there are so many possibilities! So you write a program to do it for you.

•The conference has multiple tracks each of which has a morning and afternoon session.
•Each session contains multiple talks.
•Morning sessions begin at 9am and must finish before 12 noon, for lunch.
•Afternoon sessions begin at 1pm and must finish in time for the networking event.
•The networking event can start no earlier than 4:00 and no later than 5:00.
•No talk title has numbers in it.
•All talk lengths are either in minutes (not hours) or lightning (5 minutes).
•Presenters will be very punctual; there needs to be no gap between sessions.

Note that depending on how you choose to complete this problem, your solution may give a different ordering or combination of talks into tracks. This is acceptable; you don’t need to exactly duplicate the sample output given here.

Test input:

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

Test output:

Track 1:

09:00AM Writing Fast Tests Against Enterprise Rails 60min

10:00AM Overdoing it in Python 45min

10:45AM Lua for the Masses 30min

11:15AM Ruby Errors from Mismatched Gem Versions 45min

12:00PM Lunch

01:00PM Ruby on Rails: Why We Should Move On 60min

02:00PM Common Ruby Errors 45min

02:45PM Pair Programming vs Noise 45min

03:30PM Programming in the Boondocks of Seattle 30min

04:00PM Ruby vs. Clojure for Back-End Development 30min

04:30PM User Interface CSS in Rails Apps 30min

05:00PM Networking Event

Track 2:

09:00AM Communicating Over Distance 60min

10:00AM Rails Magic 60min

11:00AM Woah 30min

11:30AM Sit Down and Write 30min

12:00PM Lunch

01:00PM Accounting-Driven Development 45min

01:45PM Clojure Ate Scala (on my project) 45min

02:30PM A World Without HackerNews 30min

03:00PM Ruby on Rails Legacy App Maintenance 60min

04:00PM Rails for Python Developers lightning

05:00PM Networking Event

Problem Three: Merchant’s Guide to the Galaxy

You decided to give up on earth after the latest financial collapse left 99.99% of the earth’s population with 0.01% of the wealth. Luckily, with the scant sum of money that is left in your account, you are able to afford to rent a spaceship, leave earth, and fly all over the galaxy to sell common metals and dirt (which apparently is worth a lot).

Buying and selling over the galaxy requires you to convert numbers and units, and you decided to write a program to help you.

The numbers used for intergalactic transactions follows similar convention to the roman numerals and you have painstakingly collected the appropriate translation between them.

Roman numerals are based on seven symbols:

Symbol

Value

I

1

V

5

X

10

L

50

C

100

D

500

M

1,000

Numbers are formed by combining symbols together and adding the values. For example, MMVI is 1000 + 1000 + 5 + 1 = 2006. Generally, symbols are placed in order of value, starting with the largest values. When smaller values precede larger values, the smaller values are subtracted from the larger values, and the result is added to the total. For example MCMXLIV = 1000 + (1000 − 100) + (50 − 10) + (5 − 1) = 1944.

•The symbols “I”, “X”, “C”, and “M” can be repeated three times in succession, but no more. (They may appear four times if the third and fourth are separated by a smaller value, such as XXXIX.) “D”, “L”, and “V” can never be repeated.
•”I” can be subtracted from “V” and “X” only. “X” can be subtracted from “L” and “C” only. “C” can be subtracted from “D” and “M” only. “V”, “L”, and “D” can never be subtracted.
•Only one small-value symbol may be subtracted from any large-value symbol.
•A number written in [16]Arabic numerals can be broken into digits. For example, 1903 is composed of 1, 9, 0, and 3. To write the Roman numeral, each of the non-zero digits should be treated separately. Inthe above example, 1,000 = M, 900 = CM, and 3 = III. Therefore, 1903 = MCMIII.

(Source: Wikipedia ( [17]http://en.wikipedia.org/wiki/Roman_numerals)

Input to your program consists of lines of text detailing your notes on the conversion between intergalactic units and roman numerals.

You are expected to handle invalid queries appropriately.

Test input:

glob is I

prok is V

pish is X

tegj is L

glob glob Silver is 34 Credits

glob prok Gold is 57800 Credits

pish pish Iron is 3910 Credits

how much is pish tegj glob glob ?

how many Credits is glob prok Silver ?

how many Credits is glob prok Gold ?

how many Credits is glob prok Iron ?

how much wood could a woodchuck chuck if a woodchuck could chuck wood ?

Test Output:

pish tegj glob glob is 42

glob prok Silver is 68 Credits

glob prok Gold is 57800 Credits

glob prok Iron is 782 Credits

I have no idea what you are talking about

ThoughtWorks笔试题汇总相关推荐

  1. 程序员必看 c++笔试题汇总

    ①链表反转 单向链表的反转是一个经常被问到的一个面试题,也是一个非常基础的问题.比如一个链表是这样的: 1->2->3->4->5 通过反转后成为5->4->3-& ...

  2. 校招笔试C语言,校招c ++笔试题汇总

    ①链表反转 单向链表的反转是一个经常被问到的一个面试题,也是一个非常基础的问题, 最容易想到的方法遍历一遍链表,利用一个辅助指针,存储遍历过程中当前指针指向的下一个元素,然后将当前节点元素的指针反转后 ...

  3. 【Mysql笔试】-常见笔试题汇总

    Mysql常见笔试题汇总 基础知识 排序的规则? 函数的分类?经常使用的函数? 分组查询注意条件? limit使用方法? 创建表时有什么约束条件? mysql常见数据类型? 增加删除修改表结构 常见约 ...

  4. 数字IC设计笔试题汇总(一)

    数字IC设计笔试题汇总(一) 快秋招了,这篇博客记录了一些最近看见的数字IC设计相关的笔试题,仅供参考 1. 用100MHz的时钟A去采样200MHz的时钟B(与A无关)产生的8bit信号是同步采样还 ...

  5. 电信笔试C语言,电信的几个网络方面面试笔试题汇总

    选择题 1.通信网的基本结构形式有五种,以下正确的说法是(C) A.网型.星型.树型.环型.总线型; B.网型.星型.线型.复合型.环型; C.网型.星型.复合型.环型.总线型; D.网型.环型.线型 ...

  6. 北大青鸟java8.0 s1_北大青鸟s1笔试试题(笔试题汇总及所有.docx

    北大青鸟s1笔试试题(笔试题汇总及所有 北大青鸟s1笔试试题(笔试题汇总及所有 篇一:XX_9北大青鸟S1考试笔试 选择题(针对以下题目,请选择最符合题目要求的答案.针对每一道题目,所有答案都选对,则 ...

  7. 仿真软件测试基尔霍夫定律,硬件工程师常见笔试题汇总

    原标题:硬件工程师常见笔试题汇总 一.电路分析: 1.竞争与冒险 在组合逻辑中,在输入端的不同通道数字信号中经过了不同的延时,导致到达该门的时间不一致叫竞争.因此在输出端可能产生短时脉冲(尖峰脉冲)的 ...

  8. 计算机基础word简单面试题,Word、excel、PPT、计算机基础笔试题汇总

    Word.excel.PPT.计算机基础笔试题汇总 (31页) 本资源提供全文预览,点击全文预览即可全文预览,如果喜欢文档就下载吧,查找使用更方便哦! 29.9 积分 Word.excel.PPT. ...

  9. 数字IC设计笔试题汇总(二)

    数字IC设计笔试题汇总(二) 快秋招了,这篇博客记录了一些最近看见的数字IC设计相关的笔试题,仅供参考 1. 在边沿敏感的时序逻辑代码中使用(A)赋值,会导致综合前与综合后仿真结果不一致. A . 阻 ...

  10. 2015年阿里巴巴校招研发工程师在线笔试题汇总

    在线笔试题汇总 卷一: 1.下面的函数中哪个是系统调用而不是库函数______?  printf  scanf  fgetc  read  print_s  scan_s 2.某足球队有四名外援,分别 ...

最新文章

  1. GitHub开源:狗屁不通文章生成器
  2. 把接口调用打成jar包的类怎么写_直观讲解RPC调用和HTTP调用的区别
  3. 借助码云快速安装 golang.org/x/lint/golint 和 golang.org/x/tools/ 等依赖
  4. 江西住建云实名认证怎么弄_王者荣耀无限时间怎么弄 2020年无限时间账号
  5. 每天30分钟:成功有效的学习方法
  6. 3 天开发物联网应用!腾讯云 IoT 超级小程序来了
  7. 阿里云服务器部署Java Web项目全过程
  8. 中国海洋大学c语言期末题库,中国海洋大学C语言期末笔试2010年秋A试题.doc
  9. 基于Freemarker模板引擎的Java代码生成器
  10. c语言软件下载与配置
  11. SaaS销售迎来破局 渠道分销重回主场
  12. 计算机无法自动搜索更新驱动程序,Win10怎么设置自动搜索更新驱动软件
  13. 计算机程序设计专业大学排名,全国计算机专业大学排名一览表
  14. 分布式系统----时钟同步
  15. FortiGate常用命令
  16. 中国一百大姓,您排第几?
  17. 【转】qlv文件如何转换成mp4 怎样把下载好的qlv格式视频转换成MP4格式
  18. 使用javaGUI做一个MC版俄罗斯方块(二)
  19. 灰度图像增强和图像去噪
  20. 记忆化搜索 (蒟蒻练习生)

热门文章

  1. html个性签名,经典的个性签名设计
  2. 阿里云活动价格点击购买时价格上涨的解决办法
  3. android 飞行模式 源代码,android 定时进入飞行模式 例子
  4. Word中把竖排文字里的数字变横向
  5. Birt时间参数添加My97日历控件
  6. Windows留后门--教程(四)——Windows启动项后门
  7. 语音合成 TTS 相关的一些总结
  8. 写个单机版斗地主程序,复习c++面向对象
  9. 【Love2d从青铜到王者】第一篇:Love2d入门以及安装教程
  10. python爬取去哪儿网机票_去哪儿网机票爬虫