# 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.
My answer was Selection Sort.
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?
My answer was Quick Sort and Radix Sort.
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?
2) I’ve asked him about merging AI in CLR (especially in Garbage Collection and Thread Sync.)

# Interview: Web Developer/Search Engine Engineer at Sakhr Software

In the last period I’ve made two interview with Sakhr Software one was as Web Developer and other as Search Engine Engineer.

Firstly, both interviews was great and I’ve get accepted as Search Engine Engineer.

In this post I’ll mention questions that were asked to me as Web Developer.

• Web Questions:
1. What’s the difference between state-full and stateless?
2. How to make state-full?
3. What’s XML?
4. How web browsers render XML styled?
5. What are differences between Server Side and Client Side based applications?
• Object Oriented Programming/Design Patterns Questions:
1. What’s the difference between Interface and Abstract Class?
2. What are types of polymorphism?
• SQL Questions:
1. What’s a trigger?
2. What’s the difference between INNER JOIN and OUTER JOIN?
3. What’s better? Calling SQL procedure from C# or write it in C# layer?

As Search Engine Engineer they have discussed my projects, grades and C++ skills. The main question was as follows:

Assume that you have 2 list of names:

محمد على محمد

عبدالرحمن أحمد

ميرفت أمين

and

Abdelrahman Ahmed

Merfat Amin

Mervat Amyn

Mohamed Aly Mohamud

How to match names from Arabic List with English List?

They’ve requested from me developing a C++ application that resolves this problem. Find in this link the project.

NB: Make sure that you are connected to the internet while running the program because I’m accessing Google Translation API in it.

# What I’ve learned from Timeline Interview

From planning perspective, I’ve started to search around for a company to work in. This company mainly must be working with C/C++ and preferred if Game Programmer or AI is found there. Timeline Interactive was the first company in mind.

I’ve prepared myself for the interview by revising common Classical AI Techniques in Games and then I’ve received an invitation to an interview there.

Thanks god, I’ve got accepted there.

I’ve started with a technical interview with Mostafa Hafez and Mohamed Seif. It was a good one actually very interesting. Mostafa and Mohamed where very friendly I’ve liked talking with them. They are from the type who make you relaxed and able to think clearly. Well, I’ve some point of improvements that I’d like to mention here for the future.

• I’ve revised Classical AI techniques but for a medium level. That means, I’ve not wrote code for each technique to revise it well.
• I’ve forgot to mention several points of strengths that I’ve as object oriented analysis and design skills.
• I’ve not talked about my graduation project with an organized and professional way.
• Some of my answers were not organized. I’ve answered many questions right way but I have not modeled my answer in an organized way after getting the idea out.
• Some of my answers were not with justification, so the interviewer may misunderstand what I meant for example:
• Mohamed Seif asked me “What’s the number of team mates you prefer to work with”. I’ve started to answer as I was making a brainstorming with him! I said many things and at last said that I prefer working with 4 team mates. The point is that I’ve forgot to mention that I like to work in such team because the power of revision. Where each team member will see my task an criticize them for more quality. (read Ahmad Hosny’s reply for more useful details)
• Mostafa Hafez asked me “What do you expect to do here?”. My answer was very silly 😀 I’ve said “I’d like to know the topic that I’ll work on, get it’s resources and study them carefully then starting to work on tasks”. What a strict answer! Yes sometimes I’ll do this but if I already know the topic I’ll not read about it or even search for resources. My answer should be adjusted to: “Well, I’m expected to have tasks and be responsible about. In case that I feel the task in hand requires more technical knowledge to be done in perfect form, I’ll start to get resources about it, study it and finish it well.”
• After all, I’ve got a feeling from this interview: when applying for a position be professional at it don’t think that the company is willing to hire you to start studying and then get in work. No! Studying is in your home dear. Company wants solid programmers to hold it’s tasks. (read Omar Gamil’s reply for more useful details)

Really getting in an interview requires hard technical and well organized person.

At the end in case that I’m going to apply on AI/Gameplay programmer for any Game Development company I must prepaer myself in the following:

• Develop gameplay for at least one character to talk about it in the interview.
• Organize points of strengths that I’ll talk about.
• Thinking for 30 seconds before firing an answer.

In the technical interview they’ve asked me:

1. Vector mathematics.
2. Steering Behaviors (Seek Behavior).
3. Describe A* Algorithm.
4. Discussed all game projects I’ve developed.
5. What you expect when you come to Timeline?
6. How you see yourself in 5 years?
7. Describe gameplay for weapon in FPS Game.
8. Write C++ code for traversing Binary Tree.

In the HR Interview they’ve asked me:

1. Why you’d like to work at Timeline?
2. What you’ll give to Timeline?
3. What Timeline will give to you?