## 微软面试题 转

1.烧一根不均匀的绳，从头烧到尾总共需要1 个小时。现在有若干条材质相同的绳子，问如何用烧绳的方法来计时一个小时十五分钟呢？

2.12 个球一个天平，现知道只有一个和其它的重量不同，问怎样称才能用三次就找到那个

Too complicated. Go find brain teaser answers by yourself.

3.在9 个点上画10 条直线，要求每条直线上至少有三个点？（3 分钟-20 分钟）

4.在一天的24 小时之中，时钟的时针、分针和秒针完全重合在一起的时候有几次？都分别是什么时间？你怎样算出来的？（5 分钟-15 分钟）

22 times a day if you only count the minute and hour hands overlapping. The approximate times are listed below. (For the precise times, see the related question.)

2 times a day if you only count when all three hands overlap. This occurs at midnight and noon.

am 12:00
1:05
2:11
3:16
4:22
5:27
6:33
7:38
8:44
9:49
10:55
pm 12:00
1:05
2:11
3:16
4:22
5:27
6:33
7:38
8:44
9:49
10:55

A really simple way to see this is to imagine that the two hands are racing each other around a track. Every time the minute hand 'laps' the hour hand, we have the overlaps we want.

So, we can say that the number of laps completed by the minute hand every T hours, Lm = T laps. Since there are 12hours in a full rotation of the hour hand, that hand only rotates Lh = T/12 laps.

In order for the first 'lapping' to occur, the minute hand must do one more lap than the hour hand: Lm = Lh +1, so we get T = T/12 + 1 and that tells us that the first overlap happens after T = (12/11) hours. Similarly, the 2nd lapping will occur when Lm = Lh + 2.

In general, the 'Nth' lapping will occur when Lm = Lh +N, which means every N*(12/11) hours (for N = 0,1,2,3...). In other words, it will happen approximately every 1hr5mins27secs, starting at 00:00. In 24hours, this occurs a total of 24/(12/11) = 22 times.

======================================================================================

So we are looking at two rotating hands. Ultimately, its just the angles we care about. Let θH represent the angle of the hours hand and θM represent the angle of the minutes hand. You could also introduce the seconds hand but that makes the problem more complicated. For now, lets assume the question only cares about the minute and hour hands. Initially we might think we are looking for:

θH=θM

But this doesn't take into account that if one hand has "gone around" a few times, its angle will be different from a hand in the same position that hasn't "gone around" the same number of times. So we have to modify our goal. Instead we let the angles differ by an integer multiple of 2π (360°). Let us call this arbitrary integer z. Now our condition is:

θM-θH=2πz

You could subtract the two angles in either order but the reason I chose to subtract hours from minutes is because it will result in positive integers which is just simpler. The minute hand goes around more times, thus its angle is bigger, thus this order of subtraction is positive. Now we have to find out how these angles depend upon the time. Let us call our time t and measure it in hours. I omit units for simplicity. The hour hand goes around a full rotation (2π) once every 12 hours. So:

θH=(2π/12) t

For those more versed in mathematics, 2π/12 is the "angular frequency" for the hour hand (usually denoted by ω).

Similarly the minute hand goes around a full rotation (2π) once every hour. So:

θM=2π t

Plugging back in:

θM-θH=2πz
2π t - (2π/12) t = 2πz
t - t/12 = z
(11/12) t = z

Now we are ready to solve. The two hands overlap at every solution of this equation, so we want to know the number of solutions of this equation. But remember, we want to know how many times this happens in a single day, so t cant be bigger than 24 (remember we are measuring t in hours), and technically no smaller than 0 (assuming we start our clock at 0 hours). Since t and z are proportional, each solution for z corresponds to exactly one solution for t, and accordingly exactly one solution of the equation.

Also, remember than z must be an integer. So if we wanted all the times we would just let z go from 0 (when t=0) up and solve for t and stop as soon as we passed t=24. Then of course we'd have to convert that into hour and minute format. However, we only care about the number of times this happens. So we can notice that as t increases, z is just keeping track of how many times the two hands have overlapped. When z=0 we get the first time, when z=1 we get the second time, and so on. Since t and z are directly proportional, t increases with z, thus z represents the number of times the hands have overlapped up until time t minus 1 (and starting from t=0). Since we don't want t to go past 24, we plug in 24 and solve for z which will tell us how many times this event has occurred from t=0 to t=24 (one day).

(11/12)*24 = z
22 = z

So this happens 22 times in a day. Technically this has 23 solutions (0 through 22) but the last one is for t=24 which has begun the next day. If we don't count that solution we are left with 22.■

If we want the second hand to overlap as well, we have to go a bit further. First we note that the second hand makes a full rotation once every minute, thus 60 times an hour. From this we have:

θS=(2π*60) t

We want the second and hour hands to overlap AND the minute and second hands to overlap. Those conditions can be summarized as follows, where x and y are positive integers:

θS-θM=2πx
θS-θH=2πy

Plugging in our functions of t for the θ's and solving for t we are left with:

t=x/59
t=12y/719

We want our integers x and y to produce the same time (making all hands overlap at that time). So we want to set the two equations equal. Simplifying, we get;

x=708y/719

708 and 719 are coprime (719 is prime and 708 is decomposed into 2^2*3*59). In fact 708y and 719 are coprime except for when y is an integer multiple of 719. Thus 708y/719 can only be reduced when y=719k for some integer k. In this case we have:
x=708k

The first solution is when k=0. Then x=0 and t=0 corresponding to midnight. The next solution is k=1. Then x=708 and t=12 corresponding to noon. The next solution is k=2 but this corresponds to t=24 which is (midnight for) the next day and due to the direct proportionality of t and k, every k from here on up will produce t's higher than 24.

In summary, all three hands only overlap twice a day: at noon and midnight. ■

All of this assumes that the hands sweep continuously. So the math is more(?) complicated for those with fake Rolex's (or any ticking handed clocks). ### pczhangtl

《微软ASP.NET 电商网站开发实战 MVC6 +HTML5 +WCF+WebAPI+NoSQL+mongoDB+Redis+Core 视频 代码 面试题 》下载网盘：https://yunpan.cn/cP7SNIjgJYYjA 访问密码 7fc6 微软特邀讲师 徐雷Frank...

frankxulei
2016/06/23
0
0
18届清华硕士狂拿18家互联网公司offer

2018校招总结（外企，国内大公司，国内创业公司） 本篇是我参加2018春招实习和秋招的求职经历，除了笔试面试中遇到的一些问题，更多的是一些个人想法。 春招和秋招面了不少公司，实习offer有...

2017/12/18
0
1

2013/01/06
299
0

abcdd1234567890
2017/06/14
0
0
[转载]9个offer，12家公司，35场面试，从微软到谷歌，应届计算机毕业生的2012求职之路

1，简介 毕业答辩搞定，总算可以闲一段时间，把这段求职经历写出来，也作为之前三个半月的求职的回顾。 首先说说我拿到的offer情况： 微软，3面->终面，搞定 百度，3面->终面，口头offer 搜狗...

2013/01/10
8.4K
50

sharelocked
35分钟前
2
0
burpsuite无法抓取https数据包

1.将浏览器和burpsuite的代理都设置好 2.在浏览器地址栏输入： http://burp 3.下载下面的证书，并将证书导入浏览器 cacert.der

Frost729
59分钟前
1
0
JeeSite4.x 消息管理、消息推送、消息提醒

ThinkGem

6
0
OpenML

https://www.openml.org/search?type=data

shengjuntu

2
0
java强引用,软引用，弱引用和虚引用

woshixin

1
0 