0% found this document useful (0 votes)
5 views3 pages

C# Interview Preparation Guide

Uploaded by

userstudent7758
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views3 pages

C# Interview Preparation Guide

Uploaded by

userstudent7758
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

C# Complete Interview Guide

Overview
C# is an object-oriented, component-based programming language developed by Microsoft. It
combines power of C++ and simplicity of Visual Basic.

Key Features
Object-oriented, Type-safe, Automatic garbage collection, Cross-platform, Rich class library.

.NET Relationship
C# runs on .NET; CLR executes code and BCL provides base libraries.

OOP Concepts
Encapsulation, Abstraction, Inheritance, Polymorphism.

Access Modifiers
public, private, protected, internal, protected internal, private protected.

Data Types
Value (int, bool), Reference (class, string), Nullable (int?).

Boxing/Unboxing
Boxing: value→object; Unboxing: object→value.

Control Statements
if-else, switch, loops (for, while, foreach), break, continue.

Collections
ArrayList, List, Dictionary, Queue, Stack.

Strings
Immutable; use StringBuilder for mutable strings.

Properties
Access fields via get/set; supports encapsulation.

Constructors
Default, Parameterized, Copy, Static; destructors clean resources.
Polymorphism
Overloading (compile-time) & overriding (runtime).

Abstraction
Using abstract classes or interfaces to hide details.

Sealed/Static/Partial
sealed blocks inheritance; static has only static members; partial splits class definition.

Exception Handling
try, catch, finally, throw; can create custom exceptions.

Delegates
Type-safe method references; can be multicast or anonymous.

Events
Use delegates to notify subscribers.

Generics
Type-safe collections improving performance; e.g., List.

LINQ
Query syntax in C# for objects, SQL, XML; uses from, where, select.

Asynchronous Programming
async/await keywords enable non-blocking tasks.

Threads
[Link] and Task Parallel Library (TPL).

File I/O
[Link] namespace with File, StreamReader, StreamWriter.

Assemblies
Compiled .dll/.exe with metadata; logical grouping via namespaces.

Reflection
Inspect metadata at runtime using [Link].
Attributes
Add metadata to classes and methods like [Serializable].

Garbage Collection
Automatic memory management by CLR.

Dynamic/Anonymous Types
Dynamic typing and inline anonymous objects.

Records
Immutable reference types for data storage.

New Features
Records, pattern matching, top-level statements, nullable references.

Common Interview Questions


- Difference between value type and reference type?
- Explain boxing and unboxing.
- Difference between abstract class and interface.
- What are delegates and events?
- Explain LINQ and its uses.
- What is async/await?
- What is reflection?
- Difference between finalize() and dispose().

You might also like