.NET MCQs with Answers

Programming Practice

Practice .NET MCQs with answers.

Distraction-free environment with keyboard shortcuts (1-4, Enter, Esc)

Programming / Programming

.NET MCQs

50 Questions

Practice .NET MCQs with answers.

0 / 302 answered0 correct0 incorrect

1What is the purpose of 'System.Text.Json' in modern .NET compared to Newtonsoft.Json?

2What does 'IApplicationBuilder.UseEndpoints' do in modern ASP.NET Core?

3What is the purpose of 'WebApplication.CreateBuilder(args)' in modern .NET (6/7/8/9)?

4What is the purpose of 'Health Checks' in ASP.NET Core (e.g. app.MapHealthChecks("/health"))?

5What is 'Output Caching' introduced in .NET 7 / ASP.NET Core?

6What is the purpose of 'Rate Limiting' middleware introduced in .NET 7?

7What is 'Optimistic Concurrency' in EF Core and how is it usually implemented?

8What does 'context.Database.Migrate()' do in EF Core?

9What is the purpose of 'Value Conversions' in EF Core (e.g. HasConversion)?

10What is a 'Shadow Property' in Entity Framework Core?

11What does the '[AllowAnonymous]' attribute do when placed on an action inside an authorized controller?

12What does the '[Authorize]' attribute do in ASP.NET Core?

13What is 'Response Caching' middleware in ASP.NET Core?

14What is the difference between 'AddHttpClient' and creating new 'new HttpClient()' instances in C#?

15What is the purpose of 'IHostedService' and 'BackgroundService' in .NET / ASP.NET Core?

16How do you configure route constraints in ASP.NET Core route templates (e.g. matching an integer ID)?

17What is the RFC specification used by ASP.NET Core for standardizing HTTP API error responses?

18What is the purpose of 'Global Exception Handling' middleware (e.g. app.UseExceptionHandler()) in ASP.NET Core?

19What is the purpose of the 'AddDbContextPool' method in EF Core?

20What is the purpose of 'CORS' (Cross-Origin Resource Sharing) middleware in ASP.NET Core?

21What does '[FromServices]' specify?

22What does '[FromRoute]' specify?

23What does '[FromQuery]' specify when decorating a controller action parameter?

24What is the purpose of the '[ApiController]' attribute on a C# controller class in ASP.NET Core?

25What is the purpose of 'Action Filters' in ASP.NET Core MVC / Web API?

26What CLI command applies pending migrations to the database in EF Core?

27What CLI command creates a new Entity Framework Core code-first migration?

28What is the hierarchy order of standard log levels in Microsoft.Extensions.Logging from lowest to highest severity?

29Why should string interpolation ($) be avoided when calling ILogger methods (e.g. logger.LogInformation($"User {user} logged in"))?

30What is 'Structured Logging' in ASP.NET Core (e.g. logger.LogInformation("Order {OrderId} processed for {Amount}", id, amt))?

31What is the difference between 'IOptions<T>', 'IOptionsSnapshot<T>', and 'IOptionsMonitor<T>' in ASP.NET Core?

32What does 'context.SaveChanges()' return in Entity Framework Core?

33What is 'Explicit Loading' in EF Core?

34What is the 'N+1 Query Problem' commonly caused by naive Lazy Loading in ORMs like EF Core?

35What is 'Eager Loading' in Entity Framework Core and how is it implemented?

36What is the purpose of '.AsNoTracking()' in EF Core LINQ queries?

37What is the default service lifetime of a DbContext registered via 'services.AddDbContext<MyDbContext>()'?

38What is 'DbContext' in Entity Framework Core?

39What is 'Minimal APIs' introduced in .NET 6?

40What is the recommended placement order between 'UseAuthentication()' and 'UseAuthorization()' in ASP.NET Core?

41Why is the ordering of middleware in Program.cs critical in ASP.NET Core?

42What is the difference between 'app.Use' and 'app.Run' when configuring middleware in ASP.NET Core?

43What is 'Middleware' in ASP.NET Core?

44How does ASP.NET Core detect captive dependencies during local development?

45What is a 'Captive Dependency' bug in ASP.NET Core Dependency Injection?

46What is the lifetime of a service registered with 'services.AddSingleton<IService, Service>()'?

47What is the lifetime of a service registered with 'services.AddScoped<IService, Service>()'?

48What is the lifetime of a service registered with 'services.AddTransient<IService, Service>()'?

49What are the three service lifetimes provided by the built-in ASP.NET Core Dependency Injection (DI) container?

50What is Kestrel in ASP.NET Core?

Previous TopicTopic 1 of 49 · More questions availableNext Topic

Comprehensive Question Hub

Subject-Wise MCQ Practice

Select any core Computer Science or programming subject below to access dedicated practice questions, answers, and topic-wise modules.

Practice Computer Science MCQs27 Core Subjects

Fundamental CS engineering subjects covering systems, theory, and data architecture.

Programming Language MCQs9 Languages

Practice coding output questions, language syntax, OOP paradigms, and standard libraries.

Targeted Exam Preparation

MCQs for Competitive Exams

Prepare with exam-specific question banks tailored to syllabi, previous years' question papers, and negative-marking criteria.

Teaching Exam

BPSC TRE 2.0 Computer Science

Practice BPSC TRE 2.0 Class 11-12 Computer Science previous-year questions with solutions.

Teaching Exam

BPSC TRE 3.0 Computer Science

Practice BPSC TRE 3.0 Class 11-12 Computer Science previous-year questions with solutions.

Teaching Exam

BPSC TRE 4.0 Computer Science

Practice BPSC TRE 4.0 Class 11-12 Computer Science previous-year questions with solutions.

Teaching Eligibility Test

Bihar STET Paper II Computer Science

Practice Bihar STET Paper II Class 11-12 Computer Science questions with solutions.

National Exam

GATE Computer Science (CSE)

High-yield engineering questions covering Algorithms, Theory of Computation, Compiler Design, Computer Organization, and Operating Systems.

Assistant Professor & JRF

UGC NET Computer Science

Comprehensive question sets aligned with NTA UGC NET Paper II syllabus, featuring theoretical foundations, discrete math, and systems.

Government Recruitment

SSC & State Technical Exams

Foundational and practical MCQs for technical assistants, programmers, and informatics officers in central and state departments.

Why Practice MCQs on CodeZov?

A modern, high-yield practice platform designed to build speed, accuracy, and deep conceptual clarity.

Instant Answers & In-Depth Explanations

Receive immediate validation with step-by-step technical explanations and code breakdown so you learn from mistakes on the spot.

Full-Screen Distraction-Free Exam Mode

Simulate authentic exam environments with dedicated Full-Screen mode, keyboard shortcuts (1-4, A-D, Enter), and a live question matrix.

Topic-Wise & Subject-Wise Syllabus

Explore modular practice sets across Data Structures, Algorithms, DBMS, Operating Systems, Computer Networks, and modern programming languages.

Previous Year Questions (PYQs)

Solve authentic previous year questions adapted from BPSC TRE Computer Science, GATE CSE, and UGC NET question papers.

Ready to Deepen Your Conceptual Knowledge?

MCQ practice is most effective when paired with structured conceptual tutorials, career roadmaps, and full-length timed mock tests. Check out CodeZov's free resources to boost your preparation.

Core Syllabus Coverage

  • Programming (C, C++, Java, Python, SQL)
  • Data Structures & Algorithms
  • Database Management Systems (DBMS)
  • Operating Systems & Architecture
  • Computer Networks & Cybersecurity

Frequently Asked Questions

Answers to common questions about practicing Computer Science MCQs on CodeZov.

What are MCQs?

Multiple-Choice Questions (MCQs) are objective assessment questions where learners select the correct option from multiple choices. In Computer Science, MCQs evaluate theoretical understanding, code snippet outputs, algorithm time complexities, and system architecture fundamentals.

Can I practice Computer Science MCQs online?

Yes, CodeZov offers 100% free online Computer Science MCQ practice with instant scoring, step-by-step explanations, code execution analysis, and Hindi translations without requiring mandatory registration or fees.

Are MCQs available topic-wise?

Yes, all questions on CodeZov are systematically organized by subject (such as DBMS, Operating Systems, Data Structures) and further categorized into specific topics (such as Trees, Normalization, CPU Scheduling, and TCP/IP) for focused preparation.

Do MCQs include answers and explanations?

Every MCQ on CodeZov features verified correct answers alongside in-depth conceptual explanations. Many questions also include bilingual Hindi explanations and line-by-line code breakdowns to ensure complete conceptual clarity.

Which subjects are available for MCQ practice?

CodeZov provides MCQs across over 40 technical subjects including C Programming, C++, Java, Python, Data Structures, Algorithms, DBMS, Operating Systems, Computer Networks, Theory of Computation, Compiler Design, Digital Logic Design, and Software Engineering.

Can I use MCQs to prepare for competitive exams?

Yes, our question bank is specifically curated for competitive examinations including BPSC TRE Computer Science (Class 11-12), GATE CSE, NTA UGC NET / JRF, ISRO, NIELIT, Kendriya Vidyalaya (KVS/NVS) PGT Computer Science, and university semester exams.