technicalsymposium

Free Advertisement Procedure and Free Email /Whatsapp Updates

Free Email Alerts-Subscribe Below


Enter your Email ID here:

Note:Login & Check Your Email Inbox and Activate Confirmation Link

Technical Round Materials-C#-Free Download

Technical Round Materials-C#-Free Download

1. What is C#?

C# is the best language for writing Microsoft .NET applications. C# provides the rapid application development found in Visual Basic with the power of C++. Its syntax is similar to C++ syntax and meets 100% of the requirements of OOPs like the following:

  • Abstraction
  • Encapsulation
  • Polymorphism
  • Inheritance

2. What is an Object?

According to MSDN, " a class or struct definition is like a blueprint that specifies what the type can do. An object is basically a block of memory that has been allocated and configured according to the blueprint. A program may create many objects of the same class. Objects are also called instances, and they can be stored in either a named variable or in an array or collection. Client code is the code that uses these variables to call the methods and access the public properties of the object. In an object-oriented language such as C#, a typical program consists of multiple objects interacting dynamically".

Objects helps us to access the member of a class or struct either they can be fields, methods or

3. What is Managed or Unmanaged Code?

Managed Code

“The code, which is developed in .NET framework is known as managed code. This code is directly executed by CLR with the help of managed code execution. Any language that is written in .NET Framework is managed code”.

Unmanaged Code

The code, which is developed outside .NET framework is known as unmanaged code.

“Applications that do not run under the control of the CLR are said to be unmanaged, and certain languages such as C++ can be used to write such applications, which, for example, access low - level functions of the operating system. Background compatibility with the code of VB, ASP and COM are examples of unmanaged code”.

Unmanaged code can be unmanaged source code and unmanaged compile code. Unmanaged code is executed with the help of wrapper classes.

Wrapper classes are of two types:

  • CCW (COM Callable Wrapper).
  • RCW (Runtime Callable Wrapper).

4. What is Boxing and Unboxing?

Answer: Boxing and Unboxing both are used for type conversion but have some difference:

Boxing:

Boxing is the process of converting a value type data type to the object or to any interface data type which is implemented by this value type. When the CLR boxes a value means when CLR is converting a value type to Object Type, it wraps the value inside a System.Object and stores it on the heap area in application domain.

Example:



Unboxing:

Unboxing is also a process which is used to extract the value type from the object or any implemented interface type. Boxing may be done implicitly, but unboxing have to be explicit by code.

Example:



The concept of boxing and unboxing underlines the C# unified view of the type system in which a value of any type can be treated as an object.


5. What is the difference between a struct and a class in C#?

Answer:

Class and struct both are the user defined data type but have some major difference:

Struct

  • The struct is value type in C# and it inherits from System.Value Type.
  • Struct is usually used for smaller amounts of data.
  • Struct can’t be inherited to other type.
  • A structure can't be abstract.
  • No need to create object by new keyword.
  • Do not have permission to create any default constructor.

Class

  • The class is reference type in C# and it inherits from the System.Object Type.
  • Classes are usually used for large amounts of data.
  • Classes can be inherited to other class.
  • A class can be abstract type.
  • We can’t use an object of a class with using new keyword.
  • We can create a default constructor.

6. What is the difference between Interface and Abstract Class?

Answer:

Theoretically their are some differences between Abstract Class and Interface which are listed below:

  • A class can implement any number of interfaces but a subclass can at most use only one abstract class.
  • An abstract class can have non-abstract methods (concrete methods) while in case of interface all the methods has to be abstract.
  • An abstract class can declare or use any variables while an interface is not allowed to do so.
  • In an abstract class all data member or functions are private by default while in interface all are public, we can’t change them manually.
  • In an abstract class we need to use abstract keyword to declare abstract methods while in an interface we don’t need to use that.
  • An abstract class can’t be used for multiple inheritance while interface can be used as multiple inheritance.
  • An abstract class use constructor while in an interface we don’t have any type of constructor.

7. What is enum in C#?

Answer:

An enum is a value type with a set of related named constants often referred to as an enumerator list. The enum keyword is used to declare an enumeration. It is a primitive data type, which is user defined.

An enum type can be an integer (float, int, byte, double etc.). But if you used beside int it has to be cast.

An enum is used to create numeric constants in .NET framework. All the members of enum are of enum type. Their must be a numeric value for each enum type.

The default underlying type of the enumeration element is int. By default, the first enumerator has the value 0, and the value of each successive enumerator is increased by 1.

1. enum Dow {Sat, Sun, Mon, Tue, Wed, Thu, Fri};

Some points about enum

  • Enums are enumerated data type in c#.
  • Enums are not for end-user, they are meant for developers.
  • Enums are strongly typed constant. They are strongly typed, i.e. an enum of one type may not be implicitly assigned to an enum of another type even though the underlying value of their members are the same.
  • Enumerations (enums) make your code much more readable and understandable.
  • Enum values are fixed. Enum can be displayed as a string and processed as an integer.
  • The default type is int, and the approved types are byte, sbyte, short, ushort, uint, long, and ulong.
  • Every enum type automatically derives from System.Enum and thus we can use System.Enum methods on enums.
  • Enums are value types and are created on the stack and not on the heap.

8. What is the difference between “continue” and “break” statements in C#?

Answer:

Using break statement, you can 'jump out of a loop' whereas by using continue statement, you can 'jump over one iteration' and then resume your loop execution.

Eg. Break Statement

1. using System;

2. using System.Collections;

3. using System.Linq;

4. using System.Text;

5.

6. namespace break_example

7. {

8. Class brk_stmt {

9. public static void main(String[] args) {

10. for (int i = 0; i <= 5; i++) {

11. if (i == 4) {

12. break;

13. }

14. Console.WriteLine("The number is " + i);

15. Console.ReadLine();

16.

17. }

18. }

19. }

20.

21. }

Output

The number is 0;
The number is 1;
The number is 2;
The number is 3;

Eg.Continue Statement

1. using System;

2. using System.Collections;

3. using System.Linq;

4. using System.Text;

5.

6. namespace continue_example

7. {

8. Class cntnu_stmt

9. {

10. public static void main(String[]

11. {

12. for (int i = 0; i <= 5; i++)

13. {

14. if (i == 4)

15. {

16. continue;

17. }

18. Console.WriteLine(“The number is "+ i);

19. Console.ReadLine();

20.

21. }

22. }

23. }

24.

25. }

26.

27.

Output

The number is 1;
The number is 2;
The number is 3;
The number is 5;



9. What is the difference between constant and read only in c#?

Answer:

Constant (const) and Readonly (readonly) both looks like same as per the uses but they have some differences:

Constant is known as “const” keyword in C# which is also known immutable values which are known at compile time and do not change their values at run time like in any function or constructor for the life of application till the application is running.

Readonly is known as “readonly” keyword in C# which is also known immutable values and are known at compile and run time and do not change their values at run time like in any function for the life of application till the application is running. You can assay their value by constructor when we call constructor with “new” keyword.

See the example

We have a Test Class in which we have two variables one is readonly and another is constant.

1. class Test {

2. readonly int read = 10;

3. const int cons = 10;

4. public Test() {

5. read = 100;

6. cons = 100;

7. }

8. public void Check() {

9. Console.WriteLine("Read only : {0}", read);

10. Console.WriteLine("const : {0}", cons);

11. }

12. }

Here I was trying to change the value of both the variables in constructor but when I am trying to change the constant it gives an error to change their value in that block which have to call at run time.



So finally remove that line of code from class and call this Check() function like the following code snippet:

1. class Program {

2. static void Main(string[] args) {

3. Test obj = new Test();

4. obj.Check();

5. Console.ReadLine();

6. }

7. }

8. class Test {

9. readonly int read = 10;

10. const int cons = 10;

11. public Test() {

12. read = 100;

13. }

14. public void Check() {

15. Console.WriteLine("Read only : {0}", read);

16. Console.WriteLine("const : {0}", cons);

17. }

18. }

Output:



10. What is the difference between ref and out keywords?

Answer:

In C Sharp (C#) we can have three types of parameters in a function. The parameters can be in parameter (which is not returned back to the caller of the function), out parameter and ref parameter. We have lots of differences in both of them.



11. Can “this” be used within a static method?

Answer:

We can't use this in static method because keyword 'this' returns a reference to the current instance of the class containing it. Static methods (or any static member) do not belong to a particular instance. They exist without creating an instance of the class and call with the name of a class not by instance so we can’t use this keyword in the body of static Methods, but in case of Extension Methods we can use it the functions parameters. Let’s have a look on “this” keyword.

The "this" keyword is a special type of reference variable that is implicitly defined within each constructor and non-static method as a first parameter of the type class in which it is defined. For example, consider the following class written in C#.

12. Define Property in C#.net?

Answer:

Properties are members that provide a flexible mechanism to read, write or compute the values of private fields, in other words by the property we can access private fields. In other words we can say that a property is a return type function/method with one parameter or without a parameter. These are always public data members. It uses methods to access and assign values to private fields called accessors.

Now question is what are accessors?

The get and set portions or blocks of a property are called accessors. These are useful to restrict the accessibility of a property, the set accessor specifies that we can assign a value to a private field in a property and without the set accessor property it is like a read-only field. By the get accessor we can access the value of the private field, in other words it returns a single value. A Get accessor specifies that we can access the value of a field publically.

We have the three types of properties

  • Read/Write.
  • ReadOnly.
  • WriteOnly

13. What is extension method in c# and how to use them?

Answer:

Extension methods enable you to add methods to existing types without creating a new derived type, recompiling, or otherwise modifying the original type. An extension method is a special kind of static method, but they are called as if they were instance methods on the extended type.

How to use extension methods?


An extension method is a static method of a static class, where the "this" modifier is applied to the first parameter. The type of the first parameter will be the type that is extended.

Extension methods are only in scope when you explicitly import the namespace into your source code with a using directive.

Like: suppose we have a class like bellow:

1. public class Class1 {

2. public string Display() {

3. return ("I m in Display");

4. }

5.

6. public string Print() {

7. return ("I m in Print");

8. }

9. }

Now we need to extend the definition of this class so m going to create a static class to create an extinction method like:

1. public static class XX {

2. public static void NewMethod(this Class1 ob) {

3. Console.WriteLine("Hello I m extended method");

4. }

5. }

Here I just create a method that name is NewMethod with a parameter using this to define which type of data I need to be extend, now let’s see how to use this function.

1. class Program {

2. static void Main(string[] args) {

3. Class1 ob = new Class1();

4. ob.Display();

5. ob.Print();

6. ob.NewMethod();

7. Console.ReadKey();

8. }

9. }

Output will be:



14. What is the difference between dispose and finalize methods in c#?

Answer: finalizer and dispose both are used for same task like to free unmanaged resources but have some differences see.

Finalize:

  • Finalize used to free unmanaged resources those are not in use like files, database connections in application domain and more, held by an object before that object is destroyed.
  • In the Internal process it is called by Garbage Collector and can’t called manual by user code or any service.
  • Finalize belongs to System.Object class.
  • Implement it when you have unmanaged resources in your code, and make sure that these resources are freed when the Garbage collection happens.

Dispose:

  • Dispose is also used to free unmanaged resources those are not in use like files, database connections in Application domain at any time.
  • Dispose explicitly it is called by manual user code.
  • If we need to dispose method so must implement that class by IDisposable interface.
  • It belongs to IDisposable interface.
  • Implement this when you are writing a custom class that will be used by other users.

15. What is the difference between string and StringBuilder in c#?

Answer:

StringBuilder and string both use to store string value but both have many differences on the bases of instance creation and also for performance:

String:

String is an immutable object. Immutable like when we create string object in code so we cannot modify or change that object in any operations like insert new value, replace or append any value with existing value in string object, when we have to do some operations to change string simply it will dispose the old value of string object and it will create new instance in memory for hold the new value in string object like:


Note:

  • It’s an immutable object that hold string value.
  • Performance wise string is slow because its’ create a new instance to override or change the previous value.
  • String belongs to System namespace.

StringBuilder:

System.Text.Stringbuilder is mutable object which also hold the string value, mutable means once we create a System.Text.Stringbuilder object we can use this object for any operation like insert value in existing string with insert functions also replace or append without creating new instance of System.Text.Stringbuilder for every time so it’s use the previous object so it’s work fast as compare than System.String. Let’s have an example to understand System.Text.Stringbuilder like:


Note:

  • StringBuilder is a mutable object.
  • Performance wise StringBuilder is very fast because it will use same instance of StringBuilder object to perform any operation like insert value in existing string.
  • StringBuilder belongs to System.Text.Stringbuilder namespace.

16. What is delegates in C# and uses of delegates?

Answer:

C# delegates are same as pointers to functions, in C or C++. A delegate Object is a reference type variable that use to holds the reference to a method. The reference can be changed at runtime which is hold by an object of delegate, a delegate object can hold many functions reference which is also known as Invocation List that refers functions in a sequence FIFO, we can new functions ref in this list at run time by += operator and can remove by -= operator.

Delegates are especially used for implementing events and the call-back methods. All delegates are implicitly derived from the System.Delegate class.

Let’s see how to use Delegate with Example:


17. What is sealed class in c#?

Answer:

Sealed classes are used to restrict the inheritance feature of object oriented programming. Once a class is defined as a sealed class, the class cannot be inherited.

In C#, the sealed modifier is used to define a class as sealed. In Visual Basic .NET the Not Inheritable keyword serves the purpose of sealed. If a class is derived from a sealed class then the compiler throws an error.

If you have ever noticed, structs are sealed. You cannot derive a class from a struct.

The following class definition defines a sealed class in C#:

1. // Sealed class

2. sealed class SealedClass

3. {

4.

5. }

18. What are partial classes?

Answer:

A partial class is only use to splits the definition of a class in two or more classes in a same source code file or more than one source files. You can create a class definition in multiple files but it will be compiled as one class at run time and also when you’ll create an instance of this class so you can access all the methods from all source file with a same object.

Partial Classes can be create in the same namespace it’s doesn’t allowed to create a partial class in different namespace. So use “partial” keyword with all the class name which you want to bind together with the same name of class in same namespace, let’s have an example:


19. What is boxing and unboxing?

Answer:

Boxing and Unboxing both using for type converting but have some difference:

Boxing:


Boxing is the process of converting a value type data type to the object or to any interface data type which is implemented by this value type. When the CLR boxes a value means when CLR converting a value type to Object Type, it wraps the value inside a System.Object and stores it on the heap area in application domain.

Example:


Unboxing:

Unboxing is also a process which is use to extracts the value type from the object or any implemented interface type. Boxing may be done implicit but unboxing have to be explicit by code.

Example:


20. What is IEnumerable<> in c#?

Answer:

IEnumerable is the parent interface for all non-generic collections in System.Collections namespace like ArrayList, HastTable etc. that can be enumerated. For the generic version of this interface as IEnumerable<T> which a parent interface of all generic collections class in System.Collections.Generic namespace like List<> and more.

In System.Collections.Generic.IEnumerable<T> have only a single method which is GetEnumerator() that returns an IEnumerator. IEnumerator provides the power to iterate through the collection by exposing a Current property and Move Next and Reset methods, if we doesn’t have this interface as a parent so we can’t use iteration by foreach loop or can’t use that class object in our LINQ query.


21. What is difference between late binding and early binding in c#?

Answer:

Early Binding and Late Binding concepts belongs to polymorphism so let’s see first about polymorphism:

Polymorphism is an ability to take more than one form of a function means with a same name we can write multiple functions code in a same class or any derived class.

Polymorphism we have 2 different types to achieve that:

  • Compile Time also known as Early Binding or Overloading.
  • Run Time also known as Late Binding or Overriding.

Compile Time Polymorphism or Early Binding:

In Compile time polymorphism or Early Binding we will use multiple methods with same name but different type of parameter or may be the number or parameter because of this we can perform different-different tasks with same method name in the same class which is also known as Method overloading.

See how we can do that by the following example:



Run Time Polymorphism or Late Binding:

Run time polymorphism also known as late binding, in Run Time polymorphism or Late Binding we can do use same method names with same signatures means same type or same number of parameters but not in same class because compiler doesn’t allowed that at compile time so we can use in derived class that bind at run time when a child class or derived class object will instantiated that’s way we says that Late Binding. For that we have to create my parent class functions as partial and in driver or child class as override functions with override keyword.


22. What are the differences between IEnumerable and IQueryable?

Answer:

Before the differences learn what is IEnumerable and IQueryable.

IEnumerable:

Is the parent interface for all non-generic collections in System.Collections namespace like ArrayList, HastTable etc. that can be enumerated. For the generic version of this interface as IEnumerable<T> which a parent interface of all generic collections class in System.Collections.Generic namespace like List<> and more.

IQueryable:

As per MSDN IQueryable interface is intended for implementation by query providers. It is only supposed to be implemented by providers that also implement IQueryable<T>. If the provider does not also implement IQueryable<T>, the standard query operators cannot be used on the provider's data source.

The IQueryable interface inherits the IEnumerable interface so that if it represents a query, the results of that query can be enumerated. Enumeration causes the expression tree associated with an IQueryable object to be executed. The definition of "executing an expression tree" is specific to a query provider. For example, it may involve translating the expression tree to an appropriate query language for the underlying data source. Queries that do not return enumerable results are executed when the Execute method is called.

23. What happens if the inherited interfaces have conflicting method names?

Answer:

If we implement multipole interface in the same class with conflict method name so we don’t need to define all or in other words we can say if we have conflict methods in same class so we can’t implement their body independently in the same class coz of same name and same signature so we have to use interface name before method name to remove this method confiscation let’s see an example:

1. interface testInterface1 {

2. void Show();

3. }

4. interface testInterface2 {

5. void Show();

6. }

7. class Abc: testInterface1,

8. testInterface2 {

9.

10. void testInterface1.Show() {

11. Console.WriteLine("For testInterface1 !!");

12. }

13. void testInterface2.Show() {

14. Console.WriteLine("For testInterface2 !!");

15. }

16. }

Now see how to use those in a class:

1. class Program {

2. static void Main(string[] args) {

3. testInterface1 obj1 = new Abc();

4. testInterface1 obj2 = new Abc();

5. obj1.Show();

6. obj2.Show();

7.

8. Console.ReadLine();

9. }

10. }

Output:

24. What are the Arrays in C#.Net?

Answer:

Arrays are powerful data structures for solving many programming problems. You saw during the creation of variables of many types that they have one thing in common, they hold information about a single item, for instance an integer, float and string type and so on. So what is the solution if you need to manipulate sets of items? One solution would be to create a variable for each item in the set but again this leads to a different problem. How many variables do you need?

So in this situation Arrays provide mechanisms that solves problem posed by these questions. An array is a collection of related items, either value or reference type. In C# arrays are immutable such that the number of dimensions and size of the array are fixed.

Arrays Overview

An array contains zero or more items called elements. An array is an unordered sequence of elements. All the elements in an array are of the same type (unlike fields in a class that can be of different types). The elements of an array accessed using an integer index that always starts from zero. C# supports single-dimensional (vectors), multidimensional and jagged arrays.

Elements are identified by indexes relative to the beginning of the arrays. An index is also commonly called indices or subscripts and are placed inside the indexing operator ([]). Access to array elements is by their index value that ranges from 0 to (length-1).

Array Properties

  • The length cannot be changed once created.
  • Elements are initialized to default values.
  • Arrays are reference types and are instances of System.Array.
  • Their number of dimensions or ranks can be determined by the Rank property.
  • An array length can be determined by the GetLength() method or Length property.

25. What is the Constructor Chaining in C#?

Answer: constructor chaining is a way to connect two or more classes in a relationship as Inheritance, in Constructor Chaining every child class constructor is mapped to parent class Constructor implicitly by base keyword so when you create an instance of child class to it’ll call parent’s class Constructor without it inheritance is not possible.

26. What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?

Answer:

Clone:

Method creates a shallow copy of an array. A shallow copy of an Array copies only the elements of the Array, whether they are reference types or value types, but it does not copy the objects that the references refer to. The references in the new Array point to the same objects that the references in the original Array point to.

CopyTo:

The Copy static method of the Array class copies a section of an array to another array. The CopyTo method copies all the elements of an array to another one-dimension array. The code listed in Listing 9 copies contents of an integer array to an array of object types.

27. Can Multiple Catch Blocks executed in c#?

Answer:

we can use multiple Catches block with every try but when any Exceptions is throw by debugger so every catches match this exception type with their signature and catch the exception by any single catch block so that means we can use multiple catches blocks but only one can executed at once like:

1. using System;

2. class MyClient {

3. public static void Main() {

4. int x = 0;

5. int div = 0;

6. try {

7. div = 100 / x;

8. Console.WriteLine("Not executed line");

9. } catch (DivideByZeroException de) {

10. Console.WriteLine("DivideByZeroException");

11. } catch (Exception ee) {

12. Console.WriteLine("Exception");

13. } finally {

14. Console.WriteLine("Finally Block");

15. }

16. Console.WriteLine("Result is {0}", div);

17. }

18. }

28. What is Singleton Design Patterns and How to implement in C#?

Answer:

What is Singleton Design Pattern?

1. Ensures a class has only one instance and provides a global point of access to it.

2. A singleton is a class that only allows a single instance of itself to be created, and usually gives simple access to that instance.

3. Most commonly, singletons don't allow any parameters to be specified when creating the instance, since a second request of an instance with a different parameter could be problematic! (If the same instance should be accessed for all requests with the same parameter then the factory pattern is more appropriate.)

4. There are various ways to implement the Singleton Pattern in C#. The following are the common characteristics of a Singleton Pattern.

• A single constructor, that is private and parameterless.
• The class is sealed.
• A static variable that holds a reference to the single created instance, if any.
• A public static means of getting the reference to the single created instance, creating one if necessary.

This is the example how to write the code with Singleton:

1. namespace Singleton {

2. class Program {

3. static void Main(string[] args) {

4. Calculate.Instance.ValueOne = 10.5;

5. Calculate.Instance.ValueTwo = 5.5;

6. Console.WriteLine("Addition : " + Calculate.Instance.Addition());

7. Console.WriteLine("Subtraction : " + Calculate.Instance.Subtraction());

8. Console.WriteLine("Multiplication : " + Calculate.Instance.Multiplication());

9. Console.WriteLine("Division : " + Calculate.Instance.Division());

10.

11. Console.WriteLine("\n----------------------\n");

12.

13. Calculate.Instance.ValueTwo = 10.5;

14. Console.WriteLine("Addition : " + Calculate.Instance.Addition());

15. Console.WriteLine("Subtraction : " + Calculate.Instance.Subtraction());

16. Console.WriteLine("Multiplication : " + Calculate.Instance.Multiplication());

17. Console.WriteLine("Division : " + Calculate.Instance.Division());

18.

19. Console.ReadLine();

20. }

21. }

22.

23. public sealed class Calculate {

24. private Calculate() {}

25. private static Calculate instance = null;

26. public static Calculate Instance {

27. get {

28. if (instance == null) {

29. instance = new Calculate();

30. }

31. return instance;

32. }

33. }

34.

35. public double ValueOne {

36. get;

37. set;

38. }

39. public double ValueTwo {

40. get;

41. set;

42. }

43.

44. public double Addition() {

45. return ValueOne + ValueTwo;

46. }

47.

48. public double Subtraction() {

49. return ValueOne - ValueTwo;

50. }

51.

52. public double Multiplication() {

53. return ValueOne * ValueTwo;

54. }

55.

56. public double Division() {

57. return ValueOne / ValueTwo;

58. }

59. }

60. }

29. Difference between Throw Exception and Throw Clause.

Answer:

The basic difference is that the Throw exception overwrites the stack trace and this makes it hard to find the original code line number that has thrown the exception.

Throw basically retains the stack information and adds to the stack information in the exception that it is thrown.

Let us see what it means rather speaking so many words to better understand the differences. I am using a console application to easily test and see how the usage of the two differ in their functionality.

1. using System;

2. using System.Collections.Generic;

3. using System.Linq;

4. using System.Text;

5.

6. namespace TestingThrowExceptions {

7. class Program {

8. public void ExceptionMethod() {

9. throw new Exception("Original Exception occurred in ExceptionMethod");

10.

11. }

12.

13. static void Main(string[] args) {

14. Program p = new Program();

15. try {

16. p.ExceptionMethod();

17. } catch (Exception ex) {

18.

19. throw ex;

20. }

21. }

22. }

23. }

Now run the code by pressing the F5 key of the keyboard and see what happens. It returns an exception and look at the stack trace:


30. What are Indexer in C# .Net?

Answer:

Indexer allows classes to be used in more intuitive manner. C# introduces a new concept known as Indexers which are used for treating an object as an array. The indexers are usually known as smart arrays in C#. They are not essential part of object-oriented programming.

An indexer, also called an indexed property, is a class property that allows you to access a member variable of a class using the features of an array.

Defining an indexer allows you to create classes that act like virtual arrays. Instances of that class can be accessed using the [] array access operator.

Creating an Indexer

1. < modifier > <

2. return type > this[argument list] {

3. get {

4. // your get block code

5. }

6.

7. set {

8. // your set block code

9. }

10. }

In the above code:

<modifier>

can be private, public, protected or internal.

<return type>

can be any valid C# types.

31. What is multicast delegate in c#?

Answer

Delegate can invoke only one method reference has been encapsulated into the delegate.it is possible for certain delegate to hold and invoke multiple methods such delegate called multicast delegates.multicast delegates also know as combinable delegates, must satisfy the following conditions:

  • The return type of the delegate must be void. None of the parameters of the delegate type can be delegate type can be declared as output parameters using out keywords.
  • Multicast delegate instance that created by combining two delegates, the invocation list is formed by concatenating the invocation list of two operand of the addition operation. Delegates are invoked in the order they are added.

Implement Multicast Delegates Example:

1. using System;

2. using System.Collections.Generic;

3. using System.Linq;

4. using System.Text;

5. delegate void MDelegate();

6. class DM {

7. static public void Display() {

8. Console.WriteLine("Meerut");

9. }

10. static public void print() {

11. Console.WriteLine("Roorkee");

12. }

13. }

14. class MTest {

15. public static void Main() {

16. MDelegate m1 = new MDelegate(DM.Display);

17. MDelegate m2 = new MDelegate(DM.print);

18. MDelegate m3 = m1 + m2;

19. MDelegate m4 = m2 + m1;

20. MDelegate m5 = m3 - m2;

21. m3();

22. m4();

23. m5();

24. }

25. }

32. Difference between Equality Operator (==) and Equals() Method in C#.

Answer:

Both the == Operator and the Equals() method are used to compare two value type data items or reference type data items. The Equality Operator (==) is the comparison operator and the Equals() method compares the contents of a string. The == Operator compares the reference identity while the Equals() method compares only contents. Let’s see with some examples.

In this example we assigned a string variable to another variable. A string is a reference type and in the following example, a string variable is assigned to another string variable so they are referring to the same identity in the heap and both have the same content so you get True output for both the == Operator and the Equals() method.

1. using System;

2. namespace ComparisionExample {

3. class Program {

4. static void Main(string[] args) {

5. string name = "sandeep";

6. string myName = name;

7. Console.WriteLine("== operator result is {0}", name == myName);

8. Console.WriteLine("Equals method result is {0}", name.Equals(myName));

9. Console.ReadKey();

10. }

11. }

12. }

33. Difference between is and as operator in C#.

Answer:

"is" operator

In the C# language, we use the "is" operator to check the object type. If the two objects are of the same type, it returns true and false if not.

Let's understand the preceding from a small program.

We defined the following two classes:

1. class Speaker {

2. public string Name {

3. get;

4. set;

5. }

6. }

7. class Author {

8. public string Name {

9. get;

10. set;

11. }

12. }

Now, let's try to check the preceding types as:

1. var speaker = new Speaker { Name="Gaurav Kumar Arora"};

We declared an object of Speaker as in the following:

1. var isTrue = speaker is Speaker;

In the preceding, we are just checking the matching type. Yes, our speaker is an object of Speaker type.

1. Console.WriteLine("speaker is of Speaker type:{0}", isTrue);

So, the results as true.

But, here we get false:

1. var author = new Author { Name = "Gaurav Kumar Arora" };

2. var isTrue = speaker is Author;

3. Console.WriteLine("speaker is of Author type:{0}", isTrue);

Because our our speaker is not an object of Author type.

"as" operator:

The "as" operator behaves similar to the "is" operator. The only difference is it returns the object if both are compatible to that type else it returns null.

Let's understand the preceding with a small snippet as in the following:

1. public static string GetAuthorName(dynamic obj)

2. {

3. Author authorObj = obj as Author;

4. return (authorObj != null) ? authorObj.Name : string.Empty;

5. }

We have a method that accepts dynamic objects and returns the object name property if the object is of the Author type.

Here, we declared two objects:

1. var speaker = new Speaker { Name="Gaurav Kumar Arora"};

2. var author = new Author { Name = "Gaurav Kumar Arora" };

The following returns the "Name" property:

1. var authorName = GetAuthorName(author);

2. Console.WriteLine("Author name is:{0}", authorName);

It returns an empty string:

1. authorName = GetAuthorName(speaker);

2. Console.WriteLine("Author name is:{0}", authorName);

34. How to use Nullable<> Types in .Net?

Answer:

A nullable Type is a data type is that contain the defined data type or the value of null.

You should note here that here variable datatype has been given and then only it can be used.

This nullable type concept is not comaptible with "var".

I will explain this with syntax in next section.

Declaration:

Any DataType can be declared nullable type with the help of operator "?".
Example of the syntax is as Follows :-

1. int? i = null;

As discussed in previous section "var" is not compatible with this Nullable Type.

So we will have Compile Time error if we are declaring something like: -

1. var? i = null;

though following syntax is completely fine :-

1. var i = 4;

35. Different Ways of Method can be overloaded.

Answer:

Method overloading is a way to achieve compile time Polymorphism where we can use a method with the same name but different signature, Method overloading is done at compile time and we have multiple way to do that but in all way method name should be same.

  • Number of parameter can be different.
  • Types of parameter can be different.
  • Order of parameters can be different.

Example:

1. using System;

2. using System.Collections.Generic;

3. using System.Linq;

4. using System.Text;

5.

6. namespace Hello_Word {

7. class overloding {

8. public static void Main() {

9. Console.WriteLine(volume(10));

10. Console.WriteLine(volume(2.5F, 8));

11. Console.WriteLine(volume(100L, 75, 15));

12. Console.ReadLine();

13. }

14.

15. static int volume(int x) {

16. return (x * x * x);

17. }

18.

19. static double volume(float r, int h) {

20. return (3.14 * r * r * h);

21. }

22.

23. static long volume(long l, int b, int h) {

24. return (l * b * h);

25. }

26. }

27. }

Note:

If we have a method that have two parameter object type and have a same name method with two integer parameter so when we call that method with int value so it’ll call that method have integer parameter instead of object type parameters method.

36. What is an Object Pool in .Net?

Answer:

Object Pooling is something that tries to keep a pool of objects in memory to be re-used later and hence it will reduce the load of object creation to a great extent. This article will try to explain this in detail. The example is for an Employee object, but you can make it general by using Object base class.

What does it mean?

Object Pool is nothing but a container of objects that are ready for use. Whenever there is a request for a new object, the pool manager will take the request and it will be served by allocating an object from the pool.

How it works?

We are going to use Factory pattern for this purpose. We will have a factory method, which will take care about the creation of objects. Whenever there is a request for a new object, the factory method will look into the object pool (we use Queue object). If there is any object available within the allowed limit, it will return the object (value object), otherwise a new object will be created and give you back.

37. What are generics in c#.net?

Answer:

Generics allow you to delay the specification of the data type of programming elements in a class or a method, until it is actually used in the program. In other words, generics allow you to write a class or method that can work with any data type.

You write the specifications for the class or the method, with substitute parameters for data types. When the compiler encounters a constructor for the class or a function call for the method, it generates code to handle the specific data type.



Generic classes and methods combine reusability, type safety and efficiency in a way that their non-generic counterparts cannot. Generics are most frequently used with collections and the methods that operate on them. Version 2.0 of the .NET Framework class library provides a new namespace, System.Collections.Generic, that contains several new generic-based collection classes. It is recommended that all applications that target the .NET Framework 2.0 and later use the new generic collection classes instead of the older non-generic counterparts such as ArrayList.

Features of Generics

Generics is a technique that enriches your programs in the following ways:

  • It helps you to maximize code reuse, type safety and performance.
  • You can create generic collection classes. The .NET Framework class library contains several new generic collection classes in the System.Collections.Generic namespace. You may use these generic collection classes instead of the collection classes in the System.Collections namespace.
  • You can create your own generic interfaces, classes, methods, events and delegates.
  • You may create generic classes constrained to enable access to methods on specific data types.
  • You may get information on the types used in a generic data type at run-time using reflection.

38. Describe the accessibility modifiers in c#.Net.

Answer:

Access modifiers are keywords used to specify the declared accessibility of a member or a type.

Why to use access modifiers?

Access modifiers are an integral part of object-oriented programming. They support the concept of encapsulation, which promotes the idea of hiding functionality. Access modifiers allow you to define who does or doesn't have access to certain features.

In C# there are 5 different types of Access Modifiers.

39. What is Virtual Method in C#?

Answer:

A virtual method is a method that can be redefined in derived classes. A virtual method has an implementation in a base class as well as derived the class. It is used when a method's basic functionality is the same but sometimes more functionality is needed in the derived class. A virtual method is created in the base class that can be overridden in the derived class. We create a virtual method in the base class using the virtual keyword and that method is overridden in the derived class using the override keyword.

When a method is declared as a virtual method in a base class then that method can be defined in a base class and it is optional for the derived class to override that method. The overriding method also provides more than one form for a method. Hence it is also an example for polymorphism.

When a method is declared as a virtual method in a base class and that method has the same definition in a derived class then there is no need to override it in the derived class. But when a virtual method has a different definition in the base class and the derived class then there is a need to override it in the derived class.

When a virtual method is invoked, the run-time type of the object is checked for an overriding member. The overriding member in the most derived class is called, which might be the original member, if no derived class has overridden the member.

Virtual Method

1. By default, methods are non-virtual. We can't override a non-virtual method.

2. We can't use the virtual modifier with the static, abstract, private or override modifiers.

40. What are the Difference between Array and ArrayList in C#.Net?

Answer:

Difference between Array and ArrayList

41. What you understand by Value types and Reference types in C#.Net?

Answer:

In C# data types can be of two types: Value Types and Reference Types. Value type variables contain their object (or data) directly. If we copy one value type variable to another then we are actually making a copy of the object for the second variable. Both of them will independently operate on their values, Value Type member will located into Stack and reference member will located in Heap always.

Let consider each case briefly.

1. Pure Value Type

Here I used a structure as a value type. It has an integer member. I created two instances of this structure. After wards I assigned second instance to the first one. Then I changed the state of second instance, but it hasn't effect the first one, as whole items are value type and assignments on those types will copy only values not references i.e. in a Value Type assignment, all instances have its own local copy of members.

2. Pure Reference Type

I created a class and added a "DataTable" as a Reference Type member for this class. Then I performed the assignments just like below. But the difference is that on changing the state of second instance, the state of first instance will automatically alter. So in a Reference Type assignment both Value and Reference will be assigned i.e. all instances will point to the single object.

3. Value Type With Reference Type

This case and the last case to come are more interesting. I used a structure in this particular scenario also. But this time it includes a Reference Type(A Custom Class Object) Member besides a Value Type (An Integer) Member. When you performing the assignments, it seems like a swallow copy, as Value Type member of first instance won't effected, but the Reference Type member will alter according to the second instance. So in this particular scenario, assignment of Reference Type member produced a reference to a single object and assignment of Value Type member produced a local copy of that member.

4. Reference Type With Value Type

Contrary to the above case, in this scenario, both Reference & Value Types will be effected. I.e. a Value Type member in a Reference Type will be shared among its instances.

42. What is Serialization?

Answer:

Serialization means saving the state of your object to secondary memory, such as a file.

Suppose you have a business layer where you have many classes to perform your business data.

Now suppose you want to test whether your business classes give the correct data out without verifying the result from the UI or from a database. Because it will take some time to process.

SO what you will you do my friend?

Here comes Serialization. You will serialize all your necessary business classes and save them into a text or XML file.

on your hard disk. So you can easily test your desired result by comparing your serialized saved data with.

your desired output data. You can say it is a little bit of autonomic unit testing performed by the developer.

There are three types of serialization:

1. Binary serialization (Save your object data into binary format).

2. Soap Serialization (Save your object data into binary format; mainly used in network related communication).

3. XmlSerialization (Save your object data into an XML file).

43. What is the use of Using statement in C#?

Answer:

The .Net Framework provides resource management for managed objects through the garbage collector - You do not have to explicitly allocate and release memory for managed objects. Clean-up operations for any unmanaged resources should performed in the destructor in C#. To allow the programmer to explicitly perform these clean-up activities, objects can provide a Dispose method that can be invoked when the object is no longer needed. The using statement in C# defines a boundary for the object outside of which, the object is automatically destroyed. The using statement is excited when the end of the "using" statement block or the execution exits the "using" statement block indirectly, for example - an exception is thrown. The "using" statement allows you to specify multiple resources in a single statement. The object could also be created outside the "using" statement. The objects specified within the using block must implement the IDisposable interface. The framework invokes the Dispose method of objects specified within the "using" statement when the block is exited.

44. What is jagged array in C#.Net?

Answer:

A jagged array is an array whose elements are arrays. The elements of a jagged array can be of different dimensions and sizes. A jagged array is sometimes called an "array of arrays."

A special type of array is introduced in C#. A Jagged Array is an array of an array in which the length of each array index can differ.

Example:

1. int[][] jagArray = new int[5][];

In the above declaration the rows are fixed in size. But columns are not specified as they can vary.

Declaring and initializing jagged array.

1. int[][] jaggedArray = new int[5][];

2.

3. jaggedArray[0] = new int[3];

4. jaggedArray[1] = new int[5];

5. jaggedArray[2] = new int[2];

6. jaggedArray[3] = new int[8];

7. jaggedArray[4] = new int[10];

8. jaggedArray[0] = new int[] { 3, 5, 7, };

9. jaggedArray[1] = new int[] { 1, 0, 2, 4, 6 };

10. jaggedArray[2] = new int[] { 1, 6 };

11. jaggedArray[3] = new int[] { 1, 0, 2, 4, 6, 45, 67, 78 };

12. jaggedArray[4] = new int[] { 1, 0, 2, 4, 6, 34, 54, 67, 87, 78 };

45. What is Multithreading with .NET?

Answer:

The real usage of a thread is not about a single sequential thread, but rather using multiple threads in a single program. Multiple threads running at the same time and performing various tasks is referred as Multithreading. A thread is considered to be a lightweight process because it runs within the context of a program and takes advantage of resources allocated for that program.


A single-threaded process contains only one thread while a multithreaded process contains more than one thread for execution.


System.Threading Namespace

Like many other features, in .NET, System.Threading is the namespace that provides various types to help in construction of multithreaded applications.

46. Explain Anonymous type in C#?

Answer:

Anonymous types allow us to create new type without defining them. This is way to defining read only properties into a single object without having to define type explicitly. Here Type is generating by the compiler and it is accessible only for the current block of code. The type of properties is also inferred by the compiler.

We can create anonymous types by using “new” keyword together with the object initializer.

Example

1. var anonymousData = new

2. {

3. ForeName = "Jignesh",

4. SurName = "Trivedi"

5. };

6. Console.WriteLine("First Name : " + anonymousData.ForeName);

Anonymous Types with LINQ Example

Anonymous types are also used with the "Select" clause of LINQ query expression to return subset of properties.

Example

If Any object collection having properties called FirstName , LastName, DOB etc. and you want only FirstName and LastName after the Querying the data then.

1. class MyData {

2. public string FirstName {

3. get;

4. set;

5. }

6. public string LastName {

7. get;

8. set;

9. }

10. public DateTime DOB {

11. get;

12. set;

13. }

14. public string MiddleName {

15. get;

16. set;

17. }

18. }

19. static void Main(string[] args) {

20. // Create Dummy Data to fill Collection.

21. List < MyData > data = new List < MyData > ();

22. data.Add(new MyData {

23. FirstName = "Jignesh", LastName = "Trivedi", MiddleName = "G", DOB = new DateTime(1990, 12, 30)

24. });

25. data.Add(new MyData {

26. FirstName = "Tejas", LastName = "Trivedi", MiddleName = "G", DOB = new DateTime(1995, 11, 6)

27. });

28. data.Add(new MyData {

29. FirstName = "Rakesh", LastName = "Trivedi", MiddleName = "G", DOB = new DateTime(1993, 10, 8)

30. });

31. data.Add(new MyData {

32. FirstName = "Amit", LastName = "Vyas", MiddleName = "P", DOB = newDateTime(1983, 6, 15)

33. });

34. data.Add(new MyData {

35. FirstName = "Yash", LastName = "Pandiya", MiddleName = "K", DOB = newDateTime(1988, 7, 20)

36. });

37. }

38. var anonymousData = from pl in data

39. select new {

40. pl.FirstName, pl.LastName

41. };

42. foreach(var m in anonymousData) {

43. Console.WriteLine("Name : " + m.FirstName + " " + m.LastName);

44. }

45. } 47. Explain Hashtable in C#?

Answer:

A Hashtable is a collection that stores (Keys, Values) pairs. Here, the Keys are used to find the storage location and is immutable and cannot have duplicate entries in the Hashtable. The .Net Framework has provided a Hash Table class that contains all the functionality required to implement a hash table without any additional development. The hash table is a general-purpose dictionary collection. Each item within the collection is a DictionaryEntry object with two properties: a key object and a value object. These are known as Key/Value. When items are added to a hash table, a hash code is generated automatically. This code is hidden from the developer. All access to the table's values is achieved using the key object for identification. As the items in the collection are sorted according to the hidden hash code, the items should be considered to be randomly ordered.

The Hashtable Collection

The Base Class libraries offers a Hashtable Class that is defined in the System.Collections namespace, so you don't have to code your own hash tables. It processes each key of the hash that you add every time and then uses the hash code to look up the element very quickly. The capacity of a hash table is the number of elements the hash table can hold. As elements are added to a hash table, the capacity is automatically increased as required through reallocation. It is an older .Net Framework type.

Declaring a Hashtable

The Hashtable class is generally found in the namespace called System.Collections. So to execute any of the examples, we have to add using System.Collections; to the source code. The declaration for the Hashtable is:

1. Hashtable HT = new Hashtable ();

48. What is LINQ in C#?

Answer:

LINQ stands for Language Integrated Query. LINQ is a data querying methodology which provides querying capabilities to .NET languages with a syntax similar to a SQL query

LINQ has a great power of querying on any source of data. The data source could be collections of objects, database or XML files. We can easily retrieve data from any object that implements the IEnumerable<T> interface.

Advantages of LINQ

1. LINQ offers an object-based, language-integrated way to query over data no matter where that data came from. So through LINQ we can query database, XML as well as collections.

2. Compile time syntax checking.

3. It allows you to query collections like arrays, enumerable classes etc in the native language of your application, like VB or C# in much the same way as you would query a database using SQL.

49. What is File Handling in C#.Net?

Answer:

The System.IO namespace provides four classes that allow you to manipulate individual files, as well as interact with a machine directory structure. The Directory and File directly extends System.Object and supports the creation, copying, moving and deletion of files using various static methods. They only contain static methods and are never instantiated. The FileInfo and DirecotryInfo types are derived from the abstract class FileSystemInfo type and they are typically, employed for obtaining the full details of a file or directory because their members tend to return strongly typed objects. They implement roughly the same public methods as a Directory and a File but they are stateful and the members of these classes are not static.


50. What is Reflection in C#.Net?

Answer:

Reflection typically is the process of runtime type discovery to inspect metadata, CIL code, late binding and self-generating code. At run time by using reflection, we can access the same "type" information as displayed by the ildasm utility at design time. The reflection is analogous to reverse engineering in which we can break an existing *.exe or *.dll assembly to explore defined significant contents information, including methods, fields, events and properties.

You can dynamically discover the set of interfaces supported by a given type using the System.Reflection namespace. This namespace contains numerous related types as follows:



Reflection typically is used to dump out the loaded assemblies list, their reference to inspect methods, properties etcetera. Reflection is also used in the external disassembling tools such Reflector, Fxcop and NUnit because .NET tools don't need to parse the source code similar to C++.

Metadata Investigation

The following program depicts the process of reflection by creating a console based application. This program will display the details of the fields, methods, properties and interfaces for any type within the mscorlib.dll assembly. Before proceeeding, it is mandatory to import "System.Reflection".

Here, we are defining a number of static methods in the program class to enumerate fields, methods and interfaces in the specified type. The static method takes a single "System.Type" parameter and returns void.

1. static void FieldInvestigation(Type t) {

2. Console.WriteLine("*********Fields*********");

3. FieldInfo[] fld = t.GetFields();

4. foreach(FieldInfo f in fld) {

5. Console.WriteLine("-->{0}", f.Name);

6. }

7. }

8.

9. static void MethodInvestigation(Type t) {

10. Console.WriteLine("*********Methods*********");

11. MethodInfo[] mth = t.GetMethods();

12. foreach(MethodInfo m in mth) {

13. Console.WriteLine("-->{0}", m.Name);

14. }

15. }

1) What is C-Sharp (C#)?

C# is a type-safe, managed and object oriented language, which is compiled by .Net framework for generating intermediate language (IL).

2) Explain the features of C#?

Below are some of the features supported in C# -

  • Constructors and Destructors
  • Properties
  • Passing Parameters
  • Arrays
  • Main
  • XML Documentation and
  • Indexers

3) List some of the advantages of C#?

Below are the advantages of C# -

  • Easy to learn
  • Object oriented
  • Component oriented
  • Part of .NET framework

4) What are IDE’s provided by Microsoft for C# development?

Below are the IDE’s used for C# development –

  • Visual Studio Express (VCE)
  • Visual Studio (VS)
  • Visual Web Developer

5) Explain the types of comments in C#?

Below are the types of comments in C# -

  • Single Line Comment Eg : //
  • Multiline Comments Eg: /* */
  • XML Comments Eg : ///

6) Explain sealed class in C#?

Sealed class is used to prevent the class from being inherited from other classes. So “sealed” modifier also can be used with methods to avoid the methods to override in the child classes.

7) Give an example of using sealed class in C#?

Below is the sample code of sealed class in C# -

class X {}
sealed class Y : X {}

Sealed methods –

class A
{
protected virtual void First() { }
protected virtual void Second() { }
}
class B : A
{
sealed protected override void First() {}
protected override void Second() { }
}

If any class inherits from class “B” then method – “First” will not be overridable as this method is sealed in class B.


8) List out the differences between Array and ArrayList in C#?

  • Array stores the values or elements of same data type but arraylist stores values of different datatypes.
  • Arrays will use the fixed length but arraylist does not uses fixed length like array.

9) Why to use “using” in C#?

“Using” statement calls – “dispose” method internally, whenever any exception occurred in any method call and in “Using” statement objects are read only and cannot be reassignable or modifiable.

10) Explain namespaces in C#?

Namespaces are containers for the classes. We will use namespaces for grouping the related classes in C#. “Using” keyword can be used for using the namespace in other namespace.

11) Why to use keyword “const” in C#? Give an example.

“Const” keyword is used for making an entity constant. We can’t reassign the value to constant.

Eg: const string _name = "Test";

12) What is the difference between “constant” and “readonly” variables in C#?

  • “Const” keyword is used for making an entity constant. We cannot modify the value later in the code. Value assigning is mandatory to constant variables.
  • “readonly” variable value can be changed during runtime and value to readonly variables can be assigned in the constructor or at the time of declaration.

13) Explain “static” keyword in C#?

“Static” keyword can be used for declaring a static member. If the class is made static then all the members of the class are also made static. If the variable is made static then it will have a single instance and the value change is updated in this instance.

14) What is the difference between “dispose” and “finalize” variables in C#?

  • Dispose - This method uses interface – “IDisposable” interface and it will free up both managed and unmanaged codes like – database connection, files etc.
  • Finalize - This method is called internally unlike Dispose method which is called explicitly. It is called by garbage collector and can’t be called from the code.

15) How the exception handling is done in C#?

In C# there is a “try… catch” block to handle the error.

16) Can we execute multiple catch blocks in C#?

No. Once any exception is occurred it executes specific exception catch block and the control comes out.

17) Why to use “finally” block in C#?

“Finally” block will be executed irrespective of exception. So while executing the code in try block when exception is occurred, control is returned to catch block and at last “finally” block will be executed. So closing connection to database / releasing the file handlers can be kept in “finally” block.

18) What is the difference between “finalize” and “finally” methods in C#?

  • Finalize – This method is used for garbage collection. So before destroying an object this method is called as part of clean up activity.
  • Finally – This method is used for executing the code irrespective of exception occurred or not.

19) What is the difference between “throw ex” and “throw” methods in C#?

  • “throw ex” will replace the stack trace of the exception with stack trace info of re throw point.
  • “throw” will preserve the original stack trace info.

20) Can we have only “try” block without “catch” block in C#?

Yes we can have only try block without catch block but we have to have finally block.

21) List out two different types of errors in C#?

Below are the types of errors in C# -

  • Compile Time Error
  • Run Time Error

22) Do we get error while executing “finally” block in C#?

Yes. We may get error in finally block.

23) Mention the assembly name where System namespace lies in C#?

Assembly Name – mscorlib.dll

24) What are the differences between static, public and void in C#?

  • Static classes/methods/variables are accessible throughout the application without creating instance. Compiler will store the method address as an entry point.
  • Public methods or variables are accessible throughout the application.
  • Void is used for the methods to indicate it will not return any value.

25) What is the difference between “out” and “ref” parameters in C#?

“out” parameter can be passed to a method and it need not be initialized where as “ref” parameter has to be initialized before it is used.

26) Explain Jagged Arrays in C#?

If the elements of an array is an array then it’s called as jagged array. The elements can be of different sizes and dimensions.

27) Can we use “this” inside a static method in C#?

No. We can’t use “this” in static method.

28) What are value types in C#?

Below are the list of value types in C# -

  • decimal
  • int
  • byte
  • enum
  • double
  • long
  • float

29) What are reference types in C#?

Below are the list of reference types in C# -

  • class
  • string
  • interface
  • object

30) Can we override private virtual method in C#?

No. We can’t override private virtual methods as it is not accessible outside the class.

Q #1) What is an Object and a Class?

Ans: A Class is an encapsulation of properties and methods that are used to represent a real-time entity. It is a data structure that brings all the instances together in a single unit.

An Object in an instance of a Class. Technically, it is just a block of memory allocated that can be stored in the form of Variables, Array or a Collection.

Q #2) What are the fundamental OOP concepts?

Ans: The four fundamental concepts of Object Oriented Programming are:

  • Encapsulation – The Internal representation of an object is hidden from the view outside object’s definition. Only the required information can be accessed whereas the rest of the data implementation is hidden.
  • Abstraction – It is a process of identifying the critical behavior and data of an object and eliminating the irrelevant details.
  • Inheritance – It is the ability to create new classes from another class. It is done by accessing, modifying and extending the behavior of objects in the parent class.
  • Polymorphism – The name means, one name, many forms. It is achieved by having multiple methods with the same name but different implementations.

Q #3) What is Managed and Unmanaged code?

Ans: Managed code is a code which is executed by CLR (Common Language Runtime) i.e all application code based on .Net Platform. It is considered as managed because of the .Net framework which internally uses the garbage collector to clear up the unused memory.

Unmanaged code is any code that is executed by application runtime of any other framework apart from .Net. The application runtime will take care of memory, security and other performance operations.

Q #4) What is an Interface?

Ans: An Interface is a class with no implementation. The only thing that it contains is the declaration of methods, properties, and events.

Q #5) What are the different types of classes in C#?

Ans: The different types of class in C# are:

  • Partial class – Allows its members to be divided or shared with multiple .cs files. It is denoted by the keyword Partial.
  • Sealed class – It is a class which cannot be inherited. To access the members of a sealed class, we need to create the object of the class. It is denoted by the keyword Sealed.
  • Abstract class – It is a class whose object cannot be instantiated. The class can only be inherited. It should contain at least one method. It is denoted by the keyword abstract.
  • Static class – It is a class which does not allow inheritance. The members of the class are also static. It is denoted by the keyword static. This keyword tells the compiler to check for any accidental instances of the static class.

Q #6) Explain Code compilation in C#.

Ans: There are four steps in code compilation which include:

  • Compiling the source code into Managed code by C# compiler.
  • Combining the newly created code into assemblies.
  • Loading the Common Language Runtime(CLR).
  • Executing the assembly by CLR.

Q #7) What are the differences between a Class and a Struct?

Ans: Given below are the differences between a Class and a Struct:

Class

Struct

Supports Inheritance

Does not support Inheritance

Class is Pass by reference (reference type)

Struct is Pass by Copy (Value type)

Members are private by default

Members are public by default

Good for larger complex objects

Good for Small isolated models

Can use waste collector for memory management

Cannot use Garbage collector and hence no Memory management

Q #8) What is the difference between Virtual method and Abstract method?

Ans: A Virtual method must always have a default implementation. However, it can be overridden in the derived class, though not mandatory. It can be overridden using override keyword.

An Abstract method does not have an implementation. It resides in the abstract class. It is mandatory that the derived class implements the abstract method. An override keyword is not necessary here though it can be used.

Q #9) Explain Namespaces in C#.

Ans: They are used to organize large code projects. “System” is the most widely used namespace in C#. We can create our own namespace and use one namespace in another, which are called Nested Namespaces.

They are denoted by the keyword “namespace”.

Q #10) What is “using” statement in C#?

Ans: “Using” Keyword denotes that the particular namespace is being used by the program.

For Example, using System . Here System is a namespace. The class Console is defined under System. So we can use the console.writeline (“….”) or readline in our program.

Q #11) Explain Abstraction.

Ans: Abstraction is one of the OOP concepts. It is used to display only the essential features of the class and hides the unnecessary information.

Let us take an Example of a Car:

A driver of the car should know the details about the Car such as color, name, mirror, steering, gear, brake, etc. What he doesn’t have to know is an Internal engine, Exhaust system.

So, Abstraction helps in knowing what is necessary and hiding the internal details from the outside world. Hiding of the internal information can be achieved by declaring such parameters as Private using the private keyword.

Q #12) Explain Polymorphism?

Ans: Programmatically, Polymorphism means same method but different implementations.

It is of 2 types, Compile-time and Runtime.

Compile time polymorphism is achieved by operator overloading.

Runtime polymorphism is achieved by overriding. Inheritance and Virtual functions are used during Runtime Polymorphism.

For Example , If a class has a method Void Add(), polymorphism is achieved by Overloading the method, that is, void Add(int a, int b), void Add(int add) are all overloaded methods.

Q #13) How is Exception Handling implemented in C#?

Ans: Exception handling is done using four keywords in C#:

  • try – Contains a block of code for which an exception will be checked.
  • catch – It is a program that catches an exception with the help of exception handler.
  • finally – It is a block of code written to execute regardless whether an exception is caught or not.
  • Throw – Throws an exception when a problem occurs.

Q #14) What are C# I/O Classes? What are the commonly used I/O Classes?

Ans: C# has System.IO namespace, consisting of classes that are used to perform various operations on files like creating, deleting, opening, closing etc.

Some commonly used I/O classes are:

  • File – Helps in manipulating a file.
  • StreamWriter – Used for writing characters to a stream.
  • StreamReader – Used for reading characters to a stream.
  • StringWriter – Used for reading a string buffer.
  • StringReader – Used for writing a string buffer.
  • Path – Used for performing operations related to path information.

Q #15) What is StreamReader/StreamWriter class?

Ans: StreamReader and StreamWriter are classes of namespace System.IO. They are used when we want to read or write charact90, Reader-based data, respectively.

Some of the members of StreamReader are: Close(), Read(), Readline().

Members of StreamWriter are: Close(), Write(), Writeline().

Class Program1

{

using(StreamReader sr = new StreamReader(“C:\ReadMe.txt”)

{

//----------------code to read-------------------//

}

using(StreamWriter sw = new StreamWriter(“C:\ReadMe.txt”))

{

//-------------code to write-------------------//

}

}

Q #16) What is a Destructor in C#?

Ans: A Destructor is used to clean up the memory and free the resources. But in C# this is done by the garbage collector on its own. System.GC.Collect() is called internally for cleaning up. But sometimes it may be necessary to implement destructors manually.

For Example:

~Car()

{

Console.writeline(“….”);

}

Q #17) What is an Abstract Class?

Ans: An Abstract class is a class which is denoted by abstract keyword and can be used only as a Base class. An Abstract class should always be inherited. An instance of the class itself cannot be created. If we do not want any program to create an object of a class, then such classes can be made abstract.

Any method in the abstract class does not have implementations in the same class. But they must be implemented in the child class.

For Example:

abstract class AB1

{

Public void Add();

}

Class childClass : AB1

{

childClass cs = new childClass ();

int Sum = cs.Add();

}

All the methods in an abstract class are implicitly virtual methods. Hence virtual keyword should not be used with any methods in abstract class.

Q #18) What are Boxing and Unboxing?

Ans: Converting a value type to reference type is called Boxing.

For Example:

int Value1 -= 10;

//————Boxing——————//

object boxedValue = Value1;

Explicit conversion of same reference type (created by boxing) back to value type is called Unboxing.

For Example:

//————UnBoxing——————//

int UnBoxing = int (boxedValue);

Q #19) What is the difference between Continue and Break Statement?

Ans: Break statement breaks the loop. It makes the control of the program to exit the loop. Continue statement makes the control of the program to exit only the current iteration. It does not break the loop.

Q #20) What is the difference between finally and finalize block?

Ans: finally block is called after the execution of try and catch block. It is used for exception handling. Regardless of whether an exception is caught or not, this block of code will be executed. Usually, this block will have clean-up code.

finalize method is called just before garbage collection. It is used to perform clean up operations of Unmanaged code. It is automatically called when a given instance is not subsequently called.

Questions on Arrays and Strings

Q #21) What is an Array? Give the syntax for a single and multi-dimensional array?

Ans: An Array is used to store multiple variables of the same type. It is a collection of variables stored in a contiguous memory location.

For Example:

double numbers = new double[10];

int[] score = new int[4] {25,24,23,25};

A Single dimensional array is a linear array where the variables are stored in a single row. Above example is a Single dimensional array.

Arrays can have more than one dimension. Multidimensional arrays are also called rectangular arrays.

For Example , int[,] numbers = new int[3,2] { {1,2} ,{2,3},{3,4} };

Q #22) What is a Jagged Array?

Ans: A Jagged array is an array whose elements are arrays. It is also called as the array of arrays. It can be either single or multiple dimensions.

int[] jaggedArray = new int[4][];

Q #23) Name some properties of Array.

Ans: Properties of an Array include:

  • Length – Gets the total number of elements in an array.
  • IsFixedSize – Tells whether the array is fixed in size or not.
  • IsReadOnly – Tells whether the array is read-only or not.

Q #24) What is an Array Class?

Ans: An Array class is the base class for all arrays. It provides many properties and methods. It is present in the namespace System.

Q #25) What is a String? What are the properties of a String Class?

Ans: A String is a collection of char objects. We can also declare string variables in c#.

string name = “C# Questions”;

A string class in C# represents a string.

The properties of String class are Chars and Length.
Chars get the Char object in the current String.
Length gets the number of objects in the current String.

Q #26) What is an Escape Sequence? Name some String escape sequences in C#.

Ans: An Escape sequence is denoted by a backslash (\). The backslash indicates that the character that follows it should be interpreted literally or it is a special character. An escape sequence is considered as a single character.

String escape sequences are as follows:

\n – Newline character
\b – Backspace
\\ – Backslash
\’ – Single quote
\’’ – Double Quote

Q #27) What are Regular expressions? Search a string using regular expressions?

Ans: Regular expression is a template to match a set of input. The pattern can consist of operators, constructs or character literals. Regex is used for string parsing and replacing the character string.

For Example:

* matches the preceding character zero or more times. So, a*b regex is equivalent to b, ab, aab, aaab and so on.

Searching a string using Regex

static void Main(string[] args)

{

string[] languages = { "C#", "Python", "Java" };

foreach(string s in languages)

{

if(System.Text.RegularExpressions.Regex.IsMatch(s,"Python"))

{

Console.WriteLine("Match found");

}

}

}

The above example searches for “Python” against the set of inputs from the languages array. It uses Regex.IsMatch which returns true in case if the pattern is found in the input. The pattern can be any regular expression representing the input that we want to match.

Q #28) What are the basic String Operations? Explain.

Ans: Some of the basic string operations are:

  • Concatenate –Two strings can be concatenated either by using System.String.Concat or by using + operator.
  • Modify – Replace(a,b) is used to replace a string with another string. Trim() is used to trim the string at the end or at the beginning.
  • Compare – System.StringComparison() is used to compare two strings, either case-sensitive comparison or not case sensitive. Mainly takes two parameters, original string, and string to be compared with.
  • Search – StartWith, EndsWith methods are used to search a particular string.

Q #29) What is Parsing? How to Parse a Date Time String?

Ans: Parsing is converting a string into another data type.

For Example:

string text = “500”;

int num = int.Parse(text);

500 is an integer. So, Parse method converts the string 500 into its own base type, i.e int.

Follow the same method to convert a DateTime string.
string dateTime = “Jan 1, 2018”;
DateTime parsedValue = DateTime.Parse(dateTime);

Advanced Concepts

Q #30) What is a Delegate? Explain.

Ans: A Delegate is a variable that holds the reference to a method. Hence it is a function pointer of reference type. All Delegates are derived from System.Delegate namespace. Both Delegate and the method that it refers to can have the same signature.



Declaring a delegate: public delegate void AddNumbers(int n);

After the declaration of a delegate, the object must be created of the delegate using the new keyword.

AddNumbers an1 = new AddNumbers(number);

The delegate provides a kind of encapsulation to the reference method, which will internally get called when a delegate is called.

public delegate int myDel(int number);

public class Program

{

public int AddNumbers(int a)

{

int Sum = a + 10;

return Sum;

}

public void Start()

{

myDel DelgateExample = AddNumbers;

}

}

In the above example, we have a delegate myDel which takes an integer value as a parameter. Class Program has a method of the same signature as the delegate, called AddNumbers().

If there is another method called Start() which creates an object of the delegate, then the object can be assigned to AddNumbers as it has the same signature as that of the delegate.

Q #31) What are Events?

Ans: Events are user actions that generate notifications to the application to which it must respond. The user actions can be mouse movements, keypress and so on.

Programmatically, a class that raises an event is called a publisher and a class which responds/receives the event is called a subscriber. An Event should have at least one subscriber else that event is never raised.

Delegates are used to declare Events.

Public delegate void PrintNumbers();

Event PrintNumbers myEvent;

Q #32) How to use Delegates with Events?

Ans: Delegates are used to raise events and handle them. Always a delegate needs to be declared first and then the Events are declared.

Let us see an Example:

Consider a class called Patient. Consider two other classes, Insurance, and Bank which requires Death information of the Patient from patient class. Here, Insurance and Bank are the subscribers and the Patient class becomes the Publisher. It triggers the death event and the other two classes should receive the event.

namespace ConsoleApp2

{

public class Patient

{

public delegate void deathInfo();//Declaring a Delegate//

public event deathInfo deathDate;//Declaring the event//

public void Death()

{

deathDate();

}

}

public class Insurance

{

Patient myPat = new Patient();

void GetDeathDetails()

{

//-------Do Something with the deathDate event------------//

}

void Main()

{

//--------Subscribe the function GetDeathDetails----------//

myPat.deathDate += GetDeathDetails;

}

}

public class Bank

{

Patient myPat = new Patient();

void GetPatInfo ()

{

//-------Do Something with the deathDate event------------//

}

void Main()

{

//--------Subscribe the function GetPatInfo ----------//

myPat.deathDate += GetPatInfo;

}

}

}

Q #33) What are the different types of Delegates?

Ans: The Different types of Delegates are:

Single Delegate – A delegate which can call a single method.

Multicast Delegate – A delegate which can call multiple methods. + and – operators are used to subscribe and unsubscribe respectively.

Generic Delegate – It does not require an instance of delegate to be defined. It is of three types, Action, Funcs and Predicate.

  • Action – In the above example of delegates and events, we can replace the definition of delegate and event using Action keyword. The Action delegate defines a method that can be called on arguments but does not return a result

Public delegate void deathInfo();

Public event deathInfo deathDate;

//Replacing with Action//

Public event Action deathDate;

Action implicitly refers to a delegate.

  • Func – A Func delegate defines a method that can be called on arguments and returns a result.

Func <int, string, bool> myDel is same as delegate bool myDel(int a, string b);

  • Predicate – Defines a method that can be called on arguments and always returns the bool.

Predicate<string> myDel is same as delegate bool myDel(string s);

Q #34) What do Multicast Delegates mean?

Ans: A Delegate that points to more than one method is called a Multicast Delegate. Multicasting is achieved by using + and += operator.

Consider the Example from question 32.

There are two subscribers for deathEvent, GetPatInfo, and GetDeathDetails. And hence we have used += operator. It means whenever the myDel is called, both the subscribers get called. The delegates will be called in the order in which they are added.

Q #35) Explain Publishers and Subscribers in Events.

Ans: A Publisher is a class responsible for publishing a message of different types of other classes. The message is nothing but Event as discussed in the above questions.

From the Example in Question 32, Class Patient is the Publisher class. It is generating an Event deathEvent, which the other classes receive.

Subscribers capture the message of the type that it is interested in. Again, from the Example of Question 32, Class Insurance and Bank are Subscribers. They are interested in event deathEvent of type void.

Q #36) What are Synchronous and Asynchronous operations?

Ans: Synchronization is a way to create a thread-safe code where only one thread can access the resource at any given time.

Asynchronous call waits for the method to complete before continuing with the program flow. Synchronous programming badly affects the UI operations, when the user tries to perform time-consuming operations since only one thread will be used.

In Asynchronous operation, the method call will immediately return so that the program can perform other operations while the called method completes its work in certain situations.

In C#, Async and Await keywords are used to achieve asynchronous programming. Look at Question 43 for more details on synchronous programming.

Q #37) What is Reflection in C#?

Ans: Reflection is the ability of a code to access the metadata of the assembly during runtime. A program reflects upon itself and uses the metadata to inform the user or modify its behavior. Metadata refers to information about objects, methods.

The namespace System.Reflection contains methods and classes that manage the information of all the loaded types and methods. It is mainly used for windows applications, for Example, to view the properties of a button in a windows form.

The MemberInfo object of the class reflection is used to discover the attributes associated with a class.

Reflection is implemented in two steps, first, we get the type of the object, and then we use the type to identify members such as methods and properties.

To get type of a class, we can simply use

Type mytype = myClass.GetType();

Once we have a type of class, the other information of the class can be easily accessed.

System.Reflection.MemberInfo Info = mytype.GetMethod(“AddNumbers”);

Above statement tries to find a method with name AddNumbers in the class myClass.

Q #38) What is a Generic Class?

Ans: Generics or Generic class is used to create classes or objects which do not have any specific data type. The data type can be assigned during runtime, i.e when it is used in the program.

Q #39) Explain Get and Set Accessor properties?

Ans: Get and Set are called Accessors. These are made use by Properties. A property provides a mechanism to read, write the value of a private field. For accessing that private field, these accessors are used.

Get Property is used to return the value of a property
Set Property accessor is used to set the value.

Q #40) What is a Thread? What is Multithreading?

Ans: A Thread is a set of instructions that can be executed, which will enable our program to perform concurrent processing. Concurrent processing helps us do more than one operation at a time. By default, C# has only one thread. But the other threads can be created to execute the code in parallel with the original thread.

Thread has a life cycle. It starts whenever a thread class is created and is terminated after the execution. System.Threading is the namespace which needs to be included to create threads and use its members.

Threads are created by extending the Thread Class. Start() method is used to begin thread execution.

//CallThread is the target method//

ThreadStart methodThread = new ThreadStart(CallThread);

Thread childThread = new Thread(methodThread);

childThread.Start();

C# can execute more than one task at a time. This is done by handling different processes by different threads. This is called MultiThreading.

There are several thread methods that are used to handle the multi-threaded operations:

Start, Sleep, Abort, Suspend, Resume and Join.

Most of these methods are self-explanatory.

Q #41) Name some properties of Thread Class.

Ans: Few Properties of thread class are:

  • IsAlive – contains value True when a thread is Active.
  • Name – Can return the name of the thread. Also, can set a name for the thread.
  • Priority – returns the prioritized value of the task set by the operating system.
  • IsBackground – gets or sets a value which indicates whether a thread should be a background process or foreground.
  • ThreadState – describes the thread state.

Q #42) What are the different states of a Thread?

Different states of a thread are:

  • Unstarted – Thread is created.
  • Running – Thread starts execution.
  • WaitSleepJoin – Thread calls sleep, calls wait on another object and calls join on another thread.
  • Suspended – Thread has been suspended.
  • Aborted – Thread is dead but not changed to state stopped.
  • Stopped – Thread has stopped.

Q #43) What are Async and Await?

Ans: Async and Await keywords are used to create asynchronous methods in C.

Asynchronous programming means that the process runs independently of main or other processes.

Usage of Async and Await is as shown below:

  • Async keyword is used for the method declaration.
  • The count is of a task of type int which calls the method CalculateCount().
  • Calculatecount() starts execution and calculates something.
  • Independent work is done on my thread and then await count statement is reached.
  • If the Calculatecount is not finished, myMethod will return to its calling method, thus the main thread doesn’t get blocked.
  • If the Calculatecount is already finished, then we have the result available when the control reaches await count. So the next step will continue in the same thread. However, it is not the situation in the above case where Delay of 1 second is involved.

Q #44) What is a Deadlock?

Ans: A Deadlock is a situation where a process is not able to complete its execution because two or more processes are waiting for each other to finish. This usually occurs in multi-threading.

Here a Shared resource is being held by a process and another process is waiting for the first process to release it and the thread holding the locked item is waiting for another process to complete.

Consider the below Example:

  • Perform tasks accesses objB and waits for 1 second.
  • Meanwhile, PerformtaskB tries to access ObjA.
  • After 1 second, PeformtaskA tries to access ObjA which is locked by PerformtaskB.
  • PerformtaskB tries to access ObjB which is locked by PerformtaskA.

This creates Deadlock.

Q #45) Explain Lock, Monitors, and Mutex Object in Threading.

Ans: Lock keyword ensures that only one thread can enter a particular section of the code at any given time. In the above Example, lock(ObjA) means the lock is placed on ObjA until this process releases it, no other thread can access ObjA.

A Mutex is also like a lock but it can work across multiple processes at a time. WaitOne() is used to lock and ReleaseMutex() is used to release the lock. But Mutex is slower than lock as it takes time to acquire and release it.

Monitor.Enter and Monitor.Exit implements lock internally. a lock is a shortcut for Monitors. lock(objA) internally calls.

Monitor.Enter(ObjA);

try

{

}

Finally {Monitor.Exit(ObjA));}

Q #46) What is a Race Condition?

Ans: A Race condition occurs when two threads access the same resource and are trying to change it at the same time. The thread which will be able to access the resource first cannot be predicted.

If we have two threads, T1 and T2, and they are trying to access a shared resource called X. And if both the threads try to write a value to X, the last value written to X will be saved.

Q #47) What is Thread Pooling?

Ans: A Thread pool is a collection of threads. These threads can be used to perform tasks without disturbing the primary thread. Once the thread completes the task, the thread returns to the pool.

System.Threading.ThreadPool namespace has classes which manage the threads in the pool and its operations.

System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(SomeTask));

The above line queues a task. SomeTask methods should have a parameter of type Object.

Q #48) What is Serialization?

Ans: Serialization is a process of converting a code to its binary format. Once it is converted to bytes, it can be easily stored and written to a disk or any such storage devices. Serializations are mainly useful when we do not want to lose the original form of the code and it can be retrieved anytime in the future.

Any class which is marked with the attribute [Serializable] will be converted to its binary form.

The reverse process of getting the c# code back from the binary form is called Deserialization.

To Serialize an object we need the object to be serialized, a stream which can contain the serialized object and namespace System.Runtime.Serialization can contain classes for serialization.

Q #49) What are the types of Serialization?

Ans: The different types of Serialization are: XML serialization, SOAP, and Binary.

  • XML serialization – It serializes all the public properties to the XML document. Since the data is in XML format, it can be easily read and manipulated in various formats. The classes reside in System.sml.Serialization.
  • SOAP – Classes reside in System.Runtime.Serialization. Similar to XML but produces a complete SOAP compliant envelope which can be used by any system that understands SOAP.
  • Binary Serialization – Allows any code to be converted to its binary form. Can serialize and restore public and non-public properties. It is faster and occupies less space.

Q #50) What is an XSD file?

Ans: An XSD file stands for XML Schema Definition. It gives a structure for the XML file. It means it decides the elements that the XML should have and in what order and what properties should be present. Without an XSD file associated with XML, the XML can have any tags, any attributes, and any elements.

Xsd.exe tool converts the files to XSD format. During Serialization of C# code, the classes are converted to XSD compliant format by xsd.exe.

1. What is C#?

C# is an object oriented, type safe and managed language that is compiled by .Net framework to generate Microsoft Intermediate Language.

2. What are the types of comment in C# with examples?

Single line

Eg:

1

//This is a Single line comment

ii. Multiple line (/* */)

Eg:

1

2

3

/*This is a multiple line comment

We are in line 2

Last line of comment*/

iii. XML Comments (///).

Eg:

1

2

3

/// summary;

/// Set error message for multilingual language.

/// summary

3. Can multiple catch blocks be executed?

No, Multiple catch blocks can’t be executed. Once the proper catch code executed, the control is transferred to the finally block and then the code that follows the finally block gets executed.

4. What is the difference between public, static and void?

Public declared variables or methods are accessible anywhere in the application. Static declared variables or methods are globally accessible without creating an instance of the class. Static member are by default not globally accessible it depends upon the type of access modified used. The compiler stores the address of the method as the entry point and uses this information to begin execution before any objects are created. And Void is a type modifier that states that the method or variable does not return any value.

5. What is an object?


An object is an instance of a class through which we access the methods of that class. “New” keyword is used to create an object. A class that creates an object in memory will contain the information about the methods, variables and behavior of that class.

6. Define Constructors?

A constructor is a member function in a class that has the same name as its class. The constructor is automatically invoked whenever an object class is created. It constructs the values of data members while initializing the class.

7. What is Jagged Arrays?

The array which has elements of type array is called jagged array. The elements can be of different dimensions and sizes. We can also call jagged array as Array of arrays.

8. What is the difference between ref & out parameters?

An argument passed as ref must be initialized before passing to the method whereas out parameter needs not to be initialized before passing to a method.

9. What is the use of using statement in C#?

The using block is used to obtain a resource and use it and then automatically dispose of when the execution of block completed.

10. What is serialization?

When we want to transport an object through network then we have to convert the object into a stream of bytes. The process of converting an object into a stream of bytes is called Serialization. For an object to be serializable, it should implement ISerialize Interface. De-serialization is the reverse process of creating an object from a stream of bytes.

11. Can “this” be used within a static method?

We can’t use ‘This’ in a static method because we can only use static variables/methods in a static method.

12. What is difference between constants and read-only?

Constant variables are declared and initialized at compile time. The value can’t be changed afterwards. Read only is used only when we want to assign the value at run time.

13. What is an interface class?

Interface is an abstract class which has only public abstract methods and the methods only have the declaration and not the definition. These abstract methods must be implemented in the inherited classes.

14. What are value types and reference types?

Value types are stored in the Stack whereas reference types stored on heap.
Value types:

1

int, enum , byte, decimal, double, float, long

Reference Types:

1

string , class, interface, object

15. What are Custom Control and User Control?

Custom Controls are controls generated as compiled code (Dlls), those are easier to use and can be added to toolbox. Developers can drag and drop controls to their web forms. Attributes can be set at design time. We can easily add custom controls to Multiple Applications (If Shared Dlls), If they are private then we can copy to dll to bin directory of web application and then add reference and can use them.
User Controls are very much similar to ASP include files, and are easy to create. User controls can’t be placed in the toolbox and dragged – dropped from it. They have their design and code behind. The file extension for user controls is ascx.

16. What are sealed classes in C#?

We create sealed classes when we want to restrict the class to be inherited. Sealed modifier used to prevent derivation from a class. If we forcefully specify a sealed class as base class then a compile-time error occurs.

17. What is method overloading?

Method overloading is creating multiple methods with the same name with unique signatures in the same class. When we compile, the compiler uses overload resolution to determine the specific method to be invoke.

18. What is the difference between Array and Arraylist?

In an array, we can have items of the same type only. The size of the array is fixed. An arraylist is similar to an array but it doesn’t have a fixed size.

19. Can a private virtual method be overridden?

No, because they are not accessible outside the class.

20. Describe the accessibility modifier “protected internal”.

Protected Internal variables/methods are accessible within the same assembly and also from the classes that are derived from this parent class.


21. What are the differences between System.String and System.Text.StringBuilder classes?

System.String is immutable. When we modify the value of a string variable then a new memory is allocated to the new value and the previous memory allocation released. System.StringBuilder was designed to have concept of a mutable string where a variety of operations can be performed without allocation separate memory location for the modified string.

22. What’s the difference between the System.Array.CopyTo() and System.Array.Clone() ?

Using Clone() method, we creates a new array object containing all the elements in the original array and using CopyTo() method, all the elements of existing array copies into another existing array. Both the methods perform a shallow copy.

23. How can we sort the elements of the array in descending order?

Using Sort() methods followed by Reverse() method.

24. Write down the C# syntax to catch exception?

To catch an exception, we use try catch blocks. Catch block can have parameter of system.Exception type.

Eg:

1

2

3

4

5

6

7

try

{

GetAllData();

}

catch(Exception ex)

{

}

In the above example, we can omit the parameter from catch statement.

25. What’s the difference between an interface and abstract class?

Interfaces have all the methods having only declaration but no definition. In an abstract class, we can have some concrete methods. In an interface class, all the methods are public. An abstract class may have private methods.

26. What is the difference between Finalize() and Dispose() methods?

Dispose() is called when we want for an object to release any unmanaged resources with them. On the other hand Finalize() is used for the same purpose but it doesn’t assure the garbage collection of an object.

27. What are circular references?

Circular reference is situation in which two or more resources are interdependent on each other causes the lock condition and make the resources unusable.

28. What are generics in C#.NET?

Generics are used to make reusable code classes to decrease the code redundancy, increase type safety and performance. Using generics, we can create collection classes. To create generic collection, System.Collections.Generic namespace should be used instead of classes such as ArrayList in the System.Collections namespace. Generics promotes the usage of parameterized types.

29. What is an object pool in .NET?

An object pool is a container having objects ready to be used. It tracks the object that is currently in use, total number of objects in the pool. This reduces the overhead of creating and re-creating objects.

30. List down the commonly used types of exceptions in .Net?

ArgumentException, ArgumentNullException , ArgumentOutOfRangeException, ArithmeticException, DivideByZeroException ,OverflowException , IndexOutOfRangeException ,InvalidCastException ,InvalidOperationException , IOEndOfStreamException , NullReferenceException , OutOfMemoryException , StackOverflowException etc.

31. What are Custom Exceptions?

Sometimes there are some errors that need to be handeled as per user requirements. Custom exceptions are used for them and are used defined exceptions.

32. What are delegates?

Delegates are same are function pointers in C++ but the only difference is that they are type safe unlike function pointers. Delegates are required because they can be used to write much more generic type safe functions.

33. How do you inherit a class into other class in C#?

Colon is used as inheritance operator in C#. Just place a colon and then the class name.

1

public class DerivedClass : BaseClass

34. What is the base class in .net from which all the classes are derived from?

1

System.Object

35. What is the difference between method overriding and method overloading?

In method overriding, we change the method definition in the derived class that changes the method behavior. Method overloading is creating a method with the same name within the same class having different signatures.

36. What are the different ways a method can be overloaded?

Methods can be overloaded using different data types for parameter, different order of parameters, and different number of parameters.

37. Why can’t you specify the accessibility modifier for methods inside the interface?

In an interface, we have virtual methods that do not have method definition. All the methods are there to be overridden in the derived class. That’s why they all are public.

38. How can we set class to be inherited, but prevent the method from being over-ridden?

Declare the class as public and make the method sealed to prevent it from being overridden.

39. What happens if the inherited interfaces have conflicting method names?

Implement is up to you as the method is inside your own class. There might be problem when the methods from different interfaces expect different data, but as far as compiler cares you’re okay.

40. What is the difference between a Struct and a Class?

Structs are value-type variables and classes are reference types. Structs stored on the stack, causes additional overhead but faster retrieval. Structs cannot be inherited.

41. How to use nullable types in .Net?

Value types can take either their normal values or a null value. Such types are called nullable types.

1

2

3

4

Int? someID = null;

If(someID.HasVAlue)

{

}

42. How we can create an array with non-default values?

We can create an array with non-default values using Enumerable.Repeat.

43. What is difference between is and as operators in c#?

“is” operator is used to check the compatibility of an object with a given type and it returns the result as Boolean.

“as” operator is used for casting of object to a type or a class.

44. What’s a multicast delegate?

A delegate having multiple handlers assigned to it is called multicast delegate. Each handler is assigned to a method.

45. What are indexers in C# .NET?

Indexers are known as smart arrays in C#. It allows the instances of a class to be indexed in the same way as array.

Eg:

1

public int this[int index] // Indexer declaration

46. What is difference between the “throw” and “throw ex” in .NET?

“Throw” statement preserves original error stack whereas “throw ex” have the stack trace from their throw point. It is always advised to use “throw” because it provides more accurate error information.

47. What are C# attributes and its significance?

C# provides developers a way to define declarative tags on certain entities eg. Class, method etc. are called attributes. The attribute’s information can be retrieved at runtime using Reflection.

48. How to implement singleton design pattern in C#?

In singleton pattern, a class can only have one instance and provides access point to it globally.

Eg:

1

2

3

4

Public sealed class Singleton

{

Private static readonly Singleton _instance = new Singleton();

}

49. What is the difference between directcast and ctype?

DirectCast is used to convert the type of an object that requires the run-time type to be the same as the specified type in DirectCast.

Ctype is used for conversion where the conversion is defined between the expression and the type.

50. Is C# code is managed or unmanaged code?

C# is managed code because Common language runtime can compile C# code to Intermediate language.

1) What is C#?

C# is a simple, modern, general purpose programming language. It is an object oriented programming language developed by Microsoft. It is a safe and managed language that is compiled by .NET framework to generate Microsoft intermediate language (machine code).


2) What is the reason behind the invention of C#?

C# is designed for Common Language Infrastructure (CLI). It contains the executable code and runtime environment that makes the users able to use various high-level languages on different computer platforms and architectures.


3) What are the main reasons to use C# language?

These are top reasons to use C# language:

  • Easy to learn
  • General purpose and object oriented programming language
  • Component oriented
  • Structured language
  • Can be compiled on variety of computer platforms
  • Produces efficient programs
  • Part of .net framework

4) What is the difference between public, static and void?

You can access public declared variables anywhere in the application.

Static declared variables are globally accessible without creating an instance of the class.

Void is a type modifier that specifies that the method doesn't return any value.

5) What are constructors in C#?

A constructor is a member function in the class and has the same name as its class. Whenever the object class is created, the constructor is automatically invoked. It constructs the value of data members while initializing the class.


6) What are the different types of constructors in C#?

Basically, there are five types of constructors:

  • Static constructor
  • Private constructor
  • Copy constructor
  • Default constructor
  • Parameterized constructor

7) What is static constructor?

Static constructor is used to initialize static data members as soon as the class is referenced first time.


8) What is method overloading in C#?

Method overloading is mechanism to create multiple methods with the same name and unique signature in the same class. When you go for compilation, the compiler uses overload resolution to determine the specific method to be invoked.


9) Is overriding of a function possible in the same class?

No


10) What is array?

Array is a set of related instances either value or reference types.

There are three types of array supported by C#:

  • Single Dimensional Array : It contains a single row. It is also known as vector array.
  • Multi Dimensional Array : It is rectangular and contains rows and columns.
  • Jagged Array : It also contains rows and columns but it has an irregular shape.

11) What is ArrayList?

ArrayList is a dynamic array. You can add and remove the elements from an ArrayList at runtime. In the ArrayList, elements are not automatically sorted.


12) What is a collection?

A collection works as a container for instances of other classes. All classes implement ICollection interface.


13) What is an interface?

Interface is an abstract class that has only public abstract method. These methods only have declaration not the definition. These abstract methods must be implemented in the inherited classes.


14) What is the lock statement in C#?

Lock statement is used to ensure that one thread doesn?t enter a critical section of code while another thread is in the critical section. If another thread attempts to enter a locked code it will wait, block, until the object is released.


15) What is serialization?

If you want to transport an object through network then you have to convert the object into a stream of bytes. The process of converting an object into a stream of bytes is called serialization.


16) How to declare a property in a class?

1. int m_PersonID = 0;

2. public int PersonID

3. {

4. get { return m_PersonID; }

5. set { m_PersonID = value; }

6. }


17) What is the difference between early binding and late binding in C#?

Early binding and late binding are the concept of polymorphism. There are two types of polymorphism in C#.

  • Compile Time Polymorphism : It is also known as early binding.
  • Run Time Polymorphism : It is also known as late binding or method overriding or dynamic polymorphism.

18) Which are the access modifiers available in C#?

Following are the access modifiers generally used for accessibility:

  • Public : If you define an attribute or method as public, it can be accessed from any code of the project.
  • Private : A private defined attribute or method can be accessed by any code within the containing class only.
  • Protected : If you define the method or attribute as protected it can be accessed by any method in the inherited classes and any method within the same class.
  • Internal : If you define an attribute or a method as internal, it is restricted to classes within the current position assembly.
  • Protected internal : If you define an attribute or method as protected internal, access is restricted to classes within the current project assembly or types derived from the containing class.

19) What is the difference between abstract class and interface in C#?

Abstract class can have abstract and concrete methods whereas interface has only abstract methods.


20) What is the difference between dispose() and finalize() methods in C#?

The dispose() method is explicitly called by user to free unmanaged resources such as files, database connections etc whereas finalize() method is implicitly called by garbage collector to free unmanaged resources like files, database connections etc.

The dispose() method belongs to IDisposable interface whereas finalize() method belongs the Object class.


21) What is the difference between method overloading and method overriding in C#?

Method parameters must be different in method overloading whereas it must be same in method overriding.

Inheritance is not required in method overloading, it occurs within the same class. But inheritance is required in method overriding.


22) What is object pool in .Net?

Object pool is a container of ready to use objects. It reduces the overhead of creating new object.


23) What is delegate in C#?

A delegate in C# is an object that holds the reference to a method. It is like function pointer in C++.


24) What is Hashtable?

A Hashtable is a collection of key/value pairs. It contains values based on the key.


25) What is Reflection?

Reflection allows us to get metadata and assemblies of an object at runtime.


26) What is Garbage Collection?

Garbage Collection is a process of releasing memory automatically occupied by objects which are no longer accessible.

Question 1: So what makes your code really object-oriented?

In order to understand this, we must first analyze what benefits we can derive from OO. In order to do this, we must clearly understand its foundation.

So given that C# is at its core object-oriented, most interviewers might be tempted to ask the following question:

Question 2: What are the fundamental principles of OO programming?

As a developer, you might be tempted to answer that it comprises things like Encapsulation, Polymorphism, Abstraction, and Inheritance. Although this is true, it doesn’t really explain the fundamental core of what OO is and what its benefits are.

Principles are crucial but they are not the most important aspect of what OO actually is. What is really important is to understand in what grounds OO is built upon, or in other words, what are the foundations of OO programming.

The two most fundamental core concepts on which OO has been built upon in C# are this pointer and Dynamic Dispatch.

Obviously, there are principles like Encapsulation, Polymorphism, Abstraction, and Inheritance, but these are the consequence and not the generating force behind the OO paradigm in C#.

Question 3: What is the this Pointer?

The this pointer is silently passed with a call to an instance-level function, which then operates on an object (instance of a class).

Basically, this core mechanism makes it possible to bring operations close to data. It also eliminates the need to have global functions and it gives data structures the intrinsic ability to perform operations on its data.

So, having said this, if we now raise the following question:

Question 4: What is the OO fundamental idea using C# that allows a data structure to perform operations on its own data?

What would your answer be? Pretty obvious. The humble this pointer.

Notice that despite this being a mind-bending idea, we can already start to appreciate the bigger picture for which C# was designed.

The this pointer is basically a way for a data structure (object) to be able to access methods that allow itself to perform operations on its own data. It is a way to manage state within a data structure.

Now let’s talk a bit about the other core concept that takes this to the next level.

Question 5: What is Dynamic Dispatch?

Dynamic Dispatch becomes possible when each object carries data about its generating type, which is basically the object’s duty.

It is possible to achieve this when the type is able to keep track by using a virtual functions table, becoming the type’s duty. This allows an object to override some functions which have been inherited from its base type.

The bottom line is that when we place a call to a function, we don’t really know in an OO paradigm which function is really going to be executed.

In fact, it is the runtime’s duty to jump in when a call is placed on an object and determine which concrete function address to invoke, by looking at its generating type.

This constitutes the base of Polymorphism. If this sounds a bit intimidating, it will become clearer with an example going forward.

OO as a Mindset

One key aspect to understand is that it is possible to write OO code in a structured language like C, although the language itself was not designed with that paradigm in mind.

So it is not really the programming language that is object-oriented, but it’s more how we interact with it—how we use it.

It is true though those languages that are built from the ground up with OO fundamental core concepts and principles such as C#, make it easier for developers to implement code that is OO compliant, however, it is still largely known that many developers still use the language like they would use a procedural and structured language.

At the end of the day, OO is a shift in the thinking process on how developers write software. Some programming languages are better suited for this paradigm than others and C# is one of them.

Starting to think OO

So if C# is a language designed to be OO from the ground up—

Question 6: Why do we still see so much non-OO code written in C# today?

The problem basically resides in the fact that it takes a deep understanding of OO in order to actually start writing code that behaves that way.

In order to really start thinking about how to properly implement OO code, it is critically important to know what data goes together with which operations—this consists of defining objects, their data, and operations.

Also, it is important to recognize which operations requests are dispatched dynamically—this consists of applying virtual functions and method overrides by means of inheritance, which leads to Polymorphism.

At this point, everything else pretty much comes as a byproduct of the other two core concept just mentioned: defining data and operations together and recognizing which operations are dynamically dispatched.

These lead to objects being brought to life. This allows operations to be determined dynamically and behavior modified by substituting objects.

So in short, the this pointer which is part of every instance and dynamic dispatching, which makes it possible to substitute one function specification with another during runtime—without affecting the caller, are at the core of OO.

The rest of the known OO principles such as Inheritance and Abstract Types are simply syntactical sugar on top of these two fundamental concepts.

Question 7: How does OO simplify development?

The goal of any software is to be useful to its users. If you’ve been long enough in the software industry you know how much customer requirements can change throughout time and with every one of those changes, the code needs to be modified and re-checked.

This process can be a complicated endeavor depending on the scope of the requirements and changes associated with them.

Let’s take for instance the following example. The program below reverses a string. This was the initial user requirement. So given this requirement, one might be tempted to write this in C# using Visual Studio 2015 as follows.

Example Problem 1:

    using System;
    
    namespace TestApp
    {
        class Program
        {
            public static string ReverseString(string s)
            {
                string tmp = string.Empty;
    
                for (int i = s.Length - 1; i >= 0; i--)
                {
                    tmp += s[i].ToString();
                }
    
                return tmp;
            }
    
            static void Main(string[] args)
            {
                Console.WriteLine(ReverseString("Pizza"));
                Console.Read();
            }
        }
    }

Cool! That works. We’ve solved the user’s requirements in a simple way. However what happens if the requirements suddenly change and we are asked to filter out characters that are not letter or digits.

Easy right? We can solve this by simply adding a condition that evaluates if a character within the string is either a digit or a letter and if that is true, then the character can be appended to the temporary string that is returned by the function. Let’s have a look.

    using System;
    
    namespace TestApp
    {
        class Program
        {
            public static string ReverseString(string s)
            {
                string tmp = string.Empty;
    
                for (int i = s.Length - 1; i >= 0; i--)
                {
                    if (char.IsLetterOrDigit(s[i]))
                        tmp += s[i].ToString();
                }
    
                return tmp;
            }
    
            static void Main(string[] args)
            {
                Console.WriteLine(ReverseString("P!zza"));
                Console.Read();
            }
        }
    }

If we execute this code with the string P!zza, we get the following result.

Awesome, that also works. So that was easy to get resolved. But what happens if user requirements change again and they become a bit more complex. Say for instance that P1zza would be a valid string to reverse, but not P2zza or P3zza.

Although this is a hypothetical example, in real life user requirements are prone to change and this has a direct impact on the code we write.

At the moment, we are simply using C# to write procedural code. The class is simply a wrapper around the procedural code and nothing more.

We are not really doing any OO programming and definitely not using the full potential of C#.

Question 8: So how can we use the core concepts of OO in order to make this code easy to maintain and yet still flexible enough to cope with possibly ever-changing requirements?

In order to answer this question properly, we first need to understand what the problem is.

Basically, the issue with the way the current code has been written is that the decision of which characters should be reversed is static. The solution to the problem is to make that decision dynamically.

The static code runs into a fundamental problem every time a change needs to be done. That fundamental issue is that each change may break a feature that used to work fine. This is definitely not what any developer wants.

So in order to make the code less static, let’s consider this. What if we rewrite the code with a selector that is responsible for returning the characters that can be reversed?

Let’s have a look how this can be done.

Example Problem 2:

    using System;
    
    namespace TestApp
    {
        class Program
        {
            public static string ReverseString(string s, Selector sl)
            {
                string tmp = string.Empty;
    
                foreach (char c in sl.pick(s))
                {
                    tmp += s[i].ToString();
                }
    
                return tmp;
            }
    
            static void Main(string[] args)
            {
                Console.WriteLine(ReverseString("P!zza"));
                Console.Read();
            }
        }
    }

In this example, we’ve removed the responsibility of determining which character in the string could be reversed from the ReverseString function to a Pick method available within a Selector instance that is passed to the calling function.

That’s definitely a step in the right direction as the responsibility should be contained within a class and not let the calling function (in this case ReverseString) to have to decide which characters to use.

Question 9: How to avoid the NULL trap?

In real life, null is nothing. However, in the programming world, null does represent the value of nothing. Basically, nothing is a value!

Still today, we see lots of code out there that contains many conditional statements that check if the value of a variable is null. This is a cause for concern in OO programming and here’s why.

Null is not an object. We might have a class, but when we have a variable with a null value we don’t have an object. Simply put, we cannot build OO code based on null references!

Therefore we need to avoid the null trap. Let’s examine the following code.

Example Problem 3:

    using System;
    
    namespace TestApp
    {
        class Program
        {
            public static string DisplayUpperStr(string s)
            {
                string upper = string.Empty;
    
                if (s == null)
                {
                    upper = null;
                }
                else
                {
                    upper = s.ToUpper();
                }
    
                return upper;
            }
    
            static void Main(string[] args)
            {
                Console.WriteLine(DisplayUpperStr("to upper"));
                Console.Read();
            }
        }
    }

Syntactically, this code is perfectly fine and it produces the desired result, which is to convert to upper case a given string.

Even though this works fine, it is advisable from an OO perspective to consider constructing an object that represents nothing, rather than evaluating a condition that contains a null.

So in light of that, let’s modify the previous code as follows.

    using System;
    
    namespace TestApp
    {
        class Program
        {
            public static string DisplayUpperStr(PossibleString s)
            {
                string upper = s.ToPossiblyUpper();
    
                return upper;
            }
    
            static void Main(string[] args)
            {
                Console.WriteLine(DisplayUpperStr("to upper"));
                Console.Read();
            }
        }
    }

Notice how all of a sudden, the DisplayUpperStr function became more readable, less cluttered and it no longer uses a conditional statement to check for a null value. Much cleaner and easier to maintain.

Furthermore, the responsibility of converting the string to the upper case has moved from the calling function to the PossibleString object, specifically by invoking its method ToPossiblyUpper.

Despite not having an implementation for a PossibleString class yet, we can already start to appreciate the benefit that the OO paradigm provides in this example.

This leads to a separation of concerns in the code, which eventually leads to Encapsulation.

Question 10: How to move to a State-related Codebase?

So now that we’ve explored these concepts, let’s move to a state-related code base. So you might be asking yourself at this moment:

Question 11: What is a state-related codebase?

Well, it is a way to write code that basically replaces branching and conditional statements with functions and then some of those functions can be used to manage state within a class.

So, first things first and let’s start by turning conditions into functions. Let’s consider the following code.

Example Problem 4:

    using System;
    
    namespace TestApp
    {
        class Program
        {
            public static string DisplayUpperStr(PossibleString s)
            {
                string upper = s.ToPossiblyUpper();
    
                return upper;
            }
    
            static void Main(string[] args)
            {
                Console.WriteLine(DisplayUpperStr("to upper"));
                Console.Read();
            }
        }
    }

In this example, we have defined a very basic class called Taxi.

Basically, this represents a private taxi company that only drives customers to their destination if the customer has booked a taxi through the company’s website beforehand. The taxi company doesn’t pick up any passenger from the street.

So considering this, there is a Pay method that has a guard clause. The clause is basically a conditional statement that checks if the taxi has been booked beforehand. If the taxi has not been booked, then no payment takes place (the PayToDriver method is not executed).

Although the Pay method has a guard clause and PayToDriver is only invoked when it really needs to be called, Pay is still responsible for checking if a taxi has been booked.

Ideally, what is required is to have this responsibility detached from the Pay method and have it as an Action that handles the booked state. So something like this:

    using System;
    
    namespace TestApp
    {
        public class Taxi
        {
            public void Pay()
            {
                this.ManageBooking();
                PayToDriver();
            }
        }
    }

This basically removes the condition from being the responsibility of the Pay method and delegates it to the ManageBooking method. This is what is called turning a condition into a function.

Now let’s take this a notch further and see how we can turn a function into a state. To do this, let’s redefine our function as an Action.

    using System;
    
    namespace TestApp
    {
        public class Taxi
        {
            public void Pay()
            {
                this.ManageBooking = this.StayVerified;
                PayToDriver();
            }
        }
    }

Notice that ManageBooking is no longer a method but instead an Action. By being an Action, the state (handled through the property StayVerified) can be directly assigned to the Action, delegate which is then fully responsible for handling state.

Notice how these small but crucial changes have been key in simplifying the code, making it more readable and at the same time, moving responsibility away from the calling class to the actual object that should ultimately be responsible for it.

As an exercise, you should now try to envision and create the implementation for the ManageBooking action. Notice that it should be an Action delegate. StayVerified can be implemented as a property.

Source: Contents are provided by Technicalsymposium Google Group Members.
Disclaimer: All the above contents are provided by technicalsymposium.com Google Group members.
Further, this content is not intended to be used for commercial purpose. Technicalsymposium.com is not liable/responsible for any copyright issues.

Technical Symposium.Com All Jobs & Certifications
Lecture Notes and Scholarships & Project Details

Fresher Jobs Details
job detailsAll Fresher Software Jobs Details
job detailsAll Government Jobs Details
job detailsAll Internships Details
job detailsOff-Campus Interviews/Walk-in Details
job detailsAll Competitive Exam Details
job detailsBank Clerk/Officers Jobs Details
job detailsB.Sc/M.Sc Graduate Fresher Jobs
job detailsAll Technical Jobs Details
job detailsAll State/Central Government Jobs Details
Conference/Symposium Details
job detailsAll International Conference Details
job detailsAll National Conference Details
job detailsAll Symposium/Workshop Details
job detailsUniversity Conferences Details
job detailsIIT/NIT/IIM Conference Details
job detailsComputer Science Conference Details
job detailsElectronics Conferences Details
job detailsMechanical Conferences Details
job detailsAll Latest Conferences Details
Calendar of Events Details
job detailsJanuary – List of All Event Details
job detailsFebruary – List of All Event Details
job detailsMarch– List of All Event Details
job detailsApril – List of All Event Details
job detailsMay – List of All Event Details
job detailsJune – List of All Event Details
job detailsJuly – List of All Event Details
job detailsAugust – List of All Event Details
job detailsAll Months - List of All Events Details
GATE Question Papers & Syllabus
job detailsAll GATE Previous Year Question Papers
job detailsGATE Syllabus for All Branches
job detailsGATE-Computer Science Question Papers
job detailsGATE – Mechanical Question Papers
job detailsGATE – ECE Question Papers
job detailsGATE- EEE Question Papers
job detailsGATE – Civil Engineering Question Papers
job detailsGATE – All Branches Question Papers
job detailsGATE Exam Pattern Details
IES Question Papers & Syllabus
job detailsIES Complete Information
job detailsIES Previous Year Question Papers
job detailsIES Syllabus for All Branches
job detailsIES – Mechanical Question Papers
job detailsIES - E & T Question Papers
job detailsIES - EEE Question Papers
job detailsIES -Civil Engineering Question Papers
job detailsIES - All Branches Question Papers
job detailsIES - Exam Pattern Details
All Companies Placement Materials
job detailsTCS Placement Papers
job detailsWIPRO Placement Papers
job detailsZOHO Placement Papers
job detailsCTS Placement Papers
job detailsINFOSYS Placement Papers
job detailsARICENT Placement Papers
job detailsSBI Placement Papers
job detailsRRB Placement Papers
job detailsBANK/IBPS Placement Papers
Aptitude Round Materials
job details Problem on Numbers
job detailsProblem on Trains
job detailsTime and Work
job detailsSimple Interest
job detailsAptitude Short- Cut Formulas
job detailsAptitude Tricks
job detailsOdd Man Out Series
job detailsSimplification Problems
job detailsProfit & Loss
Technical Round Materials
job detailsJAVA Technical Round Q & A
job detailsC Technical Round Q & A
job detailsC++ Technical Round Q & A
job detailsASP.NET Technical Round Q & A
job detailsData Structure Technical Round Q & A
job detailsSQL Technical Round Q & A
job detailsC# Technical Round Q & A
job detailsPHP Technical Round Q & A
job detailsJ2EE Technical Round Q & A
Software Programs and Lab Manuals
job detailsSurvey Lab Manuals
job detailsCAD/CAM Lab Manuals
job detailsOOPS/C++ Lab Manuals
job detailsJAVA/Internet Programming Manuals
job detailsList of All C Programs with Source Code
job detailsList of All Data Structure Programs
job detailsC Aptitude Programs
job detailsMicroprocessor & Micro Controller Manuals
job detailsAll Engineering Branches Lab Manuals
Anna University Syllabus & Question Papers
job detailsB.E/B.Tech Previous Year Question Papers
job detailsBE-Computer Science Syllabus
job detailsBE-Mechanical Engineering Syllabus
job detailsBE-Civil Engineering Syllabus
job detailsBE-ECE Syllabus
job detailsBE-EEE Syllabus
job detailsMBA/MCA Syllabus
job detailsBE-Aeronautical Engineering Syllabus
job detailsBE-Biomedical Syllabus
IBPS/Bank Syllabus & Question Papers
job detailsIBPS Clerk Exam Syllabus
job detailsIBPS Clerk Question Papers
job detailsIBPS Probationary Officers Syllabus
job detailsIBPS PO Question Papers
job detailsIBPS RRB Exam Syllabus
job detailsIBPS Special Officers Exam Syllabus
job detailsSBI Clerk/PO Syllabus
job detailsAll Private Banks PO/Clerk Syllabuses
job detailsAll Nationalized Bank Po/Clerk Syllabuses
Civil Engineering Lecture Notes
job detailsFirst Semester Lecture Notes
job detailsSecond Semester Lecture Notes
job detailsThird Semester Lecture Notes
job detailsFourth Semester Lecture Notes
job detailsFifth Semester Lecture Notes
job detailsSixth Semester Lecture Notes
job detailsSeventh Semester Lecture Notes
job detailsEighth Semester Lecture Notes
job detailsLab Manuals
Mechanical Engineering Lecture Notes
job detailsFirst Semester Lecture Notes
job detailsSecond Semester Lecture Notes
job detailsThird Semester Lecture Notes
job detailsFourth Semester Lecture Notes
job detailsFifth Semester Lecture Notes
job detailsSixth Semester Lecture Notes
job detailsSeventh Semester Lecture Notes
job detailsEighth Semester Lecture Notes
job detailsLab Manuals
Computer Science Engineering Lecture Notes
job detailsFirst Semester Lecture Notes
job detailsSecond Semester Lecture Notes
job detailsThird Semester Lecture Notes
job detailsFourth Semester Lecture Notes
job detailsFifth Semester Lecture Notes
job detailsSixth Semester Lecture Notes
job detailsSeventh Semester Lecture Notes
job detailsEighth Semester Lecture Notes
job detailsLab Manuals
MCA Lecture Notes
job detailsFirst Semester Lecture Notes
job detailsSecond Semester Lecture Notes
job detailsThird Semester Lecture Notes
job detailsFourth Semester Lecture Notes
job detailsFifth Semester Lecture Notes
job detailsSixth Semester Lecture Notes
job detailsSeventh Semester Lecture Notes
job detailsEighth Semester Lecture Notes
job detailsLab Manuals
MBA Lecture Notes
job detailsFirst Semester Lecture Notes
job detailsSecond Semester Lecture Notes
job detailsThird Semester Lecture Notes
job detailsFourth Semester Lecture Notes
job detailsFifth Semester Lecture Notes
job detailsSixth Semester Lecture Notes
job detailsSeventh Semester Lecture Notes
job detailsEighth Semester Lecture Notes
job detailsLab Manuals
ECE Lecture Notes
job detailsFirst Semester Lecture Notes
job detailsSecond Semester Lecture Notes
job detailsThird Semester Lecture Notes
job detailsFourth Semester Lecture Notes
job detailsFifth Semester Lecture Notes
job detailsSixth Semester Lecture Notes
job detailsSeventh Semester Lecture Notes
job detailsEighth Semester Lecture Notes
job detailsLab Manuals
EEE Lecture Notes
job detailsFirst Semester Lecture Notes
job detailsSecond Semester Lecture Notes
job detailsThird Semester Lecture Notes
job detailsFourth Semester Lecture Notes
job detailsFifth Semester Lecture Notes
job detailsSixth Semester Lecture Notes
job detailsSeventh Semester Lecture Notes
job detailsEighth Semester Lecture Notes
job detailsLab Manuals
Biotechnology Lecture Notes
job detailsFirst Semester Lecture Notes
job detailsSecond Semester Lecture Notes
job detailsThird Semester Lecture Notes
job detailsFourth Semester Lecture Notes
job detailsFifth Semester Lecture Notes
job detailsSixth Semester Lecture Notes
job detailsSeventh Semester Lecture Notes
job detailsEighth Semester Lecture Notes
job detailsLab Manuals
Chemical Engineering Lecture Notes
job detailsFirst Semester Lecture Notes
job detailsSecond Semester Lecture Notes
job detailsThird Semester Lecture Notes
job detailsFourth Semester Lecture Notes
job detailsFifth Semester Lecture Notes
job detailsSixth Semester Lecture Notes
job detailsSeventh Semester Lecture Notes
job detailsEighth Semester Lecture Notes
job detailsLab Manuals
Biomedical Engineering Lecture Notes
job detailsFirst Semester Lecture Notes
job detailsSecond Semester Lecture Notes
job detailsThird Semester Lecture Notes
job detailsFourth Semester Lecture Notes
job detailsFifth Semester Lecture Notes
job detailsSixth Semester Lecture Notes
job detailsSeventh Semester Lecture Notes
job detailsEighth Semester Lecture Notes
job detailsLab Manuals
Aeronautical Engineering Lecture Notes
job detailsFirst Semester Lecture Notes
job detailsSecond Semester Lecture Notes
job detailsThird Semester Lecture Notes
job detailsFourth Semester Lecture Notes
job detailsFifth Semester Lecture Notes
job detailsSixth Semester Lecture Notes
job detailsSeventh Semester Lecture Notes
job detailsEighth Semester Lecture Notes
job detailsLab Manuals
B.Sc (All Major Branches) Lecture Notes
job detailsMaths / Statistics Lecture Notes
job detailsPhysics Lecture Notes
job detailsChemistry Lecture Notes
job detailsElectronics Lecture Notes
job detailsComputer Science/IT Lecture Notes
job detailsAgriculture Lecture Notes
job detailsBiotechnology/Biomedical Lecture Notes
job detailsNursing Lecture Notes
job detailsFashion Technology Lecture Notes
M.Sc (All Major Branches) Lecture Notes
job detailsComputer Science/IT Lecture Notes
job detailsAgriculture Lecture Notes
job detailsBiotechnology/Biomedical Lecture Notes
job detailsNursing Lecture Notes
job detailsFashion Technology Lecture Notes
job detailsMaths / Statistics Lecture Notes
job detailsPhysics Lecture Notes
job detailsChemistry Lecture Notes
job detailsElectronics Lecture Notes
B.Com/M.Com Lecture Notes
job detailsFirst Semester Lecture Notes
job detailsSecond Semester Lecture Notes
job detailsThird Semester Lecture Notes
job detailsFourth Semester Lecture Notes
job detailsFifth Semester Lecture Notes
job detailsSixth Semester Lecture Notes
job detailsLab Manuals
job detailsCommerce Placement Materials
job detailsCommerce Placement Materials
BBA Lecture Notes
job detailsFirst Semester Lecture Notes
job detailsSecond Semester Lecture Notes
job detailsThird Semester Lecture Notes
job detailsFourth Semester Lecture Notes
job detailsFifth Semester Lecture Notes
job detailsSixth Semester Lecture Notes
job detailsLab Manuals
job detailsPlacement MaterialsEighth Semester Lecture Notes
job detailsFresher Jobs Details
BCA Lecture Notes
job detailsFirst Semester Lecture Notes
job detailsSecond Semester Lecture Notes
job detailsThird Semester Lecture Notes
job detailsFourth Semester Lecture Notes
job detailsFifth Semester Lecture Notes
job detailsSixth Semester Lecture Notes
job detailsLab Manuals
job detailsPlacement Materials
job detailsFresher Jobs Details

Hosting by Yahoo!

About-Us    Contact-Us    Site-map

©copyright All rights are reserved to technicalsymposium.com