Microsoft Interview Question for Software Engineer / Developers






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

Possible problem: Memory overwrite.
Use memory profiling tool to find it, like insure++ or purify etc

- Jack of all October 12, 2007 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

It also depends on the application and the way it is running. If you run the whole application and not particular event then it may cause the problem as there may be more than one module interacting.

- Matrix October 21, 2007 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

This might be because of memory leaks .
This might be either because of heap overflow or corruption of data on the stack .

For detecting these issues , we can either use Purify, calgrind and other dynamic memory watch tools.

- Anonymous October 30, 2007 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

If there is memory leak or overwrite, it should crash at the same place all the time. I think there is a random number/some variable which is deciding the behavior of the program/crash site.

- V April 04, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

double deletion of pointers. Once a pointer is deleted the memory is freed and the program can allocate the freed memory to some body else.. this happens in multiple threads case where you might end up deleting a ptr in two different threads and depending on whom the address pointed to by this deleted ptr got allocated the crash might show up in different places..

- varun March 25, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

varun, isn't the application single threaded? as mentioned in the question itself.

- Anonymous March 25, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Some reasons for crashing in different place each time:
(some overlap, some are similar, there could be plenty more)

1) it uses random numbers.
2) it uses time.
3) it persists state and reads it back the next time.
4) it could be eating up memory. Depending on other processes in the OS, it could get out of memory exceptions at different times.
5) the application is trying to mess with the OS (like trying to set the pagefile size) (the C standard library restriction might remove this cause, though)
6) it is trying to read/write to hardware device. (again, not sure what C library gives).
7) it is using shared memory.

if the source is given, why not show it here? It would be easier :-)

- T March 25, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Jack is absolutely right. I have seen such issues many times in my 4 years of experience. The major cause is HEAP corruption. Corruption in stack (local vars) is never that unpredictable, unless coupled with BO.

- ujjwal May 30, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Apart from heap corruption and other fun stuff,
what about more basic stuff like - uninitialized variables + the "not all paths return value" scenarios ?

- zedus September 24, 2013 | 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