Monday, December 26, 2005

Good News

Another long time to post any thing on the blog, but it's not my fault any way, it's just I don't find any news to post :D

Any way, I promised last time to post episode 3, but this will take some time because I want post it until episode 4 is happened ;)

So now, what's the good news?!

The good news that although I've waited for a bit long time, I knew from about a week ago that one of my best friends and the one I love the most (his name is Hany) has been accepted in Microsoft Redmond HQ too as SDE (the same title as me) in Windows Serviceability team.

So now, I'll have my best friend with me in Redmond, sharing the same flat and enjoying the same life ;)

Thursday, December 08, 2005

Previous Days, Episode 2

So, let's continue the second episode, where have we stopped?!

mmm, I think when I told you about the media and art team and our problems in it, yeah, so as I said before, I've sent tons of ads into as many groups as you could imagine, but in vain, no one from people whom have answered my email is qualified to work in this job, and we were in great mess because we were having nothing to do in order to solve this great problem, all these till the solution has come from our God.

While we were surfing on the web, we found some sort of art studio in china, whose people were looking for a company to share and make any sort of corporation to be valuable for both parties, so I have added their lead on my msn, have very nice chatting together till we became friends.

Then we reached the most important part, to ask them about their work and what they could do, he have sent me some screen shots and a link to their showreel (I was hoping to put some shots for these stuff here, but I don't know whether they have any sort of copywrites or not), after I've seen these demos, I got amazed, these team was capable of doing any thing related to the art part, they are doing characters better than those in half-life 2, making movies, cartoon, any thing you could imagine they could make and with great output.

Also the most amazing part, they know well how it could be to build models and media for 3D games, because they worked in games and movies before, so it won't take any time to teach them any thing about game programming.

Till this moment every thing is great, but what about dealing with them, could they agree?

And if yes, what would they request?
And how we could do it?

All these questions will be answered in the next episode, so say tight ;)

Catch you later.....

Monday, November 28, 2005

Previous Days, Episode 1

As I promised before that I'll post soon what has happened in the previous days and why I was away from blogging world, so I'll begin now and will try to write the main events only :)

So where we've stopped last time?!

Mmm, when I went to get my green paper (the postponement paper), I got it and returned back to home, after that I heard again that the H1 committee has voted for increasing the cap with additional 30,000 visas this year, so I asked them back for any news and they confirmed my email and told me to wait until they finish the decision and make it ready (it's additional 2 months or so :( ).


That's for Microsoft, but for the gaming company, at last we got an agreement with our partners to establish the company and we've chosen the game genre and the game play mode, but we faced a great problem, what's it?!


Now we've money, have developers, have a game and have a place, but we're missing a very important issue, which is the artists!!!

I don't know if any of you know about this or not, but in game development the art part (the media folder) is consists of 2 main parts, the sound files and 3D objects files.

The sound files are files for music, sound effects, etc.

The 3D objects files are files for players' models, vehicles, buildings, maps, etc, and for a modeler to model a perfect 3D model, there must exist what's known by concept art part, or those whom design the model on paper or Photoshop and give it to the modeler to model in into 3D model.

So we knew that we need:

1- Audio Engineers (or artists whatever).
2- 3D modelers (and in addition to being perfect in making 3D models, there must exist some experience in some specific topics as no one who can just make 3D models to be able to make them for games).
3- 2D artists for conceptual part.


For the audio part, I knew someone who could solve this problem completely for me, also for 2D artists we knew that we could find tons of people whom can do it in perfect way, now back to the initial problem, the modelers.

We made an ad in yahoo groups, we got many CV, nearly we can say that about 2 of them are acceptable (you see, I said acceptable not good), which means that we could try them but we won't be sure that they could make any thing good, so how this problem is solved?!

This is the main subject of the next episode ;)


Catch you later.....

Wednesday, November 16, 2005

My life rating

Recently I have rated my life, and got these results:



This Is My Life, Rated
Life:
8.5
Mind:
7.9
Body:
7.8
Spirit:
9.2
Friends/Family:
5.9
Love:
4.3
Finance:
9
Take the Rate My Life Quiz




Your Life Analysis:

Life: Your life rating is a score of the sum total of your life, and accounts for how satisfied, successful, balanced, capable, valuable, and happy you are. The quiz attempts to put a number on the summation of all of these things, based on your answers. Your life score is amazingly high. This means that you are in tune with your needs and on a path toward great personal fulfillment. Despite the challenges of life, you have achieved harmony and balance. Continue doing what you are doing right; do not allow yourself to slip or falter. (Read more on improving your life).

Mind: Your mind rating is a score of your mind's clarity, ability, and health. Higher scores indicate an advancement in knowledge, clear and capable thinking, high mental health, and pure thought free of interference. Your mind score is within a healthy zone. This means you have achieved a level of mental balance and harmony consistent with living a healthy, happy life. Continue doing what works, and keep your focus. In our fast-paced world, mental clutter is all too common. Be vigilant in maintaining healthy mental function. Read advice from other quiz-takers on improving the mind.

Body: Your body rating measures your body's health, fitness, and general wellness. A healthy body contributes to a happy life, however many of us are lacking in this area. You have a rather good body score, which is an indication that you take care of yourself. There is room for improvement, however. Please keep doing what works. Eat right, exercise, reduce your stress, treat any illness. Doing these things will help ensure your body will be in good working order for a long time to come. Read advice from other quiz-takers on improving the body.

Spirit: Your spirit rating seeks to capture in a number that elusive quality which is found in your faith, your attitude, and your philosophy on life. A higher score indicates a greater sense of inner peace and balance. Your spirit score is dramatic. Continue on your path, do not stray. Continue to reap the rewards which your spirituality brings forth. Read advice from other quiz-takers on improving the spirit.

Friends/Family: Your friends and family rating measures your relationships with those around you, and is based on how large, healthy, and dependable your social network is. Your friends and family score is not bad but can be improved. Maintain your current social net, while you try to expand it. Try new things and form new friendships. You will be rewarded greatly.

Love: Your love rating is a measure of your current romantic situation. Sharing your heart with another person is one of life's most glorious, terrifying, rewarding experiences. You have a rather low love score. While some are lucky, for most of us love doesn't fall in our laps. You must actively work on improving this area. Do not despair, there is someone out there for you. Read advice from other quiz-takers on finding and maintaining love.

Finance: Your finance rating is a score that rates your current financial health and stability. Your financial score is impressive. You seem to be doing everything right in this area, so keep up what you're doing. Do not fall into common traps and continue planning for long-term stability. Read advice from other quiz-takers on improving your finances.


Also, as I mentioned before, soon I'll write what happened in the previous days and what I was doing through all this period :)


Catch you later.....

My Blogging Type

Your Blogging Type is Pensive and Philosophical

You blog like no one else is reading...
You tend to use your blog to explore ideas - often in long winded prose.
Easy going and flexible, you tend to befriend other bloggers easily.
But if they disagree with once too much, you'll pull them from your blogroll!

Tuesday, November 08, 2005

And finally I got the green paper :D

Ohhhhhhhhhh, it has been sooo long since I have written in these blog, but I have tons of things to discuss later because I was really too busy in many thing, and soon I'll post every thing about the previous days, but when I get some time because Iam still busy :D (It's a matter of 3 or 4 weeks at most).

Any way, so what's the green paper?

The green paper which I mean is the postponement paper of the army, after getting this piece of dirty paper, I can now renew my passport and travel to any place in the world, live my life and forget all about those black days :D:D

I hope best luck to my friends too.

Soon I'll post all what happened in the previous days in the form of episodes again ;)

Keep in touch

Catch you later.....

Wednesday, October 12, 2005

Microsoft Visual Studios 2005 Team System, Episode IV (Microsoft Visual C# 2.0 new Features Part A)

Now I'll resume the Visual Studio 2005 Articles, but I'll put one or two new features in each new article to stop it from being to large.

Let's begin.

One of the most amazing features which come with C# 2.0, is the enabling of edit and continue in debugging mode, in this article, we'll talk about what's edit and continue, how it's working, and its limitations inside C# 2.0, for the full article, visit: http://msdn.microsoft.com/vcsharp/default.aspx?pull=/library/en-us/dnvs05/html/edit_continue.asp


What is edit and continue?

Edit and Continue (hereafter referred to as E&C) is a new debugging feature introduced in Visual C# 2005, it was used by VC++ developers since early VC++ editors.
It allows you to make changes to the code while an application is being debugged and to apply the code changes without having to end execution, rebuild, and run the application again.


But how it could make your life easier?!

Imagine you're making something like a complete Game Engine, or a huge 3D game, and as you know debugging such applications is like hell, now imagine after 20 pr 30 min of full debugging, you discovered that you need to change something in your code, but Ohh my god, I must stop the debugging and restart it again, so all the time I passed in the debugging (the 30 min) is over now, and furthermore, I may lost the exception which I had already caught if I tried to restart it again, so what shall I do?!!
Now this is why you should use edit and continue, because now you're not forced to stop and restart the debugger again, it'll just get the edits you made, inject it to the code inside memory and here you're debugging the application after being changed without restarting it, isn't it amazing ;)


How does edit and continue work?!

Though E&C is simple to use, the CLR and the compiler have to work together to do some heavy lifting in the background. When a file is edited in the IDE during a debugging session, the compiler first checks whether the change is allowed or not. If it is not possible to perform that change, you'll see a dialog box like the one in Figure 1.

Figure 1. Message box shown when you make a change that is not allowed



Clicking the Edit Code button takes you back to the debugging session to allow you to fix the errors that won't allow the debugging session to continue. You might choose this option if the errors that didn't allow E&C to continue were build errors. . Clicking the Stop Debugging button ends the current debugging session and reverts back to design mode. You would choose this option if the errors detected are changes that you need to make. The compiler supplies delta-IL and delta-metadata, which is used to replace parts of the existing IL and metadata in memory. Delta-IL and delta-metadata simply refers to the gap used to insert the edited code. If the edited methods have been JIT-ed into native x86 code, they are replaced with new x86 code.

Limitations of Edit and Continue:

The rule of thumb for making E&C changes is that you can change virtually anything within a method body, so larger scope changes affecting public or method level code are not supported. Some examples of such unsupported changes are:
· Changing the name of a class.
· Adding or removing method parameters.
· Adding public fields to a class.
· Adding or removing methods.


That's all for today, next time we'll talk about Generics the new feature in C# 2.0 which mimics C++ templates but in different way.
Catch you later.....

Saturday, October 08, 2005

H1B Visa, Status Report!

Hii everybody, and sorry for being late for writing new episode on C# 2.0 inside Visual Studio 2005, but there's a reason for this, which is the news I got from my immigration attorney inside Microsoft.

As I said before, I heard that the Fiscal Year 2006 (FY2006) H-1B visa cap has been reached, but I was having no clue whether Iam inside those whom got accepted or not.

Till 2 days ago I was having no clue about this, but finally I knew, that my petition was not selected for adjudication under the FY2006 cap, and this mean that if I wanna apply for H1B visa again I'll travel on next September 2006 at least.

So what about solutions?!

There're many solutions, some of them I can't publish here unless I get sure that I can use them, others are like optaining another type of visa temporary or waiting until the next H1 cap are also available!

Iam just telling you that the next episode will be late somehow till I knew any thing new.

Catch you later.....

Thursday, October 06, 2005

Microsoft Visual Studios 2005 Team System, Episode III (Microsoft Visual C++ 2005 new Features Part B)

Now it's time for Visual C++ 2005 new features part B, so what else?!

3- Additions for optimizing the generated applications:


Another huge part is the optimization inside Visual C++ 2005, you'll know all now about PGO (profile guided optimization) in this part.

We all know about aggressive optimization offered before in Visual C++ 2003 and 2002, I don't know whether they have any modifications inside it or not, but I'd like to talk about PGO now because it's really a very nice features.


My source in this article is MSDN in addition to a private seminar held by one of the VC++ team members in my old company Sakhr, you can find the whole article source at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/profileguidedoptimization.asp


Now let's jump into details, to know about how PGO works, you need a quick idea about how normal optimization in compilers are working, to know this, look at this sample:





int setArray(int a, int * array)
{
for (int x = 0; x array[x] = 0;

return x;

}


From this file the compiler knows nothing about the potential values for "a" (besides they must be of type int), nor does it know anything about the typical alignment of array.
This compiler/linker model is not particularly bad, but it misses two major opportunities for optimization: First, it doesn't exploit information that it could gain from analyzing all source files together; secondly it does not make any optimizations based upon expected/profiled behavior of the application. That's what WPO (Whole Program Optimization) and PGO (Profile Guided Optimization) are doing.

Before knowing PGO, let's know at first how traditional WPO in Visual C++ is working.

With Visual C++ 7.0 and beyond, including all recent versions of the Itanium® compiler, Visual C++ has supported a mechanism known as link-time code generation (LTCG).

LTCG is a technology that allows the compiler to effectively compile all the source files as a single translation unit. This is done in a two-step process:

1- The compiler compiles the source file and emits the result as an intermediate language (IL) into the generated .obj file rather than a standard object file. It's worth noting that this IL is not the same thing as MSIL (which is used by the Microsoft® .NET Framework).

2- When the linker is invoked with /LTCG switch, the linker actually invokes the backend to compile all the code compiled with WPO. All of the IL from the WPO .obj files are aggregated and a call graph of the complete program can be generated. From this the compiler backend and linker compiles the whole-program and links it into an executable image.

Now with WPO, the compiler knew all about the structure of the whole program, and so will be more effective certain types of optimizations.
For example, when doing traditional compilation/linking, the compiler could not inline a function from source file foo.cpp to source file bar.cpp. When compiling bar.cpp, the compiler does not have any info about foo.cpp. With WPO the compiler now has both bar.cpp and foo.cpp (in IL form) available to it, and can make optimizations that ordinarily would not be possible (like cross translation unit inlining).

To compile your program using LTCG, first you compile your program using whole program optimization switch: /GL
After that link it using /LTCG switch.

Now your generated executable is always faster, although it needs more memory and time to compile using this switch, but the final output deserves these.

But what if you want more optimization?!
It's now PGO turn.

Now you gained a bit performance using WPO through /LTCG switch, but you can gain additional performance which will be very significant using PGO in addition to LTCG.
The idea of how PGO is working is simple, you just run your application several times, and every time a profile for your application is created which is containing all the info about how many times each function is executed, and about the most used parts of your code, and then you use it after that to re-build your application based on this profiles.
The whole process is done in 3 main stages:

1- Compile into instrumented code (first compilation phase).

2- Train instrumented code (profiles generation phase).

3- Re-compile into optimized code (based on generated profiles).

And here you're a graphic representation for how the whole process looks like:


Now to pass through these 3 stages:

1- Compiling instrumented code:

The first phase is to instrument the code, to do this, you first compile the source files with WPO (/GL). After this take all of the source files from the application and link them with the /LTCG:PGINSTRUMENT switch (this can abbreviated as /LTCG:PGI). Note that not all files need to be compiled as /GL for PGO to work on the application as a whole. PGO will instrument those files compiled with /GL and won't instrument those that aren't.

The instrument of you code means putting several probes inside your code, there're two main types of probes, those for collecting flow information and those for collecting value information.
The result of linking /LTCG:PGI will be an executable or DLL and a PGO database file (.PGD). By default the PGD file takes the name of the generated executable, but the user can specify the name of the PGD file when linking with the /PGD:filename linker option.


2- Training of instrumented code:

Now to train your code and generate well profiles that really reflect the usage of your application, you run your application several times with scenarios that reflect their usage in real life, after every scenario a PGO count file (.PGC) is generated and takes the name of the .PGD file with numbers reflecting the scenario number.


3- Re-Compile the Optimized code:

The last step is to re-compile your application using the generated profiles through the different scenarios you made, this time when you link you application you use the switch: /LTCG:PGOPTIMIZE or /LTCG:PGO which will use the generated profiles to create the optimized application.

Now we knew in brief how to use PGO, but the most important thing is to know how PGO could help optimizing applications?
And this is the next section.

There are several things PGO can help in the applications optimization, which are:

1- Inlining:

As described earlier, WPO gives the application the ability to find more inlining opportunities. With PGO this is supplemented with additional information to help make this determination. For example, examine the call graph in Figures 2, 3, and 4 below.
In Figure 2. we see that a, foo, and bat all call bar, which in turn calls baz.


Figure 2. The original call graph of a program



Figure 3. The measured call frequencies, obtained with PGO




Figure 4. The optimized call-graph based on the profile obtained in Figure 3


2- Partial Inlining:

Next is an optimization that is at least partially familiar to most programmers. In many hot functions, there exist paths of code within the function that are not so hot; some are downright cold. In Figure 5 below, we will inline the purple sections of code, but not the blue.



Figure 5. A control flow graph, where the purple nodes get inlined, while the blue node does not



3- Cold Code Separation:

Code blocks that are not called during profiling, cold code, are moved to the end of the set of sections. Thus pages in the working set usually consist of instructions that will be executed, according to the profile information.



Figure 6. Control flow graph showing how the optimized layout moves basic blocks together that are used more often, and cold basic blocks further away.


4- Size/Speed Optimization:

Functions that are called more often can be optimized for speed while those that are called less frequently get optimized for size. This tends to be the right tradeoff.

5- Block Layout:

In this optimization, we form the hottest paths through a function, and lay them out such that hot paths are spatially located closer together. This can increase the utilization of the instruction cache and decrease the working set size and number of pages used.

6- Virtual Call Speculation:

Virtual calls can be expensive due to the jumping through the vtable to invoke method. With PGO, the compiler can speculate at the call site of a virtual call and inline the method of the speculated object into the virtual call site; the data to make this decision is gathered with the instrumented application. In the optimized code, the guard around the inlined function is a check to ensure that the type of the speculated object matches the derived object.

The following pseudocode shows a base class, two derived classes, and a function invoking a virtual function:


class Base

{
...
virtual void call();
}
class Foo:Base
{
...
void call();
}
class Bar:Base
{
...void call();
}
// This is the Func function before PGO has optimized it.
void Func(Base *A)
{
...
while(true)
{
... A->call();
...
}
}

The code below shows the result of optimizing the above code, given that the dynamic type of "A" is almost always Foo.

// This is the Func function call after PGO has optimized it.
void Func(Base *A){
...
while(true) {
...
if(type(A) == Foo:Base) {
// inline of A->call();
}
else
A->call();
...
}
}

4- Changes in compiler switches:

You can find them all here:
Last but not least, I forgot to mention that they had added some pre-processing directive to enable on fly distributed-processing for your code when you have more that one processor running on the machine which is running your application :)
Next time I'll be talking about additions in C# Language, so stay tight


Catch you later.....

Wednesday, October 05, 2005

Microsoft Visual Studios 2005 Team System, Episode II (Microsoft Visual C++ 2005 new Features Part A)

Now it's the time for the first technical article, it'll be about the new features added inside Microsoft Visual C++ Whidbey, of course it won't be a complete guide for those searching for every thing new (they can refer to C++ language specification), but Iam only listing here the new amazing features which are added to Microsoft Visual C++.


The new additions for Visual C++ are categorized into 3 main categories:

1- Additions to the core language compiler.
2- Additions for giving the applications more security.
3- Additions for optimizing the generated applications.
4- Changes in compiler switches.

We'll talk about each of these sections in more detail now.


1- Additions to the core language compiler:

During last several years, C++ compiler wasn't following the pure standard rules, in other words, Microsoft Visual C++ compiler till version 2003, was not following the standard C++ language and it wasn't conformant, it was accepting things that mustn't be accepted and was refusing things that mustn't be refused, and so when some body is trying to compiler some code from Unix or Linux on MS VC++ compiler, he'll usually get tons of compilation errors.

This problem had been solved completely, now VC++ compiler is more standard than any compiler (it's about 98% following standard rules), it's more standard than Intel's compiler and gcc, and so, now you can easily import Unix and Linux code and libraries and build them easily without any problems or errors, but you are supposed to get some errors if you compile your old code, and this will be the case only if your old code is not following the standard rules.


2- Additions for giving the applications more security:


Visual C++ 2005 adds a lot of options to make you sure that you're shipping a secure application and makes it passes through many levels of checks, I'll take the example of buffer overrun through this article to make it clear for every body, the first addition to support this, or to say the first level, is making a lot of changes in C and C++ libraries, every function which is dealing with strings or character pointers or any function which may lead to buffer overrun and such security vulnerabilities, is having a new version from it to secure your application, as example, imagine this simple application which will show you the buffer overrun vulnerability through stack overrun from writing secure code great book:




#include "stdio.h"
#include "string.h"

void foo(const char * input)
{
char buf[10];
//What? No extra arguments supplied to printf?
//It's a cheap trick to view the stack 8-)
//We'll see the trick again when we look at format strings.
printf("My stack looks like:\n%p\n%p\n%p\n%p\n%p\n% p\n\n");

//Pass the user input straight to secure code public enemy #1
strcpy(buf,input);
printf("%s\n",buf);
printf("Now the stack looks like: \n%p\n%p\n%p\n%p\n%p\n% p\n\n");
}

void bar(void)
{
printf("Augh! I've been hacked!\n");
}

int main(int argc, char * argv[])
{
//Blatant cheating to make life easier on myself
printf("Address of foo = %p\n",foo);
printf("Address of bat = %p\n",bar);
if(argc != 2)
{
printf("Please supply a string as an argument!\n");
return -1;
}
foo(argv[1]);
return 0;
}

Now let's try to show how we could make the overrun happens, first let's try to run it in normal mode:

D:\Secureco2\Chapter05>StackOverrun.exe Hello
Address of foo = 00401000
Address of bar = 00401045
My stack looks like:
00000000
00000000
7FFDF000
0012FF80
0040108A <-- We want to overwrite the return address for foo. 00410EDE

Hello
Now the stack looks like:
6C6C6548 <-- You can see where "Hello" was copied in.
0000006F
7FFDF000
0012FF80
0040108A
00410EDE

Now let's try another input:

D:\Secureco2\Chapter05>StackOverrun.exe ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
Address of foo = 00401000
Address of bar = 00401045
My stack looks like:
00000000
00000000
7FFDF000
0012FF80
0040108A
00410EBE

ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
Now the stack looks like:
44434241
48474645
4C4B4A49
504F4E4D
54535251 <-- Return address has changed to this number.
58575655

We'll get now an error message telling us that we're trying to execute instruction at 0x54535251.
And as we see 0x54 is the code for the letter T, so if we tried this time:

D:\Secureco2\Chapter05>StackOverrun.exe ABCDEFGHIJKLMNOPQRS
Address of foo = 00401000
Address of bar = 00401045
My stack looks like:
00000000
00000000
7FFDF000
0012FF80
0040108A
00410ECE

ABCDEFGHIJKLMNOPQRS
Now the stack looks like:
44434241
48474645
4C4B4A49
504F4E4D
00535251 <-- Return address has changed to this number.
00410ECE

Now we got it, by changing the user input we're able to manipulate where the next instruction to be executed, so if we could send 0x45, 0x10, 0x40 instead of QRS, we could get bar to execute, but how we could pass these parameters and 0x10 is not even printable? We'll create a perl script (or you could create another program which passes the following input to the buffer overrun exe):

$arg = "ABCDEFGHIJKLMNOP"."\x45\x10\x40";
$cmd = "StackOverrun ".$arg;
system ($cmd);

Then run it:

D:\Secureco2\Chapter05>perl HackOverrun.pl
Address of foo = 00401000
Address of bar = 00401045
My stack looks like:
77FB80DB
77F94E68
7FFDF000
0012FF80
0040108A
00410ECA

ABCDEFGHIJKLMNOPE?@
Now the stack looks like:
44434241
48474645
4C4B4A49
504F4E4D
00401045
00410ECA

Augh! I've been hacked!


Now we knew how it could occur, now how Visual Studio has solved this problem?!

The first level is to provide the strsafe versions for strcpy and such functions, which gives another parameter which is to add the size of the buffer, when the developer is using the normal dangerous versions, the compiler will give him a warning of having the probability of exporting vulnerable code.

That looks cool, but what if the developer had committed a mistake and provided a wrong value for the buffer?!

Now we come to the second level, at execution time (this is the thing Iam not well remembering now), as you see it's all about overriding some values on the stack, the compiler will make many things, the one I am remembering now is the shadow copy of the stack and when it's trying to return will compare the old with the new and then determine if someone has made any thing over the stack or not, I am really not remembering the exact actions, so no body asks me how it's done exactly :D, but whenever I remember or find any resource on the web which is discussing how they made it, I'll put it here immediately :)


I think it's really enough for today, next time I'll resume the new additions in VC++ as I am tired now from writing all these stuff

Catch you later.....

Tuesday, October 04, 2005

Microsoft Visual Studios 2005 Team System, Episode I (Introduction)

As I mentioned before, I'll switch my blog mode to talk in some technical stuff, I'll start here with Microsoft Visual Studio 2005 Team System, then Microsoft Windows Vista, then finally my beloved product, Microsoft SQL Server Yukon (I hope another series of articles will come after that, but that's all for now).


Before any thing, I'll divide my articles about the new version of visual studio into these parts:

1- New features in Visual C++ compiler.
2- New features in C# compiler and the new features in .Net framework.
3- The new addition over traditional Visual Studio Professional and Enterprise Editions which is the Team System.


Actually there're many new features inside the new Visual Studio version, which in my opinion will make it un-beatable when compared to many other editors, because now it's not intended to support programmers only, but also testers, managers, IT professional, system architects, all in one solution.

That's all what I can say now as a simple introduction for what I'll discuss in the following articles, the next article will talk about the new features and additions in Microsoft Visual C++ compiler,

Catch you later.....

People are asking why Microsoft (Benefits of working inside Microsoft)?!

During the last several days I got these questions several times: Why you're so happy because you're going to Microsoft?! And what's the difference between it and any company here like IBM Egypt, Sakhr or ITWorx?! And why you're still asking for it and you're supposed to have a personal project which if succeeded will bring you much much more money than that you'll get after working inside Microsoft?! To answer all these questions, I must list all benefits in points, but before this list, for me the most important reason that I DO LOVE MICROSOFT AND JUST WISH TO MAKE IT BETTER AND STRONGER, for other reasons which are related to mind rather than emotions, here you're the point, so stay tight because it'll be a bit long


A- Company directly related benefits as employee:

1- Effectiveness: you as employee inside are not treated as a new comer who has no right to talking about higher policies in the company and the software you're working in, on the contrary, since the first day you'll find yourself as important as any one there, people of higher positions there like managers ore listening so well to your comments about everything, as example you may give a comment about some sort of feature in your product in the first day and you may find that the team is working with your advice and it has really changed the feature according to your feedback, really amazing!!!

2- Role: knowing the fact that you're working in things every person in the world is using is sooo amazing, unlike many other companies here like those I mentioned before, Microsoft's product is widely used around the world, not only by normal users, also by IT professional, software developers, and business users, etc, so you'll find yourself sooo excited by working in a product which you may find your own family is using everyday, really amazing!!!!

3- Innovation: you have the chance to completely invent and create new things even they are looking mad, no one will come and tell you that the features in your mind can't be achieved because of the company size is still not that big compared with your ideas, in other words, as much as the size of your ideas and the speed of your expansion, Microsoft will be bigger :)

4- Experience: no need to mention this part, most of us had at least used a single product from Microsoft, but lets talk about software developers whom will be concerned with this point so much more than others, at least any of you (I mean software developers here) had used at least a single application or library or piece of code coming from Microsoft and see the amount of professionalism they are creating the software with, furthermore, I had met myself, many team members of many products, like SQL Server, Windows, Visual C++ compiler, in addition to tons of movies on channel 9 of MSDN, and I can prove it to you, that a single year here in Microsoft may be equal to 10 years or more in any other company in Egypt and even in any place in the world, this is because you won't spend your whole life working in only one part which is too small compared to the whole IT world and after 8 or 10 years, when asked about any thing new, you say I don't know!No, you may work today in SQL Server, several months later, may leave and join Windows Team, many months later, may leave to join VC++ team, Xbox team, and so on, so you're working in a very huge organization which is having one simple rule, as much as you wish to work in any field, you'll find it out there :)Although, Microsoft will give you the chance for Professional Development, in other words, Microsoft will pay you all the tuition fees for any courses, Masters, PhDs, or any advanced program for increasing your skills as long as you're taking such courses in things related to your job at Microsoft (I think more than 95% of IT related fields are related to Microsoft work).So your experience in both Scientific and Technical sides will be so huge compared with others in other companies.

5- Freedom: the most amazing part here in Microsoft is the freedom every employee has, I'll list you some of them, first of all and the most important point, no attendance, in other words there's no place for the dummy rule of coming everyday from X to Y and even more, you're not supposed to come anytime but forced to come over certain interval of time (like Harf and ITWorx), and more than this, you're not forced to stay for X hours, you come and leave whenever you want as long as you're doing your job fine and are meeting your deadlines well, also you're free to Blog within Microsoft, free to work and to have another job even related to IT (as long as it's not affecting your work with Microsoft), and so they are not making things like here in Egypt as you sign tons of papers stating that you're not allowed to work in any thing (related or not related to IT) through your job, also after leaving it, you can't work in many fields (some companies extended it to whole IT fields) after leaving the company with several year, nothing like that, also, no one even your manager will force you to do something you're not convinced with, if they asked you to do something you're not convinced with, you'll sit together and talk, and he may find that you're right and he's wrong, and he will state this fact very bravely (he won't tell himself that I am the manager and he's still a new employee so I have more experience than him and so I must be right and he must be wrong), Microsoft Policy as Steve Palmer said (Microsoft's CEO) is Developers Developers Developers, so the developer is the main building block out there, and he's the most important part, so he must be very satisfied by working inside Microsoft.

6- Trust: There's no over-control rules like many companies here in Egypt, in other words, no rules that preventing you from accessing tons of sites, or sending emails within the company or upload files, or connect to messenger service or get your laptop with you inside the company, nothing like that, even more, you can take the code offline to complete it at home (even not only your code!), so the idea that you'll feel the amount of trust the company is giving you (with code which everybody is believing that it worth more than any other code in this country!!) and this will give you the happiness and making you very faithful to the company, also you could access your work and Microsoft's Intranet from anywhere in the world through your blue card within your PC or laptop ;)

7- Internal Environment and Employees Care: I hadn't seen any company all over the world which is caring about its employees to this extend!!Starting from normal free soda and juices all over the place till the health clubs!!!You as an employee inside Microsoft, has tons of benefits, I'll list the things I remember:

1- Health Club: This is known for everybody from its name.
2- Tons of play yards inside the company.
3- Tons of Xboxes, Arcade Video Game, Pool tables, Baby Foot, massage chairs, and many many things around every office which are increasing the fun factor inside the company.
4- Has a separate office (or at max sharing it with one or two members, but in most cases a separate one), no cubicles any more.
5- Tons of green spaces around you.
6- Vacation days: once starting, you have 21 vacation day which will be increased every interval (2 years as I remember).
7- Paid Holidays: Eight US holidays plus two personal holidays to take at your leisure.
8- Relocation: Nearly everything (nearly here means every thing except some rare things like Piano and such things) even furniture, will be relocated by them through some sort of transportation company, your ticket, a starting amount of money (outside your official salary) and many things related to your relocation to Microsoft.
9- P.R.I.M.E Discounts: discounts on many thing, including automotive, computers, restaurants and many thing.

10- Hour Health Line: Available 24/7, the Health Line provides useful, easy-to-understand health information that can help you make appropriate healthcare decisions.
11- Shipping Events: Huge trips after the shipping of each product, as example VC++ team is planning to go to Hawaii when they Ship Visual Studio CodeName Hawaii, so it's usually things like that :)
12- Tons of free stuff and discount on tons of other stuff.
13- Free drinks (the most fun part :P ), which are including soda, juices, soft drinks, etc.I can't remember more than these, but I am sure there were more items than these.

14- Free buses with Wi-Fi
15- On-site showers and lockers.
16- Flexpass: which you can use to ride all these selections for free: buses, trains, metro, even get a free car with free gas if you're more than 2 using the car!

8- People: people here in Microsoft are sooo great and friendly, I had dealt or talked to more than 20 engineers working inside Microsoft, in addition to many HR employees, all of them are great, dealing with you like a dear friend whom you know well since years, really it's so great to find people like that.

9- Management: there's no need to talk about management power inside Microsoft, it's all about management which makes Microsoft reaches this level of professionalism and experience.

10- Professionalism: Also no mention for how much professional Microsoft is, every thing is well arranged, every thing is amazing inside, side by side with great freedom which makes every thing very very very amazing.

11- Diversity: Iam a strong believer in the value of diversity in increasing both technical and community sides of any person, inside Microsoft you'll be working with people from very different cultures, different countries, different languages, and different ways for solving a specific problem, creating you a huge variety of cultures which will affect directly the way you think and the way you solve any problem.

12- Additional Degrees: What about making masters or PhD?
What if you want to make additional degree in your career?
In Microsoft, they won't only put your studying hours inside your working hours (which means if you're studying 20 hours per week, then now you'll work 20 hours only per week and the other 20 are paid for study), but also they will pay all expenses including books, materials, labs, etc, have you ever seen any thing like that?!!!

13- Finances: Very good and competitive package compared with all big companies in USA (of course we can't even think about comparing Microsoft's salary with salaries of any company inside Egypt), Bonus awards, Merit increases, furthermore, Stock awards, in which employee may be eligible to earn stock awards in the company (actually once you started you've stock awards waiting for you, in addition to awards every given interval), not only these.There're investment programs which will help you to secure your financial future, from there programs:

1- Saving Plus 401(k) plan: 401(k) savings plan lets you defer pre-tax income up to 50 percent of your eligible compensation (up to the IRS maximum). Microsoft matches 50 cents on every dollar you defer pre-tax up to a pre-tax contribution rate of 6 percent, excluding catch-up contributions, for a maximum matching contribution of 3 percent of your eligible compensation. You can also contribute up to 7 percent of your eligible compensation on an after-tax basis.

2- Employee Stock Purchase Plan: during any quarterly purchase period, employees may purchase stock at a 10 percent discount off the market price.

3- Goal Planner Investment Program: this program helps you save money from your net pay ― after taxes ― for anticipated future expenses such as college tuition (although in most cases, it's covered completely by Microsoft without any additional fees on you) or the purchase of a home. The program provides a personal discount brokerage account, direct investment deposits through payroll deduction, and financial planning tools that help you make informed decisions. You may enroll during any month.


I wish I hadn't forgotten any thing in this part.


B- Company in-directly related benefits:

Being at Redmond inside Washington, gives you tons of options you will like very much:

1- Redmond City and Quiet Life: Redmond city is sooo quiet, a lot of green spaces, very well arranged, and overall, it's a very perfect place to live within, but other people may ask, what if I'd like to go shopping in a huge city?
Or even want to make ice skating?
Or to swim or to camp?

This will be a simple question, to go to a huge city, just head west, a few miles (exactly 13 miles) you'll find yourself inside Seattle, were a lot of lights exist, and the true meaning of a city with very high building will be available :)

To make ice skating, head north, you'll find a ton of snow out there :)Wanna to camp? Just you'll find tons of forests around you, because northwest is rich with forests and mountains for camping and hiking and rivers and lakes for fishing, boating, kayaking and windsurfing :)
Also minutes from Microsoft, you'll find many Lakes and also heading west you'll find a lot of places to enjoy swimming :)

2- Being inside US, will give you a lot of options of buying cars or houses or any thing with much easy financial options.

And Finally take a look on some photos of MS (Most of these photos are more than 8 years old), it contains a satellite image for building 35, my work place and the SQL Server building:


http://www.programmingplanet.net/ms/

Also you can see Steven Sinofsky's article on the same subject on:
http://blogs.msdn.com/techtalk/archive/2005/10/09/478898.aspx


Mmm, I don't remember what else, but there're many more options (another personal option at least of loving this company so much even before joining it or even before the wish of joining it), I'll try to update this page as soon as I remember any thing, but till this moment, stay updated with my blog, because I am gonna switch the mode of the blog a bit and I'll jump into some technical posts concerning with Microsoft's new technologies and product like Visual Studio Whidbey, Windows Vista, and my beloved SQL Server Yukon. So stay connected :)


Catch you later.....

Sunday, September 25, 2005

Live chatting from Redmond

It was very nice, really very nice, but what's it?!

Today I have a nice chatting with my dear colleagues who had already traveled to Redmond on early Friday 23 at 3:00 AM Christian and Mohamed Helal, it was really nice to chat with them knowing that every thing is ok with them out there, and that the life is awesome out there, soon Chris will post all images for the first and second day on his blog, please feel free to visit it to have a good understanding for how every thing look like.

Finally I hope to finish my H1B papers soon to catch them asap because it's getting boring and boring every day and every minite :S

Catch you later.....

Saturday, September 17, 2005

Iam backkkkkkkkkk, the most important episode (Episode 5)

During this period and after it, the most two important events in my life had happened in which I think my life will be changed completely after them, one of them concerning my military service and the other concerning our seminar with EFG-Hermes IDEAVELOPERS (click on it to see my previous post on it).

First I'll talk about EFG-Hermes opportunity because it comes first, after I heard my military results, I got a phone call from EFG-Hermes telling me that they need to hold a meeting with us concerning our seminar and so on.

Without diving into much details of the two meetings we had held, all what they want is to establish a gaming company here in Egypt with stock of multi-millions and we're supposed to be stock-holders inside the company, the idea was great, and looks very nice (especially that our dream was to establish a company like this one day), that's all for the first part (I hadn't dived into the details because there're a lot of details here).

After the second meeting with them, I had got the second amazing event in my life, I had been postponed from the army for 3 years, wowwwwwww, now I can relocate to MS and enjoy my life in Redmond, and it's very nice.

Till now I hadn't decided yet what shall I do, but Iam looking to work in the both sides, travel to MS after the company is well established here in Egypt and then work with them online after my regular working hours there, but who knows, may something else happens, just who knows!!!

By the way, I had returned back to my first status, which is:

Waiting for H1B Documents.


The End........

Friday, September 16, 2005

Iam backkkkkkkkkk (Episode 4)

After finishing my military papers I felt too bad, because I felt everything is destroyed and I had lost one time-life opportunity, all these had made me feeling too bad, at that time I worked for 3 weeks inside Sakhr, so I had decided not to go again to Sakhr and I decided to forget all about the money I must take for the previous 3 weeks, but when I thought again about it, I found it so bad, how could I left someone who had trusted me to do some sort of work inside this critical time of releasing the software?!

So I had changed my mind from leaving immediately to wait until I finish the important work and until someone else arrive to replace me.

But I asked myself a small question, if I told my manager that I want to leave, how could I convince him to leave me because of my bad temper and that time, so I found a small idea, I will tell my manager that my travel date had been changed to 17 September 2005 instead of 24 October 2005 to make him leave me on the end of the last week (I know it's a very bad action from me, but I had made it because I was acting very badly and my work performance was decreasing too much and I hadn't used to take money without making the required job, so if he's reading this blog now, I am asking him to forgive me for this action and to know why I had made it at all).

After I told him this info, I had worked 1 week in real testing (from QC point of view) and it was the most boring week in my whole life, after this week my friend Yasser Rihan had arrived to the company, and that was my last week, I had told him about the whole system from A to Z until the end of the week had arrived then I left the job.

During this period and after it, the most two important events in my life had happened in which I think my life will be changed completely after them, one of them concerning my military service and the other concerning……

But this will be another story.

To be continued...........

Iam backkkkkkkkkk, Medical Examination day Part 2 (Episode 3)

Now to the second part of the great day of being at the most wonderful and beautiful place in the earth (actually I had invented new definitions for these words) which is the Hykesteb.

In my last post I stopped on the moment I entered to the place in which the medical examination, it started by waiting too long outside the building till the great doctors take their rest and after that they called us to enter to the room, take almost all our clothes off, and then wait another great time till someone of them is free to check you.

After all this time, some one had come out, I told him I've something (which I believe it should get me out of the army after asking many people), se he checked me and said: "mmm, yes you can get out by this but I am not sure yet" and he checked me again and said: "It's not critical as I think, so I won't let you go out"

Actually after hearing this news, I had a great shock!!
Because now I had lost my chance in Microsoft, but I remembered that I've another thing which should get me out of there, so I asked him, he told me that the doctor who's responsible for this part had left and probably will come tomorrow, so I left and came in the second day.

After coming on the second day, the doctor had checked me and after checking me he said: "Yes, you've it, and you can't bear the army while you're having this, but for your bad luck, they hadn't placed it in the rules but they are planning to put it inside the next year's rules, so if you come in the next year you could leave"!!!!!!!!!!!!!

So it's bad luck again!!!

At this moment I was 100% sure that I had lost my chance in joining Microsoft, but, is this true?!!

I should wait to see the results of postpones, but….

But this will be another story.

To be continued...........

Thursday, September 15, 2005

Iam backkkkkkkkkk, Medical Examination day Part 1 (Episode 2)

Now to the second episode of my long journey through the previous month, which is nearly the most important part (and actually the most dramatic part) from the journey, which is the day I went to the Hykesteb to begin my military service journey.


It started in Wednesday 24-September, I waked up at 5:30 AM, and went to the Hykesteb at 6:45 AM nearly, and there were a very huge number of people out there, so it takes from me till 10:00 till them actually taken my papers, I said ohh my god, they had finally taken my papers, but we're in Egypt and the thing you must learn about the army "If every thing is going ok, you must know that something is wrong and you may be in danger!!!", and as usual someone came with a lot of papers and start calling names, for my good luck, I was in these names, I asked him why you called me?

He told me because your papers which came from you faculty is not clear and it's not stating that your final marks had been approved from the university and a lot of shit like that, the most fun part that my success statement was holding "ختم النسر " (actually I don't know its name in English), so he hadn't accepted a paper holding this sign!!!!

Any way, for my good luck, my dad was out there, and we were having our car ready, so we went back to the college (please refer to my previous post about college papers and how much I had suffered gathering them and they told me that this paper will work fine in the army) so I went there to the college just to kill someone, anyway when I reached the college, I found that temporal tans-scripts are ready, so I went inside a very rough journey of taking a paper and went to a lot of places (some of them I hadn't heard about their existence before I went there in that day) and was asking everyone to sign on the paper to make me free from any responsibilities in this place, everything went fine till I reached the faculty's safe, they were so clear, they told me that they won't sign it till I pay 100 LE for the graduation party, I told them actually I won't be in Egypt to attend any parties, but no way, you must pay or we won't sign, so I paid it because I was having no time to talk, after paying the money and taking the trans-scripts (which had taken another extra time because nothing is behaving good in Egypt) I went back to the Hykesteb, and reached it at nearly 2:00 PM.

I won't dive in to details of how I had convinced them to let me in again after 2:00 PM, but finally I went in, after all normal steps of making your life hell, I reached the medical examination part,

But this will be another story.

To be continued...........


Iam backkkkkkkkkk (Episode 1)

Hello everybody,
Iam back to blogging again after all this period, yes it was a very long time since my last post, but during this period, many events had happened which made me soooo tired and sad!!!

Stay tight, because it'll be a long post.
Still interested? Ok, let's begin:

Let me think for a while where to start, as I remember last time I was talking about H1B visa and that Iam still in the pending state, during the last period, I went to Sakhr to work during the interval until I relocate to USA, so I worked with a great manager named Hatem Affify, he was really great, and I worked in the testing unit making SDK help and samples, yes somehow it was boring (when I left programming to testing for one week), but overall it was good, and the rumors I was hearing about Sakhr and how bad it was, yes it contains a lot of weak points, but people there were really great (developers and managers), but overall the company environment was good (of course if can't be compared to my beloved company Microsoft :P )

Nearly after one month it was the time for my military service medical diagnostics, the most important day in my life which will decide whether I will join Microsoft or not, so, what happened?!

This will be another story.

To be continued...........


Sunday, August 07, 2005

3D Game Event

Ohhh, it had been very long time since I had written any thing in this blog :), any way, in the last week I got a phone call from IDEAVELOPERS, a firm which is related to commercial funds in IT field, the attendees were the teams them-selves, IDEAVERLOPERS' business associates and consultants and EFG Hermes Private Equity team responsible managing the Technology Development Funds, the event was about Game Development and Production, we had went there in a hope to get some funds in order to get good media team to complete our game, the events had been in this way:


  1. We were supposed to be the first speakers to talk at 6:00 PM, but we had arrived at 6:15, so we spoke after the first team which had taken our place :).
  2. The people in the room had been fascinated with the game engine and the demos.
  3. We had found what we were looking for, the media team which was great and we hope we'll reach an agreement to work with each others :)

That's all till now, and I hope soon we got some good news :)


Wednesday, July 27, 2005

H1B Documents

Today I heard from Michelle P. D'Aguilar Microsoft Legal/Immigration that my college documents had evaluated as U.S equivalent degree to Bachelor of Science degree in Computer Science.

And now they have moved to the process of filing my H-1B documents.

Very good news :)

Wednesday, June 29, 2005

About last day in college

Today had been a very special day, it was the last day in college (the job fair in which I had attended just to be with my friends and colleagues), nearly I wont meet all this people again, may be sometimes but it wont be as we used to do, I know that I hadn't got the feeling of being so sad yet (may be because the distance between my mind and my heart is too long and the conductors are too bad LOL :P ).

Any way, whatever the reason, I think I'd really miss all this people too much, but I'll do my best to come here to Egypt 2-4 times per year to meet my family and my friends and colleagues.

Hope to see you all again, it was my pleasure to know people like you :)

Thursday, June 16, 2005

Is it a bug in the C# compiler or what?

I don't know whether the up-coming expression evaluation in the C# had revealed a bug inside the C# compiler or not, any way let's discuss it:

Imagine we've a function like this in C#:

void Func(ref int a, ref int b)
{
a ^= b ^= a ^= b;
}

Usually if we used the right to left compiler expression evaluation, we'll walk in this way, at first we know our variables' values are changing in each step, so we can easily determine that the expression must be renamed to be:

a2 ^= b1 ^= a1 ^= b0;

And when we make it as successive steps, it'll be:

a1 = a0 ^ b0;
b1 = b0 ^ a1;
a2 = a1 ^ b1;

In this case:
a-final = a1^b1 = (a0 ^ b0) ^ (b0 ^ a1) = (a0 ^ b0) ^ (b0 ^ (a0 ^ b0))
And after replacing all a0 with a and b0 with b, it'll be:

a-final = (a ^ b) ^ (b ^ (a ^ b)) = (a ^ b) ^ a = b.
The same steps done in b-final:

b-final = b0 ^ a1 = b0 ^ (a0 ^ b0) = b ^ a ^ b = a.
So we can easily determine that this function will do a simple swapping between the two variables, then where's the bug?!!

The bug will be raised when we try to evaluate the expression from right to left without renaming the variables, in this case:

a ^= b ^= a ^= b;

Will be evaluated as Three steps in order: a = a ^ b;
b = b ^ a;
a = a ^ b;

so, a-final = a ^ (b ^ (a ^ b)), and here's the bug, they hadn't put in mind that the left most a in the a-final equation is not equal to the original a, it's equal to a ^ b, so they had omit extra b which will lead the expression of a-final to be evaluated as: a-final = a ^ a = zero, so instead of being a swapping function, this function will just copy the value of a in b and make a = zero.

I don't know if this is a real bug, or they intended to evaluate the expression in C# in this way (knowing that C++ compiler is evaluating it in the true order), really I don't have a clue, but I'll try to know the truth any way :)

Saturday, June 11, 2005

My Experience with Microsoft Interview (Part 3)

After that, I had a very nice time waiting for the results, they told us that they will respond to us within a time frame of two weeks, so I had waited all that time with no answer, after that I had went to Sharm El Shekh with my friends, in the second day, we got a phone call on Mohamed Samir's cell phone, it was our friend Ahmed Ismael, he was asking him about his results, and we knew that the results had been released and we supposed to have it now on our email box, we were very mad at this moment, and we searched the whole place for a cyber or any place which has any access to the web, till I remember that I had seen a cyber on the door of the resort, so we went there, I asked Samir to see his results at first, he had seen it and unfortunately he hadn't been selected, so I had jumped into mine, I had found nothing, no yes or no, so I had spent about 3 hours waiting (because I thought it's on its way to be sent), but also in vain, so I paid the money, and go out, I had spent the rest of the journey in the cyber :D

And after all that I had sent an email to Caroline asked about my results, she told me that the team had some sudden family problems and they won't be able to answer me now!!

I had returned back home and hadn't got any thing also, a week after that (or 10 days I don't remember exactly), it was for the MDC 2005, so I went there just to meet Patrick Hynds (an instructor in MDC and the regional director of Microsoft Boston), because it was a very long time talking with him and I was looking to meet him (and I think it was the same for him), he asked me about the results and I told him that Iam the only one who hadn't got it till now, he wished me best luck and wished me to receive it before the end of the MDC to be able to make some kind of party :)

But the same bad luck is here, the MDC 2005 had wrapped up, and another week had passed since the MDC had finished with no answer yet, the funniest thing that I had contacted Caroline many times during this period, but with no result also :D:D

After that, I had got an email from Caroline, at first I was hesitated and having some fear from opening it, but I had opened it, and had made a quick scan with my eyes, Congratulation Mohamed, this was the first thing I had seen in the email, after reading it, Oh my god I had been accepted, and not only accepted, but accepted in the SQL Server Engine Core as Software Design Engineer, this was more than I can bear :)

And finally I had got my first dream came true, after that with only one more week, I had received a tons of papers to be signed, which contains every thing, starting from my basic salary there, to my health insurance and every thing about Microsoft it self as a company, my direct manager and every thing (they were so organized as much as you can imagine).

That's all for my journey with the interview itself, soon (as I hope) I'll write about my first day in Microsoft Redmond HQ (and about the visiting for the great Microsoft Museum in the first day as they told me :P )

But this will be another story.

By the way, here you can share the fun looking at the Corporation view and my building (you'll find a map in which I had marked my building on it, it's building number 35):

http://www.programmingplanet.net/ms

To be continued........

Wednesday, June 08, 2005

My Experience with Microsoft Interview (Part 2)

Now I'll write the second part with my journey through Microsoft Interview :)

Third interview:

My third interview was somehow more complex than the first two, I had it with a product manager in XML team (I think she was the manager of the XML as a whole), she asked me if I know any thing about SQL Server of course I answered no (Even I knew it well :P ), just to give myself the chance if she asked in any thing in SQL Server in which is don't know, any way, I don't remember the exact interview, but it was about how could I implement the SELECT statement between two tables if I was supposed to implement the SQL Server myself, all what I've is just a pointers to the two tables, she gave me the tables internal data structure, so I gave here an O(n ^ 2) (as usual), she told me she want it to be less than this, I gave here another solution of O(n log n), after that she asked about the O(n) solution and I gave it to her, then she asked me what if I found a duplicated rows, and she needs me to specify a way in which (if needed) will remove the duplications, I gave her the solution, she told me Iam so fine till now, and she still needs one more step, she asked me, if we've the two tables of huge size (lets say more than 1000,000,000 record each), it wont be wise to return the final result of the SELECT statement immediately, so we want a way to give the user the chance to get n results at first and then if he want more he'll get more (to implement the next function if you used SQL Server you'll know it), she asked me to do it in two ways, one way using hashtable and the other without it, I did that of the hash table, then I had given her a solution which is O(n) too without the use of hashtable, she smiled and told me that I had implemented the same technique used inside the last version of the SQL Server itself (it was an algorithm implemented by Microsoft itself and known by X merge sort, where X is some word I don't remember).

After that she told me that she finished interviewing me, and she had left with me to the main room again.

Forth interview:

After that they left us for about 10 minutes, and then came back and told us that 3 of us will leave and the other 2 will stay to some extra interviews and they will tell them the result of the interview after 2 weeks (the clue here, if you left in the middle of the interview, then you had lost your chance to be accepted), after that I had my forth interview, with some giant developer, who was interviewing me about my SDET abilities (SDET means Software Design Engineer in Test), so the question was very simple, Imagine you've 2D system which is just testing whether 2 rectangles are in collision state or not, and you supposed to make a program which takes the code of this system from its developers and test it automatically to see if it's working good or not, and output the percentage of the error in the code, what you'll do?

After making it, he then told me it's ok, fine, but you'll need some test cases to test the code on it, so you must have 2 group of test cases which must be generated automatically too, the first group is that group you know for sure that they collide, and the second one which you know for sure that they are not collide, so how you'll do this?

After telling him the rules for generating the test cases, he asked me what'll I do in the system if I've the time only for making 3 checks, what will be these checks?

I answered him, then he told me right, you got an answer, let's head now again for the main room to see what's next.

Fifth (and final) interview:

After that, it comes for the final interview, in which they had divided them-selves into 2 groups (3 each) and had taken us into an interview which was mainly about why you want to join Microsoft, and how you could imagine the way of working there, do you imagine if you joined you'll assigned a task in your first day or what?, and what if your manager assigned you a task you see it's soo trivial and easy, would you complain and say it's too easy and direct or you'll make it with internal un-satisfied or what?, and what you think the first thing you'll do when you put you feet there, would it be looking for food, or asking about where every thing is located or asking about your colleagues or what?
Many of questions like this, the most two questions I've enjoyed were:

Him: How many lines you could imagine the Visual Studio 2002 is?
Me: you mean the framework or the IDE or what?
Him: No, just the empty IDE, without any compilers, framework, debugger, any thing, just an empty IDE?
Me: how much?
Half a million?
Him (smiling): No, it's about 8,000,000 lines, Iam just telling you this to know how much the word Consistency means in our code, you may write a good and powerful code, but when included in main system will destroy it, and to clear this point for you, how much time could you imagine the line of code is surviving in our systems?

Me: How much?
4 years?

Him: No, it may reach more than 12 years, so it must be written in very good way, consistent, and good commented, and by saying the word comment, how could you think that your comments are good?

Me: mmm, I don't know, I think I should write them in a good way.

Him: and who will tell you that your way is good?

Me: It's easy, I've 2 ways, either to write them in a standardized way, or I should make a dummy function and they write a comment on it using my way, and send it to many developers with me and see if my way is good or not, and by the way, I knew that there must exist a standardized way in Microsoft for its code comments.

Then I left and they told me that I'll receive the results within a period of 2 weeks, and then it comes for the last stage:

The waiting for the results.

After that, I had a very nice time waiting for the ......

To be continued...........

Friday, June 03, 2005

My Experience with Microsoft Interview (Part 1)

Hii again, now I've some time to write my own experience with Microsoft during their interviews in Cairo, Egypt 2005 for SDE/SDET positions.

The whole game had started when I knew (I think I knew about these interviews on July 2004) that Microsoft will come to Egypt to make some interviews for some positions in Redmond campus, so I sent my CV to them along with my teammates CVs, after a short period they had answered me and had asked me about the expected graduation date for us, I told them it'll be after one year, nearly on July 2005, she replied by fine and then I hadn't heard any thing from them for about 4 months.

After this long period they had contacted me, and I knew after that, that the process is done through 4 main steps:

  1. They watch your CV, if it's good with good list, they will jump to the second step, if not they may reply you saying sorry and may not reply at all.
  2. They call you and make an initial phone interview asking you about some very simple things just to know about your way in thinking and try to deduce whether you had just written alot of things in your CV without real knowledge about them or not, usually it takes from 45-60 min, after passing this test, if you passed, you'll jump to the third step, if not, they will call you, and tell you sorry your qualifications don't meet our needs.
  3. HR test, some IQ questions, and some questions to test you way of thinking, and your ability to think for any solutions for some really weird questions and so on, this also takes between 45-60 min, and if you passed you'll jump to the final and main interview (all the above tests were just pre-tests to see whether you can go for the interview or not), also as the same 2 steps, if you passed you'll go to the interview and if not they will tell you sorry, usually no one will pass the second step and fails in the third step unless he was too sleepy or too stupid or no afraid (too afraid mean really toooooo afraid for the extend of not being able to even speak well).
  4. The main interview, it consists of 5-6 interviewers from Microsoft, every one of them will make an interview with you alone for 45-60 min, so it may take up to 6-7 hours (we were soooo tired after this interview), they will ask you alot of questions about many things, testing your ability in programming, writing an efficient algorithms, write programs free of bugs, making program to test others code to see whether it's free of bugs or not, and finally if you passed all these, you'll be setting with them in a good friendly interview and then they will ask you alot of questions about why you want to join Microsoft and what you think you'll do there and such questions.

Now I'll take you through these steps and my results during them.

1- CV: no need for talking about it, it's just CV no more no less, I think it was written in a good way, that's all, and they asked me about my military status and I told them I dont know about it yet, that's all.

2- Technical phone interview: After the 4 months I had told you about, I had got an email asking me for the best time to hold a phone interview with me, after I had replied, and in the day of the interview, I had got an international phone call (with un-able to get the caller ID msg) from a member in the Office team, his name was Mike, he had talked with me in a very friendly way, had talked about himself and his position in the company, then he asked me to open a kind of web whiteboard to begin the small test, it was mainly about sorting algorithms, and in which cases X algorithm will be better than Y, and how could we remove or add a line of code to make X works like Y and so on.

3- HR test, Caroline hadn't asked me to do this test, and I don't know why, and as I know, Iam the only one from those people whom I knew they had made their interview with Microsoft (in this year or in the past) who hadn't taken an IQ test till the end!!!

4- The main interview, the whole game began at 8:00 AM at Conrad Hotel in Cairo, I had went there with my teammates, we had found another two members there whom will have their interview with us(we discovered later that they had chosen only 20 developers for the final interviews, they had grouped them into 4 groups, 5 each, 2 groups per day), so after 10 min, we had seen someone heading to us, ohhh, it's Caroline, Hi Caroline, Hii guys, how are you, we hope you enjoyed your time in Egypt, so we had entered the elevator all, and had gone into their main room, we meet their another 5 members from Microsoft (I don't remember the names) one of them way a program manager in SQL Server, another one was program manager in XML team, the third one was working as SDET(SDET means Software Design Engineer in Test) in SQL Server team, the forth (I don't remember his position too), and the final one was HR(her name is Holly), and Caroline, so they were six members.

The interview had started in this way: we're 5, and the team (excluding Caroline) was 5, so everyone from the team will take one from us to his own room for 1 hour interview, my interview gone in this way:

First Interview:

My first interview gone with the first interviewer with Soner Terek, SQL Server Development Manager, he told me that he used to be a manager in his own company before he joined Microsoft, and that he had been in Microsoft since 11 years ago, had worked in many places like Windows and finally had reached SQL Server, and had asked me why I want to join Microsoft, and so on, after that he had asked me one question, Imagine you have a array of integer, and you want to get any two numbers whose sum is 51, what you'll do?

I asked him, do you want only 2 numbers or all 2 numbers whose combination is 51?

He told me only two in both O(n^2) and O(n) and try to parallize the both solution if we've up to n processors.

After making the whole solution set he told me that I did fine and to go back to the main room.

Second interview:

The second interview was fine, and more easy, I had made it with these one who's working as SDET(SDET means Software Design Engineer in Test) in SQL Server, it was simply about how could I make a code without any known or unknown bug, so he asked me to do 2 simple programs, the first one was a simple dynamic string array class, and had looked much into how could I handle every known and unknown bug (even the buffer over-run error) try to think about cases which can't be happened even you intended to do it, and then asked me to make another program which is handling a problem which I forgot its name (modified Josephus problem), afterthat he told me fine, nice work, let's head back to the main room.

Now I'll write the.......

To Be Continued......

Thursday, June 02, 2005

About Me (Who Am I)

Mmm, of course every blog should contain a page like this, because simply it's talking about its writer.

Any way, My name is Mohamed Meshref (of course you'll know this info if you're from those whom are seeing this page now :P lol ), Iam 21 years old now(my birth date is: 6/16/1984, because I wont edit my age every year :) ), single, currently Iam in Cairo, Egypt (but not for a long time), I was graduated from Computer Science Ain Shams on July/2005, I was working in Ractors (now it's Macrocell) in the past as security oriented software developer, currently Iam working as Game Developer in a company named by N.E.T which is providing ITV solutions, but soon I'll be relocating to Redmond, WA-USA in few months, as I had passed my interviews with Microsoft, SQL Server team and had accepted their offer for SDE(SDET means Software Design Engineer which was actually my first choice when I sent to Microsoft) in SQL Server Engine team (soon I'll post the whole story).


I've a lot of hobbies and interests, I like reading too much, especially in Meta-Physics, Space Exploring, Para-Psychology, like programming too much especially game programming of course, and the most thing I like ever is to drive planes, yes planes, I had read most ground school's lessons, and had got some in-official certificates and some in-official flight hours on Boeing 777 and Air-Bus 340 (of course on training simulators not real one, but on the simulators used to train pilots and give licenses to them :) ).

About the music I love, I like listening to Metal music (Black, death, trash, heavy, psycho, all) and slow, and Symphonic Orchestra, I know they are soo far from each others, but this is the case here :D.

Also, I like watching action movies, movies with scientifical background, fantasy, and romantic, Horror, and adventure.

Mmm, what else?
I love people, love being here in this life too much, and...... mmm
Don't know, this is enough: D
I'll left now to sleeepppppppp, it's 6:45 AM
Byeeeee
zzzzzzzzzzzzzzzzzzzzzzzz