• Home
  • About
  • Contact
  • ado.net
  • angular
  • c#.net
  • design patterns
  • linq
  • mvc
  • .net core
    • .Net Core MVC
    • Blazor Tutorials
  • sql
  • web api
  • dotnet
    • SOLID Principles
    • Entity Framework
    • C#.NET Programs and Algorithms
  • Others
    • C# Interview Questions
    • SQL Server Questions
    • ASP.NET Questions
    • MVC Questions
    • Web API Questions
    • .Net Core Questions
    • Data Structures and Algorithms

C# Interview Questions

In this article, I am going to discuss the most frequently asked Basic C# Interview Questions and Answers.

1. What is COM?
  • COM stands for Component Object Model.
  • COM is one of Microsoft Technology. Using this technology we can develop windows applications as well as web applications.
In earlier COM, VB is the programming language that is used to implement windows application and ASP is used to implement web applications.

2. What are the disadvantages of COM?
The major two disadvantages of COM is
  • Incomplete object-oriented programming means it will not support all the features of OOPs.
  • Platform dependent means COM applications can run on only Windows OS.
3. What .NET Represents?
  • NET stands for Network Enabled Technology.
  • In .NET dot (.) refers to object-oriented and NET refers to the internet.
So the complete .NET means through object-oriented we can implement internet applications

4. What is a Framework and what does the .NET Framework provide?
A framework is a software. Or we can say that a framework is a collection of many small technologies integrated together to develop applications that can be executed anywhere.

What does the .NET Framework provide?
.NET Framework provides two things such as
  • BCL (Base Class Libraries)
  • CLR (Common Language Runtime)
Explain about BCL.
  • Base Class Libraries are designed by Microsoft.
  • Without BCL we can’t write any code in .NET so BCL also was known as Building block of Programs of .NET.
  • These are installed into the machine when we installed the .NET framework into the machine.
The physical location of BCL is C:\Windows\assembly
BCL contains predefined classes and these classes are used for the purpose of application development.

5. Explain about CLR and its Execution process.
CLR is the core component under the .NET framework which is responsible for converting MSIL code into native code and then execution.
CLR execution process

In .NET, the code is compiled twice.
  • In 1st compilation source code is compiled by respective language compiler and intermediate code is generated known as MSIL (Microsoft Intermediate Language) or IL (Intermediate language code) Or Managed code.
  • In the 2nd compilation, MSIL is converted into Native code using CLR.
Always 1st compilation is slow and 2nd compilation is first.

What is JIT?
  • JIT stands for Just-in-time.
  • JIT is the component of CLR which is responsible for converting MSIL code into Native code.
  • This Native code is directly understandable by the operating system.
Explain different types of .NET Framework.
The .net framework is available in three different types
  • .NET Framework: This is the general version required to run .NET applications on Windows OS only.
  • .NET mono Framework: This is required if we want to run .NET applications on other OS like Unix, Linux, MAC OS, etc.
  • .NET Compact Framework: This is required to run .NET applications on other devices like mobile phones and smartphones.
NOTE: MSIL is only CPU dependent and will run only on Windows OS only using .NET Framework because .NET Framework is designed for Windows OS only.
There is another company known as “NOVEL” designed separate framework known as “MONO Framework”. Using this framework we can run MSIL on different OS Like Linux, UNIX, Mac, BSD, OSX, etc.
.NET is platform-dependent using the .NET framework but independent using the MONO framework.

What is not .NET?
  • .NET is not an Operating system.
  • It is not an application or package.
  • .NET is not a database.
  • It is not an ERP application.
  • .NET is not a Testing Tool.
  • It is not a programming language.
6. What is exactly .NET?
.NET is a framework tool that supports many programming languages and many technologies. It supports 60+ programming languages. In 60+ programming languages, 9 are designed by Microsoft and remaining are designed by Non-Microsoft.

Microsoft designed programming languages are as follows
  • VB.NET
  • C#.NET
  • VC++.NET
  • J#.NET
  • F#.NET
  • Jscript.NE
  • WindowsPowerShell
  • Iron phyton
  • Iron Ruby
Technologies supported by the .NET framework are as follows
  • ASP.NET (Active Server Pages.NET)
  • ADO.NET (Active Data Object.NET)
  • WCF (Windows Communication Foundation)
  • WPF (Windows Presentation Foundation)
  • WWF (Windows Workflow Foundation)
  • AJAX (Asynchronous JavaScript and XML)
  • LINQ (Language Integrated Query)
  • ASP.NET MVC (Model View Controller)
  • ASP.NET WEB API
7. What are the language and its need?
  • A language acts as the mediator between the programmer and the system.
  • It offers some rules and regulations for writing the program.
  • The language also offers some libraries which are required for writing the program.
  • The collection of programs is called software.
8. What are Technology and it’s needs?
Technology is designed for a particular purpose. For example development of web-related applications in .NET using a technology ASP.NET. But the technology does not offer any specific rules for writing the programs. That’s why technology can’t be implemented individually.
VB.NET, C#.NET both are programming languages. Using these two languages we can implement windows/desktop applications individually. Every language is having its own compiler

VB.NET, C#.NET: VB.NET and C#.NET both are programming languages. Using these two programming languages we can develop windows applications.

ASP.NET:
  • ASP.NET is a part of a Framework.
  • The ASP.NET is a technology which provides a set of predefined classes. Using these classes we can implement web applications.
  • ASP.NET is needed language support.
ADO.NET:
  • ADO stands for ActiveX Data Objects.
  • The ADO.NET is a .NET database technology.
  • ADO.NET provides a set of predefined classes. Using these predefined classes we can perform the operations with the database server.
WCF:
  • WCF stands for Windows Communication Foundation.
  • The WCF is a distributed technology. Using this technology we can implement SOA (Service Oriented Architecture) programming.
  • SOA programming provides communication between heterogeneous applications.
  • Applications that are developed using different technologies or different programming languages are known as heterogeneous applications.
WPF:
  • The WPF stands for windows presentation foundation.
  • WPF is a .NET technology using this technology we can create 2D, 3D, graphics, animations for windows application.
  • Using this technology we can also create our own audio/video players and also implement gaming applications.
LINQ:
  • LINQ stands for Language Integrated Query.
  • It is query-writing Technology.
  • LINQ offers to write queries in the programming code itself.
  • This concept is introduced in .NET framework 3.5
  • LINQ queries applying in database data and non-database data also.
9. What is Visual Studio?
Visual Studio is a Microsoft IDE tool which is needed to develop applications with the .NET framework. The IDE integrates 3 features
  • Editor
  • Compiler
  • Interpreter
10. What is .net?
  • .NET is a programming framework created by Microsoft that developers can use to create applications more easily. The framework provides libraries commonly used by developers. The .NET Base Class Libraries (BCL) servers that purpose.
  • The .NET provides language interoperability across several programming languages. Programs are written for .NET Framework execute in a software environment called Common Language Runtime (CLR).
  • CLR is the foundation of the .NET framework which provides services like safety, memory management, garbage collection, and exception handling.
  • CLR manages the execution of code. The code that is managed by CLR is called managed code. Unmanaged code does not get managed by CLR. CLR’s interoperability helps to interact between managed and unmanaged code.
  • Common Language Specification (CLS) and Common Type System (CTS) as part of CLR. CTS is responsible for interpreting data types into a common format. CLS provides the ability of code to interact with code that is written with a different programming language.
11. What is the Just-In-Time (JIT) compilation?
The MSIL is the language that all of the .NET languages compile down to. After they are in this intermediate language, a process called Just-In-Time compilation occurs when resources are used from our application at runtime.

12. What is metadata?
Metadata describes every type and member defined in our code in a Multilanguage form. Metadata stores the following information.
  • Description of assembly.
  • Identity (name, version, culture, public key).
  • The types that are exported
  • Other assemblies that this assembly depends on.
  • Security permissions needed to run.
13. What is an assembly?
Assemblies are the building block of .NET framework applications; they form the fundamental unit of deployment, version control, reuse, and activation scoping and security permissions.

14. What are the differences between managed code and unmanaged code?
Managed code/methods:
  • Machine instructions are in MSIL format and located in assemblies will be executed by the CLR will have the following advantages
  • Memory management to prevent memory leaks in program code.
  • Thread execution
  • Code safety verification
  • Compilation.
Unmanaged code/ methods:
  • The Unmanaged codes are the instructions which are targeted for specific platforms. Unmanaged code will exist in any of the formats.
  • COM/COM+ components
  • Win 32 Dlls/system DLLs
  • As these codes are in native formats of OS, these instructions will be executed faster compared with JIT compilation and execution of managed code.
15. What is C#?
C# is an object-oriented type safe and managed language that is compiled by.Net framework to generate Microsoft Intermediate Language.

16. What is the difference between an EXE and a DLL?
EXE is an executable file and can run by itself as an application whereas DLL is usually consumed by an EXE or by another DLL and we cannot run or execute DLL directly.
For example in .NET compiling a Console Application or a Windows Application generates EXE, whereas compiling a Class Library Project or an ASP.NET web application generates DLL. In the .NET framework, both EXE and DLL are called assemblies.
A DLL can be reused in the application whereas an exe file can never be reused in an application.
EXE stands for executable, and DLL stands for Dynamic Link Library

17. What’s the difference between IEnumerable<T> and List<T>?
  • IEnumerable is an interface, whereas List is one specific implementation of IEnumerable. A list is a class.
  • FOR-EACH loop is the only possible way to iterate through a collection of IEnumerable whereas List can be iterated using several ways. The list can also be indexed by an int index, the element can be added to and removed from and have items inserted at a particular index.
  • IEnumerable doesn’t allow random access, whereas List does allow random access using the integral index.
  • In general from a performance standpoint, iterating through IEnumerable is much faster than iterating thru a List.
18. Why is class an abstract data type?
A Class is an Abstract Data Type because it specifies what data members and member functions (methods) contain in it (class), but won’t provide information on how those are implemented. That makes Class Abstract and Class is User Defined DataType. So, it’s an Abstract Data Type

19. What are the new features introduced in c# 7?
This is a very commonly asked c# interview question. This question is basically asked to check if you are passionate about catching up with the latest technological advancements. The list below shows the new features that are introduced in c# 7.

Let’s have a look at the new features that are introduced as part of C# 7
  • Out variables
  • Pattern matching
  • Digit Separators
  • Tuples
  • Deconstruction (Splitting Tuples)
  • Local functions
  • Literal improvements
  • Ref returns and locals
  • Generalized async return types
  • More expression-bodied members
  • Throw expressions
  • Discards
  • Async main
  • Default literal expressions
  • Inferred tuple element names
In this article, I try to explain most frequently asked C#.NET Interview Questions and Answers. I hope this article will help you with your need. I would like to have your feedback. Please post your feedback, question, or comments about this article.

0 comments:

Post a Comment

If you like this website, please share with your friends on Facebook, Twitter, LinkedIn.

Join us on Telegram

Loved Our Blog Posts? Subscribe To Get Updates Directly To Your Inbox

Like us on Facebook

Popular Posts

  • What is Dependency Injection(DI)
    Hi friends! Today we are going to learn about Dependency Injection and in our last session we have come across Static classes and where it s...
  • C# Programming Examples on Sorting
    Today i am going to tell you some of the Sorting programming questions in C#. Q1- Write a C# program to perform Selection sort. Ans:  Sel...
  • Calling Web API Service in a Cross-Domain Using jQuery AJAX
    In this article, I am going to discuss Calling Web API Service in a Cross-Domain Using jQuery AJAX . Please read our previous article befor...
  • ViewBag in ASP.NET Core MVC
    In this article, I am going to discuss the use of ViewBag in ASP.NET Core MVC application with examples. Please read our previous article ...
  • Recursion And Back Tracking
    In this article, I am going to discuss Recursion And BackTracking in detail. Please read our previous article where we discussed Master Th...
  • What is Abstract Class and When we should use Abstract Class
    Hi friends! In our previous sessions we have seen  Difference Between Class and Struct . And in our last session  we learnt Usability of Sec...
  • Binary to Decimal Conversion in C# with Examples
    In this article, I am going to discuss the Binary to Decimal Conversion in C# with some examples. Please read our previous article where w...

Blog Archive

Contact Form

Name

Email *

Message *

Tags

.Net .Net Core .Net Core MVC Algorithm Angular Anonymous Types Asp.Net Asp.Net MVC Blazor C# Data Structure Database Design Patterns Entity Framework Entity Framework Core Filters Interview Question Management Studio Programming Programs SQL Server SSMS Web API

Copyright © C# Techtics | All Right Reserved.

Protected by Copyscape