Microsoft Interview Question for Senior Software Development Engineers


Country: United States




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

Assuming it there are no career break then fromYear of the subsequent experience should be sane as the toYear of the previous one (barring the corner case when somebody leaves a job on 31st December and joins the next job on 1st jan) below is the MySQL query that fetches the reqd result:

select emp.name, exp.start, exp.end from tblemployee emp inner join (select id, min(fromYear) as start, max(toYear) as end, sum(fromYear) as sumFrom, sum(toYear) as sumTo from tblexperience group by id) exp on exp.id = emp.id where exp.sumTo - exp.sumFrom = exp.end - exp.start;

Logic is: Sum(toYear) - Sum(fromYear) == max(toYear) - min(fromYear)
Can be implemented in one statement in Java using collectors and C# using linq

- The Artist May 24, 2020 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

By the way what was the interviewer expecting when he asked design patterns, dependency injection? Was he expecting these in context of full stack development?

- The Artist May 24, 2020 | 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