C# Mastery Hub
Home
Challenges
Discussion
Lessons
Core Topics
C# Fundamentals
Console Applications
Classes & OOP
Windows Forms
ASP.NET Core
SQL Server
VS & SQL Connection
RDLC Reports
.NET MAUI
Getting Started
Getting Started
Website Development
SEO Guide
Security
Project Workflow
Extra Topics
Cloud & Deployment
AWS Cloud
Deployment
About
Contact
Test Your Knowledge
Extra Topics (Full Section) Quiz
Answer all questions to test your understanding
1
What is Git?
A programming language
A version control system
A web framework
A database
2
What command initializes a new Git repository?
git start
git init
git new
git create
3
What is the purpose of a .gitignore file?
To ignore all files
To specify which files Git should not track
To ignore Git commands
To delete files
4
What does 'git add .' do?
Adds all files to the repository
Stages all changes for commit
Deletes all files
Creates a new branch
5
What is a Pull Request?
A request to pull changes from GitHub
A request to merge code changes
A request to delete a branch
A request to create a new repository
6
What command creates a new branch in Git?
git branch new
git checkout -b
git branch -c
git new-branch
7
What is the purpose of unit testing?
To test the entire application
To verify individual code units behave correctly
To test the database
To test the user interface
8
What does the AAA pattern stand for in testing?
Arrange, Act, Assert
Action, Analyze, Assert
Arrange, Assert, Act
Act, Arrange, Assert
9
What is the difference between [Fact] and [Theory] in xUnit?
[Fact] is for single tests, [Theory] is for data-driven tests
[Theory] is for single tests, [Fact] is for data-driven tests
They are the same
[Fact] is for async tests only
10
Which command runs unit tests in .NET?
dotnet run tests
dotnet test
dotnet build tests
dotnet execute tests
11
What is the purpose of Assert in unit testing?
To arrange the test data
To verify the expected result
To execute the code
To setup the test
12
How do you test that a method throws an exception in xUnit?
Using try-catch
Using Assert.Throws
Using ExceptionAssert
Using throws keyword
13
What is the Singleton pattern?
A pattern that ensures only one instance of a class exists
A pattern that creates multiple instances
A pattern for database access
A pattern for UI design
14
What is the purpose of the Factory pattern?
To create objects without specifying the exact class
To destroy objects
To manage object lifecycle
To optimize performance
15
What is the Repository pattern used for?
To separate data access logic from business logic
To store configuration
To manage user sessions
To handle errors
16
What is Dependency Injection?
A pattern where objects receive their dependencies from an external source
A pattern where objects create their own dependencies
A pattern for database access
A pattern for UI design
17
What is the Strategy pattern?
A pattern that allows swapping behavior at runtime
A pattern for database access
A pattern for UI design
A pattern for error handling
18
Which pattern is commonly used with Dependency Injection?
Singleton
Factory
Repository
All of the above
19
What is the purpose of async/await in C#?
To make code run faster
To handle asynchronous operations without blocking threads
To simplify error handling
To improve memory management
20
What type does an async method typically return?
void
Task
Task<T>
Either B or C
21
What does the await keyword do?
Blocks the thread
Suspends execution until the awaited task completes
Creates a new thread
Cancels the operation
22
What is Task.WhenAll used for?
To run tasks sequentially
To run multiple tasks in parallel
To cancel tasks
To handle errors in tasks
23
What is the difference between Result and await on a Task?
Result blocks, await doesn't
await blocks, Result doesn't
They are the same
Result is faster than await
24
How do you handle exceptions in async methods?
Using try-catch blocks
Using the catch keyword
Using Exception Handling
All of the above
25
What does REST stand for?
Representational State Transfer
Representative State Transfer
Restful State Transfer
Response State Transfer
26
What HTTP method is used to retrieve data in a REST API?
POST
GET
PUT
DELETE
27
What HTTP method is used to create new data in a REST API?
GET
POST
PUT
DELETE
28
What is the purpose of the [ApiController] attribute?
To enable automatic model validation
To disable model validation
To enable CORS
To disable authentication
29
What does the [Route] attribute do?
Defines the URL route for a controller or action
Defines the HTTP method
Defines the response format
Defines the authentication method
30
What status code does CreatedAtAction return?
200 OK
201 Created
204 No Content
404 Not Found
31
What is NuGet?
A programming language
A package manager for .NET
A web framework
A database
32
What command installs a NuGet package using the .NET CLI?
dotnet install package
dotnet add package
dotnet get package
dotnet new package
33
What command installs a NuGet package using Package Manager Console?
Install-Package
Add-Package
Get-Package
New-Package
34
Where are installed NuGet packages listed?
In the .csproj file
In the appsettings.json file
In the Program.cs file
In the Git ignore file
35
What is Newtonsoft.Json used for?
JSON serialization and deserialization
Database access
Logging
Testing
36
What should you consider before installing a NuGet package?
The publisher's reputation
The download count
The license
All of the above
Submit Quiz