.NET Interview Questions for Freshers
The fundamentals a fresher or first-job .NET developer is asked — core C#, OOP, what the CLR is, the MVC pattern, basic SQL joins and simple ASP.NET Core concepts.
For a first .NET role, interviewers check that the fundamentals are solid and that you can explain them simply. Nothing here is a trick — clear, correct answers are what count.
C# & OOP basics
5 questionsC# is a modern, statically typed, object-oriented (and increasingly functional) programming language from Microsoft. It compiles to Intermediate Language (IL) that runs on the .NET runtime (the CLR), which…
Read detailed answerA value type (struct, enum, int, bool, DateTime) holds its data directly; assigning or passing it copies the value. A reference type (class, interface, array, delegate, string) holds a reference to an object…
Read detailed answerAn abstract class is a base class you can't instantiate; it can hold state (fields), constructors, and a mix of implemented and abstract members, and a class can inherit only one. An interface is a contract —…
Read detailed answerstring is immutable — every concatenation or modification allocates a new string object. StringBuilder is a mutable buffer; appends modify it in place (growing an internal array as needed). Use StringBuilder…
Read detailed answerBoth pass an argument by reference so the method can modify the caller's variable. ref requires the variable to be initialised before the call and the method may read it. out does not require initialisation…
Read detailed answerPlatform & web basics
5 questionsThe CLR is the execution engine for .NET. It loads assemblies, JIT-compiles Intermediate Language (IL) to native machine code, enforces type safety, manages memory with the garbage collector, and provides…
Read detailed answerManaged code runs under the CLR, which handles memory, type safety and exceptions — normal C#/.NET code. Unmanaged code runs directly on the OS with no CLR services — C/C++ libraries, COM components, OS…
Read detailed answerASP.NET MVC is a web framework that implements the Model-View-Controller pattern. A controller handles the request, works with the model (the data and business logic), and returns a view (the HTML). It gives…
Read detailed answerASP.NET Core is a free, open-source, cross-platform framework for building web apps, APIs and real-time services on .NET. It is a ground-up rewrite of ASP.NET that runs on Windows, Linux and macOS, is modular…
Read detailed answerA RESTful API models the system as resources identified by URLs, manipulated with standard HTTP verbs (GET, POST, PUT, PATCH, DELETE), returning appropriate status codes and representations (usually JSON). It…
Read detailed answerSQL basics
4 questionsAn INNER JOIN returns only rows that have a match in both tables. A LEFT JOIN (left outer join) returns every row from the left table, plus matching columns from the right table where they exist and NULLs…
Read detailed answerAn index is an on-disk structure (a B-tree) that lets SQL Server find rows without scanning the whole table. It stores the indexed column values in sorted order with pointers to the matching rows, so lookups,…
Read detailed answerDELETE is DML: removes rows (optionally with a WHERE), logs each row, fires triggers, keeps the table and can be rolled back. TRUNCATE is DDL: removes all rows by deallocating pages, minimally logged, very…
Read detailed answerBoth enforce uniqueness. A primary key uniquely identifies a row, does not allow NULL, and there is exactly one per table (it creates a clustered index by default). A unique key/constraint also guarantees…
Read detailed answer