Interview: Software Engineer at Microsoft (02-09-2010)

Since 2008, I’ve  made three interviews with Microsoft. This interview was special one because it was full of technical instead of previous interviews. In this post I’ll give a brief about questions that I’ve been asked in the interview.

You can read this document to know more about tips of Microsoft interviews: Tips about MS Phone Interviews

1. Why you’d like to work in Microsoft?
2. Why you’d like to work in Artificial Intelligence? (They know that I was interested in this field)
3. Rank yourself out of 10 in C++
4. What’s the difference between Structs and Classes?
5. When writing a public member function in a class, does every object has it’s own copy of it?
6. When an object calls a member function that operates on it’s member data, how does this function determines that it’s using this object’s data?
7. What’s the difference between creating an object using new keyword and without?
8. In which memory storage the compiler put the object created by new and created without it?
9. What’s the size of this union
union DATA
{
char a;
byte b;
int    d;
}var
My answer was 4 bytes (assuming that int is 4 bytes)
10. So, what’s the special feature in union’s that differentiates it from structs?
11. Develop a function that’s similar to atoi function. Below was my code:
int* Atoi(char* c)
{
int x = 0;
while(c)
{
if(*c < 48 || *c > 48+9) return NULL;
x *= 10;
x += *c – 48;
c++;
}
return &x;
} // NB: this function has a bug, discover it yourself! 😀
12. Suggest a sorting algorithm to sort two arrays.
13. What’s the complexity of that algorithm?
O(n^2)
14. So, if the two arrays was ordered before sorting them, does this will change the complexity of that algorithm
O(n)
15. Can you suggest a better sorting algorithm?
16. Tell me how quick sort work?
17. What’s the complexity of it?
O(n lg n)
18. Do you’ve any questions?
1) What are challenges facing you working in CLR?

13 thoughts on “Interview: Software Engineer at Microsoft (02-09-2010)”

1. eslam yousef says:

Gazak Allah Kol 5er Abd Al rehman 4 spreading this knowledge
Actually i know the answers of 13 Question from these 18 :D.

2. abdelmonem says:

بالتوفيق ان شاء الله و تدخل المرحلة التانية… بس لماذا انت عاوز تشتغل في ال AI?? 🙂

• Thanks Abdelmonem. Below are reasons for picking AI:
1) Open and promising field.
2) Attractive and interesting output.
3) I’ve good and suitable environment in it.
4) Varity of applied fields (Games, Web, OS, Medicine…).

• abdelmonem says:

هل ال AI
مجالة مفتوح في مصر ولو لأ
انت كنت ناوي انك تسافر تشتغل بره

بالتوفيق 🙂

• Yes, there are little of places that works in AI.

3. U3 says:

thnx 4 info. :):):) Rabena ywafa2ak ya p0p w isA tkoon adeet ;);)

4. جزاك الله كل خير
ياعبد الرحمن
🙂

5. Here’s another great post from you Zikas, Many thanks man for this helpful post, waiting for more : )

6. […] Here’s another helpful post written by […]

7. Mahmoud Maamoun Sharaky says:

jzak ALLA kol 5ayr