Skip to main content

Posts

Cracking the Code: Your Guide to the Top 60 C# Interview Questions

So, you're gearing up for a C# interview? Fantastic! This powerful and versatile language is a cornerstone of modern software development, and landing that C# role can open up a world of exciting opportunities. But navigating the interview process can feel like traversing a complex codebase. Fear not! We've compiled a comprehensive list of the top 60 C# interview questions, complete with detailed answers, to help you ace your next technical challenge. Whether you're just starting your C# journey or you're a seasoned pro looking to brush up your knowledge, this guide has something for you. We've broken down the questions into three levels: Beginner, Intermediate, and Advanced, allowing you to focus on the areas most relevant to your experience. Let's dive in and equip you with the knowledge you need to shine! Beginner Level (1–20) 1. What is C#? C# is a modern, object-oriented programming language developed by Microsoft as part of its .NET platform. It is design...

Most Asked .NET Core API Interview Questions and Answers

.NET CORE BASICS 1. What is .NET Core?    .NET Core is a free, open-source, cross-platform framework developed by Microsoft for building modern, scalable, high-performance applications. It supports Windows, Linux, and macOS, and can be used to build web apps, APIs, microservices, console apps, and more. 2. Difference between .NET Core and .NET Framework?    - Platform Support: .NET Core is cross-platform, while .NET Framework runs only on Windows.    - Open Source: .NET Core is open-source; .NET Framework is not fully open-source.    - Performance: .NET Core is optimized for performance and scalability.    - Deployment: .NET Core allows side-by-side installations. 3. What is Kestrel?    Kestrel is a lightweight, cross-platform web server used by ASP.NET Core. It is the default server and sits behind IIS or Nginx in production for better security and performance. 4. What is Middleware in ASP.NET Core?    Middleware are...

.NET MEMORY MANAGEMENT AND GARBAGE COLLECTION

  Question 1: Is there a way we can see this Heap memory? Yes, we can analyze GC using performance counters. Performance counters are counters or measures of events in a software which allows us to do analysis. These counters are installed when software is installed. So we can use counters like GC Heap size, GC0, GC1, GC2, and working set to make more sense of how GC is working.   Question 2: Does Garbage collector clean primitive types? No, Garbage collector does not clean primitive types. They are allocated on the stack, and the stack removes them as soon as the variables go out of scope. Question 3: Managed vs UnManaged ode/objects/resources? Managed resources are those which are pure .NET objects, and these objects are controlled by the .NET CLR. Unmanaged resources are those which are not controlled by the .NET CLR runtime, like File handles, COM objects, Connection objects, and so on.   Question 4: Can garbage collector clean unmanaged code? No, GC onl...

Top 10 .NET Core Web API Interview Questions (with Answers) in 2025

1. What is .NET Core and how is it different from .NET Framework? Answer: .NET Core is a cross-platform, open-source framework maintained by Microsoft. Unlike the .NET Framework, which is Windows-only, .NET Core runs on Windows, Linux, and macOS. It’s optimized for modern app development like microservices and cloud-based apps. 2. What is a Web API in .NET Core? Answer: A Web API is a framework for building HTTP-based services that can be consumed by a broad range of clients including browsers, mobile apps, and IoT devices. In .NET Core, Web API uses the ASP.NET Core MVC framework, but it returns data instead of views. 3. How do you create a simple Web API in .NET Core? Answer: Create a new project using dotnet new webapi . Define your controller by inheriting from ControllerBase . Use routing attributes like [HttpGet] , [HttpPost] , etc. Return data using ActionResult<T> . 4. What is Dependency Injection in .NET Core? Answer: Dependency Injection (DI) ...