P2Pprogrammer 2 programmer

Home > Interview Question and Answer > C# and VB.Net > VB.NET and C# Framework, Basic , Concept, General Topic

Interview questions and Answers for VB.NET General, NET Framework, manifest & metadata, cast, GC


Interview questions and answers for VB.NET and C# Framework, Basic , Concept, General Topic. .NET Framework, manifest & metadata. properties, cast, boxing, constructor, garbage collector, scope of variable, value and reference type, serialization, authentication, ADO.NET, directcast.



Interview questions and answers for VB.NET and C# Framework, Basic , Concept, General Topic


1. Difference between directcast and ctype.

DirectCast requires the run-time type of an object variable to bethe same as the specified type.The run-time performance ofDirectCast is better than that of CType, if the specified type and the run-time typeof the expression are the same. Ctype works fine if there is a valid conversion defined between the expression and the type.

2. Explain manifest & metadata.

  1. Manifest is metadata about assemblies. It describes assembly itself like Assembly Name, version number, culture, strong name, list of all files, Type references, and referenced assemblies.
  2. Metadata is machine-readable information about a resource, or “”data about data.” In .NET, metadata includes type definitions, version information, external assembly references, and other standardized information. Metadata describes contents in an assembly classes, interfaces, enums, structs, etc., and their containing namespaces, the name of each type, its visibility/scope, its base class, the interfaces it implemented, its methods and their scope, and each method’s parameters, type’s properties, and so on.

3. What are the two kinds of properties

Two types of properties in .Net: Get & Set

4. What is a Constructor

Constructor is a method in the class which has the same name as the class (in VB.Net its New()). It initializes the member attributes whenever an instance of the class is created.

5. Describe ways of cleaning up objects

There is a perfect tool provided by .net frameworks called Garbage collector, where by mean of GC we can clean up the object and reclaim the memory. The namespace used is System.GC.

6. Scope of public, private, friend, protected, protected friend.

  1. Public/public All members in all classes and projects.
  2. Private/private Members of the current class only.
  3. Friend/internal All members in the current project.
  4. Protected/protected All members in the current class and in classes derived from this member’s class. Can be used only in member definitions, not for class or module definitions.
  5. Protected Friend/protected internal All members in the current project and all members in classes derived from this member’s class. Can be used only in member definitions, not for class or module definitions.

7. What are value types and reference types?

  1. Value type - bool, byte, chat, decimal, double, enum , float, int, long, sbyte, short, strut, uint, ulong, ushort. Value types are stored in the Stack.
  2. Reference type - class, delegate, interface, object, string Reference types are stored in the Heap.

8. Difference between VB6 and VB.Net?

  1. VB.net is object oriented
  2. VB.Net can be used in Managed Code
  3. It supports inheritance, implements
  4. Powerful Exception handling mechanism
  5. Have support for the console based applications
  6. More than one version of dll is supported
  7. Supports the Disconnected data source by using Dataset class
  8. Supports threading

9. What is Serialization in .NET?

The serialization is the process of converting the objects into stream of bytes. they or used for transport the objects(via remoting) and persist objects(via files and databases)

10. What is use of System.Diagnostics.Process class?

By using System.Diagnostics.Process class, we can provide access to the files which are presented in the local and remote system.

Example: System.Diagnostics.Process(”c:\mlaks\example.txt”) — local file
System.Diagnostics.Process(”http://www.url.com\example.txt”) — remote file

11. what are the authentication methods in .NET?

  1. Windows: Basic, digest or Integrated windows authentication
  2. Microsoft passport Authentication
  3. Forms Authentication
  4. Client Certificate Authentication

12. How many languages .NET is supporting now?

When .NET was introduced it came with several languages. VB.NET, C#, COBOL and Perl, etc. Currently Dot Net supports more than 44 languages.

13. What is ADO .NET and what is difference between ADO and ADO.NET?

can treat the ADO.Net as a separate in-memory database where in I can use relationships between the tables and select insert and updates to the database. I can update the actual database as a batch.

14. type(123.34,integer) - should it throw an error? Why or why not?

It would work fine. As the runtime type of 123.34 would be double, and Double can be converted to Integer.

15. directcast(123.34,integer) - should it throw an error? Why or why not?

It would throw an InvalidCast exception as the runtime type of 123.34 (double) doesnt match with Integer.

More C# and VB.Net Interview Question and Answers

  1. .NET Framework interview questions and answers
  2. VB.NET and C# User Interface interview questions and answers
  3. .NET Object-Oriented Programming (OOPs) interview questions and answers
  4. ADO.NET interview questions and answers
  5. Advanced .NET Framework Topics interview questions and answers
  6. Windows Service, COM+ and XML Web Services interview questions and answers
  7. .NET Assemblies, Configuration, and Security interview questions and answers
  8. VB.NET and C# setup and deployment interview questions and answers
  9. VB.NET and C# general interview questions and answers


Home > Interview Question and Answer > C# and VB.Net > .NET Framework