Table of Contents
- 1 Introduction
- 1.1 Question 1: What is .NET?
- 1.2 Question 2: How many languages does .NET support?
- 1.3 Question 3: What’s the lifespan of the items in the ViewState?
- 1.4 Question 4: What’s ‘CTS’?
- 1.5 Question 5: Define ‘encapsulation’.
- 1.6 Question 6: What’s the difference between a ‘class’ and an ‘object’?
- 1.7 Question 7: Is there a difference between ‘debug’ and ‘trace’?
- 1.8 Question 8: What’s the difference between ‘in-process’ and ‘out-of-process’?
- 1.9 Question 9: What’s MSIL?
- 1.10 Question 10: What’s ‘inheritance’?
- 1.11 Question 11: What’s the difference between ‘managed code’ and ‘unmanaged code’?
- 1.12 Question 12: Is there a difference between ‘int’ and ‘System.Int32’?
- 1.13 Question 13: Define ‘caching’.
- 1.14 Question 14: What’s an ‘assembly’?
- 1.15 Question 15: Is .NET an OOP o an AOP framework?
- 2 .NET interview questions – Advanced
- 2.1 Question 1: Is it possible to manually set a ‘session out’ timer?
- 2.2 Question 2: Can you mix up different languages in the ‘App_Code’ folder?
- 2.3 Question 3: What is a ‘.dll’ file?
- 2.4 Question 4: Is there a difference between a ‘stack’ and a ‘queue’?
- 2.5 Question 5: What is ‘boxing’?
- 2.6 Question 6: Can the index of the primary key on the table be changed or altered?
- 2.7 Question 7: How would you validate the data that’s located on the webpage?
- 2.8 Question 8: What’s the main difference between ‘functions’ and ‘stored procedures’?
- 2.9 Question 9: What’s LINQ?
- 2.10 Question 10: Is there a difference between ‘stacks’ and ‘heaps’?
- 2.11 Question 11: Define a ‘variable’ and a ‘constant’.
- 2.12 Question 12: What is a Garbage Collector?
- 2.13 Question 13: Can you specify access modifiers in an interface?
- 2.14 Question 14: What is a ‘tuple’?
- 2.15 Question 15: How many indexes are there in .NET?
- 3 Summary
- 4 Conclusions
IntroductionWe’ll start off with some of the more basic .NET interview questions. These are mostly definition-related questions to help you kind of get a feeling of what you should expect during that job interview. After this part, we’ll move on to some of the more advanced .NET framework interview questions. Since .NET is considered to be one of the more technologically difficult frameworks out there, it is probably a good idea to revise the more advanced stuff as much as possible. You shouldn’t forget the basics, though!
Question 1: What is .NET?Your potential employers might say something in the lines of: So, imagine that I don’t know anything about .NET. Explain to me what it is, what does .NET stand for, etc.
Question 2: How many languages does .NET support?As of the time of writing this tutorial, .NET supports 44 different languages.
Question 3: What’s the lifespan of the items in the ViewState?Items in the ViewState exist for as long as the page that they are in isn’t terminated.
Question 4: What’s ‘CTS’?CTS abbreviated as a Common-Type System. Basically, this system dictates the types of data that are used within the system.
Question 5: Define ‘encapsulation’.Encapsulation is a function which includes various methods and data within a project. This is done so that the object of the program could perform its functions smoothly and without any errors.
Question 6: What’s the difference between a ‘class’ and an ‘object’?Another one of the definition-based .NET interview questions, this one should be quite easy if you’re at all familiar with programming languages. To put it simply, an “object” is something that happens or is located within the “class”. Classes define what the objects look like, how they act and what sort of properties do they have. In turn, similar-acting objects make up those classes.
Question 7: Is there a difference between ‘debug’ and ‘trace’?Yes. The Trace class can be used for debugging and releasing certain builds, while Debug is used solemnly for – you’ve guessed it – debugging. This can be classified as one of the trick .NET interview questions, for it is quite easy to get forget about Trace’s additional function.
Question 8: What’s the difference between ‘in-process’ and ‘out-of-process’?Both of these are concerned with session memory management. In-process stores all of the data from a development session on a web server. As opposed to that, out-of-process stores the same data on an external memory management area. Probably one of the most popular of such external memory-storing areas would be the SQL server.
Question 9: What’s MSIL?MSIL means Microsoft Intermediate Langauge. It is used for defining values, storing memory and other similar, high-end tasks. Every single code that .NET uses must first pass through MSIL.
Question 10: What’s ‘inheritance’?
Question 11: What’s the difference between ‘managed code’ and ‘unmanaged code’?Managed code is a type of code that has been created and compiled within the .NET framework. As opposed to that, unmanaged code comes from a different software-building framework, and brings along all of the other framework’s features and settings.
Question 12: Is there a difference between ‘int’ and ‘System.Int32’?Remember when I told you about the trick .NET developer interview questions? Well, this is one of them. There’s absolutely no difference between “int” and “System.Int32”. “Int” is simply a shorter version of the same name.
Question 13: Define ‘caching’.Another term that you might be familiar with from your previous programming experiences, ‘caching’ still remains one of the more popular .NET interview questions. Caching is a process when you keep your most often used files and data in a separate memory. This separate location – a cache – is where you can access all of your designated files. Caching saves developers a lot of time and increases their memory management.
Question 14: What’s an ‘assembly’?
Question 15: Is .NET an OOP o an AOP framework?OOP stands for Object-Oriented Programming, while AOP abbreviates to Aspect-Oriented Programming. So, which one does .NET use? The answer is actually hidden in the previously mentioned .NET interview questions. .NET is completely an OOP framework – concepts like the previously discussed Encapsulation and Inheritance are some of the key features of an Object-Oriented Programming framework. This is probably one of the most interesting .NET framework interview questions that you might get asked. However, the answer is pretty obvious, especially if you know the difference between OOP and AOP.
.NET interview questions – AdvancedNow that we’ve covered some of the more basic .NET interview questions and answers, let’s transitions to the more advanced stuff. Keep in mind that the word “advanced” does not necessarily mean that you have to be a .NET expert with twenty years of experience to answer them. What it does mean, however, is that you’ll not only have to have heard of .NET, but will have also had to actually use it.
Question 1: Is it possible to manually set a ‘session out’ timer?Yes, yes it is. This is usually one of those .NET interview questions that are going to have a follow-up – your employers probably won’t be satisfied with a one-word answer.
Question 2: Can you mix up different languages in the ‘App_Code’ folder?No. The file that you are working on has to be written in a single, specific code. You can’t mix the coding languages up.
Question 3: What is a ‘.dll’ file?You know that feeling when you play your favorite game and suddenly get a great idea to mod it, only to discover that you have a bunch of “DLL” files missing after the modding process is complete? DLL files are those which need to be hidden out of plain sight. The term directly abbreviates to “Dynamic Link Library”. These libraries are vast, containing a huge amount of files and commands. DLLs can also be shared among other programs and apps.
Question 4: Is there a difference between a ‘stack’ and a ‘queue’?Yes. A very short and clear way to explain this would be to say that stacks are LIFO, and queues are FIFO. LIFO means “Last in, first out”. Stacks process value types by a “top-down” hierarchy. On the flip side, FIFO means “First in, first out”. Queues follow this principle and insert items from the lower end while deleting ones fro the top.
Question 5: What is ‘boxing’?Boxing is a process when you create objects from certain value types. These processes are implicit. This being one of those .NET interview questions that might have a follow-up, the only logical follow-up would be to ask “what is unboxing, then?”. Although, to be honest, it would probably be too easy – unboxing is the opposite process to boxing.
Question 6: Can the index of the primary key on the table be changed or altered?
Question 7: How would you validate the data that’s located on the webpage?Although at first glance this might seem like one of those opinion-asking .NET interview questions, it actually isn’t. Why is that? Well, simply because there is a “best way” to validate such data. Client-side validation is considered by many to be the best way to validate the data from your website. The main reason is that you don’t need to use up any resources to achieve this – the users that come to your webpage are the ones that deal with this process.
Question 8: What’s the main difference between ‘functions’ and ‘stored procedures’?Although there are quite a few differences between these two features, probably the most notable one is that features can perform a few different tasks, while a stored procedure is designed only for a single, specific task.
Question 9: What’s LINQ?LINQ is a Language Integrated Query. It is a Microsoft-created model with its own, specific syntax. LINQ is based on the C# programming language, and can be implemented as a library into other coding languages.
Question 10: Is there a difference between ‘stacks’ and ‘heaps’?Yes – stacks store value types, while heaps store reference types.
Question 11: Define a ‘variable’ and a ‘constant’.A variable is a place on the computer where data is stored. Each variable has a designated type of data. Variables have a specific name assigned to them. Constants are almost the same things as variable except that they have specific values attached to them, which can’t be altered.
const int interestRate =73;This is one of the .NET interview questions that may require you to demonstrate some of your coding knowledge in practice, so don’t forget to brush up your skills!
Question 12: What is a Garbage Collector?Garbage collectors are special tools in .NET that are designed to free up unused space and thus make the framework run and operate faster. The tool can be accessed with the following command: