Mic ET.N Flashcards

1
Q

What is the difference between a Stack and Queue?

A

Stacks process value types by a top-down hierarchy - last in, first-out (LIFO).

Queues follow this principle and insert items from the lower end while deleting ones from the top - first in, first-out (FIFO)

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

What are the 3 official types of JIT compilations?

A

Pre-JIT, Econo-JIT, Normal-JIT

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

What is Kestrel?

A

A cross-platform ASP.NET Core web server that is included by default in ASP.NET Core project templates

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

When would you use asynchronous actions?

A

To avoid blocking the request thread while waiting for an I/O operation

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

What is CoreCLR?

A

CoreCLR is the .NET execution engine in .NET Core that performs functions like garbage collection and compilation to machine code

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

When you define an Abstract Method, how do you use it in a derived class?

A

In your derived class, override the method

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

Which code do you use if you want to trigger a garbage collection in .NET?

A

System.GC.Collect();

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

You want to include language elements in a program. Which design pattern best fits this objective?

A

Decorator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
Define:
Interpreter
Command
Bridge
Decorator
Adapter
Singleton
A

???

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

What makes a strong-named assembly?

A

A signed assembly

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

What happens when you concatenate two strings?

A

A third string object is created containing the concatenated strings.

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

What is a delegate?

A

A delegate in .NET is similar to a function pointer in C or C++. Using a delegate allows the programmer to encapsulate a reference to a method inside a delegate object

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

Which is a set of features that extends the query capabilities of the .NET language syntax by adding sets of new standard query operators that allow data manipulation, regardless of the data source?

A

LINQ

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

What is the single responsibility principle?

A

A class should have only a single responsibility - that is, only changes to one part of the software’s specification should be able to affect the specification of the class

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

When should a developer use the .NET Standard class library project type?

A

When you want to increase the number of apps that are compatible with your library, and decrease the .NET API surface area your library can access

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

What is the difference between a SDK (software development kit) and runtime in .NET Core?

A

The runtime is the virtual machine that hosts and runs the application and abstracts all the interaction with the operating system; the SDK usually includes documentation and other help files

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

What is the Common Type System (CTS)?

A

The component of CLI in which .NET Framework provides support for several languages since it contains a type system that is common with all the languages

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

Assuming y is a value type, which is an example of boxing?

A

object thisObject = y;

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

What is an abstract class in .NET?

A

An abstract class declares a behavior that implementing classes must require. It may declare only properties, methods, and events with no access modifiers. All the declared members must be implemented

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

What is the namespace for caching information in .NET?

A

System.Runtime.Caching;

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

What is an interface in .NET?

A

An interface declares a contract or behavior that implementing classes require. It may declare only properties, methods, and events with no access modifiers. All the declared members must be implemented

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

What does CAS stand for and what does it do?

A

CAS stands for Code Access Security and it enables users to restrict, on a very granular level, what managed code can do according to a level of trust

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

Can a statement lambda return a value?

A

No

24
Q

If a statement lambda has a return value, does it have to use a return statement?

A

Yes

25
Q

Does a statement lambda require using curly braces?

A

Yes

26
Q

Can a statement lambda can have more than one statement?

A

Yes

27
Q

Is a read-only variable’s value evaluated at runtime?

A

Yes

28
Q

Can a read-only variable be static or an instance member?

A

Yes

29
Q

Can a read-only variable be initialized at declaration only?

A

No

30
Q

Can a read-only variable be initialized in either the constructor or the declaration?

A

Yes

31
Q

What is the difference between System.String and string?

A

There is none—string is an alias for System. String

32
Q

When break is used inside two nested for loops, does control come out of the inner for loop or the outer for loop?

A

It breaks from only the inner loop

33
Q

You want to separate object construction from its representation. Which design pattern best fits this objective?

A

Builder

34
Q

You want to encapsulate a command request as an object. Which design pattern best fits this objective?

A

Command

35
Q

Why would Pre-JIT be used by the .NET Framework?

A

To compile complete source code into native code in a single compilation cycle during deployment of the application

36
Q

What do code contracts do?

A

Code contracts provide a way to specify preconditions, postconditions, and object invariants in your code

37
Q

You must connect an app to an online identity provider using OAuth. For authentication, the app uses WebAuthenticationBroker object. You need to make sure the app registers with the provider. Which actions do you take?

A

Invoke the AuthenticateAsync method and construct an HTTPS request URI. //The requestUri parameter must be a HTTPS address and // You call the AuthenticateAsync method to // connect to the online identity provider and get an access token

38
Q

You want to create a class of which only a single instance can exist. Which design pattern best fits this objective?

A

Singleton

39
Q

What is the dependency inversion principle?

A

Entities must depend on abstractions, not on concrete implementations

40
Q

What is a namespace?

A

A group of classes, structures, interfaces, enumerations, and delegates—organized in a logical hierarchy by function that enable you to access the core functionality you need in your applications

41
Q

Which of the following selects an anonymous type?

A

select new { a.Country, a.Region }

42
Q

Is a Constant Variable’s value evaluated at runtime?

A

No

43
Q

What is the purpose of CLR?

A

CLR performs various operations such as memory management, security checks, assembly loading, and thread management. It also provides a secure execution environment for applications

44
Q

What is CIL?

A

Common Intermediate Language

Formerly known as MSIL, CIL is a programming language that NET developers use. It represents the lowest possible level for a language that humans can still read

45
Q

___ pattern works as a bridge between two incompatible interfaces? // wording in question is maybe changed?

A

Adapter

46
Q

Why would you use ahead-of-time (AOT) compilation?

A

You can deliver a faster startup time, especially in big applications where a lot of code executes on startup

47
Q

Which statement describes a Dispose method?

A

It belongs to the IDisposable interface and is used to free resources, such as network connection and files

48
Q

What is a thread?

A

A single operation that does not return a value and that usually executes asynchronously

49
Q

You want to add responsibilities to object dynamically. Which design pattern best fit this objective?

A

Decorator

50
Q

Which choice creates an 8-tuple containing prime numbers that are less than 20?

A

var primes = Tuple.Create(2, 3, 5, 7, 11, 13, 17, 19);

51
Q

How can you recieve form data without a model binder in a controller action?

A

public IActionResult ReceivedDataByRequest() { string theName = Request.Form[“theName”]; return View(); }

52
Q

Where should you store connection string information?

A

In configuration files

Environmental variables?

53
Q

Why use design patterns?

A

Design patterns help you solve issues related to sofware development using a proven solution, and make communication between developers more efficient

54
Q

What is a task?

A

A single operation that does not return a value and that usually executes asynchronously

55
Q

Is the .NET framework class library a component of .NET Framework?

A

No

56
Q

Can a constructor use a base statement and a this statement if the base statement comes first?

A

No

57
Q

When should you use the .NET Core class library project type?

A

When you want to increase the .NET API surface area your library can access, and allow only .NET Core apps to be compatible with your library