HomeCode HereC# final quiz C# final quiz Admin 1 min read Updated November 16, 2026 Ten mixed questions covering the whole C# track, from the SDK to the capstone. C# C# final quiz 10 questions, instant feedback Question 1 of 10 What does dotnet run do? A Only compiles B Builds and executes the project C Restores packages only D Publishes dotnet run restores if needed, builds, and starts the program. Question 2 of 10 Which type is best for a count of items? A double B int C decimal D char int holds whole numbers up to about 2.1 billion. Use long beyond that. Question 3 of 10 What does string.IsNullOrWhiteSpace check? A Length only B Null, empty or whitespace-only C Case D Encoding It covers the three cases that make a text field effectively empty, which is why it is the usual input check. Question 4 of 10 What is the difference between == and Equals for records? A Nothing B == uses value equality for records, as does Equals C == compares references only D Equals throws Records generate Equals and also overload ==, so both compare the values of the fields. Question 5 of 10 Which collection preserves insertion order and allows duplicates? A HashSet B List C Dictionary D SortedSet A list is an ordered sequence with duplicates. A set removes duplicates; a dictionary maps unique keys. Question 6 of 10 What does FirstOrDefault return for an empty sequence? A An exception B null or default(T) C 0 always D The first element It returns default(T), which is null for reference types and 0 for int, so an absent result can be ambiguous for value types. Question 7 of 10 What does await do to the calling method? A Blocks the thread B Suspends it until the task completes, freeing the thread C Starts a new thread D Cancels the task await returns control to the caller while the operation runs, then resumes the method when it finishes. Question 8 of 10 What does a nullable int? mean? A An int that may be null B A reference type C A dynamic value D A readonly int int? is Nullable, which adds HasValue and Value so a missing number can be represented. Question 9 of 10 What does an ASP.NET Core minimal API define? A A database schema B Routes and handlers in Program.cs C A test suite D A build script Minimal APIs map a route and an HTTP method to a delegate, which is enough for small services. Question 10 of 10 What makes a unit test useful? A It covers many behaviours in one method B It checks one rule and fails with a clear message C It uses the real database D It runs slowly One rule per test keeps failures diagnosable. A test that checks five things tells you little when it fails. Check my answers Try again Your answers stay in this browser. Nothing is sent to a server. More quizzes C# basics quiz Coming soon C# control flow quiz 9 questions C# objects quiz 9 questions All quizzes