Microsoft Interview Question for Software Engineer / Developers






Comment hidden because of low score. Click to expand.
1
of 1 vote

S1>e2 || s2>e1 -->success

- Anonymous February 25, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

s1>s2 ? (s1>e2?1:0) : (s2>e1?1:0)

where 1 is Success

- Anonymous February 25, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

if( S2 <S1 < E2 || S1< S2 < E1)
return success

- brijesh kumar jaiswal February 29, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

((s2 > s1) && (s2 < e1)) || ((e2 < e1) && (e2 > s1))

- zdmytriv March 06, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

!((S2 > E1) || E2 < S1))

- DrFunFrock March 13, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

this one is correct
!((S2 > E1) || E2 < S1)) -> overlap

- Anonymous June 12, 2008 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Consider the case that two does not overlap and then find NOT

the case two does not overlap is

suppose s1 <e1 && s2<e2

1. s1<s2 && e1<s2
2. s2<s1 && e2<s1

so we have

return s1<s2?(e1<s2?1:0):(e2<s1?1:0);

- J May 03, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

And then NOT in front of the result I just typed above

- J May 03, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

case1.
s1<---------s2-->e1---->e2
case2.
s1<---------s2------>e2-->e1
case3.
s2<---------s1------>e2-->e1
case4.
s2<---------s1------>e1-->e2

- usafzz May 19, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

case5.
s1<---->e1 s2<--->e2
case6.
s2<---->e2 s1<--->e1

- usafzz May 19, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

J's approach is pretty good but the answer is not neat.

!(e1<s2 || e2 < s1)

- ms_emp June 06, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

hi, usafzz, thanks to give all the situations. just want to point out that total number of combination is p(4,4)/p(2,2)^2=6.

- chuncl June 12, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

brijesh kumar jaiswal's answer is perfect.

- Anonymous June 17, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

DrFunFrock's way it the right way to do it and is actually correct.. its simple and eligant!

- another anonymous July 24, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

!((e2 < s1) || (e1 < s2))

- Anonymous October 24, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

s1 > e2 && s2 > e1

- Anonymous February 25, 2008 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More