Microsoft Interview Question for Software Engineer / Developers






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

Use a Hash table and fill the list of all the customers who paid money. Next scan through the list of all the customers and see if he is there in the hash table. If yes that means he is the one who paid, if not, then he is the one who didn't pay and hence print the name of the customer. Repeat it for the entire list of customers. This is linear in both time and space complexity.

- gauravk.18 February 23, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Hi Gaurav,

Your solution gives the obvious answer... But have you given a thought of how you can improve it?

With some realistic assumptions that the list of customers is ordered... we could use Bit vector ...maybe?? just a thought.

- chinni September 16, 2008 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Using array list may not make sense. It'll lead to O(nm) in time complexity and O(n+m) in space complexity.

But using hashmap approach, time complexity: O(n+1)=>O(n) and space complexity: O(n)

- sathishp123 April 25, 2012 | Flag


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