一家公司 给我出的面试题。。呵呵,蛮简单的。。就是好久没写了。。昨天完成了。有兴趣可以做做。。温故以前知识。
Write a program that can compute the number of unique, valid phone numbers with the following constraints:
a) A valid phone number is seven digits in length
b) A valid phone number cannot begin with a zero or a one
c) A valid phone number can contain only digits
d) A valid phone number must consist of a sequence of digits that can be traced by the movements of a chess piece on a normal telephone keypad
e) The program should be written so that it could work with any chess piece, but for the purposes of this test you only need to implement support for the knight, which has the following valid move pattern for a piece starting at the center dot:
For example, a knight starting on the number 8 could move to 1 or 3. From 1 it could move to 6 or 8, etc.
You can use any language of your pick to complete this exercise.
Additional Instructions:
When you are finished, you will be asked to review the test with us. Our evaluation criterion includes both your approach to the solution as well as your answer to the problem. You do not need to spend time documenting your code; you can discuss the code as you review it with us.
You should be able to finish the test within 4 hours. Nevertheless, we are giving 24 hours to response. You do not get extra credit for finishing quickly, nor are you penalized for taking the full 24 hours. We would much rather see a well-designed, efficient solution than a quick answer to the problem.
Deliverables:
- All source code
- Configuration files (if any)
- Compilation instruction (if required)
- Result of the question (i.e. number possible phone numbers)
分享到:
相关推荐
新的一年招聘又开始了,现在传一点儿资料,希望对朋友们有点用:yjs2008、名企面试自助手册、世界500强面试题.exe
iOS面试题收集,用于准备面试,复习面试题~_面试题都是套路_iOSFace2Face
JavaOOP面试题 Java集合/泛型面试题 Java异常面试题 Java中的IO与NIO面试题 Java反射面试题 Java序列化面试题 Java注解面试题 多线程&并发面试题 JVM面试题 Mysql面试题 Redis面试题 Memcached面试题 MongoDB面试题 ...
云计算面试题之ELK面试题,运维工程师必备云计算面试题之ELK面试题,运维工程师必备云计算面试题之ELK面试题,运维工程师必备云计算面试题之ELK面试题,运维工程师必备云计算面试题之ELK面试题,运维工程师必备...
最全的j2EE面试题,题量大、经典,是我面试的整理试题 1、java笔试题大集合 2、各个公司面试题 3、J2EE初学者面试题 4、J2EE面试题(打码查错题) 5、java_华为笔试题 6、java常见面试题 7、java程序员面试宝典 8、...
大数据面试题V3.0完成了。共523道题,679页,46w+字,来源于牛客870+篇面经。 主要分为以下几部分: Hadoop面试题:100道 Zookeeper面试题:21道 Hive面试题:47道 Flume面试题:11道 Kafka面试题:59到 HBase面试题...
46家公司笔试面试题~~~~~~~~~~~~~~~~~~~~~
c++面试题~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
文件中包含了本人最近在网上总结的面试题,有java面试题,jq面试题,jsp、servlet、ajax面试题,mysql面试题,oracle面试题,redis教案,也有最近时间总结的公司面试题,涉及的层面虽然不是很多,但是应对面试 应该...
2023年最新版--Java+最常见的+200++面试题汇总+答案总结汇总 阿里百度美团面试题合集 大数据面试题 100道 多线程面试59题(含答案) 最新JAVA面试题总结之基础/框架/数据库/JavaWeb/Redis BIO,NIO,AIO,Netty面试题 ...
2022java面试题、JVM面试题、多线程面试题、并发编程、Redis面试题、MySQL面试题、Java2022面试题、Netty面试题、Elasticsearch面试题、Tomcat面试题、Dubbo面试题、Kafka面试题、Linux面试题、2021面试题、java面试...
(完整版)运维面试题(含答案).pdf(完整版)运维面试题(含答案).pdf(完整版)运维面试题(含答案).pdf(完整版)运维面试题(含答案).pdf(完整版)运维面试题(含答案).pdf(完整版)运维面试题(含答案).pdf(完整版)运维面试题...
【BAT必备】zookeeper面试题【BAT必备】zookeeper面试题【BAT必备】zookeeper面试题【BAT必备】zookeeper面试题【BAT必备】zookeeper面试题【BAT必备】zookeeper面试题【BAT必备】zookeeper面试题【BAT必备】...
搜集的各个软件公司的面试试题,对于即将就业软件学习者是一个不错的参考~~
面试题包含了不同技术层面的面试问题,同时也能对一些没有面试开发经验的小白给予不可估量的包装, 让你的薪水绝对翻倍, 本人亲试有效.Java面试题84集、java面试专属及面试必问课程,所有的面试题有视屏讲解, 解答方案....
ERP工程师面试题ERP工程师面试题ERP工程师面试题ERP工程师面试题
【BAT必备】dubbo面试题【BAT必备】dubbo面试题【BAT必备】dubbo面试题【BAT必备】dubbo面试题【BAT必备】dubbo面试题【BAT必备】dubbo面试题【BAT必备】dubbo面试题【BAT必备】dubbo面试题【BAT必备】dubbo面试题...
java高级软件工程师面试题大全及答,一些公司的面试题,对于正在找工作应对面试的朋友或许有点帮助。java高级软件工程师面试题大全及答,一些公司的面试题,对于正在找工作应对面试的朋友或许有点帮助