Part I (closed) Flashcards
Odpowiednik repozytorium i UoW w EF?
DbSet i DbContext
What is kernel responsible for?
CPU, RAM, I/O
What is virtual addressing?
Layer of abstraction between process and memory. If not enough available memory then writing to disk happens.
Describe interrupts on example of disk?
Processor asks disk for data but doesn’t wait for the result but comes back to executing some other work. When disk is ready it interrupts the processor.
What’s the purpose of expression trees?
To translate code into data that can be then translated e.g. into string (LINQ to SQL) and executed somewhere
Difference between arithmetic and logical bit shift?
Arithmetic right shift includes the sign but while logical uses zeros.
Template method vs strategy?
Template uses inheritance, strategy uses interfaces, more runtime. Template method can substitute only part of algorytm that is the derived class.
What is IOCP?
I/O completion port - API in Windows for asynchronous I/O operations
What thread pools are there in .NET how they are different?
Worker Process Thread Pool and IOCP Thread Pool. IOCP uses OS-managed queue while worker process thread pool uses managed .NET queue.
How is thread pool related to application domain?
Each app domain has its own thread pool.
Why and when setting min threads in thread pool can be advantageous?
When app has to deal with many requests at once. Thread pool is updated every 500ms and then additional threads are eventually created.
What is preemptive multithreading?
A situation in which a thread can be suspended after reading a variable from memory but before manipulating it and storing in the memory.
Database denormalization
Keeping redundant data in tables if very much data in Db and joins could cost too much.
Describe 3 normal forms of a database
First that each column has only one piece of information (eg separate columns for different address parts). Second that each category of information should be stored separately and keys should be introduced. Third that each informational column that can be computed from others should be dropped.
What is a ViewBag?
One way of providing data to a view in ASP.NET MVC.
It is not strongly typed. Preferred way of providing data is through a view model.