FinTechInterview Flashcards
git merge vs git rebase
git merge creates a new commit that consists of two parent commits
the latest commit from the branch you are merging and into the latest commit from the branch that is being merged. The merged commit has two parents.
git rebase is taking the commits from master and applying them to your feature branch.
Lazy Loading
feature in EF Core that enables automatic loading of entities only when they are requested
EF Core Shadow Properties
Properties that are not defined in the entry class but are automatically created and managed by EF Core to store information such as foreign keys, metadata etc.
AsNoTracking()
Method that drops the tracking of entities from the DbContext. This could improve performance because entities are read only.
EF Core N+1 Query problem
This solves the problem of eager loading. Explicit loading is introduced and projection.
Lazy Loading, Explicit Loading, Projection
Lazy Loading: Data is loaded automatically when accessed.
Explicit Loading: Data is loaded manually by developers when needed.
Data is retrieved in a specific shape or with specific properties during the initial query.
Lazy Loading: Can lead to additional queries and performance issues.
Explicit Loading: Developers have more control, reducing the risk of performance issues.
Projection: Can optimize performance by retrieving only necessary data.
Difference between Process and a Thread
A process is an independent program with its own memory space.
A thread is a lightweight unit of execution within a process. Multiple threads within a process share the same memory space.
Mutex
A .NET primitive that ensures that only one thread can access a resource over time.
lock
The lock statement is used to guard a section in the code preventing multiple threads entering it.
Thread Pool
The Thread Pool is a technique used by the runtime to create and manage threads for each task. Threads from the pool are being pulled to improve performance.
What is TPL
TPL is a set of APIS in .NET that simplify parallel and concurrent programming. It includes Task and Parallel classes to help developers.
TPL vs async await
async await is a pattern used in asynchronous programming, allowing for non-blocking execution.
TPL is library allowing parallel programming including parallelizing CPU bound and I/O bound tasks.
ConfigureAwait(false) and ConfigureAwait(true)
ConfigureAwait(false) states explicitly that you do not want to use the original thread to continue the operation after the await keyword.
Task vs Thread
Represents an operating system thread. Threads are lower-level constructs provided by the operating system.
Represents a higher-level abstraction for parallel and asynchronous programming. It is built on top of the Thread Pool
Concurrency vs Parallelism
Concurrency is a concept where multiple tasks are making progress, seemingly simultaneously. It does not necessarily mean that tasks are executing in parallel or simultaneously at the exact same instant.
Parallelism is the simultaneous execution of multiple tasks in order to achieve faster results or improved throughput.
SQL Isolation levels
- Read Uncommitted
- Read Committed
- Repeatable Read
- Serializable
Common issues with transactions
- Dirty read A dirty read occurs when one transaction reads data that has been modified by another transaction but not yet committed.
- A non-repeatable read occurs when a transaction reads the same data multiple times within the same transaction, and the data is modified by another transaction in between the reads
- A phantom read occurs when a transaction reads a set of rows that satisfy a certain condition, and another transaction inserts, updates, or deletes rows that also satisfy the same condition between the first and second read.