Study FSP Flashcards

1
Q

Polymorphism

A

It means that different objects can be used in the same way.
Example: Imagine a base class called Animal with a method called Speak(). A Dog class and a Cat class both inherit from Animal and each has its own version of Speak(). When you call Speak() on an animal, the correct version (bark or meow) is used.

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

Abstraction

A

Abstraction is about hiding complex details and showing only the important parts.
Example: You can think of a Vehicle where you only see the basic controls (start, stop) without knowing how the engine works inside.

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

Value Type

A

These are simple data types (like numbers or small structures) that hold their value directly. For example, an int variable stores a number directly.

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

Reference Type

A

These types (like classes and arrays) store a reference to the data, not the data itself. Imagine it as an address that tells you where the data is kept in memory.

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

Class

A

Is a reference type. It supports inheritance (one class can be based on another) and is stored in a shared area of memory (heap).

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

Struct

A

Is a value type. It is often used for small, simple pieces of data and is stored directly (on the stack).

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

Array

A

Has a fixed size, meaning once you create it, you cannot change its length.

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

List

A

Can grow or shrink as you add or remove items, and it has many helpful methods (like adding or removing items).

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

Interface

A

It only tells what methods a class should have but doesn’t include any code.

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

Abstract class

A

Can have some code already written (and can include data) while still requiring some methods to be implemented by its child classes.

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

Boxing

A

Converting a simple type (like an int) into an object so it can be used as a reference type.

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

Unboxing

A

Getting the simple type back from the object.

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

Generics

A

Generics let you create classes or methods that can work with any data type.
Example: List can be a list of integers (List) or strings (List) without writing separate classes for each type.

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

Extension Methods

A

This feature lets you add new methods to an existing type without changing its original code.
Example: You can add a method ToTitleCase() to the string type so that you can call it like this:

“hello world”.ToTitleCase();
This new method might change the string to “Hello World”.

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

Delegate and Types of Delegates

A

A delegate is like a pointer to a method, allowing you to pass methods as parameters.

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

Single-cast delegate

A

Points to one method.

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

Multicast delegate

A

Can point to several methods.

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

Reflection

A

Reflection lets you look at the details of your code while it is running.
Example: You can ask a class “What properties do you have?” and get the answer even if you did not write that information explicitly.

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

IEnumerable

A

It’s used to iterate through a collection (like a list or array) in memory.

It works with any data that is already loaded.

It does not support database operations directly.

Executes queries immediately (when the loop starts).

List<int> numbers = new List<int> { 1, 2, 3, 4 };
IEnumerable<int> even = numbers.Where(n => n % 2 == 0);</int></int></int>

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

IQueryable

A

It’s designed for querying data from a database (like with Entity Framework).

It builds an expression tree and translates it into a SQL query.

Executes the query only when you use the data (e.g., with ToList()).

More efficient for database queries because the filter happens on the server, not in memory.

IQueryable<User> users = dbContext.Users.Where(u => u.Age > 18);</User>

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

Parallel Programming

A

Runs several tasks at the same time, often on different CPU cores, to finish work faster.

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

Async Programming

A

Lets your program do other things while waiting for a long task (like reading a file or a web call).

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

POST

A

Usually used to create a new resource (like adding a new record).

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

PUT

A

Used to update an existing resource completely.

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

PATCH

A

Only changes part of a resource.

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

Usage of [FromBody] in a Controller

A

Gets data sent in the request body (often in JSON format)

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

Usage of [FromQuery] in a Controller

A

Gets data from the URL’s query string (after the ? symbol).

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

Usage of [FromRoute] in a Controller

A

Gets data from the URL path itself.

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

Steps to Register a Service using Dependency Injection

A

Create an interface (contract) and its implementation (the class).

In your configuration (often in Startup.cs or Program.cs), add the service to the container using methods like AddTransient, AddScoped, or AddSingleton.

28
Q

Scoped

A

A new instance is created every time the service is requested.

29
Q

Transient

A

A single instance is used for each request from the client.

30
Q

Singleton

A

Only one instance is created and shared throughout the whole application.

31
Q

Claims and Claims in JSON Web Token (JWT)

A

Claims are pieces of information about a user (like user name, email, or roles) that are stored in a token. They help the system decide what the user can or cannot do.

32
Q

Action Filters

A

These are special classes that run code before or after an action (a method in a controller) is executed. They are useful for tasks like logging, security, or error handling.

33
Q

Multiple DbContext in Entity Framework:

A

Yes, you can have more than one DbContext. This might be useful if you need to work with different databases or separate parts of your application.

34
Q

Navigation Properties in Entity Framework

A

They are properties that create a link between different entities (tables). For example, an Order entity might have a navigation property to a Customer entity.

35
Q

Include

A

Helps you load related data along with your main data. Loads one level of related data.

36
Q

ThenInclude

A

Helps you load related data along with your main data. Loads further details from the already included data.

37
Q

AsNoTracking

A

This method tells Entity Framework not to track changes to the data. It makes reading data faster when you do not plan to update it.

38
Q

Lazy Loading in Entity Framework:

A

This is when related data is only loaded when you try to use it for the first time, rather than loading everything at once.

39
Q

Unit testing tools

A

Common tools for testing in .NET include MSTest, NUnit, and xUnit. These tools help you run tests to check if your code works correctly.

40
Q

Constraints in SQL

A

Constraints are rules you set on your database tables to ensure data is correct. Examples include:

PRIMARY KEY: Unique identifier for each row.

FOREIGN KEY: Ensures that a value matches a value in another table.

UNIQUE: No duplicate values are allowed.

NOT NULL: A field must have a value.

41
Q

Index

A

An index helps the database find data faster, like an index in a book.

42
Q

Clustered Index

A

Determines how data is physically stored in the table. There can be only one per table.

43
Q

Unclustered Index

A

A separate structure that points to the data’s location. You can have many nonclustered indexes per table.

44
Q

Creating an Identity Column

A

When you create a table, you can make a column automatically add a new number for each new row using the IDENTITY property. Example:

CREATE TABLE Users (
UserID INT IDENTITY(1,1) PRIMARY KEY,
UserName NVARCHAR(100)
);

45
Q

Cross Join

A

This join creates every combination of rows from two tables. It pairs each row from the first table with every row from the second table.

45
Q

UNION

A

Combines two sets of results but removes duplicate rows.

46
Q

UNION ALL

A

Combines the results and keeps all duplicate rows.

47
Q

TRUNCATE

A

Quickly removes all rows from a table and resets identity counters. It does not remove table structure.

48
Q

DELETE

A

Removes rows one by one and can remove only specific rows using a condition.

49
Q

Stored Procedure

A

A set of SQL commands that can change data or perform actions. It does not have to return a value.

50
Q

Function

A

A set of SQL commands that must return a value and is often used inside queries.

51
Q

Module

A

A container that groups related components, services, and code together.

52
Q

Component

A

A part of the user interface (UI) that controls what you see on the screen.

53
Q

Sharing Information Between Components

A

Using Input and Output properties for parent-child communication.

Creating a shared service that holds data and is available to many components.

Using event emitters or state management tools for more complex data sharing.

54
Q

Component Lifecycle Hooks

A

These are special methods that Angular calls at different times in a component’s life. For example:

ngOnInit: Called when the component is created.

ngOnDestroy: Called when the component is removed.

55
Q

Structural Directives

A

Change the structure of the HTML of the page by adding or removing elements (for example, *ngIf or *ngFor)

56
Q

Component directives

A

Are essentially components that enhance or display parts of the UI.

57
Q

Pipes and Examples

A

Pipes are simple functions that transform data in your templates. Examples:

date: Formats a date value.

currency: Formats a number as money.

uppercase: Changes text to uppercase.

58
Q

One-way and Two-way Data Binding

A

One-way binding: Data moves from your component to the view (using {{ }} or [property]= “value”).

Two-way binding: Data moves in both directions between the view and the component (using [(ngModel)]).

59
Q

Service

A

A service is just a class that contains logic or data you want to share across components.

60
Q

Provider

A

A provider tells Angular how to create or deliver an instance of a service.

You register the service as a provider so Angular can inject it where needed.

@Injectable({
providedIn: ‘root’ // Angular auto-registers it globally
})
export class UserService { }

61
Q

Template-driven Forms

A

The form is built mostly in the HTML template using Angular directives. It is easier for simple forms.

62
Q

Reactive Forms:

A

The form is built in the component class using code, giving you more control and easier testing.

63
Q

Router Component

A

This is the part of Angular (often called RouterOutlet) that displays different components based on the URL. It helps create a single-page application with multiple views.

64
Q

RxJS

A

RxJS is a library to work with asynchronous data (data that comes in over time) using streams called Observables. It makes handling events and data updates

65
Q

Jasmine

A

A framework to write tests for your code.

66
Q

Karma

A

A tool to run these tests in real web browsers.

67
Q

Microservices Architecture Experience

A

This means working with a system made up of small, independent services that work together. In a microservices system, each service has its own responsibility and communicates with others over APIs.