As I posted my first article on interview notes, I got great feedback from my peers, so here is part 2. I will cover 20 topics in this list.
Topics List is :
- CI/CD
- Solid Principles
- String vs StringBuilder vs StringBuffer
- Delegates
- ASP.NET Core Middleware
- REST vs SOAP
- Ways to Secure APIs
- Areas in MVC
- Viewdata vs Viewbag vs Tempdata
- Entityframework vs ADO.Net
- NoSQL
- Indexes
- Linkedlist vs Array
- List vs ArrayList
- Hashtable vs Dictionary
- ASP.Net Page Life Cycle
- Message Queue
- Garbage Collector
- IEnumerable vs IQuerable
- Generics vs Non-Generics
Lets get going and finish the task.
1.CI/CD
- This is the method by which we deliver apps to customer frequently
- This is done by automating app development processes
a) Continuous Integration (CI)
- Build, Test and Merge.
- Helps developers merge code frequently.
- Automated testing and building.
- Makes easier to fix those bugs.
b) Continuous Delivery (CD_1)
- Goal of continuous delivery is to have a consistent repository.
- Automatically release to repository.
c) Continuous Deployment (CD_2)
- Automatically deploy to production.
- This is extension of continuous delivery.
- Automates releasing of app to production.
- Relies on well-defined test automation.
2. Solid Principles
a) Single Responsibility Principle:
- Class should do one thing and therefore it should have single reason to change.
- Makes version control easier.
- Less merge conflicts.
b) Open-Closed Principle:
- Classes should be open for extension but closed for modification.
- It can be achieved through help of interfaces and abstract classes.
c) Liskov Substitution Principle;
- Sub classes should be substitutable for their base classes.
- No weird output even if A->B or B->A.
- Child class extends behavior but never narrows down behavior.
d) Interface Segregation Principle:
- Its about separating the interfaces
- Many client specific interfaces are better than one general purpose interface.
e) Dependency Inversion Principle:
- Our class should depend on interface or abstract class rather than concrete classes/functions.
- This is primary mechanism for Object Oriented Programming.
https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fyxf2spbpTSw&display_name=YouTube&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dyxf2spbpTSw&image=http%3A%2F%2Fi.ytimg.com%2Fvi%2Fyxf2spbpTSw%2Fhqdefault.jpg&key=a19fcc184b9711e1b4764040d3dc5c07&type=text%2Fhtml&schema=youtube
3. String vs StringBuilder vs StringBuffer
- String is immutable type.
- StringBuilder and StringBuffer are mutable type.
- Unlike string, string builder instance doesn’t result in creation of new instance in memory.
4. Delegates
- Object which refers to method or reference to methods.
- Similar to function pointer in C/C++.
- Encapsulate Methods.
- Type-safe pointer to method.
- Used for call back / events.
5. ASP.NET Core Middleware
- Middleware is nothing but a component class which is executed on every request in ASP.NET core application.
- There can be multiple middlewares.
- They can be either framework based or NuGet based or custom.
- It builds request pipeline.
6. REST vs SOAP
- REST means Representational State Transfer.
- SOAP means Simple Object Access Protocol.
- REST is based on URL(URI), Http, JSON while SOAP is based on XML and is more complex and secure than REST
- REST is simple to build and scale.
- SOAP complies with ACID properties ( Atomicity, Consistency, Isolation, Durability)
- There is successful and re-try logic in SOAP as well.
- SOAP cant be cached while REST can be cached.
- REST is built on Client-Server architecture.
7. Ways to Secure APIs
- TLS/SSL.
- OAuth2 (SSO).
- Token.
- Different Permission Levels.
- Good Libraries.
8. Areas in MVC
- Organize Model/View/Controller/Config in separate sections.
- Separate Logical sections.
9. Viewdata vs Viewbag vs Tempdata
- ViewData is Key-Value and Faster, Framework 3.5 based.
- In View Data , Type Conversion is available in it, it is null when redirection occurs, Its valid only in current request
- ViewBag is dynamic and slower.
- ViewBag was introduced in .Net Framework 4.0
- No need of type conversion in Viewbag and it is valid in only current request.
- Tempdata is key value, introduced in .NET Framework 3.5
- Tempdata is valid in consecutive request.
10. Entityframework vs ADO.Net
- ADO.NET is good for raw queries and direct Database connection.
- We have scratch control in Database in ADO.NET ,its much faster and flexible than Entity framework.
- Entity Framework is object-relational mapper and good for LINQ.
- EF is not very flexible and works with relational data with domain specific objects.
11. NoSQL
- Not Only SQL.
- Scalable and unstructured datasets.
- Distributed Server.
- Greater speed and ease of use.
- It is cost effective.
- Replication is easy.
- More Flexible.
12. Indexes
- Indexes optimize performance of database.
- Minimizes disk access.
- It is data structure technique.
- It can be sequential (Dense Index/Sparse Index) and Hash Based ( Clustered and Non-Clustered) or it can be Multi-level indexing.
13. Linked list vs Array
Arrays use contiguous memory and have a fixed size. Linked lists use non-contiguous memory and are dynamically sized.
14. List vs ArrayList
- List is strongly typed elements and faster for value types and its avoids boxing.
- ArrayList only accepts objects and boxing/unboxing exist in it.
15. Hashtable vs Dictionary
- Hashtable is non-generic, comes from System.Collection, It has key value (same or different type)
- Hashtable is thread safe and no order is maintained in its storage.
- Dictionary is generic collection and comes from System.Collection.Generic.
- Dictionary is also key-value pair.
- Order is maintained in Dictionary.
16. ASP.NET Page Life Cycle
a) Page Request
b) Starting of Page Life Cycle
c) Page Initialization
d) Page Load
e) Validation
f) Postback event handling
g) Page Rendering
h) Unlaod
17. Message Queue
- Used in server less and microservices architecture.
- It is used in distributed applications.
- Asynchronous service to service communication.
- Decouple heavy weight processing.
- Lightweight buffer.
- Producer->Queue->Consumer.
- Each message is processed only once by a single consumer.
- FIFO.
- Ex: RabbitMQ.
18. Garbage Collector
- Automatic memory management.
- Automatically release memory when object is not required.
- Always work on managed heap (Optimization engine).
- Occurs on 3 condition when low physical memory, pre-set threshold or GC.Collect() is called.
19. IEnumerable vs IQuerable
- IEnumerable is in-memory, comes from System.Collection, LINQ to Object or LINQ to XML.
- IQurable is out-of-memory, comes from System.LINQ, LINQ to SQL queries.
20. Generics vs Non-Generics
- Generic is strongly typed Ex: List, Dictionary, Sorted List.
- Non-Generic is not strongly typed Ex: ArrayList, Queue, Stack, HashTable.
Thats it for Today’s Post. Many more to come in upcoming future.
About the Author:
As you are aware, my name is Saif Khan Hakro. I completed my BS in Computer Science at FAST NUCES Karachi between 2013 and 2017 with a 3.49 grade point average. I have been a software developer in the software sector since 2017 with a focus on (.NET Domain). I enjoy creating essays and reading books. These articles were created to make learning simple for professionals and students.
Disclaimer:
These ideas come from my notes, thus they might not be entirely accurate or flawless.