Microsoft Interview Question for Software Engineer / Developers


Team: GTSC
Country: India
Interview Type: In-Person




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

Difference between crash and exception in c++ -

Exceptions are defined situations which c++ can manage and handle.
Some undefined behaviors like null pointer dereferencing is not handled through exception, and so causes the program to crash.

- kanhaiya.baranwal October 08, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Answer_1
When a program encounters a situation that was not expected, there are three different behaviors the program could exhibit:
-Sometimes programs crash. A crash is when a program quits unexpectedly.
-Sometimes programs return an exception. An exception is an unexpected error that does not result in the program quitting.
-Sometimes programs hang. A hang is when a program remains open and fails to respond to input by the user.

- Priyan October 25, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Ans_2(Source stackoverflow)
-Inline replaces a call to a function with the body of the function, however, inline is just a request to the compiler that could be ignored (you could still pass some flags to the compiler to force inline or use *always_inline* attribute with gcc).
-compilers can also inline expand some recursive functions; recursive macros are typically illegal.
-A macro on the other hand, is expanded by the preprocessor before compilation, so it's just like text substitution, also macros are not type checked, inline functions are. There's a comparison in the wiki.
-For the sake of completeness, you could still have some kind of type safety with macros, using gcc's __typeof__ for example, the following generate almost identical code and both cause warnings if used with the wrong types:

- Priyan October 25, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Ans_5
Late_binding :Late binding is a runtime process of looking up a declaration, by name, that corresponds to a uniquely specified type. It does not involve type checking during compilation, when referencing libraries, including an object, is not required.The term ‘dynamically linked’ means that the program and the particular library it references are not combined together by the linker at link time.Late binding's main disadvantages are:
-Slowed application performance.
-Does not provide code completion benefits, versus early binding.
Late binding is generally used in scenarios where an exact object interface is unknown at design time.
Early_binding:The term ‘statically linked’ means that the program and the particular library that it’s linked against are combined together by the linker at link time.

- Priyan October 25, 2014 | 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