Cheat sheets
Every course condensed for the day of the interview: key definitions, syntax, comparisons and gotchas. Open a single course's sheet to print it, or skim them all here.
1. How Computers Work — CPU, Memory, OS, Processes and Threads
Speed ladder (approx.)
Register < 1 ns · L1 ~1 ns · L3 ~10–20 ns · RAM ~100 ns · SSD ~50 µs · HDD ~5 ms · same-DC network ~0.5 ms · cross-continent ~150 ms.
Stack vs heap
Stack: per thread, frames, locals, fast, auto-freed, ~1 MB, overflow on deep recursion. Heap: shared, objects, GC-managed in .NET, leaks = still referenced.
Process vs thread
Process = own address space, isolated. Thread = path inside a process, shares heap, own stack. Context switch = save/restore thread state.
Concurrency problems
Race → lock / Interlocked / immutability. Deadlock → same lock order, short locks, timeouts, no .Result. Starvation → fair scheduling, async.
Code to execution
C# → Roslyn → IL → JIT (tiered) → machine code; OS loads process, CLR manages memory with GC; I/O via system calls.
2. Data Structures & Algorithms — How They Work Inside
Complexity ladder
O(1) < O(log n) < O(n) < O(n log n) < O(n²) < O(2ⁿ) < O(n!). For n = 10⁶: O(n log n) OK, O(n²) not.
Pick the structure
Index access → array/List · key lookup → Dictionary/HashSet · LIFO → Stack · FIFO → Queue · min/max fast → PriorityQueue · sorted + range → SortedDictionary / B-tree index · prefix → Trie · relationships → graph adjacency list.
Sorting facts
Merge: n log n always, stable, O(n) space. Quick: n log n avg, n² worst, in place. Heap: n log n, O(1) space. Insertion: great for tiny/nearly sorted. .NET Array.Sort = introsort (unstable); LINQ OrderBy = stable.
Patterns
Two pointers · sliding window · prefix sums · binary search (also on the answer) · BFS (shortest unweighted) · DFS/backtracking · heap for top-K · hash map for counting/lookups · DP for overlapping subproblems · greedy when locally optimal is globally optimal.
Interview method
Clarify → examples → brute force + Big-O → optimise → code → test edge cases → state time/space.
3. Coding Round Practice (DSA in C#)
Pattern → when to use
| Clue in the problem | Pattern |
|---|---|
| "pair/complement", "seen before", duplicates | Hash map / HashSet |
| Sorted array, pair sum, palindrome | Two pointers |
| Contiguous subarray/substring, "longest/shortest window" | Sliding window |
| Brackets, "next greater", undo | Stack (monotonic stack) |
| Shortest path unweighted, level order | BFS (Queue) |
| All paths, islands, tree recursion | DFS |
| Sorted + search, "minimum feasible value" | Binary search |
| Top K, k-th largest, merge k lists | Heap (PriorityQueue) |
| Overlapping subproblems, "number of ways" | DP / memoisation |
| All combinations/permutations | Backtracking |
| Linked list cycle/middle | Fast & slow pointers |
Complexity of C# collections
| Operation | List | Dictionary/HashSet | SortedDictionary | LinkedList |
|---|---|---|---|---|
| Add | O(1)* | O(1)* | O(log n) | O(1) |
| Search | O(n) | O(1) | O(log n) | O(n) |
| Remove | O(n) | O(1) | O(log n) | O(1) with node |
| Index | O(1) | — | — | O(n) |
*amortised/average
Must-know programs (practise until automatic)
Reverse string · palindrome · anagram · char count · first unique char · reverse words · Fibonacci · prime · factorial · Armstrong · FizzBuzz · swap · second largest · duplicates · missing number · move zeros · rotate array · merge sorted arrays · two sum · Kadane · valid parentheses · reverse linked list · cycle detection · binary search · bubble/quick/merge sort · tree height/BFS · LRU cache.
Useful C# snippets
counts[c] = counts.GetValueOrDefault(c) + 1;
(a, b) = (b, a);
var pq = new PriorityQueue<string, int>(); // min-heap
var maxPq = new PriorityQueue<int, int>(Comparer<int>.Create((x, y) => y.CompareTo(x)));
int mid = lo + (hi - lo) / 2;
s[^1]; s[1..^1]; arr[..k];
Array.Sort(arr); Array.Reverse(arr, i, len);
string.Join(",", list);Answer checklist
Clarify → examples → brute force + Big-O → optimise → code → dry-run → edge cases (empty, one, duplicates, negatives, overflow) → final Big-O.
4. Networking & Hosting — How a Website Works, End to End
Request life cycle
URL → cache/HSTS → DNS → TCP (or QUIC) → TLS → HTTP request → CDN/WAF → load balancer → web server → app → DB → response → DOM/CSSOM → layout → paint.
Layers
L7 HTTP/DNS · L4 TCP/UDP (ports) · L3 IP (routers) · L2 Ethernet/Wi-Fi (switches, MAC) · L1 physical. L4 vs L7 load balancing.
Numbers to know
Ports 80/443/22/3389/1433/6379/53 · private ranges 10/8, 172.16/12, 192.168/16 · /24 = 256 addresses · TLS 1.3 = 1 RTT · TTL 300 s before migrations.
Hosting choices
Shared → VPS/VM (IaaS) → PaaS (App Service) → containers (Container Apps/AKS) → serverless (Functions); static SPA → Static Web Apps/CDN.
Troubleshooting toolkit
nslookup/dig · ping/tracert · Test-NetConnection -Port · curl -v · DevTools Network timing · SSL Labs · IIS stdout log + Event Viewer · App Insights.
5. System Design — High-Level Design (HLD) from Basics to Case Studies
Interview framework
Requirements → estimation → API → data model → diagram → deep dive → bottlenecks/failures → trade-offs.
Estimation shortcuts
1M/day ≈ 12/s · peak 2–10× · day ≈ 10⁵ s · 99.9 % ≈ 8.8 h/yr down · 99.99 % ≈ 53 min/yr.
Building blocks
DNS/CDN · load balancer · API gateway · stateless services · cache (Redis) · SQL + replicas · NoSQL · object storage · queue/stream · search index · rate limiter · monitoring.
Data scaling ladder
Indexes → caching → read replicas → vertical scale → partitioning → sharding (consistent hashing) → multi-region.
Trade-offs to say out loud
Consistency vs availability · latency vs consistency · push vs pull · SQL vs NoSQL · sync vs async · cost vs redundancy · simplicity (monolith) vs independence (microservices).
6. Low-Level Design (LLD) — Object Design, UML and Classic Problems in C#
LLD steps
Requirements → use cases → nouns/verbs → relationships → class diagram → SOLID + patterns → code core flow → concurrency, edge cases, tests, tables.
Pattern picker
Varying rule → Strategy · lifecycle states → State · object creation → Factory/Builder · notify many → Observer · add features → Decorator · pass along handlers → Chain of Responsibility · undo/queue requests → Command · simple front door → Facade · one instance → DI singleton.
UML quick key
+ public - private # protected · ▷ inheritance · ┈▷ interface · ◆ composition · ◇ aggregation · multiplicities 1, 0..1, , 1...
Classic problems
Parking lot · library · elevator · vending machine · ATM (chain of note dispensers) · LRU cache · rate limiter · Splitwise · movie booking (seat locks) · snake & ladder · chess · hotel booking · food delivery.
Concurrency in LLD
Lock critical sections · atomic ops (Interlocked, ConcurrentDictionary.TryAdd) · optimistic concurrency (row version) · unique constraints · distributed locks with TTL · idempotent operations.
7. C# Language — Basics to Advanced
Types at a glance
| Category | Types |
|---|---|
| Integral | byte short int (32-bit) long (64-bit), unsigned variants |
| Floating | float (~7 digits), double (~15–16 digits), decimal (28–29 digits, use for money) |
| Others | bool, char (UTF-16), string, object, DateTime, DateOnly, TimeOnly, Guid |
| User-defined | class, struct, record, record struct, interface, enum, delegate |
Value types are copied on assignment; reference types share one object.
Keywords people mix up
constvsreadonly: compile-time and copied into callers vs set once at runtime.isvsas:istests a type/pattern (bool);ascasts or givesnull.refvsoutvsin: read/write vs must assign vs read-only.abstractvsvirtual: no body, must override vs has a body, may override.sealed: can't inherit (class) or override further (method).newmodifier: hides a base member (no polymorphism).staticclass: can't be instantiated; only static members.throw;keeps the stack trace;throw ex;loses it.
Null handling
x?.Prop // null if x is null
x ?? fallback // fallback if null
x ??= value // assign if null
x! // "trust me, not null"
x is null / x is not null
ArgumentNullException.ThrowIfNull(x);Collections — pick fast
| Need | Use |
|---|---|
| Ordered list | List<T> |
| Key lookup | Dictionary<K,V> |
| Unique items | HashSet<T> |
| FIFO / LIFO | Queue<T> / Stack<T> |
| Thread-safe map | ConcurrentDictionary<K,V> |
| Producer/consumer | Channel<T> |
| Read-only, read-heavy | FrozenDictionary / ImmutableArray |
async rules
async Task/Task<T>;async voidonly for event handlers.- Never
.Result/.Wait()— async all the way. - Independent calls:
await Task.WhenAll(...). - Pass
CancellationToken. - CPU-bound:
Task.Run/Parallel; I/O-bound: justawait. - Use
SemaphoreSlim(notlock) aroundawait.
Memory & disposal
- GC generations 0/1/2; LOH ≥ 85,000 bytes.
using/await usingforIDisposable/IAsyncDisposable.- Finaliser = last-resort safety net;
GC.SuppressFinalize. - Leaks: static collections, events not unsubscribed,
HttpClientper call, unbounded caches. - Low-allocation code:
Span<T>,ArrayPool,StringBuilder,stackalloc.
Modern syntax quick list
record Person(string Name, int Age); // C# 9
var p2 = p1 with { Age = 31 };
global using System.Text.Json; // C# 10
namespace Shop.Api; // file-scoped
var json = """{"name": "Divakar"}"""; // raw string (C# 11)
public required string Name { get; init; } // required (C# 11)
class Svc(IRepo repo) { } // primary ctor (C# 12)
int[] xs = [1, 2, ..others]; // collection expressions (C# 12)
order?.Status = Status.Shipped; // C# 14The 6 answers to have ready
- Value vs reference types (with the stack/heap nuance).
stringimmutability +StringBuilder.IEnumerablevsIQueryable.- async/await doesn't create threads; no
.Result. IDisposable+using+ GC generations.- Delegates vs events.
Data types & conversion
| Need | Use |
|---|---|
| Money, quantities | decimal (12.5m) |
| Scientific / graphics | double |
| User input → number | int.TryParse(s, out var n) |
| Overflow check | checked(a + b) |
| Timestamps | UTC: DateTime.UtcNow / DateTimeOffset |
| Pure dates / times | DateOnly / TimeOnly |
Arrays & collections in one look
int[] fixed · int[,] rectangular · int[][] jagged · List<T> growable · Dictionary<K,V> key lookup (TryGetValue) · HashSet<T> unique · SortedList/SortedDictionary ordered keys · Stack<T> LIFO · Queue<T> FIFO · PriorityQueue<T,P> · ArrayList/Hashtable = legacy (boxing, no type safety) · (int, string) ValueTuple for quick multi-returns.
Delegates, exceptions & files
Func returns · Action void · Predicate bool · += multicast · out T covariance, in T contravariance · throw; not throw ex; · custom exception = derive Exception + 3 constructors · File.ReadLines for big files · always using/await using streams · Path.Combine for paths.
8. VB.NET — Visual Basic .NET from Basics to Advanced (with C# Comparison)
Keyword map VB → C#
Dim x As T → T x · Sub/Function → void/method · Me/MyBase → this/base · Shared/Module → static · Nothing → null · Inherits/Implements → : · MustInherit/MustOverride → abstract · Overridable/Overrides → virtual/override · NotInheritable → sealed · Friend → internal · Shadows → new.
Operators
= equality · <> not equal · & concat · \ int division · Mod · ^ power · AndAlso/OrElse short-circuit · Is/IsNot reference · If(c,a,b) ternary · If(x,y) null-coalesce.
Must-know settings
Option Strict On · Option Explicit On · Option Infer On · arrays declare upper bound · (Of T) generics · arr(i) indexing.
Events
Event + RaiseEvent · WithEvents + Handles · AddHandler/RemoveHandler + AddressOf.
Migration
Option Strict first → tests → extract logic to libraries → convert libraries → rebuild UI in ASP.NET Core (strangler) → watch 1-based string functions and integer division.
9. .NET Internals — CLR, CTS, CLS, IL, JIT, Memory Management & Garbage Collection
Architecture in one line
Source → Roslyn → assembly (IL + metadata + manifest) → host starts CLR → loader + type loader → JIT (tier 0 → tier 1 + PGO) → native code → GC manages heap.
Version map
Framework 1.0 (2002) → 2.0 generics → 3.5 LINQ → 4.0 TPL → 4.5 async → 4.8 last (4.8.1 ARM64). Core 1.0 (2016) → 2.1 LTS → 3.1 LTS. .NET 5 (2020) → 6 LTS → 7 → 8 LTS → 9 → 10 LTS (2025). Even = LTS 3 yrs, odd = STS 2 yrs.
GC essentials
Gen 0 → 1 → 2; LOH ≥ 85,000 bytes (not compacted); POH for pinned; Workstation vs Server (+ background, DATAS); roots = stacks, statics, handles; finalizers delay collection; never GC.Collect() in normal code.
Dispose rules
using/await using everything disposable · SafeHandle instead of finalizers · Dispose(bool) + GC.SuppressFinalize for the full pattern · dispose what you own only.
Diagnose
dotnet-counters (live) · dotnet-gcdump (heap) · dotnet-dump analyze (dumpheap -stat, gcroot) · dotnet-trace (CPU/events) · BenchmarkDotNet MemoryDiagnoser.
10. OOP Concepts in C#
Four pillars in one line each
- Encapsulation — private data, public methods that guard rules.
- Abstraction — interfaces/abstract classes expose what, hide how.
- Inheritance —
Derived : Basereuses and extends ("is-a"). - Polymorphism — overloading (compile time) and overriding (runtime).
Interface vs abstract class
| Interface | Abstract class | |
|---|---|---|
| Inherit many? | Yes | No (one) |
| State/fields | No | Yes |
| Constructor | No | Yes |
| Default implementation | Yes (C# 8+) | Yes |
| Best for | Contracts, DI, mocking | Shared base code |
Keywords
| Keyword | Meaning |
|---|---|
virtual | May be overridden |
abstract | Must be overridden; no body |
override | Replaces base virtual/abstract |
sealed | No further inheritance/override |
new | Hides a base member (no polymorphism) |
base | Access base members/constructor |
this | Current instance / chain constructors |
static | Belongs to the type |
Relationships
- Association: uses (independent lifetimes)
- Aggregation: has-a (part survives)
- Composition: owns-a (part dies with whole)
- Inheritance: is-a
- Prefer composition; inherit only for true substitutable "is-a".
Constructor order
Static field initialisers → static ctor (once) → instance field initialisers (derived, then base) → base ctor body → derived ctor body.
Equality checklist
- Override
Equals(object), implementIEquatable<T>, overrideGetHashCodewithHashCode.Combine. - Or use
recordfor value equality for free.
11. SOLID Principles with Examples
SOLID in one table
| Principle | Smell | Fix | |
|---|---|---|---|
| S | Single Responsibility | God class, Manager/Utils | Split by reason to change |
| O | Open/Closed | Growing switch/if-else on type | Strategy/polymorphism + DI |
| L | Liskov Substitution | Override throws NotSupportedException; is checks | Fix the hierarchy; use interfaces/composition |
| I | Interface Segregation | Implementers leave methods empty | Split into role interfaces |
| D | Dependency Inversion | new ConcreteService() inside logic | Inject an abstraction |
DI lifetimes
| Instance per | Use for | |
|---|---|---|
| Transient | resolution | stateless, light |
| Scoped | request | DbContext, unit of work |
| Singleton | app | config, caches, thread-safe services |
Never inject scoped into singleton → use IServiceScopeFactory.
Other principles
- DRY — one source of truth for knowledge.
- KISS — simplest thing that works.
- YAGNI — don't build for imaginary futures.
- SoC — separate UI / business / data.
- Composition over inheritance.
- Law of Demeter — no
a.B.C.Dchains.
Quick code: DIP + OCP
public interface IExporter { string Format { get; } byte[] Export(Report r); }
public class PdfExporter : IExporter { public string Format => "pdf"; public byte[] Export(Report r) => ...; }
public class ExcelExporter : IExporter { public string Format => "xlsx"; public byte[] Export(Report r) => ...; }
public class ExportService(IEnumerable<IExporter> exporters)
{
public byte[] Run(Report r, string fmt) => exporters.Single(e => e.Format == fmt).Export(r);
}One-liners to say in the interview
- SRP: "A class should have one reason to change — one actor it serves."
- OCP: "Add new behaviour by adding classes, not by editing tested ones."
- LSP: "A subclass must work anywhere its base class is expected — no surprises."
- ISP: "Don't force clients to depend on methods they don't use."
- DIP: "High-level policy depends on abstractions; details plug in through DI."
- Balance: "I apply SOLID where change is likely; for simple, stable code I keep it simple."
12. Design Patterns (GoF + Enterprise) in C#
23 GoF patterns — one line each
| Pattern | One line |
|---|---|
| Singleton | One instance (Lazy<T> / AddSingleton) |
| Factory Method | Subclass/method decides concrete type |
| Abstract Factory | Family of related objects |
| Builder | Step-by-step construction, fluent |
| Prototype | Clone existing object |
| Adapter | Convert interface (wrap SDK) |
| Bridge | Split abstraction from implementation |
| Composite | Tree; leaf and group treated alike |
| Decorator | Wrap to add behaviour, same interface |
| Facade | Simple API over subsystem |
| Flyweight | Share immutable state |
| Proxy | Stand-in controlling access (lazy, remote, auth) |
| Chain of Responsibility | Pass along handlers (middleware) |
| Command | Request as object (queue, undo) |
| Interpreter | Evaluate a grammar |
| Iterator | Sequential access (IEnumerable) |
| Mediator | Central communication (MediatR) |
| Memento | Snapshot/restore state |
| Observer | Subscribe/notify (events) |
| State | Behaviour depends on state object |
| Strategy | Interchangeable algorithms |
| Template Method | Base skeleton, subclass steps |
| Visitor | New operations without changing classes |
Patterns hiding in .NET
| .NET feature | Pattern |
|---|---|
Middleware, DelegatingHandler | Chain of Responsibility |
IHttpClientFactory, ILoggerFactory | Factory |
WebApplication.CreateBuilder | Builder |
Stream wrappers | Decorator |
event / IObservable | Observer |
IEnumerable + yield | Iterator |
DbContext / DbSet | Unit of Work / Repository |
| EF lazy-loading proxies | Proxy |
IComparer<T> | Strategy |
ExpressionVisitor | Visitor |
Enterprise/cloud
- Repository + UoW — data access abstraction + one transaction.
- CQRS — separate reads and writes.
- Outbox — event + data in the same transaction.
- Saga — distributed transaction with compensation.
- Retry / Circuit Breaker / Timeout / Bulkhead — resilience (
AddStandardResilienceHandler). - Options — typed config:
IOptions/IOptionsSnapshot/IOptionsMonitor. - Strangler Fig — replace a legacy system piece by piece.
- API Gateway / BFF — single entry point per client type.
Answer formula
Problem → pattern name → how it works (2 lines) → code shape (interface + classes) → where you used it → trade-off.
Which pattern for which problem?
| Problem in the interview question | Pattern |
|---|---|
Big switch on type / many interchangeable algorithms | Strategy |
| Add caching/logging/retry without touching a class | Decorator |
| Wrap a third-party SDK behind your own interface | Adapter |
| One simple call over many subsystems | Facade |
| Object creation varies by input/config | Factory Method / Abstract Factory |
| Complex object with many optional parts | Builder |
| Exactly one shared instance | Singleton (prefer AddSingleton) |
| Notify many listeners of changes | Observer / events |
| Request passes through a series of handlers | Chain of Responsibility |
| Behaviour depends on the object's state | State |
| Fixed algorithm with customisable steps | Template Method |
| Decouple senders and handlers (CQRS) | Mediator / Command |
| Reliable event publishing with DB writes | Outbox |
| Flaky downstream service | Retry + Circuit Breaker |
13. ADO.NET — Connected & Disconnected Data Access
Core objects
SqlConnection · SqlCommand · SqlParameter · SqlDataReader · SqlDataAdapter · DataSet/DataTable/DataView · SqlTransaction · SqlBulkCopy · SqlCommandBuilder.
Execute methods
| Method | Returns | Use |
|---|---|---|
ExecuteReader | DataReader | SELECT rows |
ExecuteScalar | object (1 value) | COUNT, new ID |
ExecuteNonQuery | int rows affected | INSERT/UPDATE/DELETE/DDL |
ExecuteXmlReader | XmlReader | FOR XML queries |
Template
await using var conn = new SqlConnection(cs);
await conn.OpenAsync(ct);
await using var cmd = new SqlCommand(sql, conn);
cmd.Parameters.Add("@id", SqlDbType.Int).Value = id;
await using var r = await cmd.ExecuteReaderAsync(ct);
while (await r.ReadAsync(ct)) { var name = r.GetString(r.GetOrdinal("Name")); }Connection string keys
Server · Database · Integrated Security=True / User Id+Password / Authentication=Active Directory Default · Encrypt=True · TrustServerCertificate=True (dev) · Max Pool Size · Connect Timeout · MultipleActiveResultSets · Application Name.
Dapper
Query<T> · QueryFirstOrDefault<T> · QuerySingle<T> · Execute · ExecuteScalar<T> · QueryMultiple · multi-mapping splitOn · IN @Ids · commandType: CommandType.StoredProcedure · pass transaction.
Remember
Always parameterise · explicit SqlDbType + size · using/await using · open late, close early · pool max 100 · Encrypt=True default in SqlClient 4+ · SqlBulkCopy for bulk · TVP for lists · retry transient errors.
14. LINQ — Language Integrated Query
Operator families
| Family | Operators |
|---|---|
| Filter | Where, OfType |
| Project | Select, SelectMany |
| Sort | OrderBy, OrderByDescending, ThenBy, ThenByDescending, Reverse, Order |
| Group | GroupBy, ToLookup, CountBy, AggregateBy |
| Join | Join, GroupJoin, LeftJoin/RightJoin (.NET 10), Zip |
| Set | Distinct(By), Union(By), Intersect(By), Except(By), Concat |
| Partition | Skip, Take, SkipWhile, TakeWhile, Chunk, TakeLast |
| Element | First, Single, Last, ElementAt (+OrDefault) |
| Quantifier | Any, All, Contains |
| Aggregate | Count, Sum, Min, Max, MinBy, MaxBy, Average, Aggregate |
| Convert | ToList, ToArray, ToDictionary, ToHashSet, ToLookup, AsEnumerable, AsQueryable, Cast |
| Generate | Range, Repeat, Empty |
Deferred vs immediate
Deferred: returns IEnumerable/IQueryable. Immediate: returns a value, collection or element.
IEnumerable vs IQueryable
Delegates, in memory vs expression trees, translated to SQL. Keep IQueryable until ToListAsync().
Classic snippets
list.OrderByDescending(x => x.Salary).Skip(1).First(); // 2nd highest
list.GroupBy(x => x.Dept).Select(g => new { g.Key, C = g.Count() });
list.GroupBy(x => x.Email).Where(g => g.Count() > 1); // duplicates
from c in cs join o in os on c.Id equals o.CId into g from o in g.DefaultIfEmpty() select ...; // left join
words.GroupBy(w => w).ToDictionary(g => g.Key, g => g.Count()); // word frequency
string.Join(",", list.Select(x => x.Name));
nested.SelectMany(x => x.Items);Pitfalls
ToList() too early · multiple enumeration · Count() > 0 instead of Any() · First without OrderBy · N+1 with lazy loading · untranslatable methods in IQueryable · list.Contains in loops (use HashSet).
15. Entity Framework (EF6 & EF Core)
Setup
dotnet add package Microsoft.EntityFrameworkCore.SqlServer
dotnet add package Microsoft.EntityFrameworkCore.Design
dotnet tool install -g dotnet-ef
dotnet ef migrations add Init
dotnet ef database update
dotnet ef migrations script --idempotent -o deploy.sql
dotnet ef dbcontext scaffold "<conn>" Microsoft.EntityFrameworkCore.SqlServer -o ModelsEntity states
Detached · Added → INSERT · Unchanged · Modified → UPDATE · Deleted → DELETE.
Loading
Include/ThenInclude (eager) · Entry().Collection().Load() (explicit) · lazy proxies (avoid) · Select projection (best for reads) · AsSplitQuery.
Query tips
AsNoTracking · Select DTOs · AnyAsync · paginate Skip/Take · ToQueryString() · FromSql($"") · SqlQuery<T> · ExecuteUpdate/Delete · EF.CompileAsyncQuery · IgnoreQueryFilters.
Configuration precedence
Fluent API > Data Annotations > Conventions. Use IEntityTypeConfiguration<T>.
Relationships
HasOne().WithMany().HasForeignKey().OnDelete() · HasOne().WithOne().HasForeignKey<T>() · many-to-many via skip navigations · owned/complex types · TPH (default) / TPT / TPC.
Concurrency & transactions
[Timestamp] byte[] RowVersion → DbUpdateConcurrencyException → 409 · SaveChanges = one transaction · BeginTransactionAsync for multiple saves · execution strategy with retries.
DbContext rules
Scoped · short-lived · not thread-safe · IDbContextFactory for background/parallel · AddDbContextPool for throughput.
16. Dapper — The Micro-ORM from Basics to Advanced
Core calls
Query<T> · QueryFirst(OrDefault)<T> · QuerySingle(OrDefault)<T> · Execute · ExecuteScalar<T> · QueryMultiple · QueryUnbufferedAsync · all with Async versions and CommandDefinition for timeout/cancellation.
Parameters
Anonymous object new { Id = id } · DynamicParameters for types/size/direction · IN @ids with a collection · DbString { IsAnsi = true } for VARCHAR · never interpolate values.
Advanced
Multi-mapping Query<A,B,A>(sql, map, splitOn:) · stored procs commandType: CommandType.StoredProcedure · outputs p.Get<T>() · transactions pass tx · TVP AsTableValuedParameter · SqlBulkCopy for bulk · SqlMapper.TypeHandler<T>.
Architecture
Connection factory (singleton) · repositories (scoped) · open late, dispose early · unit of work for multi-step transactions · EF Core for writes + Dapper for reads is common.
Performance
Only needed columns · server paging · correct parameter types · fewer round trips · read the execution plan.
17. ASP.NET Web Forms — Page Life Cycle, ViewState, Controls and State Management
Page life cycle
PreInit → Init → InitComplete → (LoadViewState, LoadPostData) → PreLoad → Load → control events → LoadComplete → PreRender → SaveStateComplete → Render → Unload.
Application pipeline
BeginRequest → Authenticate → Authorize → ResolveRequestCache → AcquireRequestState → PreRequestHandlerExecute → handler (Page) → PostRequestHandlerExecute → ReleaseRequestState → UpdateRequestCache → EndRequest.
State options
Page: ViewState/ControlState/hidden field · request: query string · browser: cookies · user: Session (InProc/StateServer/SQL/Redis) · all users: Application/Cache.
Folders & files
App_Code · App_Data · App_Start · App_Themes · App_GlobalResources · bin · .aspx + .aspx.cs + .designer.cs · .master · .ascx · .ashx · Global.asax · Web.config (+ transforms).
Errors
try/catch → Page_Error → Application_Error (log) → customErrors/httpErrors (friendly pages) · never debug="true" or customErrors="Off" in production.
18. ASP.NET MVC 5 (.NET Framework) — Folder Structure, Request Life Cycle and Features
Request life cycle
UrlRoutingModule → MvcRouteHandler → MvcHandler → ControllerFactory → ActionInvoker → authN/authZ filters → model binding → action filters → action → result filters → ActionResult.ExecuteResult → view engine → response.
Folders
App_Start (Route/Filter/Bundle/Identity config) · Controllers · Models · Views (+Shared, _ViewStart, web.config) · Areas · Content · Scripts · Global.asax · Web.config.
Data to views
Strongly typed model > ViewData/ViewBag (this request) · TempData (next request) · Session (user).
Filters
Authentication → Authorization → Action → Result · Exception · global/controller/action scope.
MVC 5 → Core
Global.asax → Program.cs · modules → middleware · child actions → view components · HTML helpers → tag helpers · DependencyResolver → built-in DI · separate Web API → unified controllers.
19. Modern .NET — Hosting, Configuration, DI & Deployment
Versions and support
| Version | Type | Support ends |
|---|---|---|
| .NET Framework 4.8.1 | Legacy | With Windows (no new features) |
| .NET 6 | LTS | Nov 2024 (ended) |
| .NET 7 | STS | May 2024 (ended) |
| .NET 8 | LTS | 10 Nov 2026 |
| .NET 9 | STS | 10 Nov 2026 |
| .NET 10 | LTS | Nov 2028 |
New major every November · even = LTS (3 yrs) · odd = STS (2 yrs).
Runtime terms
CLR (runtime) · IL (intermediate code) · JIT (runtime compile) · tiered compilation + Dynamic PGO · R2R (precompiled) · Native AOT · CTS/CLS · BCL · GC Gen 0/1/2 + LOH (≥ 85 KB) + POH · Workstation vs Server GC.
dotnet CLI
dotnet --info / --list-sdks
dotnet new webapi -n Api
dotnet add package Serilog.AspNetCore
dotnet build -c Release
dotnet test --collect:"XPlat Code Coverage"
dotnet publish -c Release -r linux-x64 --self-contained
dotnet publish -t:PublishContainer
dotnet user-secrets set "Key" "Value"
dotnet tool install -g dotnet-efConfiguration order (last wins)
appsettings.json → appsettings.{Env}.json → user secrets (Dev) → env vars (A__B) → command line.
Options
IOptions (singleton, once) · IOptionsSnapshot (scoped, per request) · IOptionsMonitor (singleton, live + OnChange).
DI lifetimes
Transient · Scoped (per request) · Singleton · Keyed (.NET 8) · no scoped-in-singleton.
20. ASP.NET Core MVC (and Razor Pages)
Request lifecycle
Middleware → Routing → Controller (DI) → Authorization filter → Resource filter → Model binding → Validation → Action filter → Action → Action filter → Result filter → View render → Result filter → Response. Exception filters wrap the action/result stages.
Middleware order (MVC)
app.UseExceptionHandler("/Home/Error"); app.UseHsts();
app.UseHttpsRedirection();
app.UseStaticFiles(); // or MapStaticAssets()
app.UseRouting();
app.UseCors();
app.UseAuthentication();
app.UseAuthorization();
app.UseSession();
app.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}");Passing data
| Lifetime | |
|---|---|
Model (@model) | Request — preferred |
| ViewData / ViewBag | Request |
| TempData | Until read (one redirect) |
| Session | Across requests |
Action results
View · PartialView · ViewComponent · Json · Content · File · Redirect · RedirectToAction · LocalRedirect · NotFound · BadRequest · Unauthorized · Forbid · StatusCode.
Binding attributes
[FromQuery] [FromRoute] [FromForm] [FromBody] [FromHeader] [FromServices] [Bind("A,B")] [BindProperty] (Razor Pages).
Validation attributes
[Required] [StringLength] [MaxLength] [Range] [EmailAddress] [Phone] [Url] [Compare("Password")] [RegularExpression] [Remote] · custom ValidationAttribute · IValidatableObject.
Security checklist
Antiforgery on POST forms · [Authorize] + fallback policy · ownership checks (IDOR) · LocalRedirect for returnUrl · no Html.Raw on user input · HTTPS + HSTS · secure cookies · view models (no over-posting).
21. ASP.NET Core Web API & REST
HTTP methods
| Method | Safe | Idempotent | Typical response |
|---|---|---|---|
| GET | ✓ | ✓ | 200 |
| POST | ✗ | ✗ | 201 + Location |
| PUT | ✗ | ✓ | 200/204 |
| PATCH | ✗ | ✗ | 200/204 |
| DELETE | ✗ | ✓ | 204 |
Status codes to remember
200 · 201 · 202 · 204 · 304 · 400 · 401 (who are you?) · 403 (not allowed) · 404 · 409 · 412 · 415 · 422 · 429 · 500 · 502 · 503 · 504.
Pipeline order
app.UseExceptionHandler();
app.UseHttpsRedirection();
app.UseCors("spa");
app.UseAuthentication();
app.UseAuthorization();
app.UseRateLimiter();
app.UseOutputCache();
app.MapControllers();Minimal API essentials
MapGet/MapPost/MapPut/MapPatch/MapDelete · MapGroup · TypedResults · Results<Ok<T>, NotFound> · [AsParameters] · AddEndpointFilter · RequireAuthorization · RequireRateLimiting · WithTags/WithName.
Security
JWT = header.payload.signature (signed, not encrypted) · validate iss/aud/exp/signature · Auth Code + PKCE / Client Credentials · CORS ≠ auth · rate limit · HTTPS/HSTS · Key Vault.
Caching options
HTTP headers/ETag · Output cache · IMemoryCache · IDistributedCache (Redis) · HybridCache (.NET 9).
Remember
DTOs not entities · ProblemDetails for errors · CancellationToken everywhere · IHttpClientFactory · pagination with max size · version before breaking · idempotency keys for payments.
22. Exception Handling & Custom Error Handling in .NET — Every Way, Every App Type
Rules
Validate early · catch specific · throw; · wrap with inner · using for cleanup · no empty catch · no exceptions for flow · global handler at boundaries · log once with correlation id · friendly messages, no internals.
ASP.NET Core
AddProblemDetails + AddExceptionHandler<T> + UseExceptionHandler() · UseStatusCodePages(WithReExecute) · exception filters for MVC · [ApiController] 400s · developer page only in Development.
.NET Framework
Web Forms: try/catch → Page_Error → Application_Error → customErrors/httpErrors · MVC 5: OnException → [HandleError]/IExceptionFilter → Application_Error · Web API 2: IExceptionHandler/IExceptionLogger.
Status mapping
Validation 400 · auth 401/403 · not found 404 · conflict/duplicate/concurrency 409 · business rule 422 · rate limit 429 · bug/unknown 500 · dependency down 502/503 · timeout 504.
Async & process
await rethrows first exception · WhenAll → check InnerExceptions · avoid async void · BackgroundService: try/catch per iteration · AppDomain.UnhandledException / TaskScheduler.UnobservedTaskException for last-chance logging.
23. Logging & Custom Logging in .NET — ILogger, Serilog, NLog, log4net and Your Own Logger
Levels
Trace < Debug < Information < Warning < Error < Critical · production default Information, framework categories Warning.
Do
Message templates with named properties · LogError(ex, ...) with the exception · scopes/enrichers for context · correlation/trace ids · JSON to stdout in containers · central store + retention + alerts.
Don't
Interpolate log messages · log secrets/PII · log the same exception at every layer · log inside tight loops · block requests on log writes.
Libraries
ILogger (abstraction) · Serilog (structured, sinks, enrichers, UseSerilogRequestLogging) · NLog (nlog.config targets/rules) · log4net (legacy XML appenders) · ELMAH (Framework errors) · OpenTelemetry (logs + traces + metrics).
Custom logger
ILoggerProvider + ILogger · bounded Channel queue · background batch writer · never throw · flush on Dispose · builder.Logging.AddProvider(...).
24. Custom Controls & Reusable UI Components in .NET — Web Forms to Blazor
Pick the right reuse tool
Web Forms: user control (one app) → custom/composite control (many apps) · MVC 5: partial/display template → HTML helper → child action · Core: partial → tag helper → view component → Razor Class Library · Blazor: component (+ library) · WinForms/WPF: UserControl → custom control.
Web Forms control essentials
WebControl + RenderContents · ViewState-backed properties · CompositeControl.CreateChildControls + INamingContainer · events · ControlState · [ToolboxData].
Core essentials
Tag helper: [HtmlTargetElement], Process(Async), @addTagHelper · View component: InvokeAsync, Views/Shared/Components/Name/Default.cshtml, <vc:name>.
Blazor essentials
[Parameter] · EventCallback · RenderFragment / RenderFragment<T> · @typeparam · @bind-Value = Value + ValueChanged · CascadingValue · lifecycle methods · @key · Virtualize.
Good component rules
Small API · data in, events out · encode output · accessible · styleable · tested · versioned.
25. .NET Project Architectures & Folder Structures — Layered, Clean, Onion, Vertical Slice
Styles
3-tier/N-layer (UI → BLL → DAL) · Onion/Clean/Hexagonal (domain centre, dependencies inward) · Vertical Slice (per feature) · Modular monolith (modules + schemas) · Microservices.
Clean Architecture projects
Domain (entities, value objects, events) ← Application (use cases, interfaces, DTOs, validation) ← Infrastructure (EF, email, files) ; Api = composition root (controllers, middleware, Program.cs).
Repo layout
src/ · tests/ · docs/ (ADRs) · deploy/ · Directory.Build.props · Directory.Packages.props · global.json · .editorconfig · .sln/.slnx.
Placement of concerns
Exceptions & auth → Api · validation & transactions & mapping → Application · invariants → Domain · persistence & external services → Infrastructure · logging → everywhere via ILogger.
Choosing
Small CRUD → simple single project · rich domain → Clean · many independent features → Vertical Slice · many teams → modular monolith · independent scaling/deploys → microservices · write an ADR, enforce with architecture tests.
26. Clean Code, Testing & Best Practices
Clean code rules
- Intention-revealing names; verbs for methods, nouns for classes.
- Functions: small, one thing, ≤ 3 params, guard clauses.
- No magic numbers; no commented-out code; comments explain why.
- Exceptions for exceptional cases; global handler; structured logs.
- Boy Scout rule; small PRs; consistent formatting.
Naming conventions (.NET)
| Element | Style | Example |
|---|---|---|
| Class, method, property | PascalCase | OrderService.PlaceOrder |
| Interface | I + PascalCase | IOrderRepository |
| Local, parameter | camelCase | orderTotal |
| Private field | _camelCase | _repository |
| Async method | Async suffix | GetOrderAsync |
| Constant | PascalCase | MaxRetryCount |
Testing
- AAA: Arrange · Act · Assert. FIRST tests.
- xUnit:
[Fact],[Theory]+[InlineData]; ctor = setup,Dispose= teardown;IClassFixture<T>. - Moq:
new Mock<T>(),.Setup(...).ReturnsAsync(...),.Verify(..., Times.Once). - Doubles: dummy, stub, fake, mock, spy.
- Pyramid: unit ≫ integration ≫ E2E.
WebApplicationFactory<Program>for API tests; Testcontainers for real SQL Server.TimeProvider/FakeTimeProviderfor time.
Code smells → refactorings
Long method → Extract Method · God class → Extract Class · Switch on type → Polymorphism · Duplicates → Extract/DRY · Long params → Parameter Object · Primitive obsession → Value Object · Feature envy → Move Method.
Git
git switch -c feature/x
git add -p && git commit -m "Why + what"
git fetch && git rebase origin/main
git push -u origin feature/x
git stash / git stash pop
git cherry-pick <sha>
git revert <sha> # safe undo on shared branch
git reset --soft HEAD~1 # undo last local commit, keep changesSecurity quick list
Parameterised SQL · [Authorize] + ownership checks · HTTPS/HSTS · Identity password hashing · Antiforgery · Razor encoding · Key Vault for secrets · updated packages · no secrets/PII in logs.
27. Microservices & System Design with .NET
Decide the style
Modular monolith by default → extract a service only for independent scaling, release cadence, ownership or technology. Split by business capability (bounded context), never by technical layer.
Communication
| Need | Use |
|---|---|
| Public/browser API | REST + OpenAPI via gateway |
| Fast internal call | gRPC |
| "Do this later" | Queue (command) |
| "This happened" | Topic/pub-sub (event) |
| High-volume stream / replay | Kafka / Event Hubs |
Consistency toolbox
Local transaction per aggregate · saga (choreography/orchestration) with compensations · transactional outbox · idempotent consumer / inbox · idempotency keys · eventual consistency shown in UI.
Resilience toolbox
Timeout · retry + backoff + jitter (idempotent only) · circuit breaker · bulkhead · fallback · health checks (live/ready) · DLQ. .NET: AddStandardResilienceHandler().
Observability
Logs + metrics + traces via OpenTelemetry; correlation/trace id everywhere; golden signals: latency, traffic, errors, saturation; .NET Aspire dashboard locally, App Insights/Grafana in production.
System design template
Requirements → estimates → API → data model → diagram → deep dive → bottlenecks & failures → trade-offs. Always mention cache, queue, replicas, idempotency and monitoring.
28. SQL Server & T-SQL
Logical processing order
FROM → ON → JOIN → WHERE → GROUP BY → HAVING → SELECT → DISTINCT → ORDER BY → TOP/OFFSET.
Joins
INNER · LEFT · RIGHT · FULL · CROSS · SELF · CROSS APPLY · OUTER APPLY · anti-join (LEFT JOIN ... WHERE b.Id IS NULL or NOT EXISTS).
Window functions
ROW_NUMBER()/RANK()/DENSE_RANK()/NTILE(n) OVER (PARTITION BY a ORDER BY b)
SUM(x) OVER (PARTITION BY a) -- group total on every row
SUM(x) OVER (ORDER BY d ROWS UNBOUNDED PRECEDING) -- running total
LAG(x, 1) / LEAD(x, 1) OVER (ORDER BY d)
FIRST_VALUE / LAST_VALUEMust-know queries
Nth highest salary (DENSE_RANK) · duplicates (GROUP BY HAVING) · delete duplicates (CTE + ROW_NUMBER) · employee–manager (self join) · org chart (recursive CTE) · top N per group · running total · customers without orders (NOT EXISTS) · pivot (CASE/PIVOT) · upsert (MERGE).
Index rules
One clustered (narrow, unique, increasing) · non-clustered for selective filters · equality columns first, then range · INCLUDE to cover · filtered for subsets · columnstore for analytics · SARGable predicates · every index costs writes.
Isolation levels
READ UNCOMMITTED → READ COMMITTED (default) → REPEATABLE READ → SERIALIZABLE; SNAPSHOT and RCSI use row versions (readers don't block writers).
Error handling template
SET NOCOUNT ON; SET XACT_ABORT ON;
BEGIN TRY
BEGIN TRAN;
-- work
COMMIT;
END TRY
BEGIN CATCH
IF @@TRANCOUNT > 0 ROLLBACK;
THROW;
END CATCHHandy functions
GETDATE() SYSUTCDATETIME() DATEADD DATEDIFF EOMONTH FORMAT CAST/CONVERT/TRY_CONVERT ISNULL/COALESCE/NULLIF IIF CHOOSE LEN SUBSTRING CHARINDEX REPLACE TRIM STRING_AGG STRING_SPLIT CONCAT_WS JSON_VALUE OPENJSON @@ROWCOUNT SCOPE_IDENTITY() NEWID() GREATEST/LEAST (2022).
Diagnostics
SET STATISTICS IO, TIME ON · actual execution plan · Query Store · sys.dm_exec_requests · sys.dm_exec_query_stats · sys.dm_db_index_usage_stats · sys.dm_db_missing_index_details · sp_WhoIsActive · Extended Events system_health for deadlocks.
29. SQL Server Internals — How the Database Engine Really Works
Architecture
Protocol (TDS) → Relational engine (parse, bind, optimise, execute, plan cache) → Storage engine (access methods, buffer pool, locks, log) → SQLOS (schedulers, workers, waits).
Storage
Page 8 KB · extent 64 KB · GAM/SGAM/PFS/IAM · heap (RID) vs clustered B+ tree (rows at leaf) · nonclustered (key + locator) · INCLUDE = covering · good clustered key: narrow, unique, static, increasing.
Optimizer
Statistics (200-step histogram) → cardinality estimates → cheapest plan → plan cache · SARGable predicates · parameter sniffing fixes: index, RECOMPILE, OPTIMIZE FOR, Query Store forcing, PSP (2022).
Plans
Right to left · seek vs scan · key lookup · nested loops (small outer) · merge (sorted) · hash (large unsorted, memory) · spills · implicit conversions · estimated vs actual rows.
Transactions
WAL + LSN · commit = log hardened · checkpoint · recovery: analysis, redo, undo · ADR · recovery models SIMPLE/FULL/BULK_LOGGED · log backups in FULL.
Concurrency
Locks S/U/X/intent/schema · escalation ~5,000 locks · latches = internal · isolation RU/RC/RR/SER + RCSI/SNAPSHOT (version store) · deadlock = error 1205 → retry + same access order + short transactions.
Key waits
PAGEIOLATCH (disk reads) · LCK_M (blocking) · WRITELOG (log disk) · CXPACKET (parallelism) · SOS_SCHEDULER_YIELD (CPU) · RESOURCE_SEMAPHORE (memory grants) · ASYNC_NETWORK_IO (client).
30. ETL & Data Warehousing Concepts
ETL vs ELT
ETL: transform before load (SSIS). ELT: load raw, transform in the warehouse (ADF/Fabric + SQL/dbt/Spark).
Load types
Full (truncate + reload) · Incremental (watermark, rowversion, CDC, Change Tracking, hash) · Upsert (MERGE) · Deletes (soft delete, CDC, full compare).
Dimensional model
Fact (measures at a grain) + Dimensions (descriptive) · Star (denormalised) vs Snowflake (normalised dims) · Surrogate keys · Conformed, role-playing, junk, degenerate dimensions.
Fact types
Transaction · Periodic snapshot · Accumulating snapshot · Factless. Measures: additive, semi-additive, non-additive.
SCD
0 keep · 1 overwrite · 2 new row + ValidFrom/ValidTo/IsCurrent · 3 previous-value column · 4 history table · 6 hybrid.
Reliability
Staging · audit table · error tables · Unknown member (-1) · idempotent reruns · watermark updated after success · reconciliation counts/sums · alerts.
Architectures
Inmon (top-down 3NF) · Kimball (bottom-up stars) · Data Vault (hubs/links/satellites) · Data lake · Lakehouse · Medallion bronze → silver → gold.
Tools
SSIS · ADF · Fabric · Synapse · Databricks · Informatica · Talend · Airflow · dbt · Spark · Kafka.
31. SSIS — SQL Server Integration Services
Building blocks
Package (.dtsx) · Project (.ispac) · Control Flow (tasks, containers, precedence constraints) · Data Flow (sources, transformations, destinations) · Connection managers · Variables · Parameters · Event handlers · Log/SSISDB.
Key tasks
Execute SQL · Data Flow · Execute Package · File System · FTP · Script · Send Mail · Expression · Bulk Insert · CDC Control.
Transformations by blocking type
- Non-blocking: Derived Column, Data Conversion, Conditional Split, Lookup, Multicast, Row Count, Copy Column, Audit.
- Semi-blocking: Merge, Merge Join, Union All, Pivot/Unpivot.
- Fully blocking: Sort, Aggregate, Fuzzy Lookup/Grouping.
Lookup cache
Full (default, fastest) · Partial · No cache · Cache Connection Manager. Case/space/type sensitive.
Error handling
Error output: Fail / Ignore / Redirect row · OnError event handler · MaximumErrorCount · Propagate=False · checkpoints · audit table.
Deployment
Project model → SSISDB → folder → environments (DEV/QA/PROD) → parameter mapping → SQL Agent job → reports. dtexec /ISServer ... /Env n /Par ....
Performance
SQL source with filters · no Sort/Aggregate on big data · no OLE DB Command · full-cache lookups · fast load + table lock · buffer tuning · parallel tasks · staging + MERGE · incremental.
32. SSRS — SQL Server Reporting Services
Architecture
Report Designer/Report Builder → RDL → Report Server (service) + ReportServer & ReportServerTempDB → web portal (/Reports) & web service (/ReportServer) → renderers → delivery.
Data regions
Tablix = Table (dynamic rows) · Matrix (dynamic rows + columns) · List (free-form) · Chart · Gauge · Map · Sparkline · Data bar · Indicator.
Expressions
=Sum(Fields!Amount.Value, "GroupName")
=IIf(cond, a, b) / =Switch(...)
=RunningValue(Fields!X.Value, Sum, Nothing)
=RowNumber(Nothing)
=Lookup(src, dest, result, "DS")
=Join(Parameters!P.Value, ",")
=Globals!PageNumber & " of " & Globals!TotalPages
=User!UserID
=ReportItems!Textbox1.Value ' in header/footerParameters
Single/multi-value · cascading (child dataset uses parent) · default =Today() · hidden/internal · SP multi-value via Join + STRING_SPLIT.
Interactivity
Drill-down (toggle visibility) · Drill-through (Action → Go to report) · Subreport · Interactive sort · Document map · Bookmarks · Go to URL.
Delivery & performance
Standard vs data-driven subscriptions (Enterprise) · SQL Agent required · caching · snapshots · shared dataset cache · ExecutionLog3 (DataRetrieval / Processing / Rendering).
Security
Folder/item roles: Browser, Content Manager, Publisher, Report Builder, My Reports · System Administrator/User · back up the encryption key · row-level via User!UserID.
Future
SSRS 2022 = last SSRS · Power BI Report Server for on-prem going forward · paginated reports in Power BI Service.
33. IIS — Internet Information Services and Hosting .NET Applications
Request path
HTTP.sys (kernel, queue, cache, TLS) → WAS/W3SVC → w3wp.exe (app pool) → integrated pipeline modules → handler (static / ASP.NET / AspNetCoreModuleV2) → logging → response.
App pool settings
CLR v4.0 (Framework) / No Managed Code (Core) · Integrated pipeline · ApplicationPoolIdentity · AlwaysRunning + idle 0 for warm apps · recycle off-peak · rapid-fail → 503.
ASP.NET Core on IIS
Hosting Bundle · dotnet publish · web.config aspNetCore (inprocess) · stdout log for 500.30 · app_offline.htm for deploys · one in-process app per pool.
Config & features
applicationHost.config (server) · web.config (site/app) · bindings + SNI certificates · Windows auth for intranet · URL Rewrite (HTTPS, SPA fallback) · ARR reverse proxy/farms · compression · FREB tracing.
Error codes
401 auth · 403.14 no default doc · 404.3 MIME · 500.19 config · 500.21 handler · 500.30/502.5 Core startup · 502.3 backend timeout · 503 pool stopped.
34. Git & GitHub — Version Control from Basics to Advanced
Daily commands
git status | git add -p | git commit -m "msg" | git push
git switch -c feature/x | git switch main | git pull --rebase
git log --oneline --graph --all | git diff --stagedUndo table
| Need | Command |
|---|---|
| Discard file edits | git restore f |
| Unstage | git restore --staged f |
| Edit last local commit | git commit --amend |
| Undo local commits | git reset --soft/--mixed/--hard HEAD~n |
| Undo pushed commit | git revert sha |
| Find lost work | git reflog |
Merge vs rebase
Merge = true history, safe for shared branches. Rebase = linear history, rewrites ids — only on your own branches. Squash merge = one commit per PR on main.
Branching strategies
GitFlow (develop/release/hotfix, versioned releases) · GitHub Flow (main + short branches) · Trunk-based (daily merges + feature flags).
Safety rules
Never commit secrets (rotate if you do) · --force-with-lease, never --force on shared branches · protect main with PR + CI policies · small PRs, frequent syncs · tag every release.
35. Docker & Containers
CLI
docker build -t app:1.0 . docker run -d -p 8080:8080 --name a app:1.0
docker ps -a docker logs -f a
docker exec -it a sh docker stop a && docker rm a
docker images docker rmi app:1.0
docker tag app:1.0 myacr.azurecr.io/app:1.0
docker push myacr.azurecr.io/app:1.0 docker pull ...
docker volume ls / create / rm docker network ls / create
docker inspect a docker stats
docker system prune -a docker history app:1.0Compose
docker compose up -d --build | ps | logs -f svc | exec svc sh | down [-v]Dockerfile essentials
FROM · WORKDIR · COPY (prefer) / ADD · RUN · ENV / ARG · EXPOSE · USER · HEALTHCHECK · ENTRYPOINT (exec form) + CMD (default args) · multi-stage COPY --from=build.
.NET specifics
Images: sdk / aspnet / runtime / runtime-deps · .NET 8+: port 8080, non-root app user · dotnet publish -t:PublishContainer · chiseled images.
Lifecycle
Created → Running → Paused → Exited → Removed · stop = SIGTERM then SIGKILL (10 s) · restart policies: no / on-failure / always / unless-stopped.
Exit codes
0 ok · 1 app error · 137 SIGKILL/OOM · 139 segfault · 143 SIGTERM.
Best practices
Multi-stage · small pinned base · non-root · no secrets in layers · .dockerignore · cache-friendly order · scan images · logs to stdout · health checks · immutable tags.
36. Kubernetes (K8s) & AKS
Architecture
Control plane: API server · etcd · scheduler · controller manager · cloud controller. Nodes: kubelet · kube-proxy · container runtime.
Objects
Pod · ReplicaSet · Deployment · StatefulSet · DaemonSet · Job · CronJob · Service (ClusterIP/NodePort/LoadBalancer/ExternalName/headless) · Ingress / Gateway API · ConfigMap · Secret · PV / PVC / StorageClass · Namespace · ServiceAccount · Role/RoleBinding · NetworkPolicy · HPA · PDB · ResourceQuota.
kubectl
kubectl get pods -A -o wide kubectl describe pod <p>
kubectl logs <p> --previous -f kubectl exec -it <p> -- sh
kubectl apply -f file.yaml kubectl delete -f file.yaml
kubectl rollout status|history|undo deploy/<d>
kubectl scale deploy/<d> --replicas=5
kubectl port-forward svc/<s> 8080:80
kubectl top pods kubectl get events --sort-by=.lastTimestampProbes
Liveness → restart · Readiness → remove from endpoints · Startup → delay others.
Resources
Requests (scheduling) · Limits (CPU throttle, memory OOMKill) · QoS: Guaranteed / Burstable / BestEffort.
Pod phases & errors
Pending · Running · Succeeded · Failed · Unknown — ImagePullBackOff · CrashLoopBackOff · OOMKilled · CreateContainerConfigError.
Deploy strategies
Rolling (default) · Recreate · Blue-green · Canary · A/B. Rollback: kubectl rollout undo / helm rollback.
AKS
az aks create/get-credentials/upgrade/nodepool add · attach ACR · Workload Identity + Key Vault CSI · Azure CNI · Container Insights · KEDA · AKS Automatic · consider Azure Container Apps for simpler needs.
37. Azure DevOps & CI/CD
Azure DevOps services
Boards · Repos · Pipelines · Test Plans · Artifacts.
YAML hierarchy
trigger/pr/schedules → variables/parameters/resources → stages → jobs (job / deployment) → steps (task / script / template).
Common tasks
UseDotNet@2 · DotNetCoreCLI@2 · PublishTestResults@2 · PublishPipelineArtifact@1 · Docker@2 · AzureWebApp@1 · AzureCLI@2 · AzureKeyVault@2 · KubernetesManifest@1 · HelmDeploy@1 · SqlAzureDacpacDeployment@1 · Cache@2 · NuGetAuthenticate@1.
Expressions
${{ }} compile-time · $[ ] runtime · $( ) macro. Conditions: succeeded(), failed(), always(), eq(), and(), or(), contains().
Triggers
CI (trigger) · PR (pr) · schedules (cron) · pipeline resources (on another pipeline completing) · manual.
Security
Workload identity federation service connections · Key Vault variable groups · secret masking · branch policies · environment approvals & checks · required templates · least-privilege pipeline permissions.
Strategies
Trunk-based / GitHub flow / GitFlow · rolling / blue-green (slots) / canary · build once, deploy many · IaC (Bicep/Terraform) · DORA metrics.
38. Microsoft Azure for .NET Developers
Service map
| Need | Service |
|---|---|
| Web app/API | App Service |
| Serverless code | Functions (Flex Consumption, isolated worker) |
| Containers | Container Apps / AKS / ACI |
| VMs | Virtual Machines, VM Scale Sets |
| Relational DB | Azure SQL Database / Managed Instance |
| NoSQL | Cosmos DB |
| Files/objects | Blob Storage / Azure Files |
| Cache | Azure Managed Redis |
| Messages | Service Bus |
| Events | Event Grid |
| Streams | Event Hubs |
| Workflows | Logic Apps / Durable Functions |
| API gateway | API Management |
| Secrets | Key Vault |
| Config/flags | App Configuration |
| Identity | Entra ID, managed identities |
| Monitoring | Azure Monitor, Application Insights, Log Analytics (KQL) |
| Global entry | Front Door (+WAF, CDN) |
| IaC | Bicep / ARM / Terraform |
Key numbers & terms
Storage redundancy: LRS · ZRS · GRS · RA-GRS · GZRS. Blob tiers: Hot · Cool (30d) · Cold (90d) · Archive (180d). Cosmos consistency: Strong · Bounded Staleness · Session (default) · Consistent Prefix · Eventual. Functions in-process model support ends 10 Nov 2026.
CLI
az login
az account set -s <subscription>
az group create -n rg -l centralindia
az webapp up / az webapp deploy
az functionapp create
az keyvault secret set --vault-name kv -n Db --value "..."
az deployment group create -g rg -f main.bicep
azd upWell-Architected pillars
Reliability · Security · Cost Optimization · Operational Excellence · Performance Efficiency.
Golden rules
Managed identity + DefaultAzureCredential · Key Vault · private endpoints · autoscale · deployment slots · IaC · Application Insights · tags + budgets · zones/multi-region for HA.
39. Azure Databases — Azure SQL, Managed Instance, Cosmos DB, PostgreSQL and Migration
Choose the service
New app → Azure SQL Database · lift-and-shift with Agent/cross-DB → Managed Instance · full control/SSRS on box → SQL VM · global NoSQL → Cosmos DB · Postgres/MySQL → Flexible Server · cache → Redis.
Azure SQL tiers
DTU (Basic/Standard/Premium) or vCore (General Purpose, Business Critical, Hyperscale) · serverless (auto-scale, auto-pause) · elastic pools (many DBs) · Hybrid Benefit + reservations.
Security
Private endpoint · Entra-only auth + managed identity (Authentication=Active Directory Default) · TDE · Always Encrypted · RLS · auditing · Defender for SQL.
HA/DR
Built-in HA (99.99 %) · zone redundancy · geo-replication · failover groups (listener endpoints) · PITR 1–35 days · LTR up to 10 years · geo-restore · retry transient faults.
Cosmos DB
Partition key (high cardinality, in queries) · RU/s (autoscale/serverless) · consistency: Strong → Bounded → Session (default) → Prefix → Eventual · change feed · point reads cheapest.
40. Amazon Web Services (AWS) for .NET and Full Stack Developers
Core services
IAM (roles!) · EC2 · Elastic Beanstalk · ECS/Fargate · EKS · Lambda · S3 · EBS/EFS · RDS (SQL Server) · Aurora · DynamoDB · ElastiCache · VPC · ALB/NLB · Route 53 · CloudFront · API Gateway · SQS/SNS/EventBridge · CloudWatch · CloudTrail · KMS/Secrets Manager · Cognito.
Azure ↔ AWS
App Service ↔ Beanstalk/App Runner · Container Apps ↔ Fargate · AKS ↔ EKS · Functions ↔ Lambda · Blob ↔ S3 · Azure SQL ↔ RDS · Cosmos DB ↔ DynamoDB · Service Bus ↔ SQS/SNS · Key Vault ↔ Secrets Manager · Monitor ↔ CloudWatch · Bicep ↔ CloudFormation/CDK.
HA basics
2+ AZs · ALB + auto scaling · Multi-AZ RDS · stateless apps · queues for spikes · Route 53 failover for DR.
Security basics
Root MFA, no keys · least-privilege policies · roles for apps · private subnets for data · security groups chain · KMS encryption · Secrets Manager · CloudTrail on · WAF on public endpoints.
Cost basics
Right-size · Savings Plans/RIs · Spot for batch · Graviton · serverless for spiky · S3 lifecycle · VPC endpoints · Budgets + tags.
41. Google Cloud Platform (GCP) for .NET and Full Stack Developers
Key services
Compute Engine · Cloud Run · GKE (Autopilot) · Cloud Run functions · Cloud Storage · Cloud SQL (SQL Server/Postgres/MySQL) · AlloyDB · Spanner · Firestore · Bigtable · Memorystore · BigQuery · Pub/Sub · Eventarc · Cloud Tasks · Load Balancing · Cloud CDN · Cloud Armor · Secret Manager · Cloud KMS · Logging/Monitoring/Trace · Cloud Build · Artifact Registry · Vertex AI.
Hierarchy & IAM
Org → folders → projects → resources · predefined roles · service accounts for workloads · Workload Identity Federation (no keys) · org policies.
.NET on GCP
Container on Cloud Run (listen on PORT) · Cloud SQL via private IP or Auth Proxy · secrets via --set-secrets · JSON logs to stdout · Cloud Build/GitHub Actions deploy.
Cost
Sustained & committed use discounts · Spot VMs · scale to zero · budgets · BigQuery partition/cluster · lifecycle rules.
Compared with Azure/AWS
Global VPC · global load balancer with one anycast IP · strongest analytics (BigQuery) · Kubernetes origin (GKE) · per-second billing.
42. HTML5 & CSS3 — Semantic Markup to Responsive Layouts
Semantic skeleton
header > nav · main > article > section · aside · footer · one h1, headings in order · button for actions, a for navigation · labels for every input.
Specificity
inline > id (1,0,0) > class/attr/pseudo-class (0,1,0) > element (0,0,1); equal → last wins; !important overrides; @layer order before specificity.
Layout picks
| Need | Use |
|---|---|
| Row of items, centring | Flexbox |
| Page layout, card grid | Grid |
| Auto-responsive grid | repeat(auto-fill, minmax(220px, 1fr)) |
| Sticky header | position: sticky; top: 0 |
| Fluid font | clamp(min, preferred, max) |
Responsive checklist
Viewport meta · mobile-first min-width queries · no fixed widths · max-width:100% images · min-width:0 on grid/flex children · overflow wrappers for tables/code · container queries for components · test 320 → 1920 px.
Accessibility checklist
Alt text · labels · keyboard + visible focus · contrast 4.5:1 · lang · landmarks · ARIA only when needed · prefers-reduced-motion.
43. JavaScript (ES5 → ES2025) & TypeScript Basics
Types & equality
Primitives: string, number, bigint, boolean, undefined, null, symbol. Falsy: false, 0, -0, 0n, "", null, undefined, NaN. Use ===. Array.isArray, Number.isNaN, typeof null === "object".
Declarations
const by default · let when reassigning · no var · TDZ for let/const · function declarations fully hoisted.
this
method → object · plain → undefined (strict) · new → instance · call/apply/bind → explicit · arrow → lexical.
Event loop
Sync code → all microtasks (promises, queueMicrotask) → render → next macrotask (setTimeout, events, I/O).
Promises
all (fail fast) · allSettled (all outcomes) · race (first settled) · any (first success) · async/await + try/catch · AbortController.
Array methods
map · filter · reduce · find · findIndex · some · every · includes · flat · flatMap · at · toSorted · Object.groupBy · sort((a,b)=>a-b) (default sort is lexicographic!).
Modern syntax
?. · ?? · ??= · destructuring · spread/rest · template literals · classes with #private · modules · top-level await · structuredClone.
DOM
querySelector(All) · textContent (safe) vs innerHTML (XSS risk) · addEventListener · delegation with closest · bubbling vs capturing · preventDefault / stopPropagation.
Snippets
const debounce = (f, ms) => { let t; return (...a) => { clearTimeout(t); t = setTimeout(() => f(...a), ms); }; };
const unique = arr => [...new Set(arr)];
const sleep = ms => new Promise(r => setTimeout(r, ms));
const sum = arr => arr.reduce((s, x) => s + x, 0);
const groupBy = (arr, key) => arr.reduce((acc, x) => ((acc[x[key]] ??= []).push(x), acc), {});44. TypeScript — Types, Generics and Real-World Patterns
Core types
string number boolean bigint symbol · T[] / Array<T> · tuple [A, B] · unknown (safe) vs any (unsafe) · never · void · literal types "a" | "b" · as const.
Interface vs type
Interface: object contracts, extends, declaration merging. Type: unions, tuples, mapped/conditional types, & intersections.
Narrowing
typeof · instanceof · in · discriminant switch + never default · x is T guards · asserts x is T.
Utility types
Partial Required Readonly Pick Omit Record Exclude Extract NonNullable ReturnType Parameters Awaited.
Safety rules
strict: true · avoid any and as · unknown for external data · validate API responses (Zod) · generate types from OpenAPI · import type for type-only imports · tsc --noEmit in CI.
45. Node.js — Runtime Internals, Express, APIs and SQL Server
Architecture
V8 (JS engine) + libuv (event loop, thread pool of 4, async I/O) · your JS on one main thread · I/O non-blocking · CPU work → worker threads.
Event loop order
sync code → process.nextTick → promise microtasks → timers → pending → poll (I/O) → check (setImmediate) → close callbacks.
Express essentials
express.json() · routers per feature · middleware order matters · (err, req, res, next) error handler · Express 5 async errors · helmet, cors, rate limit, validation.
SQL Server from Node
mssql ConnectionPool once · .input(name, type, value) parameters · .execute(proc) · sql.Transaction · encrypt: true (Azure) · Prisma provider = "sqlserver" · secrets in env vars.
Production
LTS (even) versions · npm ci · NODE_ENV=production · PM2/cluster or containers · graceful SIGTERM shutdown · pino logging · monitor event-loop lag and heap.
46. jQuery
Core
$(fn) DOM ready · $("css") select · $(el) wrap · $("<li>", {text}) create · chaining · implicit iteration · $.noConflict().
Traversal
find · filter · not · eq · first/last · parent/parents/closest · children/siblings/next/prev · is · has.
Manipulation
text · html · val · attr · prop · data · addClass/removeClass/toggleClass · css · append/prepend/after/before · appendTo · remove/detach/empty · clone.
Events
on(event, [selector], handler) · off · one · trigger · namespaces click.ns · e.preventDefault() · return false = prevent + stop.
AJAX
$.ajax({url, method, data, contentType, dataType}) · $.get · $.post · $.getJSON · .load() · .done/.fail/.always/.then · $.when · ajaxStart/ajaxStop.
Effects
show/hide/toggle · fadeIn/fadeOut/fadeToggle · slideUp/slideDown/slideToggle · animate · stop · delay.
Versions to remember
1.7 .on() · 1.9 removed .live() · 3.0 Promises/A+ · 3.5 XSS fix · 4.0 (2026) drops old IE, ES modules.
Modern equivalents
querySelector · classList · textContent · dataset · addEventListener + closest · fetch · CSS transitions.
47. AngularJS (1.x) — Legacy
Building blocks
module · controller (controller-as vm) · $scope / $rootScope · directives · components (1.5+) · filters · services · DI · routing · digest cycle.
Directives
ng-app · ng-controller · ng-model · ng-bind · ng-repeat (track by) · ng-if · ng-show/hide · ng-switch · ng-class · ng-click · ng-submit · ng-options · ng-include · ng-cloak · ng-messages.
Services
constant (config-safe) · value · factory (returns object) · service (new) · provider ($get, configurable).
Bindings
@ string · < one-way · = two-way · & callback. Component hooks: $onInit, $onChanges, $doCheck, $postLink, $onDestroy.
Digest
watchers + dirty checking · $apply (outside AngularJS) · $applyAsync · $watch / $watchCollection / deep watch · max 10 iterations · $emit up / $broadcast down / $on.
Key facts
1.0 2012 · 1.5 components · 1.6 removed .success/.error · 1.8.3 last · EOL 31 Dec 2021 · migrate with ngUpgrade.
Performance
:: one-time binding · track by · fewer watchers · debounce ng-model · no heavy template filters · debugInfoEnabled(false).
48. Angular (2 → 21)
CLI
ng new · ng serve · ng g c|s|p|d|g · ng build · ng test · ng add · ng update.
Bindings
{{ }} · [prop] · (event) · [(ngModel)] · [class.x] · [style.x] · [attr.x].
Control flow (v17+)
@if / @else · @for (x of xs; track x.id) {} @empty {} · @switch / @case · @defer (on viewport) · @let.
Signals
signal() · computed() · effect() · linkedSignal() · resource() · input() · output() · model() · viewChild() · toSignal() / toObservable().
Lifecycle
constructor → ngOnChanges → ngOnInit → ngDoCheck → ngAfterContentInit/Checked → ngAfterViewInit/Checked → ngOnDestroy.
RxJS
switchMap (cancel) · mergeMap (parallel) · concatMap (sequential) · exhaustMap (ignore while busy) · debounceTime · distinctUntilChanged · catchError · retry · forkJoin · combineLatest · shareReplay · takeUntilDestroyed · BehaviorSubject.
Routing
provideRouter(routes) · loadComponent / loadChildren · guards CanActivateFn / CanMatchFn / CanDeactivateFn · ResolveFn · routerLink · <router-outlet />.
Forms
Template-driven (ngModel) vs Reactive (FormGroup, FormControl, FormArray, Validators, typed) · Signal Forms (v21, experimental).
Performance
OnPush · signals · zoneless · lazy routes · @defer · track · virtual scroll · SSR + hydration · NgOptimizedImage · no functions in templates.
Versions
2 (2016) · 9 Ivy · 14 standalone · 16 signals · 17 control flow + @defer · 19 standalone default · 20 stable signals · 21 zoneless default + Vitest · major every 6 months, 18-month support.
49. React (with Hooks, React 19 & Next.js basics)
Core
Components = functions returning JSX · props down, callbacks up · state triggers re-render · keys for lists · immutable updates · fragments <>...</>.
Hooks
useState · useEffect (deps, cleanup) · useLayoutEffect · useRef · useMemo · useCallback · useContext · useReducer · useId · useTransition · useDeferredValue · useSyncExternalStore · React 19: use · useActionState · useFormStatus · useOptimistic · 19.2: useEffectEvent.
Effect dependency rules
none = every render · [] = mount/unmount · [x] = when x changes · cleanup before re-run and on unmount · abort fetches.
Rules of Hooks
Top level only · React functions only · names start with use.
Performance
Profile → colocate state → memo + stable props (or React Compiler) → virtualise lists → lazy + Suspense → transitions → TanStack Query caching → SSR/RSC.
State choices
Local useState · complex useReducer · subtree Context · server data TanStack Query · global Zustand/Redux Toolkit · URL params · forms React Hook Form.
Rendering models
CSR · SSR + hydration · SSG/ISR · Server Components ("use server" actions, "use client" components) · Next.js App Router.
Versions
16.8 Hooks (2019) · 18 concurrent + batching (2022) · 19 Actions + RSC stable (Dec 2024) · 19.2 Activity (Oct 2025) · React Compiler 1.0 · CRA deprecated (2025).
50. Next.js — App Router, Folder Structure, Rendering and Full Stack with SQL Server
Folder conventions
app/ routes · page.tsx · layout.tsx · loading.tsx · error.tsx · not-found.tsx · route.ts (API) · [id] dynamic · [...slug] catch-all · (group) · _private · proxy.ts (middleware) · public/ static.
Components
Server by default (async, DB, secrets, zero JS) · "use client" for state/events · keep client components small · import "server-only" for DB code.
Rendering
Static + generateStaticParams · ISR revalidate · on-demand revalidatePath/Tag · dynamic per request · streaming Suspense · Cache Components "use cache" (16).
SQL Server
mssql pool on globalThis · Node runtime · env vars (no NEXT_PUBLIC_) · parameterised queries · or Prisma sqlserver · or call an ASP.NET Core API.
Deploy
Vercel (git push) · output: "standalone" for Docker/Azure/IIS (reverse proxy) · output: "export" for static sites.
51. Vue.js 3 (with Pinia, Vue Router & Nuxt basics)
Template
{{ }} · :prop · @event.prevent · v-model.trim/.number/.lazy · v-if/v-else-if/v-else · v-show · v-for="(x, i) in xs" :key="x.id" · #slot · <component :is>.
Reactivity
ref (.value) · reactive · computed · watch (lazy, specific) · watchEffect (immediate, auto-track) · toRefs / storeToRefs · shallowRef · readonly · nextTick.
script setup macros
defineProps · defineEmits · defineModel (3.4) · defineExpose · defineOptions · defineSlots · withDefaults.
Lifecycle (Composition)
setup → onBeforeMount → onMounted → onBeforeUpdate → onUpdated → onBeforeUnmount → onUnmounted (+ onErrorCaptured, onActivated/onDeactivated).
Communication
props ↓ · emits ↑ · v-model ↕ · provide/inject (deep) · Pinia (global) · template ref + defineExpose.
Built-ins
<Transition> · <TransitionGroup> · <KeepAlive> · <Teleport> · <Suspense> · defineAsyncComponent.
Ecosystem
Vite · Vue Router 4 (guards: beforeEach, beforeEnter, onBeforeRouteLeave) · Pinia · VueUse · Vitest + Vue Test Utils · Nuxt 4.
Versions
2.0 (2016) · 2.7 (2022) · Vue 2 EOL 31 Dec 2023 · 3.0 (2020) · 3.2 script setup · 3.4 defineModel · 3.5 props destructure, useTemplateRef · 3.6 Vapor Mode (in development).
52. Test Automation — Selenium, Playwright, API and BDD with C#
Pyramid & what to automate
Many unit → some API/integration → few UI. Automate regression, smoke, data-driven, API contracts; keep exploratory and usability manual.
Selenium essentials
driver.FindElement(By.CssSelector("[data-testid='save']")).Click();
new WebDriverWait(driver, TimeSpan.FromSeconds(10)).Until(d => d.FindElement(By.Id("ok")).Displayed);
new SelectElement(el).SelectByText("India"); driver.SwitchTo().Frame("pay");Playwright essentials
await Page.GetByRole(AriaRole.Button, new() { Name = "Save" }).ClickAsync();
await Expect(Page.GetByText("Saved")).ToBeVisibleAsync();
await Page.RouteAsync("**/api/orders", r => r.FulfillAsync(new() { Json = new[] { new { id = 1 } } }));Framework checklist
POM/components · driver factory · config per env · explicit waits only · data via API · independent tests · parallel-safe · screenshots/traces on failure · reports · CI categories (smoke/regression).
Flaky test fixes
Condition waits · stable locators · own data per test · mock unstable dependencies · quarantine + fix · retries only as a visible, temporary measure.
53. Industrial Automation — PLC, SCADA, Modbus and OPC UA
Levels (ISA-95 / Purdue)
0 field devices · 1 PLC/DCS control · 2 SCADA/HMI · 3 MES/historian · 4 ERP. DMZ between 3 and 4.
PLC basics
Scan: inputs → program → outputs → housekeeping. Languages: LD, FBD, ST, SFC (IL deprecated). Timers TON/TOF/TP; counters CTU/CTD; edges R_TRIG/F_TRIG.
Signals
Digital 24 V (PNP/NPN) · 4–20 mA (live zero, broken-wire detection) · 0–10 V · scaling (raw−rMin)/(rMax−rMin)×(eMax−eMin)+eMin.
Modbus
Coils FC01/05/15 · discrete inputs FC02 · input registers FC04 · holding registers FC03/06/16 · TCP port 502 · two registers per float — check word order · no security.
OPC UA
Nodes + information model · read/write/subscribe/methods/history/alarms · certificates + encryption · opc.tcp://host:4840 · PubSub over MQTT · companion specs.
Safety & security
E-stop NC and on safety PLC/hard-wired · SIL/PL · IEC 62443 zones & conduits · no internet to PLCs · audited writes only.
54. Industry 4.0 & IIoT — Smart Manufacturing Software
Concepts
Industry 4.0 = CPS + IIoT + cloud/edge + analytics/AI · IT/OT convergence · vertical (sensor→ERP) and horizontal (supply chain) integration · Industry 5.0 = human-centric, resilient, sustainable.
Levels & systems
ISA-95: 0 field · 1 PLC · 2 SCADA/HMI · 3 MES/historian · 4 ERP. ERP plans (days), MES executes (minutes), PLC controls (ms).
OEE
OEE = Availability × Performance × Quality · A = run/planned · P = ideal cycle × count / run · Q = good/total · six big losses · world class ≈ 85 %.
Protocols
OPC UA (machine access, information model, security) · MQTT (pub/sub, QoS 0/1/2, retained, LWT) · Sparkplug B (namespace + birth/death) · Unified Namespace on an MQTT broker.
Use cases
Real-time OEE & downtime · traceability/genealogy · SPC & quality · predictive maintenance · energy monitoring · digital twin & virtual commissioning · computer-vision inspection · AI assistants.
.NET stack
Worker Service edge (OPC UA .NET, NModbus, MQTTnet) · IoT Hub/Event Hubs · ASP.NET Core API + SignalR · SQL Server (RLS, columnstore, partitions) + time-series DB · Angular/React dashboards · Docker/K8s · OpenTelemetry.
55. Blockchain & Web3 Fundamentals
Core terms
Block · hash · Merkle root · node · consensus · mempool · confirmation · finality · fork · wallet · private/public key · address · seed phrase · gas · nonce · smart contract · EVM · ABI · token · dApp · oracle · bridge · L1/L2.
Consensus
PoW (Bitcoin, mining) · PoS (Ethereum since Sep 2022, staking, slashing, 32 ETH validator, 12 s slots, ~12.8 min finality) · DPoS · BFT · PoA.
Bitcoin vs Ethereum
BTC: 2009, PoW, 10-min blocks, 21M cap, UTXO, halving every ~4 years. ETH: 2015, PoS, 12-s blocks, account model, smart contracts, 1 ETH = 10^18 wei, EIP-1559 fee burn.
Token standards
ERC-20 fungible · ERC-721 NFT · ERC-1155 multi-token · ERC-4626 vaults · ERC-2612 permit · ERC-4337 account abstraction · EIP-712 typed signing · ERC-4361 Sign-In with Ethereum.
Scaling
Optimistic rollups (Arbitrum, Optimism, Base — 7-day challenge) · ZK rollups (zkSync, Starknet, Scroll, Linea) · sidechains (Polygon PoS) · Lightning (BTC) · EIP-4844 blobs (2024).
Upgrades to remember
The DAO hack 2016 · EIP-1559 2021 · The Merge 2022 · Shanghai 2023 · Dencun 2024 · Pectra May 2025 · Fusaka Dec 2025.
Dev stack
Solidity · Hardhat / Foundry / Remix · OpenZeppelin · ethers.js v6 / viem / wagmi · Nethereum (.NET) · MetaMask · Infura/Alchemy · Etherscan · Sepolia testnet · IPFS · The Graph · Chainlink.
Security
Seed phrase = ownership · limit approvals · audits · reentrancy · oracle manipulation · flash loans · bridge risk · MEV · multisig + timelock admins.
56. Solidity & Smart Contract Development
Skeleton
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
contract C is Parent {
uint256 public x; address public immutable owner; uint256 constant MAX = 100;
mapping(address => uint256) public bal;
event Did(address indexed who, uint256 v);
error Nope(uint256 code);
modifier onlyOwner() { if (msg.sender != owner) revert Nope(1); _; }
constructor() { owner = msg.sender; }
function f(uint256 a) external payable onlyOwner returns (uint256) { emit Did(msg.sender, a); return a; }
receive() external payable {}
}Visibility & mutability
public · external · internal · private (still readable on-chain) · view · pure · payable.
Data locations
storage (persistent, costly) · memory (temporary) · calldata (read-only inputs, cheapest) · stack · transient (per-tx, 0.8.28).
Errors
require · revert CustomError() · assert (Panic) · try/catch for external calls · all state rolled back.
Security checklist
CEI + nonReentrant · msg.sender not tx.origin · access control on every admin function · SafeERC20 · no spot-price oracles · no unbounded loops · pull payments · nonces + chainid in signatures · Chainlink VRF for randomness · initializers + _disableInitializers for proxies · multisig + timelock · audits + fuzzing.
Gas tips
Fewer SSTOREs · cache reads · pack slots · constant/immutable · calldata · custom errors · unchecked loops · events over storage · optimizer.
Tooling
Remix · Foundry (forge/cast/anvil) · Hardhat · OpenZeppelin · Slither · Echidna · Tenderly · Etherscan verify · Sepolia.
Versions
0.5 explicit locations · 0.6 virtual/override, receive/fallback · 0.8 checked math · 0.8.4 custom errors · 0.8.28 transient storage · OpenZeppelin 5.x.
57. .NET Full Stack Developer Interview — End to End
End-to-end request path
UI service → interceptor (JWT) → CORS preflight → Kestrel → exception handler → routing → CORS → authN → authZ → endpoint → validation → service → EF Core / Dapper → SQL Server → DTO → JSON → UI state → render.
Status codes to quote
| Code | Use |
|---|---|
| 200 / 201 / 204 | OK / Created (+ Location) / No content (delete, update) |
| 202 | Accepted — background job started |
| 400 | Validation failed (ProblemDetails with errors) |
| 401 / 403 | Not authenticated / authenticated but not allowed |
| 404 / 409 | Not found / conflict (concurrency, duplicate) |
| 429 | Rate limited |
| 500 | Unhandled error — log with correlation id |
Performance checklist
- Server-side paging, projection to DTOs,
AsNoTrackingfor reads - Index for every important
WHERE+ORDER BY; read the execution plan - No N+1, no query inside a loop, no
.Result/.Wait() - Cache reference data (
IMemoryCache/HybridCache/Redis) - UI: lazy routes, debounce + cancel, virtual scrolling,
OnPush/signals ormemo
Security checklist
- HTTPS + HSTS; JWT from a trusted IdP; policies, not only roles
- Ownership checks on every resource (no IDOR)
- Parameterised SQL only; validate all input
- CORS limited to known origins; rate limiting
- Secrets in Key Vault with Managed Identity; nothing sensitive in logs or JWT payload
Project answer skeleton
Business → Frontend → API layers → Data → Security → CI/CD & hosting → My contribution + one number.
Words that show seniority
Idempotency key · outbox pattern · correlation id · ProblemDetails · optimistic concurrency (ROWVERSION) · covering index · keyset paging · modular monolith · Managed Identity · deployment slots · feature flags · health checks.
58. HR & Behavioural Interview
Answer frameworks
- STAR: Situation · Task · Action (60%, "I") · Result (numbers + learning).
- Tell me about yourself: Present → Past → Future → why this role (60–90 s).
- Why us: Company → Role → You.
- Weakness: real + not fatal + what you're doing about it + proof of progress.
Story bank (prepare 8–10)
Biggest achievement · conflict · failure/mistake · tight deadline · disagreement with manager · leadership/mentoring · learning something fast · customer/stakeholder issue · going beyond your role · process improvement.
Never
Badmouth employers · lie (background checks verify) · say "no questions" · give a salary number before researching · ramble beyond 2 minutes · use only "we".
Always
Research the company · tailor examples to the JD · quantify results · ask 2–3 questions · send a thank-you email · keep your story consistent with your resume and LinkedIn.
Online checklist
Camera at eye level · light in front · headphones · notifications off · resume + JD + pitch notes open · join 5 minutes early · water nearby.
Questions to ask
90-day success · team challenges · team structure · engineering practices · growth/reviews · next steps.
59. Team Lead, Managerial & Agile Interview
Leadership answer pattern
Context → my approach (principles) → concrete example (STAR) → result/metric → what I learned.
Scrum quick facts
Roles: PO · Scrum Master · Developers. Events: Sprint · Planning · Daily (15 min) · Review · Retro. Artifacts: Product Backlog (Product Goal) · Sprint Backlog (Sprint Goal) · Increment (DoD). Scrum Guide 2020.
Planning tools
INVEST stories · acceptance criteria · story points + planning poker · velocity · three-point/PERT (O + 4M + P)/6 · MoSCoW · risk register · RAG status.
People tools
1:1s · SBI feedback · situational leadership (direct → coach → support → delegate) · Tuckman (form, storm, norm, perform) · psychological safety · PIP as last resort.
Delivery tools
Definition of Done · WIP limits · change requests · ADRs · blameless post-mortems (5 Whys) · DORA metrics · tech-debt budget 15–20%.
Phrases that work
"Here are three options and my recommendation." · "What will we drop to add this?" · "Disagree and commit." · "Let's restore service first, then find root cause." · "What does success look like for you?"
Avoid
Blaming the team · hero culture · comparing individuals by velocity · hiding bad news · promising dates without the team's estimate.
60. Career Gaps, Job Changes & Salary Negotiation
Gap answer formula
Reason (1 line) → what I did (projects, certifications, freelancing, caregiving) → proof (GitHub, certificate) → ready and committed now. Never lie; keep it under 30 seconds.
Salary research
Profile (role, YOE, skills, city, company type) → 3+ data sources → range (low/median/high) → walk-away, target, anchor numbers.
India offer terms
CTC · fixed · variable · basic · HRA · special allowance · employer PF (12% of basic) · gratuity (after 5 years) · joining bonus (clawback) · ESOP/RSU vesting · in-hand = gross − PF − professional tax − TDS · old vs new tax regime.
Taiwan offer terms
Monthly salary × 12 + year-end bonus (not guaranteed) · labour + health insurance · employer pension ≥ 6% · probation · work permit / Gold Card · minimum wage 2026 NT$29,500/month (verify).
Negotiation steps
Thank → ask time → compare with data → one clear justified ask → negotiate the package (bonus, buyout, review, level, remote) → get it in writing → decide.
Phrases
"Based on market data for this role…" · "I'm flexible on the structure of the package…" · "Is there flexibility on the fixed component?" · "Could a joining bonus or an earlier review bridge the gap?"
Resignation checklist
Written offer first · tell manager personally · short positive email · handover plan · relieving/experience letters · final settlement · PF transfer (UAN) · return assets · no burned bridges.
61. Company-wise Interview Preparation
Prepare by company type
| Type | Must prepare |
|---|---|
| IT services | Project explanation, C#/OOP, ASP.NET Core, EF, SQL queries, basic programs, Azure/DevOps basics, flexibility answers |
| Product (Amazon/Microsoft/Google) | DSA by pattern, system design, behavioural stories (Amazon: 16 LPs), clean code without IDE |
| Consulting / Big Four | Breadth, client scenarios, communication, estimation, domain knowledge |
| GCC | Fundamentals + design + cloud + stakeholder skills across time zones |
| Startup | Take-home quality, full-stack breadth, ownership, shipping speed |
| Taiwan | Language requirements, work permit/Gold Card status, company research, polite and concise communication |
Fresher tests (typical, verify yearly)
TCS NQT (Ninja/Digital/Prime) · Infosys (Systems Engineer / Specialist Programmer / Digital Specialist Engineer, HackWithInfy) · Wipro Elite NLTH · Cognizant GenC tiers · Accenture cognitive + technical + coding + communication · Capgemini game-based + pseudo-code.
Amazon LPs (16)
Customer Obsession · Ownership · Invent and Simplify · Are Right, A Lot · Learn and Be Curious · Hire and Develop the Best · Insist on the Highest Standards · Think Big · Bias for Action · Frugality · Earn Trust · Dive Deep · Have Backbone; Disagree and Commit · Deliver Results · Strive to be Earth's Best Employer · Success and Scale Bring Broad Responsibility.
Research sources
Official careers pages · Glassdoor · AmbitionBox · LeetCode Discuss · GeeksforGeeks experiences · Blind · Reddit · PTT Tech_Job (Taiwan) · recruiter.
Universal must-haves
60–90 s introduction · project deep-dive with a diagram · 8–10 STAR stories · core fundamentals · coding patterns · 2–3 smart questions · researched salary range.