C# - Interview questions, with answers

Section 1. C# language core

What is C#?
C# is a high-level object oriented programming language developed by Microsoft.
The design of C# is based on C++ and Java.
Like Java, but unlike C++, C# code compiles to an intermediate language bytecode called MSIL.
C# is the preferred language for developing applications using the Micorosft .NET framework.
C# is the language that most fully, and most closely, supports the CLI.
The term .NET encompasses both the C# programming langauge, the .NET Runtime, and the Microsoft .NET Framework Class Library.
The Microsoft.NET Framework Class Library is an object oriented library of utility classes developed by Microsoft for the .NET runtime.

Describe some advantages of IL over Native code
1. Compiling to IL makes your code portable.
Am I compiling for 16-bit, 32-bit, or 64-bit? Can I assume a MATH coprocessor? Which Intel instruction should I use? Which Memory Model? Little Endian or Big Endian?
These are all questions that a native developer has to answer because native code is compiled for specific hardware. Code compiled for the Intel '386 wouldn't run on an Intel '286. Because of this, many developers targeted the lowest common denominator to reach the broadest possible audience, and performance was reduced.
With .NET, the CLR takes care of fully exploiting the capabilites of the hardware and the platform. If a coprocessor is present, the Runtime will use it.
2. IL can be improved, enhanced, and fixed.
In 1994, Intel was forced to offer free onsite chip replacement for millions of customers, because of a bug in their Pentium processor.
The mistake cost Intel $500 Million.
Similar bugs in software can be addressed quickly, easily, and cheaply with a software update.

More will be added later...

Ads by Google

Ask a question, send a comment, or report a problem - click here to contact me.

© Richard McGrath