C# Flashcards

(25 cards)

1
Q

.NET Framework statements — FCL is OOP, CLR hosts apps.

A

Both True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Method for memory cleanup in C#?

A

All of these: Dispose, Finalize, GC.Collect

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Free Visual Studio for Azure DevOps interactions (non-devs)?

A

Team Explorer 2019

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

True .NET statements about CTS & XML classes?

A

ii and iii only

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Correct about indexers?

A

Invoked through instance index, declared with 1+ params

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

CTS matches with?

A

Describes how data types are declared

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which of the following statements about LINQ are true?
1. LINQ is a programming model introducing data querying methodology for implementing queries
2. LINQ has a syntax quite different from SQL
3. LINQ can be used to query in-memory object collections, SQL databases, and XML
4. LINQ enables developers to work with different formats of data across various data sources

A

Correct: 1, 3, 4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which of the following new features replaces a block of code with a single statement for execution?
i) Improved throw Expressions
ii) More Expression-bodied Members

A

Correct Answer: ii only

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Which pattern matching is introduced in C# 9.0?

A

Correct Answer: Positional pattern

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is used to deconstruct an expression result and test if the resulting values match the nested patterns?

A

Correct Answer: Positional pattern
Explanation: Used with Deconstruct() methods to match nested patterns.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What C# feature reads attributes or other code elements using Roslyn analysis APIs?

A

Improved Support for Code Generators

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which of the following is/are new features of C# 9.0?
- Native sized integers
- Function pointers
- Omitting the localsinit flag

A

Correct Answer: All of these

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which page is a special view page containing the statement declaration to include the Layout page?

A

_ViewStart.cshtml

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What provides a complete platform to create a Web application (also called Web app)?

A

.NET 5.0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which of the following statements about different types of C# statements are correct?
- Selection statements transfer the flow from one block to another
- Iteration statements help you execute a block repeatedly
- Jump statements transfer control after condition check
- Exception handling statements manage execution hindrances

A

Correct Answers:
✔️ Selection – Correct
✔️ Iteration – Correct

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is ‘into’ used for in LINQ?

A

Used to introduce a range variable to store sub-expression results in a query expression.

17
Q

What is ‘by’ used for in LINQ?

A

Used in a group clause.

18
Q

What is ‘from’ used for in LINQ?

A

Used to indicate a data source and a range variable.

19
Q

What is ‘let’ used for in LINQ?

A

Used to indicate an identifier which serves as a reference to the results of a join, select, or group clause.

20
Q

Which of the following keywords are associated with iteration statements?

A

Correct Answer: foreach, while

21
Q

Which of following is not true for Properties?

A

Correct Answer: Can never be declared as static

22
Q

A method can contain a parameter that a developer can pass by reference using the _______ keyword.

A

Correct Answer: ref

23
Q

The ________ keyword, is also useful for passing a parameter by reference.

A

Correct Answer: out

24
Q

From which version onwards can developers specify the data type of all out parameters inline instead of declaring them prior to passing them as parameters?

A

Correct Answer: C# 7.0

25
The compiler for _______ onwards is capable of inferring the element names of a tuple from local variables, null conditional members, and other members such as properties.
Correct Answer: C# 7.1