Microsoft Interview Question for Software Engineer / Developers


Country: India
Interview Type: In-Person




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

Yes..The actual problem was how can keeping track of leakage of memory..I was asked to assume that I have new and delete operators already present and so I can use them..I was expected to write a class which has functions to allocate memory using new operator and a destructor to remove the memory when it has no references.. and a copy constructor also..

- Anonymous October 25, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I see, something like reference counting. Yes, that can be done in 30 minutes. I would argue it's not true garbage collection.

Take a look at the implementation of shared_ptr. It already does that.

- eugene.yarovoi November 03, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

This could be achieved by implementing a Smart Pointer that cleans itself ever time the object goes out of scope. By having smart pointer mechanism implemented in Abstract class and make all other classes derive from it should work.

- Sanket Lopes November 29, 2011 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

Refer to book "The Art of C++" - Herbert Schildt, 2004, Chapter 2 - A Simple Garbage Collector for C++

- naveen.sanmane October 31, 2011 | 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