Microsoft Interview Questions

【H5】自己写了个仿360商城demo,欢迎大虾路过拍砖 1) 仿360商城写的demo,完成度较高。欢迎大神路过抛砖! 可通过BAE在线链接直接打开:http://wesleyq5233pj360mall.duapp.com/html/index.html; 喜欢的话也可以通过我的github:https://github.com/WesleyQ5233/360Mall.git下载源码,喜欢的话你就star一下。 2) 主要功能及技术点:购物 阅读详情
[This article is referred from here, and you can find out more microsoft interviews at this site]
[You can find some questions and answers here.]


The following are actual questions from actual interviews conducted by Microsoft employees on the main campus. Microsoft Consultants are sometimes allowed to have a life, so questions asked of them during interviews don't really count and aren't listed.

The questions tend to follow some basic themes:


Riddles

  • Why is a manhole cover round?
  • How many cars are there in the USA? (A popular variant is "How many gas stations are there in the USA?")
  • How many manhole covers are there in the USA?
  • You've got someone working for you for seven days and a gold bar to pay them. The gold bar is segmented into seven connected pieces. You must give them a piece of gold at the end of every day. If you are only allowed to make two breaks in the gold bar, how do you pay your worker?
  • One train leaves Los Angeles at 15mph heading for New York. Another train leaves from New York at 20mph heading for Los Angeles on the same track. If a bird, flying at 25mph, leaves from Los Angeles at the same time as the train and flies back and forth between the two trains until they collide, how far will the bird have traveled?
  • Imagine a disk spinning like a record player turn table. Half of the disk is black and the other is white. Assume you have an unlimited number of color sensors. How many sensors would you have to place around the disk to determine the direction the disk is spinning? Where would they be placed?
  • Imagine an analog clock set to 12 o'clock. Note that the hour and minute hands overlap. How many times each day do both the hour and minute hands overlap? How would you determine the exact times of the day that this occurs?
  • You have two jars, 50 red marbles and 50 blue marbles. A jar will be picked at random, and then a marble will be picked from the jar. Placing all of the marbles in the jars, how can you maximize the chances of a red marble being picked? What are the exact odds of getting a red marble using your scheme?
  • Pairs of primes separated by a single number are called prime pairs. Examples are 17 and 19. Prove that the number between a prime pair is always divisible by 6 (assuming both numbers in the pair are greater than 6). Now prove that there are no 'prime triples.'
  • There is a room with a door (closed) and three light bulbs. Outside the room there are three switches, connected to the bulbs. You may manipulate the switches as you wish, but once you open the door you can't change them. Identify each switch with its bulb.
  • Suppose you had 8 billiard balls, and one of them was slightly heavier, but the only way to tell was by putting it on a scale against another. What's the fewest number of times you'd have to use the scale to find the heavier ball?
  • Imagine you are standing in front of a mirror, facing it. Raise your left hand. Raise your right hand. Look at your reflection. When you raise your left hand your reflection raises what appears to be his right hand. But when you tilt your head up, your reflection does too, and does not appear to tilt his/her head down. Why is it that the mirror appears to reverse left and right, but not up and down?
  • You have 4 jars of pills. Each pill is a certain weight, except for contaminated pills contained in one jar, where each pill is weight + 1. How could you tell which jar had the contaminated pills in just one measurement?
  • The SF Chronicle has a word game where all the letters are scrambled up and you have to figure out what the word is. Imagine that a scrambled word is 5 characters long:
    1. How many possible solutions are there?
    2. What if we know which 5 letters are being used?
    3. Develop an algorithm to solve the word.
  • There are 4 women who want to cross a bridge. They all begin on the same side. You have 17 minutes to get all of them across to the other side. It is night. There is one flashlight. A maximum of two people can cross at one time. Any party who crosses, either 1 or 2 people, must have the flashlight with them. The flashlight must be walked back and forth, it cannot be thrown, etc. Each woman walks at a different speed. A pair must walk together at the rate of the slower woman's pace.

    Woman 1: 1 minute to cross
    Woman 2: 2 minutes to cross
    Woman 3: 5 minutes to cross
    Woman 4: 10 minutes to cross

    For example if Woman 1 and Woman 4 walk across first, 10 minutes have elapsed when they get to the other side of the bridge. If Woman 4 then returns with the flashlight, a total of 20 minutes have passed and you have failed the mission. What is the order required to get all women across in 17 minutes? Now, what's the other way?

  • If you had an infinite supply of water and a 5 quart and 3 quart pail, how would you measure exactly 4 quarts?
  • You have a bucket of jelly beans. Some are red, some are blue, and some green. With your eyes closed, pick out 2 of a like color. How many do you have to grab to be sure you have 2 of the same?
  • If you have two buckets, one with red paint and the other with blue paint, and you take one cup from the blue bucket and poor it into the red bucket. Then you take one cup from the red bucket and poor it into the blue bucket. Which bucket has the highest ratio between red and blue? Prove it mathematically.

Algorithms

  • What's the difference between a linked list and an array?
  • Implement a linked list. Why did you pick the method you did?
  • Implement an algorithm to sort a linked list. Why did you pick the method you did? Now do it in O(n) time.
  • Describe advantages and disadvantages of the various stock sorting algorithms.
  • Implement an algorithm to reverse a linked list. Now do it without recursion.
  • Implement an algorithm to insert a node into a circular linked list without traversing it.
  • Implement an algorithm to sort an array. Why did you pick the method you did?
  • Implement an algorithm to do wild card string matching.
  • Implement strstr() (or some other string library function).
  • Reverse a string. Optimize for speed. Optimize for space.
  • Reverse the words in a sentence, i.e. "My name is Chris" becomes "Chris is name My." Optimize for speed. Optimize for space.
  • Find a substring. Optimize for speed. Optimize for space.
  • Compare two strings using O(n) time with constant space.
  • Suppose you have an array of 1001 integers. The integers are in random order, but you know each of the integers is between 1 and 1000 (inclusive). In addition, each number appears only once in the array, except for one number, which occurs twice. Assume that you can access each element of the array only once. Describe an algorithm to find the repeated number. If you used auxiliary storage in your algorithm, can you find an algorithm that does not require it?
  • Count the number of set bits in a number. Now optimize for speed. Now optimize for size.
  • Multiple by 8 without using multiplication or addition. Now do the same with 7.
  • Add numbers in base n (not any of the popular ones like 10, 16, 8 or 2 -- I hear that Charles Simonyi, the inventor of Hungarian Notation, favors -2 when asking this question).
  • Write routines to read and write a bounded buffer.
  • Write routines to manage a heap using an existing array.
  • Implement an algorithm to take an array and return one with only unique elements in it.
  • Implement an algorithm that takes two strings as input, and returns the intersection of the two, with each letter represented at most once. Now speed it up. Now test it.
  • Implement an algorithm to print out all files below a given root node.
  • Given that you are receiving samples from an instrument at a constant rate, and you have constant storage space, how would you design a storage algorithm that would allow me to get a representative readout of data, no matter when I looked at it? In other words, representative of the behavior of the system to date.
  • How would you find a cycle in a linked list?
  • Give me an algorithm to shuffle a deck of cards, given that the cards are stored in an array of ints.
  • The following asm block performs a common math function, what is it?
    cwd xor ax, dx
    sub ax, dx
  • Imagine this scenario:
    I/O completion ports are communictaions ports which take handles to files, sockets, or any other I/O. When a Read or Write is submitted to them, they cache the data (if necessary), and attempt to take the request to completion. Upon error or completion, they call a user-supplied function to let the users application know that that particular request has completed. They work asynchronously, and can process an unlimited number of simultaneous requests.
    Design the implementation and thread models for I/O completion ports. Remember to take into account multi-processor machines.
  • Write a function that takes in a string parameter and checks to see whether or not it is an integer, and if it is then return the integer value.
  • Write a function to print all of the permutations of a string.
  • Implement malloc.
  • Write a function to print the Fibonacci numbers.
  • Write a function to copy two strings, A and B. The last few bytes of string A overlap the first few bytes of string B.
  • How would you write qsort?
  • How would you print out the data in a binary tree, level by level, starting at the top?

Applications

  • How can computer technology be integrated in an elevator system for a hundred story office building? How do you optimize for availability? How would variation of traffic over a typical work week or floor or time of day affect this?
  • How would you implement copy-protection on a control which can be embedded in a document and duplicated readily via the Internet?
  • Define a user interface for indenting selected text in a Word document. Consider selections ranging from a single sentence up through selections of several pages. Consider selections not currently visible or only partially visible. What are the states of the new UI controls? How will the user know what the controls are for and when to use them?
  • How would you redesign an ATM?
  • Suppose we wanted to run a microwave oven from the computer. What kind of software would you write to do this?
  • What is the difference between an Ethernet Address and an IP address?
  • How would you design a coffee-machine for an automobile.
  • If you could add any feature to Microsoft Word, what would it be?
  • How would you go about building a keyboard for 1-handed users?
  • How would you build an alarm clock for deaf people?

Thinkers

  • How are M&Ms made?
  • If you had a clock with lots of moving mechanical parts, you took it apart piece by piece without keeping track of the method of how it was disassembled, then you put it back together and discovered that 3 important parts were not included; how would you go about reassembling the clock?
  • If you had to learn a new computer language, how would you go about doing it?
  • You have been assigned to design Bill Gates bathroom. Naturally, cost is not a consideration. You may not speak to Bill.
  • What was the hardest question asked of you so far today?
  • If MS told you we were willing to invest $5 million in a start up of your choice, what business would you start? Why?
  • If you could gather all of the computer manufacturers in the world together into one room and then tell them one thing that they would be compelled to do, what would it be?
  • Explain a scenario for testing a salt shaker.
  • If you are going to receive an award in 5 years, what is it for and who is the audience?
  • How would you explain how to use Microsoft Excel to your grandma?
  • Why is it that when you turn on the hot water in any hotel, for example, the hot water comes pouring out almost instantaneously?
  • Why do you want to work at Microsoft?
  • Suppose you go home, enter your house/apartment, hit the light switch, and nothing happens - no light floods the room. What exactly, in order, are the steps you would take in determining what the problem was?
  • Interviewer hands you a black pen and says nothing but "This pen is red."

lisp 图层字体式样替换_开图自动替换字体 - AutoLISP/Visual LISP 编程技术 - CAD论坛 - 明经CAD社区 - 大虾,论坛,程序 - Powered by Discuz... [code="lisp];文字替代(解决文字乱码用)(defun c:KK( / lb_eng lb_chn lb_sech lb_tt1 lb_tt2 lb_a1 lb_a2 lb_hh)(setvar "REGENMODE" 0)(setq lb_eng (getstring "英文替代:") lb_chn (getstring "中文替代:"))(if (= "" lb_eng)(setq ... 阅读详情

相关推荐

SSCOM的模拟连接测试及服务器连接

SSCOM的介绍 该软件是大虾丁丁写的一个串口调试器,在查找串口助手时都推荐使用这个,这个软件是一个免费的,作者自己也有个论坛:www.daxia.com里面有许多问问题的帖子,也可以帮助解决自己的问题。 下载连接:http://www.daxia.com/sscom/sscom5.13.1.rar 通过这个软件进行ESP8266的串口连接及指令发送,这次在同一个电脑上同时打开两个这个软件进行esp8266的同网络下的模拟连接。 同网络(WiFi)下的数据传输测试模拟 端口设置 同时打开两个sscon,其

meetslowly的博客 2万+

MS interview question 微软笔试题

MS interview question 微软笔试题,以前在微软里面搜集到的

treeview_AfterSelect问题 c# c++

treeview+XMLXML源文件http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">            1234567      优快云                  1234567      2222222      http://community.csdn

a450987的专栏 1536

各种面试题

  *程序的内存分配一个由c/C++编译的程序占用的内存分为以下几个部分1、栈区(stack)—   由编译器自动分配释放 ,存放函数的参数值,局部变

ﺴ۩๑一棵树的程序历程๑۩ﺴ 7005

[已解决]实验室内频繁断网 重设IP后可以使用 几分钟后又掉

静态IP局域网内个别机器间歇性断网的问题 让人抓狂的过程 上半年来到实验室,办公室内大家全部手动设置静态IP,那时候没有台式机,Surface用的USB拓展坞连得网,奇怪的是实验室的同学都没有问题,我的连上之后一分钟之内是正常的,之后网络就开始抽风,换一个IP地址或者插拔网线就能好一会儿,然后又开始抽风(吐血),接过交换机的不同网口,都不好使,那时候认为可能是RJ45转USB的内部芯...

zk0272的博客 1万+

C++后缀名

VC++中各种后缀名文件的意思.h头文件.cpp源文件.dsw工程文件----可以没有.dsp工程文件-----一定要有.clw 支持ClassWizard .ncb 支持ClassView .opt 保存工作空间的配置 .aps 支持ResourceView .bsc 浏览器信息文件 .dsp 项目文件 .dsw 工作空间文件 .mak 外部的创建文件 .plg 建立日志

dongliqiang2006的专栏 3659

微软101道经典面试题

微软101道经典面试题1. Given a rectangular (cuboidal for the puritans) cake with a rectangular piece removed (any size or orientation), how would you cut the remainder of the cake into two equal halves with 

幸福的雨燕专栏 5331

C#.NET控件全屏设置

<br />我在做一个winForm的界面设置时,发现当主窗体最大化的时候,其控件不会跟着变大,请问有没有办法把控件也设置成自动最大化?<br />大小是需要自己改变的,位置是可以直接设置的。应该使用TabelLayoutPanel 容器控件来 布局<br />当窗体最大化时,如果要使控件的大小也随着窗体的大小而变化,可设置控件的Anchor属性。<br />如使pictureBox1随着窗体大小而变化,则可以在属性框上直接设置Anchor为Left,Top,Right,Bottom。<br />在公司的状

mlh548的专栏 1073

头疼的微软面试题(英汉对照)

http://blog.csdn.net/HappyTiger201/services/trackbacks/433296.aspx * Why is a manhole cover round?  为什么下水道的井盖是圆的?    * How many cars are there in the USA?    美国有多少辆车?  

freezing point·J 2398

[delphi教程]delphi开发教程全攻略(1)

如何在Image上提示字符? 怎样加入tb2k FastReport4.0安装后中文的问题。 怎样单独得到现在的年和月?? [考题]这两种字符串赋值语句有什么区别 TXmlDocument控件使用问题 急急急!!!网络数据通讯问题(多线程如何解决???) 关于保存一个Record类型到文件中的问题 如何使窗体在用户按下显示桌面之后不会隐藏(不是将它始终置前)谢谢各位 大家好,请D

师以长技以制夷 1743

Geany中utf-8编码格式声明方式

当我在用geany编写Python代码时,之前写好的demo,再次用geany打开,执行时突然出现了报错,不能展示正确的运行结果了。 报错如下: 这是为什么呢? 大虾百思不得姐,毕竟大虾之前写的时候,就是能运行处结果的,怎么只是换了个日子打开,就变了个样子(心碎脸) 经过多方查找资料,大虾抱着试试的心态,在代码的顶部,加了一行注释,如下图: 见证奇迹的时刻到了,点击执行,奇迹发生,geany就打印出了大虾想要的结果 这是因为大虾在使用geany 编写Python代码时,代码中包含了中文注释,并且一开始并

weixin_41576435的博客 963

Technical Interview Questions, Answers, and Tips

http://www.technicalinterviewquestions.net/2008/12/questions.html T

bmzyDream_007的专栏 2233

大三学生暑期寻Java实习生(成都)*附带简历

暑假了,试也考完了 是该好好找个实习工作锻炼一下自己了 学院的老师说要推荐我到某公司去实习,简历已经发给他们了,在等回复 但是我想自己找一个实习工作,各位Javaeyer谁的公司要招实习生啊,内部推荐一下嘛,感激不敬。 不招的介绍个公司也可以,我发简历,现在我发简历都找不到合适的公司,哎~ 下面是我的简历,很丑,自己鼓了很大的勇气发出来的,各位大虾拍砖可以,多多提建议,但是可不要伤害我脆弱的心灵啊...

cantellow 9052

双系统进入不了linux,双系统不能进入Linux了,请高手帮我!!!

风水先生 于 2009-08-13 10:19:54发表:学习woflying 于 2009-08-06 08:39:04发表:非常感谢各位的帮忙,看来还要努力学习呀!!! 嘿嘿。。。kxajd001 于 2009-08-05 21:49:06发表:我来学习下周公 于 2009-08-05 21:02:04发表:我也出过这样的问题,后来,安装Linux时,安装引导器grub要安装到硬盘的M...

weixin_29798625的博客 1198

如何从根本上克制自己在电脑上刷B站,专注学习(hosts文件)

对于手机来说,想要做这件事情很容易,直接把B站卸载掉就OK了 但是如果你使用的是网页版的呢? 试想一下这种场景,当你好不容易下定决心要好好学习,使用浏览器准备找一些资料的时候,突然想到:“哎,自己关注的up主更新视频了没?怎么想看一会儿宅舞的冲动?”,于是乎,就在搜索框中输入了bilibili,然后,,,从此君王不早朝… 讲真的,这就是我使用电脑查询资料经常干的事情。 所以 我想到了一个恶毒的方法...

wowhhhgd的Blog 1万+

Windows下QWT的安装详解

由于公司项目的需要,想要使用Qwt这款强大的工具。网上找过一些资料,但是在实际操作过程中还是出现了这样那样的问题。自己结合Qwt官网的说明文件完成了安装,但是也花费了一天的时间。所以觉得有必要把这些东西整理出来,希望后来人不要费那么多的时间。第一次写博客,写得不好的地方还请各位大虾指正。 安装包: Qwt的最新版本为:6.1.2,能够兼容的Qt版本为Qt4 ( >= 4.4 ) 和 Qt5。

kitt328的博客 869

html的冒号有什么作用,vb中冒号和分号有什么作用

例题: Private Sub Form_Click() Print "欢迎来到CSS布局HTML"; Print "nihao" End Sub 分号 ; 是用在Print语句中,以紧凑格式用来分隔各输出项,输出的字符之间留一个空格位,输出的数值之间除留一个空格位外还留一个符号位。 Open "TESTFILE" For Output As #1 ' 打开输出文件。 Print #1, "Thi...

weixin_39636102的博客 1382

手把手拆解UCIe协议层:从Raw Mode到Flit Mode,数据包到底经历了什么?

本文深入解析UCIe协议层的数据包处理机制,从Raw Mode到Flit Mode的三大变体(Standard 256B、68B-Enhanced、Latency-Optimized),详细揭示数据包在不同模式下的封装与转换过程。通过工程师视角,展示协议层如何实现多模式动态切换、错误恢复及与D2D Adapter的协同设计,为芯片级互连技术提供实践指导。

weixin_28728495的博客 239
上一篇: Microsoft Interview
下一篇: Interviewing at Microsoft
MichaelGen
博客等级 码龄23年 0粉丝 1原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值