
C#
C# is a high-level object-oriented programming language. It is used for building secure and robust applications.
Developed by Microsoft in 2000, C# was invented to match the increasing demand
for web applications.
Some top reasons to use C# are:
There are two types of comments in C#:
Single line:
//contains only 1 line of code
Multiple line (/* */):
/*Line 1
Line 2
Last line*/
There are several IDEs for C# development:
Common Language Runtime (CLR) is a runtime environment that manages the execution of any .NET program.
No. You can’t use multiple catch blocks for same exception in C# because a catch block is preceded by a try block.
C# supports object-oriented programming whereas C supports procedural programming.
Java Virtual Machine (JVM).
Simple Object Access Protocol.
The CLR is a virtual machine component of the .NET Framework. It manages the code execution of .NET programs.
Indexers allow objects to be indexed just like arrays.
There are mainly four types of classes in C#:
No.
No. C# is a high level programming language whereas C++ is a low level programming language. Another difference is C# compiles to CLR whereas C++ compiles to machine code.
".cs" is used to save C# files.
Curly braces {}
Operators are a set of symbols that tells the compiler to perform an action.
Yes, it is a type-safe programming language.
No, it is not possible to get the array index using the for each loop. To access the array index, you need to use a standard for loop.
Break
Yes, it is possible to inherit a class into another. It is of two types:
No. Method overriding is a process of calling functions from base class in the derived class. So overriding is not possible in the same class.
Method
Namespaces delegates, interfaces, and structures can be the members of the namespace.
No, you can’t as private virtual methods can’t be accessed outside the class.
Every statement in C# is terminated by a semicolon (;).
Yes.
No.
//
/* is used to begin and */ to end the comment.
type variableName = value;
String
const type constant_name = value;
Class
Yes
The throw statement allows you to manually throw an exception during the execution of a program.
System.UInt32
Public. As the Main() method is called by the runtime, it should be defined as public.
A C# pointer allows the user to store the memory address of another type.
(.) symbol or dot operator.
Variables are containers used to store data values. We can change the value or reuse the variable as many times as we like.
The following four keywords are used for Exception Handling in C#:
We hope that the above list of C# interview questions helps you regardless of whether you are a company looking for a C# developer or a C# developer looking for an opportunity. This above list has top C# interview questions for 10 years of experience, C# interview questions for 5 years of experience, and freshers that will help developers and recruiters.
If you are a recruiter looking for assistance in hiring C# developers for your team, get in touch with Turing. Turing helps you source, vet, and match the best developers from around the world. And if you are a C# developer looking for a senior position with a Silicon Valley company, now is the right time to apply.
Turing helps companies match with top quality remote JavaScript developers from across the world in a matter of days. Scale your engineering team with pre-vetted JavaScript developers at the push of a buttton.
Hire top vetted developers within 4 days.
Tell us the skills you need and we'll find the best developer for you in days, not weeks.