[{"id":1,"course_slug":"computer-fundamentals","course_title":"How Computers Work — CPU, Memory, OS, Processes and Threads","ord":1,"level":"Beginner","priority":"High","question":"What is the difference between stack and heap memory?","question_html":"What is the difference between stack and heap memory?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The stack holds method call frames — parameters, local value-type variables and references — per thread;</p>\n<ul class=\"q-points\"><li>allocation and cleanup are automatic and very fast (push/pop) but it is small (≈1 MB per thread).</li><li>The heap holds objects created with <code>new</code>, shared by all threads, larger, and in .NET cleaned by the garbage collector.</li><li>Stack overflow comes from too-deep recursion; heap problems are leaks and fragmentation.</li></ul>\n"},{"id":2,"course_slug":"computer-fundamentals","course_title":"How Computers Work — CPU, Memory, OS, Processes and Threads","ord":2,"level":"Beginner","priority":"High","question":"What is the difference between a process and a thread?","question_html":"What is the difference between a process and a thread?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A process is a running program with its own isolated virtual memory and resources.</p>\n<ul class=\"q-points\"><li>A thread is an execution path inside a process; threads of the same process share its heap and resources but each has its own stack and registers.</li><li>Processes are isolated and heavier; threads are lighter but need synchronisation for shared data, and an unhandled exception in one thread kills the whole process.</li></ul>\n"},{"id":3,"course_slug":"computer-fundamentals","course_title":"How Computers Work — CPU, Memory, OS, Processes and Threads","ord":3,"level":"Beginner","priority":"High","question":"What is RAM and why is it faster than disk? What is a cache?","question_html":"What is RAM and why is it faster than disk? What is a cache?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> RAM is volatile main memory accessed electronically in ~100 ns;</p>\n<ul class=\"q-points\"><li>SSDs take tens of microseconds and HDDs milliseconds because of slower technology (and seek mechanics for HDDs).</li><li>A cache is a small, faster copy of frequently used data closer to where it&#39;s needed — CPU L1/L2/L3 caches over RAM, SQL Server&#39;s buffer pool over disk, Redis over a database.</li><li>Caches work because of locality: recently or nearby used data is likely to be used again.</li></ul>\n"},{"id":6,"course_slug":"computer-fundamentals","course_title":"How Computers Work — CPU, Memory, OS, Processes and Threads","ord":6,"level":"Intermediate","priority":"High","question":"What is virtual memory?","question_html":"What is virtual memory?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> An OS + CPU mechanism that gives each process its own large, private address space, mapped page by page (usually 4 KB) to physical RAM or to disk (page file/swap).</p>\n<ul class=\"q-points\"><li>It isolates processes, lets programs use more memory than physically available, and loads pages lazily.</li><li>Accessing a page not in RAM causes a page fault; heavy paging (thrashing) makes a system extremely slow.</li></ul>\n"},{"id":7,"course_slug":"computer-fundamentals","course_title":"How Computers Work — CPU, Memory, OS, Processes and Threads","ord":7,"level":"Intermediate","priority":"High","question":"What is a race condition and how do you prevent it?","question_html":"What is a race condition and how do you prevent it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> When the result depends on the timing of threads accessing shared data, e.g. two threads doing <code>count++</code> (read, add, write) and one update is lost.</p>\n<ul class=\"q-points\"><li>Prevent it with mutual exclusion (<code>lock</code>, <code>SemaphoreSlim</code>), atomic operations (<code>Interlocked</code>), thread-safe collections (<code>ConcurrentDictionary</code>), immutable data, or by not sharing state (message passing).</li><li>In databases, transactions and isolation levels play the same role.</li></ul>\n"},{"id":8,"course_slug":"computer-fundamentals","course_title":"How Computers Work — CPU, Memory, OS, Processes and Threads","ord":8,"level":"Intermediate","priority":"High","question":"What is a deadlock? How do you avoid it?","question_html":"What is a deadlock? How do you avoid it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Two or more threads (or transactions) each hold a resource the other needs and wait forever.</p>\n<ul class=\"q-points\"><li>Conditions: mutual exclusion, hold-and-wait, no preemption, circular wait.</li><li>Avoid by acquiring locks in a consistent order, holding locks briefly, using timeouts (<code>Monitor.TryEnter</code>, <code>SemaphoreSlim.WaitAsync(timeout)</code>), and avoiding sync-over-async (<code>.Result</code>) in .NET.</li><li>SQL Server detects deadlocks and kills one victim transaction.</li></ul>\n"},{"id":14,"course_slug":"computer-fundamentals","course_title":"How Computers Work — CPU, Memory, OS, Processes and Threads","ord":14,"level":"Scenario","priority":"High","question":"A server has 16 GB RAM but the app is very slow and disk activity is constantly 100%. What might be happening?","question_html":"A server has 16 GB RAM but the app is very slow and disk activity is constantly 100%. What might be happening?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Probably memory pressure and paging: processes (or SQL Server with no max memory limit, or a leaking app) use more than physical RAM, so the OS keeps swapping pages to disk (thrashing).</p>\n<ul class=\"q-points\"><li>Check memory usage per process, page faults/sec and page file usage; set SQL Server max server memory, fix leaks, reduce caching, or add RAM.</li><li>Also check whether the disk activity is actually database reads due to missing indexes.</li></ul>\n"},{"id":4,"course_slug":"computer-fundamentals","course_title":"How Computers Work — CPU, Memory, OS, Processes and Threads","ord":4,"level":"Beginner","priority":"Medium","question":"What is the difference between 32-bit and 64-bit?","question_html":"What is the difference between 32-bit and 64-bit?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The width of CPU registers and memory addresses.</p>\n<ul class=\"q-points\"><li>A 32-bit process can address at most 4 GB (often 2–3 GB usable); a 64-bit process can address terabytes.</li><li>64-bit also has more registers.</li><li>In .NET, &quot;Any CPU&quot; assemblies run as 64-bit on a 64-bit OS; pointers/references are 8 bytes, so objects use a bit more memory.</li></ul>\n"},{"id":5,"course_slug":"computer-fundamentals","course_title":"How Computers Work — CPU, Memory, OS, Processes and Threads","ord":5,"level":"Beginner","priority":"Medium","question":"What are binary, hexadecimal, ASCII, UTF-8 and UTF-16?","question_html":"What are binary, hexadecimal, ASCII, UTF-8 and UTF-16?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Binary is base 2 (how hardware stores data); hexadecimal is base 16, a compact way to write bytes (<code>0xFF</code> = 255).</p>\n<ul class=\"q-points\"><li>ASCII maps 128 characters to 7-bit codes.</li><li>UTF-8 encodes all Unicode characters in 1–4 bytes and is backward-compatible with ASCII — the web standard.</li><li>UTF-16 uses 2 or 4 bytes per character and is what .NET <code>string</code> and Windows APIs use internally.</li></ul>\n"},{"id":9,"course_slug":"computer-fundamentals","course_title":"How Computers Work — CPU, Memory, OS, Processes and Threads","ord":9,"level":"Intermediate","priority":"Medium","question":"What is a context switch and why is it costly?","question_html":"What is a context switch and why is it costly?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The OS saving the state (registers, program counter, stack pointer) of a running thread and loading another&#39;s so it can run on that core.</p>\n<ul class=\"q-points\"><li>Costs: the switch itself, kernel transitions, and colder CPU caches/TLB afterwards.</li><li>Too many threads → too much switching; hence thread pools and async I/O.</li></ul>\n"},{"id":10,"course_slug":"computer-fundamentals","course_title":"How Computers Work — CPU, Memory, OS, Processes and Threads","ord":10,"level":"Intermediate","priority":"Medium","question":"Concurrency vs parallelism?","question_html":"Concurrency vs parallelism?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Concurrency is dealing with many tasks at once (they make progress by interleaving, possibly on one core) — e.g. a web server handling many requests with async I/O.</p>\n<ul class=\"q-points\"><li>Parallelism is executing many tasks at the same instant on multiple cores — e.g. <code>Parallel.For</code> over CPU-heavy work.</li><li>Async improves scalability for I/O-bound work; parallelism speeds up CPU-bound work.</li></ul>\n"},{"id":11,"course_slug":"computer-fundamentals","course_title":"How Computers Work — CPU, Memory, OS, Processes and Threads","ord":11,"level":"Intermediate","priority":"Medium","question":"What is the difference between a compiler, an interpreter and a JIT?","question_html":"What is the difference between a compiler, an interpreter and a JIT?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A compiler translates the whole program to machine code ahead of time (fast start, platform-specific).</p>\n<ul class=\"q-points\"><li>An interpreter executes code step by step at runtime (portable, slower).</li><li>A JIT compiles intermediate code (IL/bytecode) to machine code at runtime when methods are first used, optimising hot code — .NET, Java and modern JavaScript engines combine portability with near-native speed after warm-up.</li></ul>\n"},{"id":12,"course_slug":"computer-fundamentals","course_title":"How Computers Work — CPU, Memory, OS, Processes and Threads","ord":12,"level":"Advanced","priority":"Medium","question":"Why is iterating an array faster than a linked list even though both are O(n)?","question_html":"Why is iterating an array faster than a linked list even though both are O(n)?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Arrays store elements contiguously, so each 64-byte cache line brings several elements and the CPU prefetcher predicts the next access;</p>\n<ul class=\"q-points\"><li>linked-list nodes are scattered across the heap, so each step may be a cache miss costing ~100 ns.</li><li>Big-O counts operations, not memory latency — cache locality often dominates real performance.</li></ul>\n"},{"id":13,"course_slug":"computer-fundamentals","course_title":"How Computers Work — CPU, Memory, OS, Processes and Threads","ord":13,"level":"Advanced","priority":"Medium","question":"What is a memory leak in a garbage-collected language?","question_html":"What is a memory leak in a garbage-collected language?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Memory that stays reachable even though the program no longer needs it, so the GC can&#39;t free it: static collections that only grow, event handlers never unsubscribed, caches without size limits/expiry, timers holding references, closures capturing big objects, or unmanaged resources not disposed.</p>\n<ul class=\"q-points\"><li>Find it with memory snapshots/dumps (dotnet-gcdump, Visual Studio, PerfView) and compare which object types grow.</li></ul>\n"},{"id":15,"course_slug":"computer-fundamentals","course_title":"How Computers Work — CPU, Memory, OS, Processes and Threads","ord":15,"level":"Scenario","priority":"Medium","question":"A recursive method to process a folder tree crashes the process on a very deep structure. Why, and how do you fix it?","question_html":"A recursive method to process a folder tree crashes the process on a very deep structure. Why, and how do you fix it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Each recursive call adds a stack frame;</p>\n<ul class=\"q-points\"><li>very deep recursion exhausts the thread&#39;s stack (≈1 MB) and causes a <code>StackOverflowException</code>, which .NET can&#39;t catch — the process dies.</li><li>Fix: rewrite iteratively using an explicit <code>Stack&lt;T&gt;</code>/<code>Queue&lt;T&gt;</code> on the heap, or limit depth.</li><li>(<code>Directory.EnumerateFiles(..., SearchOption.AllDirectories)</code> already does it iteratively.)</li></ul>\n"},{"id":16,"course_slug":"computer-fundamentals","course_title":"How Computers Work — CPU, Memory, OS, Processes and Threads","ord":16,"level":"Scenario","priority":"Medium","question":"A multithreaded counter in your app gives a different result each run. Explain and fix.","question_html":"A multithreaded counter in your app gives a different result each run. Explain and fix.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A race condition: <code>counter++</code> is read-modify-write, so two threads can read the same value and both write back value+1, losing an increment.</p>\n<ul class=\"q-points\"><li>Fix with <code>Interlocked.Increment(ref counter)</code>, a <code>lock</code>, or by giving each thread its own local counter and summing at the end (<code>Parallel.For</code> with thread-local state) — the last is also fastest.</li></ul>\n"},{"id":17,"course_slug":"dsa","course_title":"Data Structures & Algorithms — How They Work Inside","ord":1,"level":"Beginner","priority":"High","question":"What is Big-O notation? Give examples.","question_html":"What is Big-O notation? Give examples.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> It describes how an algorithm&#39;s time or memory grows with input size n, ignoring constants and smaller terms.</p>\n<ul class=\"q-points\"><li>O(1) dictionary lookup, O(log n) binary search, O(n) one loop, O(n log n) good sorts, O(n²) nested loops over the same data, O(2ⁿ) all subsets.</li><li>It lets you predict whether a solution scales — e.g. O(n²) on a million items is ~10¹² operations, too slow.</li></ul>\n"},{"id":18,"course_slug":"dsa","course_title":"Data Structures & Algorithms — How They Work Inside","ord":2,"level":"Beginner","priority":"High","question":"Array vs linked list — when do you use each?","question_html":"Array vs linked list — when do you use each?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Arrays (and <code>List&lt;T&gt;</code>) store elements contiguously: O(1) index access, cache-friendly iteration, but O(n) inserts/removes in the middle.</p>\n<ul class=\"q-points\"><li>Linked lists store nodes with pointers: O(1) insert/remove at a known node, but O(n) access by position and poor cache locality.</li><li>In practice <code>List&lt;T&gt;</code> wins most of the time; linked lists suit frequent middle insertions with a node reference (LRU caches pair a linked list with a dictionary).</li></ul>\n"},{"id":19,"course_slug":"dsa","course_title":"Data Structures & Algorithms — How They Work Inside","ord":3,"level":"Beginner","priority":"High","question":"How does a hash table (Dictionary) work?","question_html":"How does a hash table (Dictionary) work?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> It computes the key&#39;s hash code, maps it to a bucket (<code>hash % size</code>), and stores the entry there; lookups recompute the hash, go to the bucket and compare with <code>Equals</code>.</p>\n<ul class=\"q-points\"><li>Collisions are handled by chaining or probing; when the load factor grows, it resizes and rehashes.</li><li>Average O(1) insert/lookup/delete, worst O(n) if many keys collide.</li><li>Keys must have consistent <code>Equals</code>/<code>GetHashCode</code> and shouldn&#39;t change while stored.</li></ul>\n"},{"id":20,"course_slug":"dsa","course_title":"Data Structures & Algorithms — How They Work Inside","ord":4,"level":"Beginner","priority":"High","question":"Stack vs queue — examples of where each is used?","question_html":"Stack vs queue — examples of where each is used?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Stack is LIFO: function call stack, undo/redo, browser back button, expression evaluation, DFS.</p>\n<ul class=\"q-points\"><li>Queue is FIFO: print jobs, request/message queues, thread-pool work items, BFS.</li><li>Both have O(1) push/pop or enqueue/dequeue.</li></ul>\n"},{"id":21,"course_slug":"dsa","course_title":"Data Structures & Algorithms — How They Work Inside","ord":5,"level":"Beginner","priority":"High","question":"Explain binary search. What is required to use it?","question_html":"Explain binary search. What is required to use it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The data must be sorted.</p>\n<ul class=\"q-points\"><li>Compare the target with the middle element; if smaller, search the left half, otherwise the right half; repeat until found or the range is empty — O(log n).</li><li>Compute the middle as <code>lo + (hi - lo) / 2</code> to avoid overflow.</li><li>Database index seeks work on the same principle over B-tree pages.</li></ul>\n"},{"id":22,"course_slug":"dsa","course_title":"Data Structures & Algorithms — How They Work Inside","ord":6,"level":"Intermediate","priority":"High","question":"Compare quicksort and merge sort.","question_html":"Compare quicksort and merge sort.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Both average O(n log n).</p>\n<ul class=\"q-points\"><li>Merge sort is always O(n log n), stable, but needs O(n) extra memory — good for linked lists and external sorting of huge data.</li><li>Quicksort sorts in place (O(log n) stack), is usually faster in practice thanks to cache locality, but is O(n²) in the worst case with bad pivots and is not stable. .NET&#39;s <code>Array.Sort</code> uses introsort to avoid the worst case.</li></ul>\n"},{"id":23,"course_slug":"dsa","course_title":"Data Structures & Algorithms — How They Work Inside","ord":7,"level":"Intermediate","priority":"High","question":"What is a binary search tree? What happens if it becomes unbalanced?","question_html":"What is a binary search tree? What happens if it becomes unbalanced?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A binary tree where every node&#39;s left subtree has smaller keys and right subtree larger keys, so search/insert/delete follow one path: O(height).</p>\n<ul class=\"q-points\"><li>Balanced height is log n; inserting sorted data into a plain BST makes it a linked list with O(n) operations.</li><li>Self-balancing trees (AVL, red-black) and B-trees keep the height logarithmic — SQL Server indexes are B+ trees.</li></ul>\n"},{"id":24,"course_slug":"dsa","course_title":"Data Structures & Algorithms — How They Work Inside","ord":8,"level":"Intermediate","priority":"High","question":"BFS vs DFS?","question_html":"BFS vs DFS?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> BFS explores level by level using a queue — finds the shortest path in unweighted graphs, uses memory proportional to the widest level.</p>\n<ul class=\"q-points\"><li>DFS goes as deep as possible using recursion or a stack — good for connectivity, cycle detection, topological sort and backtracking, uses memory proportional to depth.</li><li>Both are O(V + E).</li></ul>\n"},{"id":25,"course_slug":"dsa","course_title":"Data Structures & Algorithms — How They Work Inside","ord":9,"level":"Intermediate","priority":"High","question":"What is dynamic programming? How is it different from recursion?","question_html":"What is dynamic programming? How is it different from recursion?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> DP solves problems with overlapping subproblems and optimal substructure by storing subproblem results (memoisation top-down, or a table bottom-up) so each is computed once.</p>\n<ul class=\"q-points\"><li>Plain recursion may recompute the same subproblem exponentially many times (naive Fibonacci O(2ⁿ) vs DP O(n)).</li><li>Typical DP problems: coin change, knapsack, longest common subsequence, edit distance, climbing stairs.</li></ul>\n"},{"id":30,"course_slug":"dsa","course_title":"Data Structures & Algorithms — How They Work Inside","ord":14,"level":"Scenario","priority":"High","question":"A report compares two lists of 200,000 customer ids with nested loops and takes 20 minutes. Fix it.","question_html":"A report compares two lists of 200,000 customer ids with nested loops and takes 20 minutes. Fix it.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Nested loops are O(n × m) ≈ 4 × 10¹⁰ comparisons.</p>\n<ul class=\"q-points\"><li>Put one list into a <code>HashSet&lt;int&gt;</code> (O(m)) and check each id of the other list with <code>Contains</code> (O(1) average) — O(n + m), milliseconds.</li><li>Or sort both and merge with two pointers (O(n log n)), or let SQL do it with an indexed JOIN/EXISTS.</li></ul>\n"},{"id":31,"course_slug":"dsa","course_title":"Data Structures & Algorithms — How They Work Inside","ord":15,"level":"Scenario","priority":"High","question":"An autocomplete box queries WHERE Name LIKE '%term%' on 5 million products and is slow. How would you improve it?","question_html":"An autocomplete box queries <code>WHERE Name LIKE &#39;%term%&#39;</code> on 5 million products and is slow. How would you improve it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A leading wildcard can&#39;t use a B-tree index, so every keystroke scans the table.</p>\n<ul class=\"q-points\"><li>Options: prefix search <code>LIKE &#39;term%&#39;</code> on an indexed column (index seek), a trie or sorted in-memory list of names for prefix lookups, full-text search (SQL Server full-text index, Azure AI Search, Elasticsearch) for word matches, debounce keystrokes and limit to top 10, cache popular prefixes.</li></ul>\n"},{"id":26,"course_slug":"dsa","course_title":"Data Structures & Algorithms — How They Work Inside","ord":10,"level":"Intermediate","priority":"Medium","question":"What is a heap and what is it used for?","question_html":"What is a heap and what is it used for?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A complete binary tree stored in an array where each parent is smaller (min-heap) or larger (max-heap) than its children.</p>\n<ul class=\"q-points\"><li>Peek min/max O(1), insert and remove O(log n).</li><li>Used for priority queues (<code>PriorityQueue&lt;T,P&gt;</code>), scheduling, top-K problems, merging sorted streams, Dijkstra&#39;s algorithm and heapsort.</li></ul>\n"},{"id":27,"course_slug":"dsa","course_title":"Data Structures & Algorithms — How They Work Inside","ord":11,"level":"Intermediate","priority":"Medium","question":"What are greedy algorithms? When do they fail?","question_html":"What are greedy algorithms? When do they fail?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> They pick the locally best option at each step without revisiting.</p>\n<ul class=\"q-points\"><li>They are correct only when the problem has the greedy-choice property — e.g. activity selection, Dijkstra, Huffman coding.</li><li>They fail on problems like coin change with arbitrary coins (coins 1, 3, 4 for amount 6: greedy gives 4+1+1, optimal is 3+3), where DP is needed.</li></ul>\n"},{"id":28,"course_slug":"dsa","course_title":"Data Structures & Algorithms — How They Work Inside","ord":12,"level":"Advanced","priority":"Medium","question":"How does a B-tree differ from a binary search tree and why do databases use it?","question_html":"How does a B-tree differ from a binary search tree and why do databases use it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A B-tree node holds many keys and has many children (high fan-out), so the tree is very shallow — a few levels cover millions of rows.</p>\n<ul class=\"q-points\"><li>Each node maps to a disk/database page (8 KB in SQL Server), so a lookup reads only a handful of pages.</li><li>B+ trees keep all data/rows at the leaf level and link leaves for fast range scans.</li><li>Binary trees would be far deeper and cause many more page reads.</li></ul>\n"},{"id":29,"course_slug":"dsa","course_title":"Data Structures & Algorithms — How They Work Inside","ord":13,"level":"Advanced","priority":"Medium","question":"How would you implement an LRU cache with O(1) operations?","question_html":"How would you implement an LRU cache with O(1) operations?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Combine a dictionary (key → linked-list node) with a doubly linked list ordered by recent use.</p>\n<ul class=\"q-points\"><li>Get: look up the node in the dictionary, move it to the front.</li><li>Put: update/move to front, or insert at the front; if over capacity, remove the tail node and its dictionary entry.</li><li>Both operations are O(1).</li><li>In .NET, <code>LinkedList&lt;T&gt;</code> + <code>Dictionary&lt;K, LinkedListNode&lt;T&gt;&gt;</code>.</li></ul>\n"},{"id":32,"course_slug":"dsa","course_title":"Data Structures & Algorithms — How They Work Inside","ord":16,"level":"Scenario","priority":"Medium","question":"You need the 10 most frequent error codes from 50 million log lines. What algorithm?","question_html":"You need the 10 most frequent error codes from 50 million log lines. What algorithm?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Stream the lines once, counting with a <code>Dictionary&lt;string, int&gt;</code> (O(n) time, O(k) memory for k distinct codes), then select the top 10 with a min-heap of size 10 (O(k log 10)) or sort the k entries.</p>\n<ul class=\"q-points\"><li>Don&#39;t load all lines into memory.</li><li>For distributed data, count per partition and merge counts (map-reduce).</li></ul>\n"},{"id":33,"course_slug":"coding-practice","course_title":"Coding Round Practice (DSA in C#)","ord":1,"level":"Beginner","priority":"High","question":"Reverse a string without using built-in Reverse.","question_html":"Reverse a string without using built-in Reverse.","answer_html":"<p>Convert to a <code>char[]</code>, swap from both ends towards the middle with two pointers, then build a new string. O(n) time, O(n) space for the array (strings are immutable, so you can&#39;t do it in place).</p>\n<div class=\"code-block\"><span class=\"code-lang\">csharp</span><button class=\"copy-btn\" type=\"button\" data-copy>Copy</button><pre><code class=\"hljs\"><span class=\"hljs-function\"><span class=\"hljs-keyword\">static</span> <span class=\"hljs-built_in\">string</span> <span class=\"hljs-title\">Reverse</span>(<span class=\"hljs-params\"><span class=\"hljs-built_in\">string</span> s</span>)</span>\n{\n    <span class=\"hljs-keyword\">var</span> c = s.ToCharArray();\n    <span class=\"hljs-keyword\">for</span> (<span class=\"hljs-built_in\">int</span> i = <span class=\"hljs-number\">0</span>, j = c.Length - <span class=\"hljs-number\">1</span>; i &lt; j; i++, j--) (c[i], c[j]) = (c[j], c[i]);\n    <span class=\"hljs-keyword\">return</span> <span class=\"hljs-keyword\">new</span> <span class=\"hljs-built_in\">string</span>(c);\n}</code></pre></div>\n<p>Mention: for user-visible text with emoji or combining characters, use <code>StringInfo</code> text elements.</p>\n"},{"id":34,"course_slug":"coding-practice","course_title":"Coding Round Practice (DSA in C#)","ord":2,"level":"Beginner","priority":"High","question":"Check whether a string is a palindrome.","question_html":"Check whether a string is a palindrome.","answer_html":"<p>Two pointers from both ends, skip non-alphanumerics, compare case-insensitively. O(n) time, O(1) space. Simple version: <code>s == new string(s.Reverse().ToArray())</code>, which is O(n) extra space.</p>\n<div class=\"code-block\"><span class=\"code-lang\">csharp</span><button class=\"copy-btn\" type=\"button\" data-copy>Copy</button><pre><code class=\"hljs\"><span class=\"hljs-function\"><span class=\"hljs-keyword\">static</span> <span class=\"hljs-built_in\">bool</span> <span class=\"hljs-title\">IsPal</span>(<span class=\"hljs-params\"><span class=\"hljs-built_in\">string</span> s</span>)</span>\n{\n    <span class=\"hljs-keyword\">for</span> (<span class=\"hljs-built_in\">int</span> i = <span class=\"hljs-number\">0</span>, j = s.Length - <span class=\"hljs-number\">1</span>; i &lt; j; i++, j--)\n        <span class=\"hljs-keyword\">if</span> (<span class=\"hljs-built_in\">char</span>.ToLower(s[i]) != <span class=\"hljs-built_in\">char</span>.ToLower(s[j])) <span class=\"hljs-keyword\">return</span> <span class=\"hljs-literal\">false</span>;\n    <span class=\"hljs-keyword\">return</span> <span class=\"hljs-literal\">true</span>;\n}</code></pre></div>\n"},{"id":35,"course_slug":"coding-practice","course_title":"Coding Round Practice (DSA in C#)","ord":3,"level":"Beginner","priority":"High","question":"Print the Fibonacci series up to n terms.","question_html":"Print the Fibonacci series up to n terms.","answer_html":"<div class=\"code-block\"><span class=\"code-lang\">csharp</span><button class=\"copy-btn\" type=\"button\" data-copy>Copy</button><pre><code class=\"hljs\"><span class=\"hljs-built_in\">long</span> a = <span class=\"hljs-number\">0</span>, b = <span class=\"hljs-number\">1</span>;\n<span class=\"hljs-keyword\">for</span> (<span class=\"hljs-built_in\">int</span> i = <span class=\"hljs-number\">0</span>; i &lt; n; i++) { Console.Write(<span class=\"hljs-string\">$&quot;<span class=\"hljs-subst\">{a}</span> &quot;</span>); (a, b) = (b, a + b); }</code></pre></div>\n<p>Iterative is O(n) time and O(1) space. Naive recursion <code>F(n-1)+F(n-2)</code> is O(2ⁿ) — mention memoisation if asked for recursion.</p>\n"},{"id":36,"course_slug":"coding-practice","course_title":"Coding Round Practice (DSA in C#)","ord":4,"level":"Beginner","priority":"High","question":"Find duplicate elements in an array.","question_html":"Find duplicate elements in an array.","answer_html":"<p>Use a <code>HashSet&lt;int&gt;</code>: <code>Add</code> returns false when the item already exists. O(n) time, O(n) space. LINQ alternative: <code>arr.GroupBy(x =&gt; x).Where(g =&gt; g.Count() &gt; 1).Select(g =&gt; g.Key)</code>. If O(1) space is required and the array can be modified: sort first (O(n log n)) and compare neighbours.</p>\n<div class=\"code-block\"><span class=\"code-lang\">csharp</span><button class=\"copy-btn\" type=\"button\" data-copy>Copy</button><pre><code class=\"hljs\"><span class=\"hljs-keyword\">var</span> seen = <span class=\"hljs-keyword\">new</span> HashSet&lt;<span class=\"hljs-built_in\">int</span>&gt;();\n<span class=\"hljs-keyword\">var</span> dups = arr.Where(x =&gt; !seen.Add(x)).Distinct().ToList();</code></pre></div>\n"},{"id":37,"course_slug":"coding-practice","course_title":"Coding Round Practice (DSA in C#)","ord":5,"level":"Beginner","priority":"High","question":"Count the occurrences of each character in a string.","question_html":"Count the occurrences of each character in a string.","answer_html":"<div class=\"code-block\"><span class=\"code-lang\">csharp</span><button class=\"copy-btn\" type=\"button\" data-copy>Copy</button><pre><code class=\"hljs\"><span class=\"hljs-keyword\">var</span> counts = <span class=\"hljs-keyword\">new</span> Dictionary&lt;<span class=\"hljs-built_in\">char</span>, <span class=\"hljs-built_in\">int</span>&gt;();\n<span class=\"hljs-keyword\">foreach</span> (<span class=\"hljs-keyword\">var</span> c <span class=\"hljs-keyword\">in</span> s) counts[c] = counts.GetValueOrDefault(c) + <span class=\"hljs-number\">1</span>;\n<span class=\"hljs-comment\">// LINQ: s.GroupBy(c =&gt; c).ToDictionary(g =&gt; g.Key, g =&gt; g.Count());</span>\n<span class=\"hljs-comment\">// .NET 9: s.CountBy(c =&gt; c)</span></code></pre></div>\n<p>O(n) time, O(k) space where k = distinct characters.</p>\n"},{"id":38,"course_slug":"coding-practice","course_title":"Coding Round Practice (DSA in C#)","ord":6,"level":"Beginner","priority":"High","question":"Find the second largest number in an array.","question_html":"Find the second largest number in an array.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Single pass tracking <code>first</code> and <code>second</code> (skip values equal to <code>first</code> if distinct values are needed).</p>\n<ul class=\"q-points\"><li>O(n), O(1).</li><li>Sorting is simpler but O(n log n): <code>arr.Distinct().OrderByDescending(x =&gt; x).Skip(1).First()</code>.</li><li>Clarify: what if all elements are the same or there&#39;s only one?</li></ul>\n"},{"id":41,"course_slug":"coding-practice","course_title":"Coding Round Practice (DSA in C#)","ord":9,"level":"Intermediate","priority":"High","question":"Two Sum: return indexes of two numbers that add up to a target.","question_html":"Two Sum: return indexes of two numbers that add up to a target.","answer_html":"<p>Brute force: two loops, O(n²). Optimal: one pass with a <code>Dictionary&lt;value, index&gt;</code>. For each number, check whether <code>target - number</code> was seen. O(n) time, O(n) space. If the array is sorted, use two pointers in O(1) space.</p>\n<div class=\"code-block\"><span class=\"code-lang\">csharp</span><button class=\"copy-btn\" type=\"button\" data-copy>Copy</button><pre><code class=\"hljs\"><span class=\"hljs-keyword\">var</span> seen = <span class=\"hljs-keyword\">new</span> Dictionary&lt;<span class=\"hljs-built_in\">int</span>, <span class=\"hljs-built_in\">int</span>&gt;();\n<span class=\"hljs-keyword\">for</span> (<span class=\"hljs-built_in\">int</span> i = <span class=\"hljs-number\">0</span>; i &lt; nums.Length; i++)\n{\n    <span class=\"hljs-keyword\">if</span> (seen.TryGetValue(target - nums[i], <span class=\"hljs-keyword\">out</span> <span class=\"hljs-keyword\">var</span> j)) <span class=\"hljs-keyword\">return</span> [j, i];\n    seen[nums[i]] = i;\n}</code></pre></div>\n"},{"id":42,"course_slug":"coding-practice","course_title":"Coding Round Practice (DSA in C#)","ord":10,"level":"Intermediate","priority":"High","question":"Find the length of the longest substring without repeating characters.","question_html":"Find the length of the longest substring without repeating characters.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Sliding window: keep the last index of each character.</p>\n<ul class=\"q-points\"><li>When a repeat appears inside the window, move <code>start</code> past its previous position, and track the max window length.</li><li>O(n) time, O(k) space.</li><li>Example: &quot;abcabcbb&quot; → 3 (&quot;abc&quot;).</li></ul>\n"},{"id":43,"course_slug":"coding-practice","course_title":"Coding Round Practice (DSA in C#)","ord":11,"level":"Intermediate","priority":"High","question":"Find the maximum subarray sum (Kadane's algorithm).","question_html":"Find the maximum subarray sum (Kadane&#39;s algorithm).","answer_html":"<p class=\"q-short\"><strong>In short:</strong> At each element, either extend the current subarray or start fresh: <code>cur = max(a[i], cur + a[i])</code>, and <code>best = max(best, cur)</code>.</p>\n<ul class=\"q-points\"><li>O(n) time, O(1) space.</li><li>Works with all-negative arrays if you initialise with <code>a[0]</code>.</li><li>Example: [-2,1,-3,4,-1,2,1,-5,4] → 6 ([4,-1,2,1]).</li></ul>\n"},{"id":44,"course_slug":"coding-practice","course_title":"Coding Round Practice (DSA in C#)","ord":12,"level":"Intermediate","priority":"High","question":"Check for balanced parentheses.","question_html":"Check for balanced parentheses.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Push opening brackets on a <code>Stack&lt;char&gt;</code>.</p>\n<ul class=\"q-points\"><li>For each closing bracket, the stack must be non-empty and the top must match.</li><li>At the end the stack must be empty.</li><li>O(n) time and space.</li></ul>\n"},{"id":45,"course_slug":"coding-practice","course_title":"Coding Round Practice (DSA in C#)","ord":13,"level":"Intermediate","priority":"High","question":"Reverse a linked list.","question_html":"Reverse a linked list.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Iterate with three pointers: <code>prev</code>, <code>current</code>, <code>next</code>.</p>\n<ul class=\"q-points\"><li>Save <code>next</code>, point <code>current.Next</code> to <code>prev</code>, advance both.</li><li>Return <code>prev</code>.</li><li>O(n) time, O(1) space.</li><li>Recursive version: O(n) stack space.</li></ul>\n"},{"id":46,"course_slug":"coding-practice","course_title":"Coding Round Practice (DSA in C#)","ord":14,"level":"Intermediate","priority":"High","question":"Detect a loop in a linked list.","question_html":"Detect a loop in a linked list.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Floyd&#39;s cycle detection: slow pointer moves one step, fast moves two.</p>\n<ul class=\"q-points\"><li>If they meet, there is a cycle; if fast reaches null, there isn&#39;t.</li><li>O(n) time, O(1) space.</li><li>To find the cycle start, reset one pointer to head and move both one step at a time until they meet.</li><li>Alternative: a <code>HashSet</code> of visited nodes (O(n) space).</li></ul>\n"},{"id":47,"course_slug":"coding-practice","course_title":"Coding Round Practice (DSA in C#)","ord":15,"level":"Intermediate","priority":"High","question":"Implement binary search. What is its complexity?","question_html":"Implement binary search. What is its complexity?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> On a <strong>sorted</strong> array, compare with the middle element and discard half each time: O(log n) time, O(1) space iteratively.</p>\n<ul class=\"q-points\"><li>Compute <code>mid = lo + (hi - lo) / 2</code> to avoid overflow.</li><li>Variants: first/last occurrence, search in a rotated array, lower bound.</li></ul>\n"},{"id":50,"course_slug":"coding-practice","course_title":"Coding Round Practice (DSA in C#)","ord":18,"level":"Advanced","priority":"High","question":"Design and implement an LRU cache with O(1) get and put.","question_html":"Design and implement an LRU cache with O(1) get and put.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Combine a <code>Dictionary&lt;key, LinkedListNode&gt;</code> for O(1) lookup with a doubly <code>LinkedList</code> ordered by recency.</p>\n<ul class=\"q-points\"><li>On get: move the node to the front.</li><li>On put: update and move to the front, or insert at the front.</li><li>If over capacity, remove the <strong>last</strong> node and its dictionary entry.</li><li>Thread safety: wrap in a lock or use per-key strategies.</li><li>In production use <code>MemoryCache</code> with a size limit.</li></ul>\n"},{"id":53,"course_slug":"coding-practice","course_title":"Coding Round Practice (DSA in C#)","ord":21,"level":"Scenario","priority":"High","question":"You are given 10 million log lines and must find the top 10 most frequent IP addresses with limited memory. How?","question_html":"You are given 10 million log lines and must find the top 10 most frequent IP addresses with limited memory. How?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> If the distinct IPs fit in memory: stream the file line by line (<code>File.ReadLines</code>), count in a <code>Dictionary&lt;string,int&gt;</code>, then keep a min-heap of size 10, O(n log 10).</p>\n<ul class=\"q-points\"><li>If not: <strong>partition</strong> by hash of the IP into N temp files so each file&#39;s distinct IPs fit in memory, count each file, and merge the per-file top-10s.</li><li>For a stream with bounded error, use a Count-Min Sketch or the Space-Saving algorithm.</li><li>In practice you&#39;d load the data into SQL/Kusto and `GROUP BY ...</li><li>ORDER BY COUNT(*) DESC`.</li></ul>\n"},{"id":54,"course_slug":"coding-practice","course_title":"Coding Round Practice (DSA in C#)","ord":22,"level":"Scenario","priority":"High","question":"The interviewer says your O(n²) solution works — \"can you do better?\" What's your approach?","question_html":"The interviewer says your O(n²) solution works — &quot;can you do better?&quot; What&#39;s your approach?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Find the repeated work in the inner loop.</p>\n<ul class=\"q-points\"><li>Usual upgrades: (1) a <strong>hash map/set</strong> to replace an inner search, O(n²) → O(n);</li><li>(2) <strong>sort + two pointers</strong>, O(n log n);</li><li>(3) a <strong>sliding window</strong> for contiguous subarray/substring problems;</li><li>(4) <strong>prefix sums</strong> for range sums;</li><li>(5) a <strong>heap</strong> for top-K;</li><li>(6) <strong>binary search</strong> on a sorted structure or on the answer;</li><li>(7) <strong>memoisation/DP</strong> for overlapping subproblems.</li><li>Say the trade-off (more memory for less time).</li></ul>\n"},{"id":39,"course_slug":"coding-practice","course_title":"Coding Round Practice (DSA in C#)","ord":7,"level":"Beginner","priority":"Medium","question":"Check whether two strings are anagrams.","question_html":"Check whether two strings are anagrams.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Same length + same character counts.</p>\n<ul class=\"q-points\"><li>Use an <code>int[26]</code> count array (lowercase a–z) incrementing for one string and decrementing for the other — O(n) time, O(1) space.</li><li>Or sort both and compare — O(n log n).</li><li>For Unicode use a <code>Dictionary&lt;char,int&gt;</code>.</li></ul>\n"},{"id":40,"course_slug":"coding-practice","course_title":"Coding Round Practice (DSA in C#)","ord":8,"level":"Beginner","priority":"Medium","question":"Swap two numbers without a third variable.","question_html":"Swap two numbers without a third variable.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>(a, b) = (b, a);</code> in modern C#.</p>\n<ul class=\"q-points\"><li>Classic answers: arithmetic <code>a = a + b; b = a - b; a = a - b;</code> (can overflow) or XOR <code>a ^= b; b ^= a; a ^= b;</code> (integers only).</li></ul>\n"},{"id":48,"course_slug":"coding-practice","course_title":"Coding Round Practice (DSA in C#)","ord":16,"level":"Intermediate","priority":"Medium","question":"What sorting algorithm does .NET use? Is it stable?","question_html":"What sorting algorithm does .NET use? Is it stable?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>Array.Sort</code> and <code>List&lt;T&gt;.Sort</code> use <strong>introspective sort</strong> (quicksort, switching to heapsort when recursion is too deep, and insertion sort for small partitions).</p>\n<ul class=\"q-points\"><li>It&#39;s O(n log n) worst case and <strong>not stable</strong>.</li><li><code>Enumerable.OrderBy</code> (LINQ) is a <strong>stable</strong> sort.</li><li>Use LINQ when equal elements must keep their original order.</li></ul>\n"},{"id":49,"course_slug":"coding-practice","course_title":"Coding Round Practice (DSA in C#)","ord":17,"level":"Intermediate","priority":"Medium","question":"Find the height of a binary tree and print it level by level.","question_html":"Find the height of a binary tree and print it level by level.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Height: recursive <code>1 + max(height(left), height(right))</code>, with null = 0.</p>\n<ul class=\"q-points\"><li>Level-order: BFS with a <code>Queue</code>, processing <code>queue.Count</code> nodes per level.</li><li>Both are O(n).</li><li>Space is O(h) for recursion and O(w) for the queue (h = height, w = max width).</li></ul>\n"},{"id":51,"course_slug":"coding-practice","course_title":"Coding Round Practice (DSA in C#)","ord":19,"level":"Advanced","priority":"Medium","question":"Find the top K frequent elements.","question_html":"Find the top K frequent elements.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Count with a dictionary, O(n).</p>\n<ul class=\"q-points\"><li>Then either sort by count, O(n log n), or use a <strong>min-heap of size k</strong> (<code>PriorityQueue&lt;int,int&gt;</code>), O(n log k).</li><li>Bucket sort by frequency gives O(n).</li><li>Discuss the trade-offs.</li></ul>\n"},{"id":52,"course_slug":"coding-practice","course_title":"Coding Round Practice (DSA in C#)","ord":20,"level":"Advanced","priority":"Medium","question":"Count the number of islands in a 2D grid.","question_html":"Count the number of islands in a 2D grid.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Scan the grid.</p>\n<ul class=\"q-points\"><li>When you find unvisited land (<code>&#39;1&#39;</code>), increment the count and flood-fill (DFS or BFS) to mark the whole island visited.</li><li>O(rows × cols) time; recursion depth can reach rows × cols, so use an explicit stack or queue for big grids.</li><li>Union-Find is an alternative.</li></ul>\n"},{"id":55,"course_slug":"coding-practice","course_title":"Coding Round Practice (DSA in C#)","ord":23,"level":"Scenario","priority":"Medium","question":"You get stuck halfway through a coding problem in an interview. What do you do?","question_html":"You get stuck halfway through a coding problem in an interview. What do you do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Keep talking.</p>\n<ul class=\"q-points\"><li>Restate what works so far, try a smaller example by hand to spot the pattern, consider brute force if the optimal approach is stuck, and ask a clarifying question or for a hint.</li><li>A working brute-force solution with a clear explanation scores better than a half-written optimal one.</li><li>Test what you have and state its complexity.</li></ul>\n"},{"id":56,"course_slug":"networking-hosting","course_title":"Networking & Hosting — How a Website Works, End to End","ord":1,"level":"Beginner","priority":"High","question":"What happens when you type a URL in the browser and press Enter?","question_html":"What happens when you type a URL in the browser and press Enter?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> URL parsed → browser/OS caches checked → DNS resolves the host to an IP (resolver → root → TLD → authoritative) → TCP three-way handshake to port 443 (or QUIC for HTTP/3) → TLS handshake validates the certificate and sets up encryption → HTTP request sent with headers/cookies → CDN/load balancer/reverse proxy route it → web server and application handle it (auth, routing, controller, database) → HTTP response with status, headers, body → browser parses HTML into the DOM, loads CSS/JS/images, builds the render tree, lays out and paints the page;</p>\n<ul class=\"q-points\"><li>further requests reuse the connection.</li></ul>\n"},{"id":57,"course_slug":"networking-hosting","course_title":"Networking & Hosting — How a Website Works, End to End","ord":2,"level":"Beginner","priority":"High","question":"What is DNS and what are A, CNAME and MX records?","question_html":"What is DNS and what are A, CNAME and MX records?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> DNS translates domain names to IP addresses through a hierarchy of servers with caching (TTL).</p>\n<ul class=\"q-points\"><li>An A record maps a name to an IPv4 address (AAAA for IPv6);</li><li>a CNAME makes a name an alias of another name (e.g. <code>www</code> → <code>shop.azurewebsites.net</code>);</li><li>an MX record lists the mail servers for the domain.</li><li>TXT records are used for verification and email security (SPF, DKIM, DMARC).</li></ul>\n"},{"id":58,"course_slug":"networking-hosting","course_title":"Networking & Hosting — How a Website Works, End to End","ord":3,"level":"Beginner","priority":"High","question":"What is the difference between HTTP and HTTPS?","question_html":"What is the difference between HTTP and HTTPS?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> HTTPS is HTTP over TLS: the connection is encrypted (confidentiality), protected from tampering (integrity), and the server proves its identity with a certificate signed by a trusted certificate authority (authentication).</p>\n<ul class=\"q-points\"><li>Default ports 80 vs 443.</li><li>HTTPS is required for modern browser features, SEO and any login or personal data.</li></ul>\n"},{"id":59,"course_slug":"networking-hosting","course_title":"Networking & Hosting — How a Website Works, End to End","ord":4,"level":"Beginner","priority":"High","question":"TCP vs UDP?","question_html":"TCP vs UDP?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> TCP is connection-oriented and reliable: handshake, acknowledgements, retransmission, ordering, flow and congestion control — used for the web, databases, email.</p>\n<ul class=\"q-points\"><li>UDP is connectionless with no delivery guarantees but lower latency and overhead — used for DNS, voice/video, games and QUIC (HTTP/3), where the application handles reliability.</li></ul>\n"},{"id":60,"course_slug":"networking-hosting","course_title":"Networking & Hosting — How a Website Works, End to End","ord":5,"level":"Beginner","priority":"High","question":"What are the main HTTP methods and status codes?","question_html":"What are the main HTTP methods and status codes?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> GET (read), POST (create/action), PUT (replace, idempotent), PATCH (partial update), DELETE (remove, idempotent), OPTIONS/HEAD.</p>\n<ul class=\"q-points\"><li>Status: 200 OK, 201 Created, 204 No Content, 301/302 redirects, 304 Not Modified, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 409 Conflict, 429 Too Many Requests, 500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable, 504 Gateway Timeout.</li></ul>\n"},{"id":62,"course_slug":"networking-hosting","course_title":"Networking & Hosting — How a Website Works, End to End","ord":7,"level":"Intermediate","priority":"High","question":"What is a load balancer? What algorithms does it use?","question_html":"What is a load balancer? What algorithms does it use?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A component that distributes incoming traffic across several servers for scalability and availability, using health probes to skip unhealthy instances.</p>\n<ul class=\"q-points\"><li>Algorithms: round robin, weighted round robin, least connections, IP hash/sticky sessions, least response time.</li><li>Layer 4 balancers route by IP/port (fast); layer 7 balancers understand HTTP and can route by path, host or header and terminate TLS.</li></ul>\n"},{"id":63,"course_slug":"networking-hosting","course_title":"Networking & Hosting — How a Website Works, End to End","ord":8,"level":"Intermediate","priority":"High","question":"What is a CDN and how does it improve performance?","question_html":"What is a CDN and how does it improve performance?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A Content Delivery Network caches content at edge servers around the world, so users download from a nearby location: lower latency, less load on the origin, protection against traffic spikes and DDoS, often a WAF and free TLS.</p>\n<ul class=\"q-points\"><li>Best for static assets with long cache headers and fingerprinted file names; dynamic content can also be accelerated.</li></ul>\n"},{"id":64,"course_slug":"networking-hosting","course_title":"Networking & Hosting — How a Website Works, End to End","ord":9,"level":"Intermediate","priority":"High","question":"Forward proxy vs reverse proxy?","question_html":"Forward proxy vs reverse proxy?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A forward proxy acts for clients (they connect out through it — corporate filtering, anonymity).</p>\n<ul class=\"q-points\"><li>A reverse proxy acts for servers (clients connect to it and it forwards to backend servers — TLS termination, load balancing, caching, compression, hiding internal servers).</li><li>Nginx, IIS ARR, YARP and Azure Application Gateway are reverse proxies.</li></ul>\n"},{"id":65,"course_slug":"networking-hosting","course_title":"Networking & Hosting — How a Website Works, End to End","ord":10,"level":"Intermediate","priority":"High","question":"How is an ASP.NET Core app hosted on IIS?","question_html":"How is an ASP.NET Core app hosted on IIS?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Install the .NET Hosting Bundle (runtime + ASP.NET Core Module).</p>\n<ul class=\"q-points\"><li>IIS receives requests via HTTP.sys and the app pool&#39;s <code>w3wp.exe</code>;</li><li>the ASP.NET Core Module runs the app in-process (inside w3wp, fastest) or out-of-process (proxying to Kestrel).</li><li>The app pool uses &quot;No Managed Code&quot;; <code>web.config</code> (generated on publish) configures the module; bindings and certificates are set in IIS.</li></ul>\n"},{"id":70,"course_slug":"networking-hosting","course_title":"Networking & Hosting — How a Website Works, End to End","ord":15,"level":"Scenario","priority":"High","question":"Users report your site is down, but it works on your machine. How do you troubleshoot?","question_html":"Users report your site is down, but it works on your machine. How do you troubleshoot?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Check from outside (another network, downforeveryoneorjustme, mobile data).</p>\n<ul class=\"q-points\"><li>DNS: <code>nslookup</code> from different resolvers — wrong/expired record or propagation.</li><li>Connectivity: <code>Test-NetConnection host -Port 443</code>, firewall/NSG, load balancer health probes.</li><li>TLS: expired certificate or missing intermediate (SSL Labs).</li><li>Server: app pool/process running, logs (Event Viewer, stdout, Application Insights), 5xx errors, resource limits.</li><li>Recent changes: deployment, certificate renewal, DNS edits.</li><li>Your machine may use a cached DNS entry or hosts-file entry.</li></ul>\n"},{"id":71,"course_slug":"networking-hosting","course_title":"Networking & Hosting — How a Website Works, End to End","ord":16,"level":"Scenario","priority":"High","question":"After moving the site to a new server, some users still reach the old server for hours. Why?","question_html":"After moving the site to a new server, some users still reach the old server for hours. Why?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> DNS caching: resolvers and clients cache the old A record until its TTL expires (and some ignore TTLs).</p>\n<ul class=\"q-points\"><li>Next time lower the TTL (e.g. to 300 s) a day before the move, then change the record, keep the old server running (or redirecting) until traffic drains, and raise the TTL afterwards.</li></ul>\n"},{"id":61,"course_slug":"networking-hosting","course_title":"Networking & Hosting — How a Website Works, End to End","ord":6,"level":"Beginner","priority":"Medium","question":"What is an IP address, a port and a socket? Public vs private IP?","question_html":"What is an IP address, a port and a socket? Public vs private IP?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> An IP address identifies a machine on a network;</p>\n<ul class=\"q-points\"><li>a port identifies a program/service on that machine (443 HTTPS, 1433 SQL Server);</li><li>a socket is the endpoint IP + port + protocol, and a connection is the pair of endpoints.</li><li>Private IPs (10.x, 172.16–31.x, 192.168.x) are used inside networks and translated by NAT; public IPs are reachable on the internet.</li></ul>\n"},{"id":66,"course_slug":"networking-hosting","course_title":"Networking & Hosting — How a Website Works, End to End","ord":11,"level":"Intermediate","priority":"Medium","question":"What is the difference between HTTP/1.1, HTTP/2 and HTTP/3?","question_html":"What is the difference between HTTP/1.1, HTTP/2 and HTTP/3?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> HTTP/1.1: text protocol, one outstanding request per connection (browsers open ~6 connections per host), keep-alive.</p>\n<ul class=\"q-points\"><li>HTTP/2: binary framing, multiplexes many requests over one TCP connection, header compression; still suffers TCP head-of-line blocking on packet loss.</li><li>HTTP/3: runs over QUIC (UDP), independent streams without head-of-line blocking, faster connection setup, connection migration across networks.</li></ul>\n"},{"id":67,"course_slug":"networking-hosting","course_title":"Networking & Hosting — How a Website Works, End to End","ord":12,"level":"Intermediate","priority":"Medium","question":"Cookies vs session vs local storage?","question_html":"Cookies vs session vs local storage?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Cookies are small values sent automatically with every request to the domain (can be HttpOnly/Secure/SameSite) — used for session ids and auth.</p>\n<ul class=\"q-points\"><li>A session is server-side data keyed by a session id cookie. localStorage/sessionStorage are browser-only key-value stores readable by JavaScript and never sent automatically — fine for preferences, not for tokens (XSS risk).</li></ul>\n"},{"id":68,"course_slug":"networking-hosting","course_title":"Networking & Hosting — How a Website Works, End to End","ord":13,"level":"Intermediate","priority":"Medium","question":"IaaS vs PaaS vs SaaS vs serverless?","question_html":"IaaS vs PaaS vs SaaS vs serverless?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> IaaS: you get VMs/networks and manage the OS and everything above (Azure VM).</p>\n<ul class=\"q-points\"><li>PaaS: the platform runs your app; you manage code and configuration (Azure App Service, Azure SQL).</li><li>SaaS: complete software you just use (Microsoft 365, Salesforce).</li><li>Serverless: run functions or containers on demand with automatic scaling and pay-per-use (Azure Functions, Container Apps), no server management at all.</li></ul>\n"},{"id":69,"course_slug":"networking-hosting","course_title":"Networking & Hosting — How a Website Works, End to End","ord":14,"level":"Advanced","priority":"Medium","question":"How does TLS work and what does a certificate prove?","question_html":"How does TLS work and what does a certificate prove?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The client and server negotiate a cipher suite, exchange keys with (elliptic-curve) Diffie-Hellman, and derive symmetric session keys;</p>\n<ul class=\"q-points\"><li>the server presents a certificate binding its public key to the domain, signed by a certificate authority the client trusts.</li><li>The client checks the chain, validity dates, hostname (SAN) and revocation.</li><li>The certificate proves the server controls the domain (DV) and, for OV/EV, who the organisation is.</li></ul>\n"},{"id":72,"course_slug":"networking-hosting","course_title":"Networking & Hosting — How a Website Works, End to End","ord":17,"level":"Scenario","priority":"Medium","question":"An ASP.NET Core app on IIS shows \"HTTP Error 500.30 — ASP.NET Core app failed to start\". What do you check?","question_html":"An ASP.NET Core app on IIS shows &quot;HTTP Error 500.30 — ASP.NET Core app failed to start&quot;. What do you check?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The app crashed during startup.</p>\n<ul class=\"q-points\"><li>Enable <code>stdoutLogEnabled=&quot;true&quot;</code> in web.config (create the logs folder with write permission) or check Event Viewer → Application;</li><li>run the app from the command line on the server (<code>dotnet Shop.Web.dll</code>) to see the exception.</li><li>Common causes: wrong/missing .NET runtime or Hosting Bundle, missing config/connection string for the environment, file permissions for the app pool identity, database unreachable at startup, wrong <code>ASPNETCORE_ENVIRONMENT</code>.</li></ul>\n"},{"id":73,"course_slug":"networking-hosting","course_title":"Networking & Hosting — How a Website Works, End to End","ord":18,"level":"Scenario","priority":"Medium","question":"Behind the load balancer, users are randomly logged out. Why?","question_html":"Behind the load balancer, users are randomly logged out. Why?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The app keeps session or authentication state per server (in-memory session, per-machine Data Protection keys), and the load balancer sends requests to different instances.</p>\n<ul class=\"q-points\"><li>Fix: store session in a distributed cache (Redis/SQL), share the ASP.NET Core Data Protection key ring (Blob Storage/Redis + Key Vault), or use stateless tokens;</li><li>sticky sessions only as a stop-gap.</li></ul>\n"},{"id":74,"course_slug":"system-design","course_title":"System Design — High-Level Design (HLD) from Basics to Case Studies","ord":1,"level":"Beginner","priority":"High","question":"What is the difference between HLD and LLD?","question_html":"What is the difference between HLD and LLD?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> HLD shows the architecture of the whole system: components (clients, load balancers, services, databases, caches, queues, CDN), how they interact, data flow, scaling and failure handling.</p>\n<ul class=\"q-points\"><li>LLD details the inside of components: classes, interfaces, methods, design patterns, database tables and APIs.</li><li>HLD answers &quot;what pieces and how they connect&quot;; LLD answers &quot;how each piece is built&quot;.</li></ul>\n"},{"id":75,"course_slug":"system-design","course_title":"System Design — High-Level Design (HLD) from Basics to Case Studies","ord":2,"level":"Beginner","priority":"High","question":"Vertical vs horizontal scaling?","question_html":"Vertical vs horizontal scaling?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Vertical: give one machine more CPU/RAM — simple, no code change, but limited and a single point of failure.</p>\n<ul class=\"q-points\"><li>Horizontal: add more machines behind a load balancer — almost unlimited and fault tolerant, but services must be stateless and data must be replicated/partitioned.</li><li>Typical path: scale up first, then out.</li></ul>\n"},{"id":76,"course_slug":"system-design","course_title":"System Design — High-Level Design (HLD) from Basics to Case Studies","ord":3,"level":"Beginner","priority":"High","question":"What is caching? Explain cache-aside.","question_html":"What is caching? Explain cache-aside.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Storing frequently read data in faster storage (memory/Redis/CDN) to reduce latency and database load.</p>\n<ul class=\"q-points\"><li>Cache-aside: on read, check the cache;</li><li>on miss, read from the database and put the result in the cache with a TTL;</li><li>on write, update the database and delete (or update) the cache key.</li><li>Watch for stale data, stampedes and hot keys.</li></ul>\n"},{"id":77,"course_slug":"system-design","course_title":"System Design — High-Level Design (HLD) from Basics to Case Studies","ord":4,"level":"Beginner","priority":"High","question":"What does a load balancer do?","question_html":"What does a load balancer do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Distributes requests across multiple servers to increase capacity and availability, performs health checks to stop sending traffic to failed servers, and can terminate TLS and route by URL (L7).</p>\n<ul class=\"q-points\"><li>Algorithms: round robin, least connections, IP hash/consistent hashing, weighted.</li></ul>\n"},{"id":78,"course_slug":"system-design","course_title":"System Design — High-Level Design (HLD) from Basics to Case Studies","ord":5,"level":"Intermediate","priority":"High","question":"Explain the CAP theorem with examples.","question_html":"Explain the CAP theorem with examples.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> In a distributed system, during a network partition you can&#39;t have both strong consistency and full availability.</p>\n<ul class=\"q-points\"><li>CP systems reject or delay requests to avoid stale data (bank balances, configuration stores like etcd);</li><li>AP systems keep answering and reconcile later (social feeds, DNS, carts in Dynamo-style stores).</li><li>When there is no partition, the trade-off is latency vs consistency (PACELC).</li></ul>\n"},{"id":79,"course_slug":"system-design","course_title":"System Design — High-Level Design (HLD) from Basics to Case Studies","ord":6,"level":"Intermediate","priority":"High","question":"SQL or NoSQL — how do you choose?","question_html":"SQL or NoSQL — how do you choose?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Start from the data and access patterns.</p>\n<ul class=\"q-points\"><li>SQL for structured, related data needing transactions, joins and constraints (orders, payments).</li><li>NoSQL when you need massive horizontal scale for simple key-based access, flexible schemas, very high write throughput, or special models (documents, graphs, time-series).</li><li>Many systems combine them: SQL as the source of truth, Redis cache, search index, blob storage.</li></ul>\n"},{"id":80,"course_slug":"system-design","course_title":"System Design — High-Level Design (HLD) from Basics to Case Studies","ord":7,"level":"Intermediate","priority":"High","question":"What is sharding? How do you choose a shard key?","question_html":"What is sharding? How do you choose a shard key?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Splitting a dataset horizontally across multiple database nodes so each stores a subset, increasing capacity and throughput.</p>\n<ul class=\"q-points\"><li>A good shard key has high cardinality, spreads reads and writes evenly (no hot shard) and matches the main query pattern so most queries hit one shard (e.g. customer id for orders).</li><li>Use consistent hashing or a directory to allow adding shards with minimal data movement.</li></ul>\n"},{"id":81,"course_slug":"system-design","course_title":"System Design — High-Level Design (HLD) from Basics to Case Studies","ord":8,"level":"Intermediate","priority":"High","question":"What is consistent hashing and why is it useful?","question_html":"What is consistent hashing and why is it useful?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Nodes and keys are placed on a hash ring; each key belongs to the next node clockwise.</p>\n<ul class=\"q-points\"><li>When a node is added or removed, only the keys between it and its neighbour move (~1/N of keys), unlike <code>hash % N</code> where almost all keys move.</li><li>Virtual nodes (many points per server) spread load evenly.</li><li>Used in distributed caches and databases (Dynamo, Cassandra) and load balancers.</li></ul>\n"},{"id":82,"course_slug":"system-design","course_title":"System Design — High-Level Design (HLD) from Basics to Case Studies","ord":9,"level":"Intermediate","priority":"High","question":"Why use a message queue in system design?","question_html":"Why use a message queue in system design?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> To decouple services (the producer doesn&#39;t wait for or depend on the consumer being up), absorb traffic spikes (load levelling), process work asynchronously (emails, video encoding), retry failures with dead-letter queues, and fan out events to multiple subscribers.</p>\n<ul class=\"q-points\"><li>Consumers must be idempotent because delivery is at-least-once.</li></ul>\n"},{"id":85,"course_slug":"system-design","course_title":"System Design — High-Level Design (HLD) from Basics to Case Studies","ord":12,"level":"Advanced","priority":"High","question":"Design a URL shortener (high level).","question_html":"Design a URL shortener (high level).","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Write API creates a short code (base62 of a unique id or random 7 chars with collision check) and stores code → long URL in a key-value store or SQL with a unique index;</p>\n<ul class=\"q-points\"><li>read path <code>GET /{code}</code> checks Redis, then the store, and returns a 301/302 redirect.</li><li>Reads dominate (100:1) → cache and CDN/edge.</li><li>Analytics: send click events to a queue/stream and aggregate asynchronously.</li><li>Scale: shard by code; custom aliases, expiry and abuse checks as extras.</li></ul>\n"},{"id":86,"course_slug":"system-design","course_title":"System Design — High-Level Design (HLD) from Basics to Case Studies","ord":13,"level":"Advanced","priority":"High","question":"Design a news feed. Push or pull?","question_html":"Design a news feed. Push or pull?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Fan-out on write pushes post ids into followers&#39; precomputed feeds (fast reads, expensive for celebrities);</p>\n<ul class=\"q-points\"><li>fan-out on read builds the feed at read time (cheap writes, slow reads).</li><li>Use a hybrid: push for normal users, pull and merge for celebrity accounts.</li><li>Store feeds in Redis lists, posts in a sharded store, media via CDN, use cursor pagination, and rank asynchronously.</li></ul>\n"},{"id":88,"course_slug":"system-design","course_title":"System Design — High-Level Design (HLD) from Basics to Case Studies","ord":15,"level":"Scenario","priority":"High","question":"Your read-heavy API's database is at 90 % CPU. What steps do you take, in order?","question_html":"Your read-heavy API&#39;s database is at 90 % CPU. What steps do you take, in order?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Measure the top queries first;</p>\n<ul class=\"q-points\"><li>add/fix indexes and remove N+1 queries;</li><li>add caching (in-memory/Redis) for hot data and HTTP caching/CDN where possible;</li><li>route reads to read replicas;</li><li>reduce payloads with projection and paging;</li><li>scale the database up as a quick fix;</li><li>finally partition/shard if data or write volume demands it.</li><li>Monitor after each step.</li></ul>\n"},{"id":89,"course_slug":"system-design","course_title":"System Design — High-Level Design (HLD) from Basics to Case Studies","ord":16,"level":"Scenario","priority":"High","question":"A flash sale will bring 50× normal traffic for 10 minutes. How do you prepare?","question_html":"A flash sale will bring 50× normal traffic for 10 minutes. How do you prepare?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Load test beforehand;</p>\n<ul class=\"q-points\"><li>pre-scale and warm caches;</li><li>serve static content from the CDN;</li><li>put a virtual waiting room/queue in front of checkout;</li><li>rate limit per user;</li><li>make inventory reservation atomic (conditional update) to prevent overselling;</li><li>move non-critical work (emails, analytics) to queues;</li><li>use feature flags to switch off expensive features;</li><li>monitor dashboards and have a rollback plan.</li></ul>\n"},{"id":83,"course_slug":"system-design","course_title":"System Design — High-Level Design (HLD) from Basics to Case Studies","ord":10,"level":"Intermediate","priority":"Medium","question":"Replication: synchronous vs asynchronous?","question_html":"Replication: synchronous vs asynchronous?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Synchronous: the write is acknowledged only after replicas confirm — no data loss on failover but higher latency and reduced availability if a replica is slow.</p>\n<ul class=\"q-points\"><li>Asynchronous: acknowledge after the primary writes — fast, but replicas lag (stale reads) and recent writes can be lost if the primary fails.</li><li>Many systems use sync within a region and async across regions.</li></ul>\n"},{"id":84,"course_slug":"system-design","course_title":"System Design — High-Level Design (HLD) from Basics to Case Studies","ord":11,"level":"Intermediate","priority":"Medium","question":"How would you design a rate limiter?","question_html":"How would you design a rate limiter?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Pick an algorithm (token bucket for bursts, sliding window for smoothness), a key (user id, API key, IP), and limits per endpoint.</p>\n<ul class=\"q-points\"><li>Store counters in Redis with atomic operations and TTLs so all API instances share them;</li><li>return 429 with Retry-After;</li><li>put it in the API gateway or middleware;</li><li>allow configuration per plan;</li><li>fail open or closed by policy if Redis is down.</li></ul>\n"},{"id":87,"course_slug":"system-design","course_title":"System Design — High-Level Design (HLD) from Basics to Case Studies","ord":14,"level":"Advanced","priority":"Medium","question":"What are RPO and RTO?","question_html":"What are RPO and RTO?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Recovery Point Objective: the maximum acceptable data loss measured in time (e.g. 5 minutes → you need replication or log backups at least every 5 minutes).</p>\n<ul class=\"q-points\"><li>Recovery Time Objective: the maximum acceptable downtime to restore service (e.g. 1 hour → automated failover or a tested runbook).</li><li>Lower values cost more: synchronous replication, hot standby regions.</li></ul>\n"},{"id":90,"course_slug":"system-design","course_title":"System Design — High-Level Design (HLD) from Basics to Case Studies","ord":17,"level":"Scenario","priority":"Medium","question":"Users in Europe complain the India-hosted app is slow. What do you change?","question_html":"Users in Europe complain the India-hosted app is slow. What do you change?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Measure where time goes (network latency ≈ 150 ms per round trip).</p>\n<ul class=\"q-points\"><li>Put static assets and cacheable responses on a CDN;</li><li>reduce round trips (bundle requests, HTTP/2/3);</li><li>deploy the stateless API in a European region behind global routing (Azure Front Door/Traffic Manager);</li><li>add read replicas in Europe for read-heavy data, keep writes in the primary region or use multi-region databases (Cosmos DB, Azure SQL geo-replication) with clear consistency choices;</li><li>consider data-residency (GDPR) requirements.</li></ul>\n"},{"id":91,"course_slug":"lld","course_title":"Low-Level Design (LLD) — Object Design, UML and Classic Problems in C#","ord":1,"level":"Beginner","priority":"High","question":"How do you approach an LLD question?","question_html":"How do you approach an LLD question?","answer_html":"<p>Clarify requirements and scope → list use cases → find entities (nouns) and behaviours (verbs) → define relationships (composition, inheritance, interfaces) → draw a class diagram → apply SOLID and suitable patterns (Strategy, State, Factory, Observer) → write code for the main flows → discuss edge cases, concurrency, extensibility, testing and persistence.</p>\n"},{"id":92,"course_slug":"lld","course_title":"Low-Level Design (LLD) — Object Design, UML and Classic Problems in C#","ord":2,"level":"Beginner","priority":"High","question":"Composition vs inheritance — which do you prefer in LLD and why?","question_html":"Composition vs inheritance — which do you prefer in LLD and why?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Prefer composition (&quot;has-a&quot;) because it keeps classes small and flexible: behaviour can be swapped at runtime via interfaces (Strategy) and changes don&#39;t ripple through a hierarchy.</p>\n<ul class=\"q-points\"><li>Use inheritance only for genuine &quot;is-a&quot; relationships with shared behaviour and substitutability (Liskov).</li><li>Deep inheritance trees become rigid and fragile.</li></ul>\n"},{"id":93,"course_slug":"lld","course_title":"Low-Level Design (LLD) — Object Design, UML and Classic Problems in C#","ord":3,"level":"Beginner","priority":"High","question":"Explain association, aggregation and composition with examples.","question_html":"Explain association, aggregation and composition with examples.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Association: objects know/use each other (Teacher ↔ Student).</p>\n<ul class=\"q-points\"><li>Aggregation: whole–part where the part can exist independently (Team has Players; players exist without the team) — hollow diamond.</li><li>Composition: strong ownership where the part&#39;s lifetime depends on the whole (House has Rooms; Order has OrderLines) — filled diamond.</li></ul>\n"},{"id":94,"course_slug":"lld","course_title":"Low-Level Design (LLD) — Object Design, UML and Classic Problems in C#","ord":4,"level":"Intermediate","priority":"High","question":"Design a parking lot — what are the key classes and patterns?","question_html":"Design a parking lot — what are the key classes and patterns?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> ParkingLot (facade/singleton via DI) composed of Floors composed of Spots;</p>\n<ul class=\"q-points\"><li>Vehicle hierarchy (Car, Bike, Truck) or a type enum;</li><li>Ticket;</li><li>FeeCalculator with Strategy per vehicle type;</li><li>optional Observer for display boards;</li><li>Factory for vehicles.</li><li>Concurrency: lock or atomic spot allocation so two gates can&#39;t take one spot.</li><li>Extensibility: new vehicle/spot types and pricing rules without modifying existing classes.</li></ul>\n"},{"id":95,"course_slug":"lld","course_title":"Low-Level Design (LLD) — Object Design, UML and Classic Problems in C#","ord":5,"level":"Intermediate","priority":"High","question":"When do you use the State pattern? Give an LLD example.","question_html":"When do you use the State pattern? Give an LLD example.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> When an object&#39;s behaviour changes with its internal state and you&#39;d otherwise have large switch statements on state.</p>\n<ul class=\"q-points\"><li>Each state is a class implementing the same interface; the context delegates to the current state, and states trigger transitions.</li><li>Examples: vending machine (Idle, HasMoney, Dispensing, SoldOut), order lifecycle, ATM, elevator, document approval.</li></ul>\n"},{"id":96,"course_slug":"lld","course_title":"Low-Level Design (LLD) — Object Design, UML and Classic Problems in C#","ord":6,"level":"Intermediate","priority":"High","question":"How do you handle concurrency in an LLD (e.g. seat booking)?","question_html":"How do you handle concurrency in an LLD (e.g. seat booking)?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Identify shared mutable state and make the critical operation atomic: locks around allocation in a single process, atomic compare-and-set (<code>Interlocked</code>, <code>ConcurrentDictionary.TryAdd</code>), optimistic concurrency (row version) or unique constraints in the database, distributed locks with TTL (Redis <code>SET NX PX</code>) across servers.</p>\n<ul class=\"q-points\"><li>Seat booking: temporary locks with expiry, confirm on payment, unique (ShowId, SeatId) constraint as the final guarantee.</li></ul>\n"},{"id":99,"course_slug":"lld","course_title":"Low-Level Design (LLD) — Object Design, UML and Classic Problems in C#","ord":9,"level":"Advanced","priority":"High","question":"Design an LRU cache with O(1) operations.","question_html":"Design an LRU cache with O(1) operations.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A hash map from key to a node in a doubly linked list ordered by recency.</p>\n<ul class=\"q-points\"><li>Get: find the node via the map, move it to the front, return the value.</li><li>Put: if present, update and move to front; otherwise insert at the front, and if capacity is exceeded remove the tail node and its map entry.</li><li>Add a lock for thread safety.</li><li>In C#: <code>Dictionary&lt;K, LinkedListNode&lt;(K,V)&gt;&gt;</code> + <code>LinkedList&lt;(K,V)&gt;</code>.</li></ul>\n"},{"id":101,"course_slug":"lld","course_title":"Low-Level Design (LLD) — Object Design, UML and Classic Problems in C#","ord":11,"level":"Intermediate","priority":"High","question":"Design an ATM cash dispenser. Which pattern fits?","question_html":"Design an ATM cash dispenser. Which pattern fits?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Chain of Responsibility: handlers for ₹2000, ₹500, ₹200 and ₹100 notes;</p>\n<ul class=\"q-points\"><li>each dispenses as many notes as it can (<code>amount / denomination</code>, limited by its stock) and passes the remainder to the next handler;</li><li>if a remainder is left at the end, the request fails and nothing is dispensed (check first, then commit).</li><li>Around it: ATM with the State pattern (Idle → CardInserted → Authenticated → Transaction), a BankService interface for balance/debit, and transaction logging.</li></ul>\n"},{"id":105,"course_slug":"lld","course_title":"Low-Level Design (LLD) — Object Design, UML and Classic Problems in C#","ord":15,"level":"Scenario","priority":"High","question":"In a machine-coding round you have 90 minutes to build a working Splitwise. How do you plan your time?","question_html":"In a machine-coding round you have 90 minutes to build a working Splitwise. How do you plan your time?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> 10 min: requirements and class diagram (User, Group, Expense, Split strategies, Ledger/BalanceSheet).</p>\n<ul class=\"q-points\"><li>50 min: implement core — add expense with equal/exact/percent split (Strategy), update pairwise balances, show balances per user, validation (percentages sum to 100, exact amounts sum to total).</li><li>20 min: simplify debts (greedy matching of max creditor and max debtor), simple console/driver and a few unit tests.</li><li>10 min: refactor names, handle rounding, explain extensions (currencies, persistence, notifications).</li></ul>\n"},{"id":97,"course_slug":"lld","course_title":"Low-Level Design (LLD) — Object Design, UML and Classic Problems in C#","ord":7,"level":"Intermediate","priority":"Medium","question":"What UML diagrams are useful in LLD interviews?","question_html":"What UML diagrams are useful in LLD interviews?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Class diagrams (classes, attributes, methods, interfaces, relationships, multiplicities) and sequence diagrams (order of calls between objects for a use case).</p>\n<ul class=\"q-points\"><li>Sometimes state diagrams (lifecycle of an order/elevator) and activity diagrams.</li><li>Keep them simple and focused on the core flow.</li></ul>\n"},{"id":98,"course_slug":"lld","course_title":"Low-Level Design (LLD) — Object Design, UML and Classic Problems in C#","ord":8,"level":"Intermediate","priority":"Medium","question":"How would you make your design extensible for new requirements?","question_html":"How would you make your design extensible for new requirements?","answer_html":"<p>Program to interfaces, isolate what varies (Strategy for rules, Factory for creation, Observer for notifications, Decorator for add-ons), keep classes small with single responsibilities, use dependency injection, avoid type switches spread across the code (Open/Closed), and keep domain logic independent of UI/database so it can be tested and reused.</p>\n"},{"id":100,"course_slug":"lld","course_title":"Low-Level Design (LLD) — Object Design, UML and Classic Problems in C#","ord":10,"level":"Advanced","priority":"Medium","question":"How do you design an elevator system?","question_html":"How do you design an elevator system?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Classes: ElevatorSystem/Controller, Elevator (current floor, direction, stop queues), Request (floor, direction), Button/Panel, Dispatcher with a strategy (nearest car, least load, zone-based).</p>\n<ul class=\"q-points\"><li>Each elevator serves stops in its current direction (SCAN) before reversing.</li><li>Use the State pattern for Moving/Stopped/Maintenance, Command for requests, and simulate movement with ticks; handle emergency stop and overweight.</li></ul>\n"},{"id":102,"course_slug":"lld","course_title":"Low-Level Design (LLD) — Object Design, UML and Classic Problems in C#","ord":12,"level":"Intermediate","priority":"Medium","question":"How would you design a notification module that supports email, SMS and push, and new channels later?","question_html":"How would you design a notification module that supports email, SMS and push, and new channels later?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> An <code>INotificationChannel</code> interface (<code>SendAsync(recipient, message)</code>) with one class per channel (Strategy);</p>\n<ul class=\"q-points\"><li>a factory or DI registration resolves channels by user preferences;</li><li>a <code>NotificationService</code> builds messages from templates and sends to each selected channel;</li><li>Observer/event hooks trigger notifications from domain events (OrderShipped).</li><li>New channels (WhatsApp) = a new class + registration (Open/Closed).</li><li>Add retries and a queue for reliability.</li></ul>\n"},{"id":103,"course_slug":"lld","course_title":"Low-Level Design (LLD) — Object Design, UML and Classic Problems in C#","ord":13,"level":"Intermediate","priority":"Medium","question":"How do you map an LLD class model to database tables?","question_html":"How do you map an LLD class model to database tables?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Each entity with identity becomes a table with a primary key;</p>\n<ul class=\"q-points\"><li>value objects become columns (or owned types);</li><li>one-to-many → foreign key on the &quot;many&quot; side;</li><li>many-to-many → junction table;</li><li>inheritance → table-per-hierarchy with a discriminator column (simple, fast) or table-per-type (normalised);</li><li>enums stored as int/string;</li><li>add unique constraints for business rules (one booking per seat per show) and indexes for the main queries.</li></ul>\n"},{"id":104,"course_slug":"lld","course_title":"Low-Level Design (LLD) — Object Design, UML and Classic Problems in C#","ord":14,"level":"Advanced","priority":"Medium","question":"What makes a design \"good\" in an LLD interview?","question_html":"What makes a design &quot;good&quot; in an LLD interview?","answer_html":"<p>Correctly modelled entities and relationships, small cohesive classes with clear names, dependencies on interfaces for varying behaviour, appropriate (not excessive) patterns, valid states enforced by constructors/methods, handled edge cases and concurrency, testable code (inject time, randomness, external services), and the ability to explain trade-offs and how new requirements fit without rewriting.</p>\n"},{"id":106,"course_slug":"lld","course_title":"Low-Level Design (LLD) — Object Design, UML and Classic Problems in C#","ord":16,"level":"Scenario","priority":"Medium","question":"Your parking-lot design uses if (vehicle is Car) ... else if (vehicle is Bike) ... in five places. The interviewer adds \"electric cars with charging spots\". What do you change?","question_html":"Your parking-lot design uses <code>if (vehicle is Car) ... else if (vehicle is Bike) ...</code> in five places. The interviewer adds &quot;electric cars with charging spots&quot;. What do you change?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The type checks violate Open/Closed — every new type edits five places.</p>\n<ul class=\"q-points\"><li>Move varying behaviour behind abstractions: a spot-type mapping/strategy per vehicle type, fee strategies registered in a dictionary/DI, and a <code>ChargingSpot</code> type with its own pricing (Decorator/Strategy for charging cost).</li><li>Adding electric cars then means adding new classes and registering them, not modifying existing logic.</li></ul>\n"},{"id":107,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":1,"level":"Beginner","priority":"High","question":"What is the difference between a value type and a reference type?","question_html":"What is the difference between a value type and a reference type?","answer_html":"<p>A <strong>value type</strong> variable holds the data itself (<code>int</code>, <code>bool</code>, <code>decimal</code>, <code>DateTime</code>, any <code>struct</code>/<code>enum</code>). Assigning it copies the value. A <strong>reference type</strong> variable holds a reference to an object on the managed heap (<code>class</code>, <code>string</code>, arrays, delegates, <code>record</code>). Assigning it copies the reference, so two variables can point to the same object.</p>\n<div class=\"code-block\"><span class=\"code-lang\">csharp</span><button class=\"copy-btn\" type=\"button\" data-copy>Copy</button><pre><code class=\"hljs\"><span class=\"hljs-keyword\">var</span> a = <span class=\"hljs-keyword\">new</span> List&lt;<span class=\"hljs-built_in\">int</span>&gt;(); <span class=\"hljs-keyword\">var</span> b = a; b.Add(<span class=\"hljs-number\">1</span>);   <span class=\"hljs-comment\">// a.Count == 1 — same object</span>\n<span class=\"hljs-built_in\">int</span> x = <span class=\"hljs-number\">1</span>; <span class=\"hljs-built_in\">int</span> y = x; y++;                       <span class=\"hljs-comment\">// x is still 1</span></code></pre></div>\n<p>Value types are stored inline (stack for locals, inside the parent object for fields); reference-type objects always live on the heap and are cleaned up by the GC.</p>\n"},{"id":108,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":2,"level":"Beginner","priority":"High","question":"What is the difference between string and StringBuilder?","question_html":"What is the difference between <code>string</code> and <code>StringBuilder</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>string</code> is <strong>immutable</strong>: every concatenation creates a new string object, so building a string in a loop causes many allocations (O(n²) copying).</p>\n<ul class=\"q-points\"><li><code>StringBuilder</code> keeps a <strong>mutable buffer</strong> and appends in place; call <code>ToString()</code> once at the end.</li><li>Use <code>StringBuilder</code> for loops or many appends, plain strings/interpolation for a handful of pieces.</li></ul>\n"},{"id":109,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":3,"level":"Beginner","priority":"High","question":"Explain const vs readonly vs static readonly.","question_html":"Explain <code>const</code> vs <code>readonly</code> vs <code>static readonly</code>.","answer_html":"<ul>\n<li><code>const</code>: compile-time constant, implicitly static, only primitives/strings; the value is <strong>baked into callers</strong> at compile time.</li>\n<li><code>readonly</code>: instance field assigned at declaration or in a constructor; can differ per object.</li>\n<li><code>static readonly</code>: one value per type, computed at runtime (e.g. <code>static readonly HttpClient Client = new()</code>).</li>\n</ul>\n<p>Gotcha: if library A has <code>public const int Max = 10</code> and app B uses it, changing it to 20 in A does nothing in B until B is recompiled. Use <code>static readonly</code> for values that may change.</p>\n"},{"id":110,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":4,"level":"Beginner","priority":"High","question":"What are boxing and unboxing? Why avoid them?","question_html":"What are boxing and unboxing? Why avoid them?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Boxing converts a value type to <code>object</code> (or an interface) by allocating a heap object and copying the value; unboxing casts it back to the <strong>exact</strong> value type.</p>\n<ul class=\"q-points\"><li>It costs an allocation, a copy and GC pressure.</li><li>Typical sources: non-generic collections (<code>ArrayList</code>), <code>string.Format</code> with value-type arguments on old APIs, calling interface methods on structs via the interface.</li><li>Generics remove most boxing.</li></ul>\n"},{"id":111,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":5,"level":"Beginner","priority":"High","question":"What is the difference between == and .Equals()?","question_html":"What is the difference between <code>==</code> and <code>.Equals()</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> For <strong>reference types</strong>, <code>==</code> compares references unless the operator is overloaded; <code>Equals()</code> is virtual and can be overridden to compare content.</p>\n<ul class=\"q-points\"><li><code>string</code> overloads both to compare text.</li><li><strong>Records</strong> generate value-based <code>Equals</code> and <code>==</code>.</li><li>For value types, <code>Equals</code> compares content.</li><li>When you override <code>Equals</code>, also override <code>GetHashCode</code> (objects that are equal must have the same hash code, or dictionaries break).</li></ul>\n"},{"id":112,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":6,"level":"Beginner","priority":"High","question":"What are ref, out and in parameters?","question_html":"What are <code>ref</code>, <code>out</code> and <code>in</code> parameters?","answer_html":"<p>All three pass an argument <strong>by reference</strong>:</p>\n<ul>\n<li><code>ref</code> — must be initialised before the call; the method can read and change it.</li>\n<li><code>out</code> — need not be initialised; the method <strong>must</strong> assign it (used by <code>TryParse</code>).</li>\n<li><code>in</code> — read-only reference; avoids copying large structs.</li>\n</ul>\n"},{"id":115,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":9,"level":"Intermediate","priority":"High","question":"Explain IEnumerable, ICollection, IList and IQueryable.","question_html":"Explain <code>IEnumerable</code>, <code>ICollection</code>, <code>IList</code> and <code>IQueryable</code>.","answer_html":"<ul>\n<li><code>IEnumerable&lt;T&gt;</code>: forward-only iteration (<code>foreach</code>), deferred execution with LINQ to Objects, runs <strong>in memory</strong>.</li>\n<li><code>ICollection&lt;T&gt;</code>: adds <code>Count</code>, <code>Add</code>, <code>Remove</code>, <code>Contains</code>.</li>\n<li><code>IList&lt;T&gt;</code>: adds index access and <code>Insert</code>.</li>\n<li><code>IQueryable&lt;T&gt;</code>: builds an <strong>expression tree</strong> that a provider (EF Core) translates to SQL and runs <strong>in the database</strong>.</li>\n</ul>\n<div class=\"code-block\"><span class=\"code-lang\">csharp</span><button class=\"copy-btn\" type=\"button\" data-copy>Copy</button><pre><code class=\"hljs\">db.Orders.Where(o =&gt; o.Total &gt; <span class=\"hljs-number\">100</span>).ToList();                 <span class=\"hljs-comment\">// IQueryable: WHERE in SQL</span>\ndb.Orders.AsEnumerable().Where(o =&gt; o.Total &gt; <span class=\"hljs-number\">100</span>).ToList();  <span class=\"hljs-comment\">// loads ALL rows then filters in memory</span></code></pre></div>\n"},{"id":116,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":10,"level":"Intermediate","priority":"High","question":"What are delegates and events? How do they differ?","question_html":"What are delegates and events? How do they differ?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A delegate is a type-safe function pointer (<code>Func</code>, <code>Action</code>, custom <code>delegate</code>).</p>\n<ul class=\"q-points\"><li>It can be multicast.</li><li>An <strong>event</strong> wraps a delegate so outside code can only <code>+=</code>/<code>-=</code> handlers; only the declaring class can raise it.</li><li>This prevents subscribers from wiping out other handlers (<code>= null</code>) or raising the event themselves.</li><li>Pattern: `public event EventHandler<TArgs>?</li><li>Changed;<code>and raise with</code>Changed?.Invoke(this, args)`.</li></ul>\n"},{"id":117,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":11,"level":"Intermediate","priority":"High","question":"How does async/await work internally? Does it create a new thread?","question_html":"How does async/await work internally? Does it create a new thread?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> No new thread is created by <code>await</code>.</p>\n<ul class=\"q-points\"><li>The compiler turns the method into a <strong>state machine</strong>.</li><li>When it hits <code>await</code> on an incomplete task, the method returns to its caller and the thread goes back to the pool.</li><li>When the I/O completes, a continuation resumes the state machine — on the captured synchronisation context if there is one (UI thread), otherwise on a thread-pool thread.</li><li>CPU-bound work still needs <code>Task.Run</code> or parallelism to move off the current thread.</li></ul>\n"},{"id":118,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":12,"level":"Intermediate","priority":"High","question":"What is the difference between Task.WhenAll and awaiting tasks one by one?","question_html":"What is the difference between <code>Task.WhenAll</code> and awaiting tasks one by one?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Awaiting sequentially makes total time the <strong>sum</strong> of the calls; starting all tasks and then <code>await Task.WhenAll(...)</code> makes it roughly the <strong>longest</strong> single call.</p>\n<ul class=\"q-points\"><li><code>WhenAll</code> throws the first exception when awaited, but the returned task&#39;s <code>Exception</code> holds all of them.</li><li>Use <code>WhenAny</code> for &quot;first to finish&quot; or timeouts.</li></ul>\n"},{"id":119,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":13,"level":"Intermediate","priority":"High","question":"Why is async void dangerous?","question_html":"Why is <code>async void</code> dangerous?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Callers can&#39;t await it, so they can&#39;t know when it finishes, and an exception thrown inside crashes the process (it is raised on the synchronisation context instead of being stored in a Task).</p>\n<ul class=\"q-points\"><li>Use <code>async Task</code> everywhere except event handlers.</li></ul>\n"},{"id":120,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":14,"level":"Intermediate","priority":"High","question":"What is IDisposable and the using statement? Dispose vs Finalize?","question_html":"What is <code>IDisposable</code> and the <code>using</code> statement? Dispose vs Finalize?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>IDisposable.Dispose()</code> releases unmanaged resources (connections, file handles) <strong>deterministically</strong>.</p>\n<ul class=\"q-points\"><li><code>using</code> guarantees <code>Dispose</code> is called even if an exception is thrown (compiles to <code>try/finally</code>).</li><li>A <strong>finaliser</strong> is called by the GC at an unpredictable time and costs an extra GC cycle; it is only a safety net for raw unmanaged handles.</li><li>In <code>Dispose</code> call <code>GC.SuppressFinalize(this)</code> if a finaliser exists.</li><li>Most code just wraps <code>SafeHandle</code> and never writes a finaliser.</li></ul>\n"},{"id":121,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":15,"level":"Intermediate","priority":"High","question":"Explain garbage collection generations.","question_html":"Explain garbage collection generations.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The heap is split into <strong>Gen 0</strong> (new objects, collected very often and cheaply), <strong>Gen 1</strong> (survivors of Gen 0, a buffer), and <strong>Gen 2</strong> (long-lived objects, collected rarely and expensively).</p>\n<ul class=\"q-points\"><li>Most objects die young, so collecting Gen 0 frequently is efficient.</li><li>Objects of 85,000 bytes or more go to the <strong>Large Object Heap</strong>, collected with Gen 2. .NET has workstation and server GC modes, plus background (concurrent) GC for Gen 2.</li></ul>\n"},{"id":127,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":21,"level":"Beginner","priority":"High","question":"Why should you use decimal instead of double for money?","question_html":"Why should you use <code>decimal</code> instead of <code>double</code> for money?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>double</code> is binary floating point and can&#39;t represent many base-10 fractions exactly (0.1 + 0.2 != 0.3), so totals drift by tiny amounts that show up in invoices and reports.</p>\n<ul class=\"q-points\"><li><code>decimal</code> stores base-10 digits exactly with 28–29 significant digits.</li><li>Trade-off: <code>decimal</code> is slower and uses 16 bytes, so use <code>double</code> for scientific/graphics maths and <code>decimal</code> for money and quantities that must add up exactly.</li><li>In SQL Server map it to <code>DECIMAL(18,2)</code>, not <code>FLOAT</code>.</li></ul>\n"},{"id":128,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":22,"level":"Beginner","priority":"High","question":"What is the difference between Parse, TryParse and Convert?","question_html":"What is the difference between <code>Parse</code>, <code>TryParse</code> and <code>Convert</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>int.Parse(&quot;x&quot;)</code> throws <code>FormatException</code> for bad input (and <code>ArgumentNullException</code> for null).</p>\n<ul class=\"q-points\"><li><code>int.TryParse(s, out var n)</code> returns <code>false</code> instead of throwing — use it for user input.</li><li><code>Convert.ToInt32(value)</code> accepts many types (object, double, string), returns 0 for <code>null</code>, and rounds doubles to the nearest even number (<code>Convert.ToInt32(2.5)</code> → 2) whereas a cast truncates (<code>(int)2.9</code> → 2).</li><li>Pass a <code>CultureInfo</code> when parsing numbers and dates from files or APIs.</li></ul>\n"},{"id":129,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":23,"level":"Beginner","priority":"High","question":"What is the difference between Dictionary and Hashtable?","question_html":"What is the difference between <code>Dictionary</code> and <code>Hashtable</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>Dictionary&lt;TKey,TValue&gt;</code> is generic: type-safe, no boxing, faster; a missing key with the indexer throws <code>KeyNotFoundException</code> (use <code>TryGetValue</code>).</p>\n<ul class=\"q-points\"><li><code>Hashtable</code> is the old non-generic version storing <code>object</code> keys/values: needs casts, boxes value types, and returns <code>null</code> for a missing key.</li><li>Both are hash tables with O(1) average lookup.</li><li>For multiple threads use <code>ConcurrentDictionary</code>.</li></ul>\n"},{"id":130,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":24,"level":"Beginner","priority":"High","question":"What is the difference between a multidimensional and a jagged array?","question_html":"What is the difference between a multidimensional and a jagged array?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A multidimensional (rectangular) array <code>int[,]</code> is one object where every row has the same length, accessed as <code>a[r, c]</code>.</p>\n<ul class=\"q-points\"><li>A jagged array <code>int[][]</code> is an array of arrays — each row is a separate array and can have a different length, accessed as <code>a[r][c]</code>.</li><li>Jagged arrays are more flexible and often faster in .NET; rectangular arrays suit fixed grids such as matrices.</li></ul>\n"},{"id":135,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":29,"level":"Intermediate","priority":"High","question":"How do you create a custom exception, and when should you?","question_html":"How do you create a custom exception, and when should you?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Derive from <code>Exception</code>, end the name with <code>Exception</code>, provide the standard constructors (parameterless, message, message + inner exception) plus constructors/properties for useful data (e.g. <code>Balance</code>, <code>Requested</code>).</p>\n<ul class=\"q-points\"><li>Create one only when callers need to catch that specific situation (e.g. <code>InsufficientFundsException</code> → show a friendly message or return 409);</li><li>otherwise throw the built-in ones (<code>ArgumentException</code>, <code>InvalidOperationException</code>).</li><li>Always pass the inner exception when wrapping.</li></ul>\n"},{"id":142,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":36,"level":"Advanced","priority":"High","question":"How do you make code thread-safe? Compare lock, Monitor, SemaphoreSlim, Interlocked and concurrent collections.","question_html":"How do you make code thread-safe? Compare lock, Monitor, SemaphoreSlim, Interlocked and concurrent collections.","answer_html":"<ul>\n<li><code>lock</code> (sugar for <code>Monitor.Enter/Exit</code>): mutual exclusion inside one process, synchronous only.</li>\n<li><code>SemaphoreSlim</code>: limits concurrency to N and supports <code>WaitAsync</code>, so use it when you must <code>await</code> inside the critical section.</li>\n<li><code>Interlocked</code>: atomic operations on single variables (increment, compare-exchange), lock-free.</li>\n<li><code>ConcurrentDictionary</code>/<code>ConcurrentQueue</code>/<code>Channel&lt;T&gt;</code>: built-in thread-safe structures.</li>\n<li>Immutability: data that never changes needs no locks.</li>\n<li>Across processes/servers: database locks, distributed locks (Redis, blob leases), <code>Mutex</code> for the same machine.</li>\n</ul>\n"},{"id":143,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":37,"level":"Advanced","priority":"High","question":"What causes a deadlock with async code and how do you avoid it?","question_html":"What causes a deadlock with async code and how do you avoid it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Classic case: in a UI app or old ASP.NET (with a synchronisation context), code calls <code>task.Result</code>.</p>\n<ul class=\"q-points\"><li>The blocked thread holds the context; the awaited method&#39;s continuation needs the same context to resume, so both wait forever.</li><li>Fixes: go <strong>async all the way</strong> (<code>await</code> instead of <code>.Result</code>), use <code>ConfigureAwait(false)</code> in library code, and never mix blocking and async calls.</li><li>ASP.NET Core has no synchronisation context, but blocking still causes <strong>thread-pool starvation</strong> under load.</li></ul>\n"},{"id":148,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":42,"level":"Scenario","priority":"High","question":"A method builds a CSV of 200,000 rows using += on a string and takes minutes. What do you do?","question_html":"A method builds a CSV of 200,000 rows using <code>+=</code> on a string and takes minutes. What do you do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> String concatenation in a loop copies the whole string every time, so the work is O(n²).</p>\n<ul class=\"q-points\"><li>Replace it with a <code>StringBuilder</code>, or better, <strong>stream</strong> the rows straight to the output (<code>StreamWriter</code>, or <code>PipeWriter</code> in ASP.NET Core) so the full file is never held in memory.</li><li>Measure before and after with a stopwatch or BenchmarkDotNet.</li><li>For huge exports, page the database query and write as you read.</li></ul>\n"},{"id":149,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":43,"level":"Scenario","priority":"High","question":"Your API's memory keeps growing until the pod restarts. How would you investigate?","question_html":"Your API&#39;s memory keeps growing until the pod restarts. How would you investigate?","answer_html":"<ol>\n<li>Confirm the trend with <code>dotnet-counters</code> (GC heap size, Gen 2 count, LOH size).</li>\n<li>Take memory dumps a few minutes apart with <code>dotnet-dump collect</code> (or <code>dotnet-gcdump</code>) and compare which types grow, using Visual Studio, PerfView or <code>dotnet-dump analyze</code> (<code>dumpheap -stat</code>, <code>gcroot</code>).</li>\n<li>Usual culprits: static collections or caches with no eviction, event handlers never unsubscribed, <code>HttpClient</code> created per request, undisposed streams/DbContexts, large byte arrays on the LOH, unbounded <code>MemoryCache</code>.</li>\n<li>Fix (size-limited cache, <code>IHttpClientFactory</code>, <code>using</code>, weak events), then load-test to confirm.</li>\n</ol>\n"},{"id":150,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":44,"level":"Scenario","priority":"High","question":"Two users update the same in-memory counter and some increments are lost. Why, and how do you fix it?","question_html":"Two users update the same in-memory counter and some increments are lost. Why, and how do you fix it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>count++</code> is read, add, write — three steps.</p>\n<ul class=\"q-points\"><li>Two threads can read the same value and both write value+1, so one increment is lost (a race condition).</li><li>Fix with <code>Interlocked.Increment(ref count)</code>, a <code>lock</code>, or a concurrent type.</li><li>If the counter must survive restarts or work across several servers, keep it in the database (`UPDATE ...</li><li>SET Count = Count + 1<code>) or in Redis </code>INCR` instead.</li></ul>\n"},{"id":113,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":7,"level":"Beginner","priority":"Medium","question":"What is the difference between var, dynamic and object?","question_html":"What is the difference between <code>var</code>, <code>dynamic</code> and <code>object</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>var</code> is <strong>compile-time</strong> type inference — the variable is strongly typed (<code>var x = 5</code> is an <code>int</code>).</p>\n<ul class=\"q-points\"><li><code>object</code> is the base type; you need casts to use members.</li><li><code>dynamic</code> skips compile-time checks and resolves members <strong>at runtime</strong> through the DLR; errors appear as <code>RuntimeBinderException</code>.</li><li>Use <code>dynamic</code> only for COM interop, dynamic JSON or scripting scenarios.</li></ul>\n"},{"id":114,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":8,"level":"Beginner","priority":"Medium","question":"What is the difference between an array, ArrayList and List<T>?","question_html":"What is the difference between an array, <code>ArrayList</code> and <code>List&lt;T&gt;</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> An array has a fixed size and a single element type.</p>\n<ul class=\"q-points\"><li><code>ArrayList</code> (non-generic, legacy) stores <code>object</code>, so value types get boxed and you need casts.</li><li><code>List&lt;T&gt;</code> is generic, type-safe, resizable (it doubles its internal array when full) and has no boxing.</li><li>Always prefer <code>List&lt;T&gt;</code>.</li></ul>\n"},{"id":122,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":16,"level":"Intermediate","priority":"Medium","question":"What are extension methods? Any limitations?","question_html":"What are extension methods? Any limitations?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Static methods in a static class whose first parameter has <code>this</code>, called as if they were instance methods.</p>\n<ul class=\"q-points\"><li>LINQ is built on them.</li><li>Limitations: they can&#39;t access private members, an instance method with the same signature always wins, and they&#39;re resolved at compile time (no polymorphism).</li><li>C# 14 adds extension <em>members</em> (properties, static members) via <code>extension</code> blocks.</li></ul>\n"},{"id":123,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":17,"level":"Intermediate","priority":"Medium","question":"What is the difference between struct and class?","question_html":"What is the difference between <code>struct</code> and <code>class</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Struct: value type, copied on assignment, no inheritance (can implement interfaces), can&#39;t have a parameterless constructor before C# 10, ideal for small immutable data.</p>\n<ul class=\"q-points\"><li>Class: reference type, supports inheritance and polymorphism, lives on the heap, compared by reference by default.</li><li>Large mutable structs are a common bug source (you modify a copy).</li></ul>\n"},{"id":124,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":18,"level":"Intermediate","priority":"Medium","question":"What are records and when do you use them?","question_html":"What are records and when do you use them?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>record</code> (C# 9) is a class with <strong>value-based equality</strong>, a generated <code>ToString</code>, deconstruction and <code>with</code> expressions for non-destructive copies.</p>\n<ul class=\"q-points\"><li><code>record struct</code> (C# 10) is the value-type version.</li><li>Use them for DTOs, messages, events and value objects.</li><li>Avoid them for EF Core entities that are tracked by identity and mutated.</li></ul>\n"},{"id":125,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":19,"level":"Intermediate","priority":"Medium","question":"What are generics and what problem do they solve?","question_html":"What are generics and what problem do they solve?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Generics let you write type-safe code once for many types (<code>List&lt;T&gt;</code>, <code>Repository&lt;T&gt;</code>).</p>\n<ul class=\"q-points\"><li>They remove casts and boxing, and errors show up at compile time.</li><li>Constraints (<code>where T : class, new()</code>) restrict which types can be used.</li><li>For value types the JIT generates specialised code; for reference types the code is shared.</li></ul>\n"},{"id":126,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":20,"level":"Intermediate","priority":"Medium","question":"What is the difference between throw and throw ex?","question_html":"What is the difference between <code>throw</code> and <code>throw ex</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>throw;</code> rethrows the current exception and <strong>preserves the original stack trace</strong>.</p>\n<ul class=\"q-points\"><li><code>throw ex;</code> throws it again from the current line, losing where it really failed.</li><li>To add context, throw a new exception and pass the original as <code>innerException</code>.</li></ul>\n"},{"id":131,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":25,"level":"Beginner","priority":"Medium","question":"When do you use for, foreach, while and do-while?","question_html":"When do you use for, foreach, while and do-while?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>for</code> when you need the index or a counted loop;</p>\n<ul class=\"q-points\"><li><code>foreach</code> to read every item of any <code>IEnumerable</code> (cleanest, but you can&#39;t add/remove items of a <code>List</code> inside it);</li><li><code>while</code> to repeat while a condition is true (may run zero times);</li><li><code>do-while</code> when the body must run at least once (menus, retry prompts).</li><li><code>break</code> exits the loop, <code>continue</code> skips to the next iteration.</li></ul>\n"},{"id":132,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":26,"level":"Beginner","priority":"Medium","question":"What is a namespace? Explain the two meanings of using.","question_html":"What is a namespace? Explain the two meanings of <code>using</code>.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A namespace groups related types and prevents name clashes (<code>Shop.Models.Order</code> vs <code>Billing.Order</code>).</p>\n<ul class=\"q-points\"><li>The <code>using</code> <strong>directive</strong> (<code>using System.Text;</code>) imports a namespace — plus <code>using static</code>, aliases and <code>global using</code>.</li><li>The <code>using</code> <strong>statement/declaration</strong> (<code>using var conn = new SqlConnection(...)</code>) calls <code>Dispose()</code> automatically at the end of the scope, even if an exception is thrown.</li></ul>\n"},{"id":133,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":27,"level":"Beginner","priority":"Medium","question":"What are anonymous types?","question_html":"What are anonymous types?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Compiler-generated, unnamed classes with read-only properties, created with <code>new { Name = &quot;Asha&quot;, Age = 28 }</code> and used through <code>var</code>.</p>\n<ul class=\"q-points\"><li>They have value-based <code>Equals</code>/<code>GetHashCode</code>, and are mostly used for LINQ projections within one method.</li><li>They can&#39;t be returned in a typed way or have methods — use a record or a tuple for that.</li></ul>\n"},{"id":134,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":28,"level":"Beginner","priority":"Medium","question":"What is the difference between Stack and Queue?","question_html":"What is the difference between Stack and Queue?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>Stack&lt;T&gt;</code> is LIFO — <code>Push</code> adds to the top, <code>Pop</code> removes the most recent, <code>Peek</code> reads it (undo, expression parsing, DFS).</p>\n<ul class=\"q-points\"><li><code>Queue&lt;T&gt;</code> is FIFO — <code>Enqueue</code> adds at the back, <code>Dequeue</code> removes the oldest (job processing, BFS, buffering).</li><li>Both are O(1) for add/remove; <code>TryPop</code>/<code>TryDequeue</code> avoid exceptions on empty collections; <code>PriorityQueue&lt;T,P&gt;</code> dequeues by priority.</li></ul>\n"},{"id":136,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":30,"level":"Intermediate","priority":"Medium","question":"What is the difference between Tuple and ValueTuple?","question_html":"What is the difference between <code>Tuple</code> and <code>ValueTuple</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>Tuple&lt;T1,...&gt;</code> (.NET 4) is a class on the heap with read-only <code>Item1</code>, <code>Item2</code> properties.</p>\n<ul class=\"q-points\"><li><code>ValueTuple</code> (C# 7, syntax <code>(int Id, string Name)</code>) is a struct — no allocation — with named, mutable fields, deconstruction (<code>var (id, name) = ...</code>) and <code>==</code> support.</li><li>Use ValueTuple for returning several values from private/internal methods; use a record for public APIs because tuple element names are not kept at runtime.</li></ul>\n"},{"id":137,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":31,"level":"Intermediate","priority":"Medium","question":"What is the difference between Func, Action and Predicate?","question_html":"What is the difference between <code>Func</code>, <code>Action</code> and <code>Predicate</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> All are built-in generic delegate types.</p>\n<ul class=\"q-points\"><li><code>Func&lt;T1..., TResult&gt;</code> takes up to 16 inputs and returns a value (<code>Func&lt;int,int,int&gt; add</code>).</li><li><code>Action&lt;T1...&gt;</code> takes inputs and returns <code>void</code> (<code>Action&lt;string&gt; log</code>).</li><li><code>Predicate&lt;T&gt;</code> takes one input and returns <code>bool</code>, used by <code>List&lt;T&gt;.Find/FindAll/RemoveAll</code>; LINQ uses <code>Func&lt;T,bool&gt;</code> for the same idea.</li></ul>\n"},{"id":138,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":32,"level":"Intermediate","priority":"Medium","question":"What is a multicast delegate?","question_html":"What is a multicast delegate?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A delegate whose invocation list contains several methods, built with <code>+=</code> and reduced with <code>-=</code>.</p>\n<ul class=\"q-points\"><li>Invoking it calls each method in order; for delegates with a return value only the last result is returned, and an exception in one handler stops the rest.</li><li>Events are built on multicast delegates — that&#39;s how many subscribers receive one event.</li></ul>\n"},{"id":139,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":33,"level":"Intermediate","priority":"Medium","question":"How do you read a very large file efficiently in C#?","question_html":"How do you read a very large file efficiently in C#?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Stream it instead of loading it all: <code>File.ReadLines(path)</code> (lazy <code>IEnumerable&lt;string&gt;</code>) or a <code>StreamReader</code> with <code>ReadLineAsync</code> in a loop, a <code>FileStream</code> with a reasonable buffer for binary data, and <code>CopyToAsync</code> to move data between streams.</p>\n<ul class=\"q-points\"><li>Avoid <code>File.ReadAllText/ReadAllLines</code> for large files (whole file in memory), dispose streams with <code>using</code>, and use async I/O in server apps.</li></ul>\n"},{"id":140,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":34,"level":"Intermediate","priority":"Medium","question":"DateTime vs DateTimeOffset — which should you store?","question_html":"DateTime vs DateTimeOffset — which should you store?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>DateTime</code> holds a date/time with a <code>Kind</code> (Local, Utc, Unspecified) but no offset, so the same value can mean different instants on different servers.</p>\n<ul class=\"q-points\"><li><code>DateTimeOffset</code> stores the instant plus the UTC offset, so it is unambiguous.</li><li>Store UTC (<code>DateTime.UtcNow</code> or <code>DateTimeOffset</code>) in databases and APIs, convert to the user&#39;s time zone only for display, use <code>DateOnly</code> for pure dates like birthdays, and <code>TimeProvider</code> to make &quot;now&quot; testable.</li></ul>\n"},{"id":141,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":35,"level":"Intermediate","priority":"Medium","question":"What is a [Flags] enum?","question_html":"What is a <code>[Flags]</code> enum?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> An enum whose values are powers of two (<code>Read = 1, Write = 2, Delete = 4</code>) so several can be combined in one value with bitwise OR (<code>Read | Write</code>).</p>\n<ul class=\"q-points\"><li>Test with <code>(value &amp; Flag) != 0</code> or <code>HasFlag</code>, remove with <code>value &amp;= ~Flag</code>.</li><li><code>[Flags]</code> also makes <code>ToString()</code> print &quot;Read, Write&quot;.</li><li>Typical for permissions and options.</li></ul>\n"},{"id":144,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":38,"level":"Advanced","priority":"Medium","question":"What are Span<T> and Memory<T>?","question_html":"What are <code>Span&lt;T&gt;</code> and <code>Memory&lt;T&gt;</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>Span&lt;T&gt;</code> is a stack-only (<code>ref struct</code>) view over contiguous memory: arrays, <code>stackalloc</code> or native memory.</p>\n<ul class=\"q-points\"><li>You can slice and parse without allocating new arrays or strings.</li><li>It can&#39;t be a class field, boxed or used across <code>await</code>.</li><li><code>Memory&lt;T&gt;</code> is the heap-storable counterpart, usable in async methods.</li><li>Both are used heavily inside ASP.NET Core and System.Text.Json for performance.</li></ul>\n"},{"id":145,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":39,"level":"Advanced","priority":"Medium","question":"What is the difference between Task and ValueTask?","question_html":"What is the difference between <code>Task</code> and <code>ValueTask</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>Task</code> is a class, so every async call that returns one allocates (except cached completed tasks).</p>\n<ul class=\"q-points\"><li><code>ValueTask&lt;T&gt;</code> is a struct that avoids the allocation when the result is often available <strong>synchronously</strong> (e.g. from a cache).</li><li>Rules: await a <code>ValueTask</code> only <strong>once</strong>, don&#39;t await it concurrently, and convert with <code>.AsTask()</code> if you need to.</li><li>The default is still <code>Task</code>.</li></ul>\n"},{"id":151,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":45,"level":"Scenario","priority":"Medium","question":"A synchronous method calls GetDataAsync().Result and the app hangs under load. Explain and fix.","question_html":"A synchronous method calls <code>GetDataAsync().Result</code> and the app hangs under load. Explain and fix.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Blocking on async code ties up a thread while it waits.</p>\n<ul class=\"q-points\"><li>In a context with a synchronisation context it can deadlock.</li><li>In ASP.NET Core it causes thread-pool starvation: every request blocks a thread, the pool grows slowly, and requests queue up.</li><li>Fix: make the call chain async (<code>await</code>) from the controller down to the I/O call.</li><li>If a sync API is truly unavoidable, use a properly synchronous library call rather than sync-over-async.</li></ul>\n"},{"id":152,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":46,"level":"Scenario","priority":"Medium","question":"You need to call 500 external URLs as fast as possible without getting rate-limited. How?","question_html":"You need to call 500 external URLs as fast as possible without getting rate-limited. How?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use async I/O with <strong>bounded concurrency</strong>: <code>Parallel.ForEachAsync(urls, new ParallelOptions { MaxDegreeOfParallelism = 10 }, ...)</code> or a <code>SemaphoreSlim</code> with <code>Task.WhenAll</code>.</p>\n<ul class=\"q-points\"><li>Reuse one <code>HttpClient</code> from <code>IHttpClientFactory</code>.</li><li>Add retries with exponential backoff (Polly / <code>Microsoft.Extensions.Http.Resilience</code>), respect <code>429 Retry-After</code>, and pass cancellation tokens and timeouts.</li></ul>\n"},{"id":153,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":47,"level":"Scenario","priority":"Medium","question":"You must count error lines in a 5 GB log file without running out of memory. How?","question_html":"You must count error lines in a 5 GB log file without running out of memory. How?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Stream it: <code>foreach (var line in File.ReadLines(path)) if (line.Contains(&quot;ERROR&quot;, StringComparison.Ordinal)) count++;</code> or a <code>StreamReader</code> with <code>ReadLineAsync</code> — memory stays constant because only one line is held at a time.</p>\n<ul class=\"q-points\"><li>Don&#39;t use <code>ReadAllText</code>/<code>ReadAllLines</code>.</li><li>For more speed: a larger buffer (<code>new StreamReader(path, Encoding.UTF8, true, 1 &lt;&lt; 16)</code>), <code>Span</code>-based searching, or splitting the file into ranges processed in parallel when the disk is fast.</li></ul>\n"},{"id":154,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":48,"level":"Scenario","priority":"Medium","question":"After deploying to the cloud, order times shown to users are 5.5 hours off. What went wrong?","question_html":"After deploying to the cloud, order times shown to users are 5.5 hours off. What went wrong?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The code used <code>DateTime.Now</code>, which is the server&#39;s local time — the cloud server runs in UTC while the developer&#39;s PC ran in IST (or the opposite conversion was applied twice).</p>\n<ul class=\"q-points\"><li>Fix: store and compare in UTC (<code>DateTime.UtcNow</code>/<code>DateTimeOffset</code>), mark <code>DateTimeKind.Utc</code> when reading from the database, convert to the user&#39;s time zone (<code>TimeZoneInfo.ConvertTimeFromUtc</code>) only for display, send ISO 8601 with offset (<code>&quot;O&quot;</code> format) in APIs, and inject <code>TimeProvider</code> so tests can control the time.</li></ul>\n"},{"id":146,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":40,"level":"Advanced","priority":"Low","question":"What are covariance and contravariance?","question_html":"What are covariance and contravariance?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> They allow implicit conversion of generic type arguments.</p>\n<ul class=\"q-points\"><li><strong>Covariance</strong> (<code>out T</code>) works for outputs: <code>IEnumerable&lt;string&gt;</code> → <code>IEnumerable&lt;object&gt;</code>.</li><li><strong>Contravariance</strong> (<code>in T</code>) works for inputs: <code>Action&lt;object&gt;</code> → <code>Action&lt;string&gt;</code>, <code>IComparer&lt;Animal&gt;</code> used as <code>IComparer&lt;Dog&gt;</code>.</li><li>Only interfaces and delegates support this, and only for reference types.</li></ul>\n"},{"id":147,"course_slug":"csharp","course_title":"C# Language — Basics to Advanced","ord":41,"level":"Advanced","priority":"Low","question":"What are source generators and why are they replacing reflection?","question_html":"What are source generators and why are they replacing reflection?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Source generators run during compilation and add C# code to the project.</p>\n<ul class=\"q-points\"><li>They remove runtime reflection costs, work with trimming and Native AOT, and catch errors at build time.</li><li>Examples: <code>System.Text.Json</code> <code>JsonSerializerContext</code>, <code>[LoggerMessage]</code>, <code>[GeneratedRegex]</code>, <code>[LibraryImport]</code>.</li></ul>\n"},{"id":155,"course_slug":"vbnet","course_title":"VB.NET — Visual Basic .NET from Basics to Advanced (with C# Comparison)","ord":1,"level":"Beginner","priority":"High","question":"What is the difference between VB.NET and C#?","question_html":"What is the difference between VB.NET and C#?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Both compile to the same IL and run on the same CLR with the same libraries, so performance is the same.</p>\n<ul class=\"q-points\"><li>Differences are syntax and features: VB.NET uses English-like keywords, is case-insensitive, line-based with <code>End</code> blocks, has XML literals, <code>My</code> namespace, <code>WithEvents/Handles</code> and optional late binding;</li><li>C# uses C-style syntax, is case-sensitive and gets new language features every year while VB.NET has been feature-stable since 2020.</li><li>Most new projects use C#; VB.NET is mainly maintained in legacy systems.</li></ul>\n"},{"id":156,"course_slug":"vbnet","course_title":"VB.NET — Visual Basic .NET from Basics to Advanced (with C# Comparison)","ord":2,"level":"Beginner","priority":"High","question":"What do Option Strict, Option Explicit and Option Infer do?","question_html":"What do Option Strict, Option Explicit and Option Infer do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Option Explicit On requires variables to be declared.</p>\n<ul class=\"q-points\"><li>Option Strict On disallows implicit narrowing conversions and late binding — catching type errors at compile time (strongly recommended).</li><li>Option Infer On lets <code>Dim x = 5</code> infer the type from the initializer.</li><li>Set them per project (Compile settings) or per file at the top.</li></ul>\n"},{"id":157,"course_slug":"vbnet","course_title":"VB.NET — Visual Basic .NET from Basics to Advanced (with C# Comparison)","ord":3,"level":"Beginner","priority":"High","question":"What is the difference between Sub and Function?","question_html":"What is the difference between Sub and Function?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A <code>Sub</code> performs an action and returns no value (C# <code>void</code> method).</p>\n<ul class=\"q-points\"><li>A <code>Function</code> returns a value with <code>Return</code> (or by assigning to the function name in old code).</li><li>Both can take ByVal/ByRef, Optional and ParamArray parameters.</li></ul>\n"},{"id":158,"course_slug":"vbnet","course_title":"VB.NET — Visual Basic .NET from Basics to Advanced (with C# Comparison)","ord":4,"level":"Beginner","priority":"High","question":"ByVal vs ByRef?","question_html":"ByVal vs ByRef?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> ByVal (the default) passes a copy of the value — for reference types, a copy of the reference, so the method can modify the object but not replace the caller&#39;s variable.</p>\n<ul class=\"q-points\"><li>ByRef passes the variable itself, so assigning a new value inside the method changes the caller&#39;s variable (C# <code>ref</code>).</li></ul>\n"},{"id":161,"course_slug":"vbnet","course_title":"VB.NET — Visual Basic .NET from Basics to Advanced (with C# Comparison)","ord":7,"level":"Intermediate","priority":"High","question":"And vs AndAlso, Or vs OrElse?","question_html":"And vs AndAlso, Or vs OrElse?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>And</code>/<code>Or</code> always evaluate both operands (and also act as bitwise operators on integers).</p>\n<ul class=\"q-points\"><li><code>AndAlso</code>/<code>OrElse</code> short-circuit: the second operand is evaluated only if needed.</li><li>Use <code>AndAlso</code> for conditions like <code>If obj IsNot Nothing AndAlso obj.IsActive Then</code> to avoid NullReferenceException.</li></ul>\n"},{"id":162,"course_slug":"vbnet","course_title":"VB.NET — Visual Basic .NET from Basics to Advanced (with C# Comparison)","ord":8,"level":"Intermediate","priority":"High","question":"How are events handled in VB.NET?","question_html":"How are events handled in VB.NET?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Declare with <code>Event</code>, raise with <code>RaiseEvent</code>.</p>\n<ul class=\"q-points\"><li>Subscribe statically by declaring the field <code>WithEvents</code> and adding a <code>Handles obj.EventName</code> clause to the handler (common in WinForms/Web Forms code-behind), or dynamically with <code>AddHandler obj.Event, AddressOf Handler</code> and <code>RemoveHandler</code> (like C# <code>+=</code>/<code>-=</code>).</li></ul>\n"},{"id":163,"course_slug":"vbnet","course_title":"VB.NET — Visual Basic .NET from Basics to Advanced (with C# Comparison)","ord":9,"level":"Intermediate","priority":"High","question":"DirectCast vs CType vs TryCast?","question_html":"DirectCast vs CType vs TryCast?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>DirectCast</code> performs a type cast requiring an inheritance/interface relationship and throws <code>InvalidCastException</code> on failure (fast, like C# <code>(T)x</code>).</p>\n<ul class=\"q-points\"><li><code>CType</code> performs any defined conversion including VB conversions (string to integer) and user-defined conversions.</li><li><code>TryCast</code> returns <code>Nothing</code> instead of throwing (reference types only, like C# <code>as</code>).</li></ul>\n"},{"id":169,"course_slug":"vbnet","course_title":"VB.NET — Visual Basic .NET from Basics to Advanced (with C# Comparison)","ord":15,"level":"Scenario","priority":"High","question":"You must maintain a large VB.NET Web Forms app and gradually move it to modern .NET. What is your plan?","question_html":"You must maintain a large VB.NET Web Forms app and gradually move it to modern .NET. What is your plan?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Stabilise first: source control, Option Strict On, logging, tests on critical flows.</p>\n<ul class=\"q-points\"><li>Extract business logic from code-behind into class libraries (VB or new C#), target <code>netstandard2.0</code> where possible so both old and new apps can use them.</li><li>Put a reverse proxy (YARP/IIS ARR) in front and rebuild pages/features in ASP.NET Core (C#) one area at a time, sharing authentication and the database (strangler fig).</li><li>Retire Web Forms pages as their replacements go live.</li></ul>\n"},{"id":159,"course_slug":"vbnet","course_title":"VB.NET — Visual Basic .NET from Basics to Advanced (with C# Comparison)","ord":5,"level":"Beginner","priority":"Medium","question":"What are the VB.NET equivalents of static, this, null and abstract?","question_html":"What are the VB.NET equivalents of static, this, null and abstract?","answer_html":"<p><code>static</code> → <code>Shared</code> (and a <code>Module</code> is like a static class), <code>this</code> → <code>Me</code>, <code>base</code> → <code>MyBase</code>, <code>null</code> → <code>Nothing</code>, <code>abstract class</code> → <code>MustInherit</code>, <code>abstract method</code> → <code>MustOverride</code>, <code>virtual</code> → <code>Overridable</code>, <code>override</code> → <code>Overrides</code>, <code>sealed</code> → <code>NotInheritable</code>, <code>internal</code> → <code>Friend</code>.</p>\n"},{"id":160,"course_slug":"vbnet","course_title":"VB.NET — Visual Basic .NET from Basics to Advanced (with C# Comparison)","ord":6,"level":"Beginner","priority":"Medium","question":"Why does Dim arr(5) As Integer create 6 elements?","question_html":"Why does <code>Dim arr(5) As Integer</code> create 6 elements?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> VB.NET array declarations specify the <strong>upper bound</strong>, not the length, and arrays are zero-based — so <code>arr(5)</code> has indexes 0 to 5 = 6 elements.</p>\n<ul class=\"q-points\"><li>In C#, <code>new int[5]</code> specifies the length (indexes 0–4).</li><li>A classic off-by-one source when converting code.</li></ul>\n"},{"id":164,"course_slug":"vbnet","course_title":"VB.NET — Visual Basic .NET from Basics to Advanced (with C# Comparison)","ord":10,"level":"Intermediate","priority":"Medium","question":"What is the difference between On Error GoTo and Try/Catch?","question_html":"What is the difference between On Error GoTo and Try/Catch?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>On Error GoTo label</code> / <code>Resume Next</code> is legacy unstructured error handling from VB6: errors jump to a label or are silently skipped, making flow hard to follow and hiding failures.</p>\n<ul class=\"q-points\"><li><code>Try/Catch/Finally</code> is structured exception handling with typed exceptions, filters (<code>When</code>), <code>Finally</code> cleanup and proper rethrowing.</li><li>Use Try/Catch; refactor On Error when touching old code.</li></ul>\n"},{"id":165,"course_slug":"vbnet","course_title":"VB.NET — Visual Basic .NET from Basics to Advanced (with C# Comparison)","ord":11,"level":"Intermediate","priority":"Medium","question":"What is a Module in VB.NET?","question_html":"What is a Module in VB.NET?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A container whose members are implicitly <code>Shared</code> and which can&#39;t be instantiated or inherited — compiled as a sealed class with static members (C# static class).</p>\n<ul class=\"q-points\"><li>Module members can be called without qualifying the module name, which is convenient for helper functions and <code>Sub Main</code>.</li></ul>\n"},{"id":166,"course_slug":"vbnet","course_title":"VB.NET — Visual Basic .NET from Basics to Advanced (with C# Comparison)","ord":12,"level":"Intermediate","priority":"Medium","question":"What are XML literals?","question_html":"What are XML literals?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A VB-only feature that lets you write XML directly in code as <code>XElement</code>/<code>XDocument</code> objects, embed expressions with <code>&lt;%= %&gt;</code>, and query with axis properties (<code>.&lt;child&gt;</code>, <code>...&lt;descendant&gt;</code>, <code>.@attribute</code>).</p>\n<ul class=\"q-points\"><li>Handy for generating and reading XML configuration or reports with LINQ to XML.</li></ul>\n"},{"id":167,"course_slug":"vbnet","course_title":"VB.NET — Visual Basic .NET from Basics to Advanced (with C# Comparison)","ord":13,"level":"Advanced","priority":"Medium","question":"Can a C# project and a VB.NET project be in the same solution?","question_html":"Can a C# project and a VB.NET project be in the same solution?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Yes.</p>\n<ul class=\"q-points\"><li>Each project compiles to IL in its own assembly, and projects reference each other normally (same CTS types).</li><li>A single project can&#39;t mix languages.</li><li>This makes gradual migration possible: put new code in C# libraries consumed by the VB application.</li><li>Keep public APIs CLS-compliant (avoid names differing only by case, which VB can&#39;t distinguish).</li></ul>\n"},{"id":168,"course_slug":"vbnet","course_title":"VB.NET — Visual Basic .NET from Basics to Advanced (with C# Comparison)","ord":14,"level":"Advanced","priority":"Medium","question":"Does VB.NET run on .NET 8/10?","question_html":"Does VB.NET run on .NET 8/10?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Yes for console, class libraries, WinForms and WPF (and Worker Services); the compiler is part of Roslyn.</p>\n<ul class=\"q-points\"><li>VB.NET won&#39;t get new language features, ASP.NET Core has no VB templates (you can still reference VB libraries from ASP.NET Core C# projects), and Web Forms stays on .NET Framework.</li></ul>\n"},{"id":170,"course_slug":"vbnet","course_title":"VB.NET — Visual Basic .NET from Basics to Advanced (with C# Comparison)","ord":16,"level":"Scenario","priority":"Medium","question":"After converting a VB function to C#, string results are off by one character. Why?","question_html":"After converting a VB function to C#, string results are off by one character. Why?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> VB&#39;s classic string functions (<code>Mid</code>, <code>InStr</code>, <code>Left</code>) are <strong>1-based</strong>, while .NET methods (<code>Substring</code>, <code>IndexOf</code>) are 0-based, and <code>InStr</code> returns 0 for &quot;not found&quot; while <code>IndexOf</code> returns −1.</p>\n<ul class=\"q-points\"><li>Converters sometimes translate them literally.</li><li>Fix the indexes, add unit tests comparing old and new outputs for typical inputs.</li></ul>\n"},{"id":171,"course_slug":"dotnet-internals","course_title":".NET Internals — CLR, CTS, CLS, IL, JIT, Memory Management & Garbage Collection","ord":1,"level":"Beginner","priority":"High","question":"What is the CLR and what does it do?","question_html":"What is the CLR and what does it do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The Common Language Runtime is .NET&#39;s execution engine.</p>\n<ul class=\"q-points\"><li>It loads assemblies, verifies type safety, JIT-compiles IL to native code, manages memory with the garbage collector, handles exceptions, threads and synchronisation, provides interop with native code and exposes debugging/profiling services.</li><li>Code running under it is &quot;managed code&quot;.</li></ul>\n"},{"id":172,"course_slug":"dotnet-internals","course_title":".NET Internals — CLR, CTS, CLS, IL, JIT, Memory Management & Garbage Collection","ord":2,"level":"Beginner","priority":"High","question":"What are CTS and CLS?","question_html":"What are CTS and CLS?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> CTS (Common Type System) defines how types are declared and used in .NET — value vs reference types, inheritance, members, visibility — so all languages share one type system (C# <code>int</code> = VB.NET <code>Integer</code> = <code>System.Int32</code>).</p>\n<ul class=\"q-points\"><li>CLS (Common Language Specification) is a subset of CTS rules that every .NET language supports, so a CLS-compliant library can be used from any language (e.g. avoid public unsigned types or names differing only in case).</li></ul>\n"},{"id":173,"course_slug":"dotnet-internals","course_title":".NET Internals — CLR, CTS, CLS, IL, JIT, Memory Management & Garbage Collection","ord":3,"level":"Beginner","priority":"High","question":"What is IL (MSIL/CIL) and what does the JIT do?","question_html":"What is IL (MSIL/CIL) and what does the JIT do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> IL is the CPU-independent, stack-based intermediate code the C#/VB.NET compilers produce, stored with metadata in assemblies.</p>\n<ul class=\"q-points\"><li>At runtime the JIT compiles each method&#39;s IL to native machine code on its first call, optimised for the actual CPU;</li><li>tiered compilation starts with quick code and re-compiles hot methods with full optimisation.</li><li>ReadyToRun and Native AOT precompile to reduce startup time.</li></ul>\n"},{"id":174,"course_slug":"dotnet-internals","course_title":".NET Internals — CLR, CTS, CLS, IL, JIT, Memory Management & Garbage Collection","ord":4,"level":"Beginner","priority":"High","question":"What is the difference between .NET Framework, .NET Core and .NET 5+?","question_html":"What is the difference between .NET Framework, .NET Core and .NET 5+?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> .NET Framework (2002–2019) is Windows-only, installed machine-wide, and now only maintained (4.8.1 last);</p>\n<ul class=\"q-points\"><li>it has Web Forms, WCF and WWF. .NET Core (2016–2019) was the open-source, cross-platform, high-performance rewrite. .NET 5 (2020) onward unifies them as simply &quot;.NET&quot;, released every November with LTS versions (6, 8, 10) supported for 3 years.</li><li>New projects use .NET 8/10.</li></ul>\n"},{"id":175,"course_slug":"dotnet-internals","course_title":".NET Internals — CLR, CTS, CLS, IL, JIT, Memory Management & Garbage Collection","ord":5,"level":"Beginner","priority":"High","question":"What is managed vs unmanaged code?","question_html":"What is managed vs unmanaged code?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Managed code runs under the CLR, which handles memory (GC), type safety and exceptions — C#, VB.NET, F#.</p>\n<ul class=\"q-points\"><li>Unmanaged code runs directly on the OS without the CLR — C/C++ DLLs, Win32 APIs, COM components — and manages its own memory. .NET calls unmanaged code via P/Invoke or COM interop;</li><li>resources from it must be released with <code>IDisposable</code>/<code>SafeHandle</code>.</li></ul>\n"},{"id":176,"course_slug":"dotnet-internals","course_title":".NET Internals — CLR, CTS, CLS, IL, JIT, Memory Management & Garbage Collection","ord":6,"level":"Beginner","priority":"High","question":"What is an assembly? What does it contain?","question_html":"What is an assembly? What does it contain?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The unit of deployment and versioning in .NET — a <code>.dll</code> or <code>.exe</code> containing IL code, metadata describing all types and members, a manifest (name, version, culture, public key token, references) and optional resources.</p>\n<ul class=\"q-points\"><li>Assemblies can be private (in the app folder), shared in the GAC (.NET Framework) or satellite (localised resources).</li></ul>\n"},{"id":177,"course_slug":"dotnet-internals","course_title":".NET Internals — CLR, CTS, CLS, IL, JIT, Memory Management & Garbage Collection","ord":7,"level":"Intermediate","priority":"High","question":"Explain how the garbage collector works. What are generations?","question_html":"Explain how the garbage collector works. What are generations?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The GC allocates objects by bumping a pointer and, when the gen-0 budget is used up, suspends threads, marks all objects reachable from roots (stack, statics, handles), compacts survivors and updates references.</p>\n<ul class=\"q-points\"><li>Generations: gen 0 for new objects (collected often and cheaply), gen 1 as a buffer, gen 2 for long-lived objects (full, expensive collections).</li><li>Large objects (≥ 85,000 bytes) go to the LOH, collected with gen 2 and not compacted by default.</li></ul>\n"},{"id":178,"course_slug":"dotnet-internals","course_title":".NET Internals — CLR, CTS, CLS, IL, JIT, Memory Management & Garbage Collection","ord":8,"level":"Intermediate","priority":"High","question":"Dispose vs Finalize — what's the difference? What is the Dispose pattern?","question_html":"Dispose vs Finalize — what&#39;s the difference? What is the Dispose pattern?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>Dispose</code> (from <code>IDisposable</code>) is called deterministically by your code (<code>using</code>) to release resources early;</p>\n<ul class=\"q-points\"><li>a finalizer (<code>~Class()</code>) is called non-deterministically by the GC&#39;s finalizer thread as a safety net for unmanaged resources and makes objects survive an extra GC.</li><li>The Dispose pattern: <code>Dispose()</code> calls <code>Dispose(true)</code> and <code>GC.SuppressFinalize(this)</code>;</li><li>the finalizer calls <code>Dispose(false)</code>;</li><li><code>Dispose(bool disposing)</code> frees managed resources only when <code>disposing</code> is true and unmanaged resources always.</li><li>Prefer <code>SafeHandle</code> over writing finalizers.</li></ul>\n"},{"id":179,"course_slug":"dotnet-internals","course_title":".NET Internals — CLR, CTS, CLS, IL, JIT, Memory Management & Garbage Collection","ord":9,"level":"Intermediate","priority":"High","question":"Where are value types and reference types stored?","question_html":"Where are value types and reference types stored?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Reference-type objects are always on the managed heap; variables hold references to them.</p>\n<ul class=\"q-points\"><li>Value types are stored inline where they are declared: on the stack (or in registers) for locals, inside the containing object for fields, inside the array for array elements, and on the heap when boxed or captured by closures/async methods.</li><li>So &quot;value types live on the stack&quot; is only partly true.</li></ul>\n"},{"id":180,"course_slug":"dotnet-internals","course_title":".NET Internals — CLR, CTS, CLS, IL, JIT, Memory Management & Garbage Collection","ord":10,"level":"Intermediate","priority":"High","question":"Workstation vs Server GC?","question_html":"Workstation vs Server GC?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Workstation GC uses one heap and runs collections on the allocating thread — lower memory and shorter pauses, suited to desktop apps.</p>\n<ul class=\"q-points\"><li>Server GC creates one heap and one dedicated GC thread per logical core and collects in parallel — higher throughput and allocation rates, more memory, the default for ASP.NET Core.</li><li>Both support background (concurrent) gen-2 collection; .NET 9 enables DATAS to adapt Server GC heap count to load.</li></ul>\n"},{"id":185,"course_slug":"dotnet-internals","course_title":".NET Internals — CLR, CTS, CLS, IL, JIT, Memory Management & Garbage Collection","ord":15,"level":"Advanced","priority":"High","question":"How do you find a memory leak in a production .NET application?","question_html":"How do you find a memory leak in a production .NET application?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Confirm growth with <code>dotnet-counters</code> / Application Insights (GC heap size and gen-2 size rising, gen-2 collections not reclaiming).</p>\n<ul class=\"q-points\"><li>Capture heap snapshots (<code>dotnet-gcdump</code>) or full dumps (<code>dotnet-dump</code>) at two points in time, compare object counts by type, and find the roots keeping them alive (<code>gcroot</code>, &quot;paths to root&quot;).</li><li>Typical culprits: unbounded static caches, event handlers not unsubscribed, timers, captive dependencies in DI, undisposed resources, LOH fragmentation from large buffers.</li></ul>\n"},{"id":188,"course_slug":"dotnet-internals","course_title":".NET Internals — CLR, CTS, CLS, IL, JIT, Memory Management & Garbage Collection","ord":18,"level":"Scenario","priority":"High","question":"An ASP.NET Core API's memory grows steadily until the container is OOM-killed every few hours. What do you do?","question_html":"An ASP.NET Core API&#39;s memory grows steadily until the container is OOM-killed every few hours. What do you do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Monitor GC counters to see if the managed heap (gen 2/LOH) grows or native memory grows.</p>\n<ul class=\"q-points\"><li>Take two <code>dotnet-gcdump</code> snapshots and compare the biggest growing types; check their roots.</li><li>Common findings: an in-memory cache without limits, a singleton holding scoped objects or request data, event subscriptions, <code>HttpClient</code> created per request, large response buffering in the LOH.</li><li>Also set container memory limits correctly (GC respects them), consider DATAS/workstation GC for small containers, and add alerts on memory growth.</li></ul>\n"},{"id":181,"course_slug":"dotnet-internals","course_title":".NET Internals — CLR, CTS, CLS, IL, JIT, Memory Management & Garbage Collection","ord":11,"level":"Intermediate","priority":"Medium","question":"What is the GAC and is it used in .NET Core?","question_html":"What is the GAC and is it used in .NET Core?","answer_html":"<p>The Global Assembly Cache is a machine-wide store for strong-named shared assemblies in .NET Framework, letting multiple apps share one version (with binding redirects for versioning). .NET Core/.NET 5+ doesn&#39;t use the GAC: dependencies come from NuGet and are deployed with the app (or the shared framework), resolved via <code>deps.json</code>.</p>\n"},{"id":182,"course_slug":"dotnet-internals","course_title":".NET Internals — CLR, CTS, CLS, IL, JIT, Memory Management & Garbage Collection","ord":12,"level":"Intermediate","priority":"Medium","question":"AppDomain vs AssemblyLoadContext?","question_html":"AppDomain vs AssemblyLoadContext?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> AppDomains (.NET Framework) isolated code within one process and could be unloaded — IIS ran each web app in its own AppDomain. .NET Core supports only one AppDomain;</p>\n<ul class=\"q-points\"><li>isolation and unloading of plugins use <code>AssemblyLoadContext</code> (collectible contexts can be unloaded), and strong isolation uses separate processes or containers.</li></ul>\n"},{"id":183,"course_slug":"dotnet-internals","course_title":".NET Internals — CLR, CTS, CLS, IL, JIT, Memory Management & Garbage Collection","ord":13,"level":"Intermediate","priority":"Medium","question":"What is tiered compilation, ReadyToRun and Native AOT?","question_html":"What is tiered compilation, ReadyToRun and Native AOT?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Tiered compilation JITs methods quickly at tier 0 and recompiles frequently used methods with full optimisation (tier 1, with Dynamic PGO) — fast startup and fast steady state.</p>\n<ul class=\"q-points\"><li>ReadyToRun ships precompiled native code inside assemblies for faster startup while keeping the JIT.</li><li>Native AOT compiles the entire app ahead of time into a self-contained native executable — fastest startup and lowest memory, but no runtime code generation and limited reflection.</li></ul>\n"},{"id":184,"course_slug":"dotnet-internals","course_title":".NET Internals — CLR, CTS, CLS, IL, JIT, Memory Management & Garbage Collection","ord":14,"level":"Intermediate","priority":"Medium","question":"How does async/await work internally?","question_html":"How does async/await work internally?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The compiler turns an async method into a state-machine struct;</p>\n<ul class=\"q-points\"><li>each <code>await</code> checks whether the awaited task has completed — if not, it stores the current state, registers a continuation and returns an incomplete Task to the caller, releasing the thread.</li><li>When the operation completes (the OS signals I/O completion), the continuation runs <code>MoveNext()</code> from the saved state on a thread-pool thread (or the captured SynchronizationContext).</li><li>No thread is blocked while waiting for I/O.</li></ul>\n"},{"id":186,"course_slug":"dotnet-internals","course_title":".NET Internals — CLR, CTS, CLS, IL, JIT, Memory Management & Garbage Collection","ord":16,"level":"Advanced","priority":"Medium","question":"What is the Large Object Heap and why can it cause problems?","question_html":"What is the Large Object Heap and why can it cause problems?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Objects of 85,000 bytes or more are allocated on the LOH, which is collected only with gen 2 and not compacted by default, so frequent large temporary allocations (big arrays, <code>MemoryStream</code> buffers, large strings) cause expensive full GCs and fragmentation (memory grows though objects are freed).</p>\n<ul class=\"q-points\"><li>Fix with buffer reuse (<code>ArrayPool&lt;T&gt;</code>, <code>RecyclableMemoryStream</code>), streaming instead of loading everything, or occasional LOH compaction (<code>GCSettings.LargeObjectHeapCompactionMode</code>).</li></ul>\n"},{"id":187,"course_slug":"dotnet-internals","course_title":".NET Internals — CLR, CTS, CLS, IL, JIT, Memory Management & Garbage Collection","ord":17,"level":"Advanced","priority":"Medium","question":"How does virtual method dispatch work in the CLR?","question_html":"How does virtual method dispatch work in the CLR?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Each type has a MethodTable with a vtable of slots for its virtual methods; derived types copy the base slots and replace those they override.</p>\n<ul class=\"q-points\"><li>A virtual call loads the object&#39;s MethodTable pointer, reads the slot for the method and calls that address — so the runtime type decides which implementation runs.</li><li>Sealed types and JIT devirtualisation (with PGO) can turn these into direct calls and enable inlining.</li></ul>\n"},{"id":189,"course_slug":"dotnet-internals","course_title":".NET Internals — CLR, CTS, CLS, IL, JIT, Memory Management & Garbage Collection","ord":19,"level":"Scenario","priority":"Medium","question":"A console tool processes images and becomes slow with frequent gen-2 collections. Why?","question_html":"A console tool processes images and becomes slow with frequent gen-2 collections. Why?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Each image creates large byte arrays (&gt; 85 KB) on the LOH; allocating many short-lived large objects forces gen-2 collections and fragments the LOH.</p>\n<ul class=\"q-points\"><li>Reuse buffers with <code>ArrayPool&lt;byte&gt;.Shared</code>, process images as streams, dispose <code>Bitmap</code>/image objects promptly (they hold native memory), and measure with BenchmarkDotNet&#39;s MemoryDiagnoser or <code>dotnet-counters</code>.</li></ul>\n"},{"id":190,"course_slug":"oop","course_title":"OOP Concepts in C#","ord":1,"level":"Beginner","priority":"High","question":"What are the four pillars of OOP? Explain each with an example.","question_html":"What are the four pillars of OOP? Explain each with an example.","answer_html":"<ol>\n<li><strong>Encapsulation</strong> — private state with a controlled public API. <code>BankAccount</code> keeps <code>_balance</code> private and exposes <code>Deposit()</code> that rejects negative amounts.</li>\n<li><strong>Abstraction</strong> — expose <em>what</em>, hide <em>how</em>. <code>IPaymentGateway.ChargeAsync()</code> hides HTTP calls, signatures and retries.</li>\n<li><strong>Inheritance</strong> — a derived class reuses and extends a base. <code>Contractor : Employee</code> reuses <code>Name</code> and <code>Describe()</code>.</li>\n<li><strong>Polymorphism</strong> — the same call behaves differently by type. <code>employee.MonthlyPay()</code> runs the <code>Permanent</code> or <code>Contractor</code> override at runtime.</li>\n</ol>\n"},{"id":191,"course_slug":"oop","course_title":"OOP Concepts in C#","ord":2,"level":"Beginner","priority":"High","question":"What is the difference between a class and an object?","question_html":"What is the difference between a class and an object?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A class is a <strong>type definition</strong> (blueprint) describing fields, properties and methods; it exists in code and metadata.</p>\n<ul class=\"q-points\"><li>An object is an <strong>instance</strong> of that class created at runtime with <code>new</code>, occupying memory with its own state.</li><li>One class, many objects.</li></ul>\n"},{"id":192,"course_slug":"oop","course_title":"OOP Concepts in C#","ord":3,"level":"Beginner","priority":"High","question":"What is the difference between method overloading and method overriding?","question_html":"What is the difference between method overloading and method overriding?","answer_html":"<div class=\"table-wrap\"><table><thead><tr><th>Overloading</th><th>Overriding</th></tr></thead><tbody><tr><td>Same name, <strong>different parameters</strong></td><td>Same signature in a derived class</td></tr><tr><td>Same class (or derived)</td><td>Requires <code>virtual</code>/<code>abstract</code> + <code>override</code></td></tr><tr><td>Resolved at <strong>compile time</strong></td><td>Resolved at <strong>runtime</strong> by the object&#39;s type</td></tr><tr><td>Return type alone can&#39;t differ</td><td>Return type the same (covariant returns allowed since C# 9)</td></tr></tbody></table></div>\n"},{"id":193,"course_slug":"oop","course_title":"OOP Concepts in C#","ord":4,"level":"Beginner","priority":"High","question":"What is the difference between an abstract class and an interface? When do you use which?","question_html":"What is the difference between an abstract class and an interface? When do you use which?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> An abstract class can hold state, constructors and shared implementation, and a class can inherit only one.</p>\n<ul class=\"q-points\"><li>An interface is a contract; a class can implement many, and it has no instance state (default methods are allowed since C# 8).</li><li>Use an <strong>interface</strong> for capabilities and dependency injection (<code>IEmailSender</code>) and an <strong>abstract class</strong> when related types share code and state (<code>Shape</code>, <code>Employee</code>).</li><li>A common design is to use both: the interface for consumers, an abstract base for shared code.</li></ul>\n"},{"id":194,"course_slug":"oop","course_title":"OOP Concepts in C#","ord":5,"level":"Beginner","priority":"High","question":"Does C# support multiple inheritance?","question_html":"Does C# support multiple inheritance?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Not for classes — a class has exactly one base class, which avoids the <strong>diamond problem</strong> (ambiguity when two parents implement the same member).</p>\n<ul class=\"q-points\"><li>A class can implement <strong>multiple interfaces</strong>.</li><li>If two interfaces declare the same member, use explicit interface implementation to disambiguate.</li></ul>\n"},{"id":195,"course_slug":"oop","course_title":"OOP Concepts in C#","ord":6,"level":"Beginner","priority":"High","question":"What are access modifiers? What are the defaults?","question_html":"What are access modifiers? What are the defaults?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>public</code>, <code>private</code>, <code>protected</code>, <code>internal</code>, <code>protected internal</code>, <code>private protected</code> (plus <code>file</code> for types).</p>\n<ul class=\"q-points\"><li>Defaults: class members are <code>private</code>; top-level types are <code>internal</code>; interface members are <code>public</code>.</li></ul>\n"},{"id":198,"course_slug":"oop","course_title":"OOP Concepts in C#","ord":9,"level":"Intermediate","priority":"High","question":"What is the difference between method overriding and method hiding (new)?","question_html":"What is the difference between method overriding and method hiding (<code>new</code>)?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> With <strong>override</strong>, the runtime type decides which method runs — true polymorphism.</p>\n<ul class=\"q-points\"><li>With <strong>hiding</strong> (<code>new</code>), the <strong>compile-time variable type</strong> decides: <code>A x = new B(); x.Name()</code> calls <code>A.Name()</code>.</li><li>Hiding breaks polymorphism and is usually a design smell.</li><li>The compiler warns if you hide a member without the <code>new</code> keyword.</li></ul>\n"},{"id":199,"course_slug":"oop","course_title":"OOP Concepts in C#","ord":10,"level":"Intermediate","priority":"High","question":"What is the difference between composition and inheritance? Why \"favour composition\"?","question_html":"What is the difference between composition and inheritance? Why &quot;favour composition&quot;?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Inheritance is a static &quot;is-a&quot; relationship fixed at compile time; subclasses depend on base-class internals, so base changes can break them.</p>\n<ul class=\"q-points\"><li>Composition is &quot;has-a&quot;: an object holds other objects (often via interfaces) and delegates to them.</li><li>You can swap them at runtime, test them in isolation and avoid class explosions.</li><li>Use inheritance only when the subtype really is a substitutable kind of the base (see LSP).</li></ul>\n"},{"id":200,"course_slug":"oop","course_title":"OOP Concepts in C#","ord":11,"level":"Intermediate","priority":"High","question":"Explain association, aggregation and composition with examples.","question_html":"Explain association, aggregation and composition with examples.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> All three are &quot;uses/has&quot; relationships of different strength.</p>\n<ul class=\"q-points\"><li><strong>Association</strong>: two classes know about each other and have independent lifetimes (Doctor–Patient).</li><li><strong>Aggregation</strong>: whole–part where the part can exist alone (Team–Player; delete the team and the players remain).</li><li><strong>Composition</strong>: whole–part with shared lifetime (Order–OrderLine, House–Room; delete the order and its lines go too).</li></ul>\n"},{"id":201,"course_slug":"oop","course_title":"OOP Concepts in C#","ord":12,"level":"Intermediate","priority":"High","question":"Can you create an instance of an abstract class? Can an abstract class have a constructor?","question_html":"Can you create an instance of an abstract class? Can an abstract class have a constructor?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> You can&#39;t instantiate it with <code>new</code>.</p>\n<ul class=\"q-points\"><li>It <strong>can</strong> have constructors, usually <code>protected</code>, which derived classes call via <code>: base(...)</code> to initialise shared state.</li><li>An abstract class can also have no abstract members at all; it&#39;s then just a base that must not be used directly.</li></ul>\n"},{"id":208,"course_slug":"oop","course_title":"OOP Concepts in C#","ord":19,"level":"Scenario","priority":"High","question":"You have Bird with a Fly() method and now need Penguin. How do you model it?","question_html":"You have <code>Bird</code> with a <code>Fly()</code> method and now need <code>Penguin</code>. How do you model it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Making <code>Penguin : Bird</code> and throwing <code>NotSupportedException</code> from <code>Fly()</code> violates Liskov substitution: callers that loop over birds and call <code>Fly()</code> will crash.</p>\n<ul class=\"q-points\"><li>Split the capability out: <code>Bird</code> (common: eat, lay eggs) plus an <code>IFlyable</code> interface implemented only by birds that fly.</li><li>Code that needs flying asks for <code>IFlyable</code>.</li><li>This is composition of capabilities over a deep hierarchy.</li></ul>\n"},{"id":209,"course_slug":"oop","course_title":"OOP Concepts in C#","ord":20,"level":"Scenario","priority":"High","question":"A ReportGenerator class has methods for fetching data, formatting PDF and Excel, emailing and logging. It's 3,000 lines. How would you refactor it?","question_html":"A <code>ReportGenerator</code> class has methods for fetching data, formatting PDF and Excel, emailing and logging. It&#39;s 3,000 lines. How would you refactor it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Identify the responsibilities and extract each into a focused class behind an interface: <code>IReportDataSource</code>, <code>IReportFormatter</code> (with <code>PdfFormatter</code> and <code>ExcelFormatter</code>), <code>IReportSender</code> and <code>ILogger</code>.</p>\n<ul class=\"q-points\"><li><code>ReportGenerator</code> then orchestrates them, receiving them by constructor injection.</li><li>Add unit tests around the current behaviour <strong>before</strong> extracting (characterisation tests), then refactor in small steps.</li><li>Result: SRP, OCP (new format = new formatter class) and easy mocking.</li></ul>\n"},{"id":196,"course_slug":"oop","course_title":"OOP Concepts in C#","ord":7,"level":"Beginner","priority":"Medium","question":"What is a constructor? Can it be private or static?","question_html":"What is a constructor? Can it be private or static?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A constructor initialises a new object and has the class&#39;s name and no return type.</p>\n<ul class=\"q-points\"><li>A <strong>private</strong> constructor prevents outside instantiation (Singleton, factory methods, static-like classes).</li><li>A <strong>static</strong> constructor takes no parameters and no access modifier, runs <strong>once</strong> before the type is first used, and initialises static data.</li><li>Constructors can be overloaded and chained with <code>this(...)</code>/<code>base(...)</code>.</li><li>They are not inherited.</li></ul>\n"},{"id":197,"course_slug":"oop","course_title":"OOP Concepts in C#","ord":8,"level":"Beginner","priority":"Medium","question":"What is the sealed keyword?","question_html":"What is the <code>sealed</code> keyword?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A <code>sealed</code> class can&#39;t be inherited (e.g. <code>string</code>).</p>\n<ul class=\"q-points\"><li>A <code>sealed override</code> method can&#39;t be overridden further.</li><li>Use it to lock down security-sensitive or invariant-heavy types.</li><li>It also gives a small performance gain because the JIT can devirtualise calls.</li></ul>\n"},{"id":202,"course_slug":"oop","course_title":"OOP Concepts in C#","ord":13,"level":"Intermediate","priority":"Medium","question":"What are virtual methods? Why aren't methods virtual by default in C#?","question_html":"What are virtual methods? Why aren&#39;t methods virtual by default in C#?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A <code>virtual</code> method can be overridden in derived classes.</p>\n<ul class=\"q-points\"><li>C# makes methods <strong>non-virtual by default</strong> (unlike Java) for performance (non-virtual calls are direct and can be inlined) and versioning safety: designers must explicitly allow overriding, so a new base method can&#39;t accidentally change the behaviour of subclasses.</li></ul>\n"},{"id":203,"course_slug":"oop","course_title":"OOP Concepts in C#","ord":14,"level":"Intermediate","priority":"Medium","question":"What is a static class? Static vs singleton?","question_html":"What is a static class? Static vs singleton?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A static class can&#39;t be instantiated or inherited and contains only static members (e.g. <code>Math</code>, extension method holders).</p>\n<ul class=\"q-points\"><li>A <strong>singleton</strong> is a normal class with one instance.</li><li>It can implement interfaces, be passed as a dependency, be lazily created and be mocked.</li><li>In ASP.NET Core you usually get singleton behaviour by registering a service with <code>AddSingleton</code> rather than writing the pattern by hand.</li></ul>\n"},{"id":204,"course_slug":"oop","course_title":"OOP Concepts in C#","ord":15,"level":"Intermediate","priority":"Medium","question":"Why must you override GetHashCode when you override Equals?","question_html":"Why must you override GetHashCode when you override Equals?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Hash-based collections (<code>Dictionary</code>, <code>HashSet</code>) first compare hash codes to find a bucket, then call <code>Equals</code>.</p>\n<ul class=\"q-points\"><li>If two equal objects return different hash codes, lookups miss and duplicates appear.</li><li>The contract: <code>a.Equals(b)</code> ⇒ <code>a.GetHashCode() == b.GetHashCode()</code>.</li><li>Use <code>HashCode.Combine(...)</code>, or use a <code>record</code>, which generates both.</li></ul>\n"},{"id":205,"course_slug":"oop","course_title":"OOP Concepts in C#","ord":16,"level":"Intermediate","priority":"Medium","question":"What is an interface default method (C# 8) and why was it added?","question_html":"What is an interface default method (C# 8) and why was it added?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Interfaces can now include a method body.</p>\n<ul class=\"q-points\"><li>It was added so library authors can <strong>add members to a published interface without breaking existing implementers</strong>, and for Java/Swift interop.</li><li>The default implementation is only reachable through the interface type, not through the class variable.</li></ul>\n"},{"id":206,"course_slug":"oop","course_title":"OOP Concepts in C#","ord":17,"level":"Advanced","priority":"Medium","question":"What are cohesion and coupling? How do you measure them in practice?","question_html":"What are cohesion and coupling? How do you measure them in practice?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Cohesion is how strongly related a class&#39;s responsibilities are; coupling is how much a class depends on others.</p>\n<ul class=\"q-points\"><li>Aim for high cohesion and low coupling.</li><li>Signs of trouble: classes named <code>Manager</code>/<code>Helper</code>/<code>Utils</code> with unrelated methods, constructors with 8+ dependencies, and changes that ripple across many files.</li><li>Tools: Visual Studio code metrics (class coupling, maintainability index), NDepend, SonarQube.</li></ul>\n"},{"id":210,"course_slug":"oop","course_title":"OOP Concepts in C#","ord":21,"level":"Scenario","priority":"Medium","question":"Your team adds a new payment method every quarter, and each time someone edits a big switch statement in PaymentService. What design would you suggest?","question_html":"Your team adds a new payment method every quarter, and each time someone edits a big switch statement in <code>PaymentService</code>. What design would you suggest?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Replace the switch with <strong>polymorphism</strong>: an <code>IPaymentMethod</code> interface with one class per method (Card, UPI, Wallet, BankTransfer).</p>\n<ul class=\"q-points\"><li>Register all of them in DI, and have a resolver pick the right one by key.</li><li>Adding a method means adding a class and a DI registration, without touching existing code (Open/Closed principle, Strategy pattern).</li></ul>\n"},{"id":211,"course_slug":"oop","course_title":"OOP Concepts in C#","ord":22,"level":"Scenario","priority":"Medium","question":"An interviewer asks you to design classes for a parking lot. What would you show?","question_html":"An interviewer asks you to design classes for a parking lot. What would you show?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Start with the nouns: <code>ParkingLot</code> (has <code>Levels</code>), <code>Level</code> (has <code>Spots</code>), <code>ParkingSpot</code> (abstract: <code>Compact</code>, <code>Large</code>, <code>Motorbike</code>, <code>EvCharging</code>), <code>Vehicle</code> (abstract: <code>Car</code>, <code>Bike</code>, <code>Truck</code>), <code>Ticket</code>, <code>Payment</code>, <code>EntryGate</code>/<code>ExitGate</code>.</p>\n<ul class=\"q-points\"><li>Behaviour: <code>ParkingLot.Park(vehicle)</code> finds a fitting spot (Strategy for allocation), issues a <code>Ticket</code>;</li><li><code>Exit(ticket)</code> calculates the fee (Strategy for pricing) and frees the spot.</li><li>Mention encapsulation (spot availability private), polymorphism (<code>CanFit(vehicle)</code>), concurrency (two cars taking the same spot: lock per level or an atomic DB update), and extensibility (new vehicle types).</li></ul>\n"},{"id":207,"course_slug":"oop","course_title":"OOP Concepts in C#","ord":18,"level":"Advanced","priority":"Low","question":"What are covariant return types (C# 9)?","question_html":"What are covariant return types (C# 9)?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> An override can return a <strong>more derived</strong> type than the base method.</p>\n<ul class=\"q-points\"><li>For example, <code>Animal.Clone()</code> returns <code>Animal</code>, and <code>Dog.Clone()</code> can be declared to return <code>Dog</code>.</li><li>Callers then don&#39;t need to cast.</li></ul>\n"},{"id":212,"course_slug":"solid","course_title":"SOLID Principles with Examples","ord":1,"level":"Beginner","priority":"High","question":"What are the SOLID principles? Explain each briefly.","question_html":"What are the SOLID principles? Explain each briefly.","answer_html":"<ul>\n<li><strong>S</strong>ingle Responsibility: one reason to change per class.</li>\n<li><strong>O</strong>pen/Closed: extend behaviour by adding code, not modifying existing code.</li>\n<li><strong>L</strong>iskov Substitution: subclasses must work anywhere the base class works.</li>\n<li><strong>I</strong>nterface Segregation: small client-specific interfaces instead of a fat one.</li>\n<li><strong>D</strong>ependency Inversion: high- and low-level modules depend on abstractions; inject dependencies.</li>\n</ul>\n<p>Follow with one concrete example from your own project, e.g. &quot;payment providers behind <code>IPaymentGateway</code>, registered in DI — that&#39;s OCP and DIP.&quot;</p>\n"},{"id":213,"course_slug":"solid","course_title":"SOLID Principles with Examples","ord":2,"level":"Beginner","priority":"High","question":"Give a real example of the Single Responsibility Principle.","question_html":"Give a real example of the Single Responsibility Principle.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> An <code>InvoiceService</code> that calculates totals, writes to SQL and sends email has three reasons to change.</p>\n<ul class=\"q-points\"><li>Split it into <code>InvoiceCalculator</code>, <code>IInvoiceRepository</code> and <code>IInvoiceSender</code>, with a small workflow class orchestrating them.</li><li>Now an SMTP-to-SendGrid change touches only the sender, and each part has focused unit tests.</li></ul>\n"},{"id":214,"course_slug":"solid","course_title":"SOLID Principles with Examples","ord":3,"level":"Beginner","priority":"High","question":"How do you implement the Open/Closed Principle in C#?","question_html":"How do you implement the Open/Closed Principle in C#?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Through <strong>abstractions and polymorphism</strong>: define an interface (<code>IDiscountRule</code>, <code>IExportFormatter</code>), implement each variant as its own class, and let the consumer receive <code>IEnumerable&lt;IDiscountRule&gt;</code> from DI.</p>\n<ul class=\"q-points\"><li>Adding a variant means a new class and registration; no existing, tested code changes.</li><li>Other OCP tools: Strategy, Decorator, middleware, filters, events.</li></ul>\n"},{"id":215,"course_slug":"solid","course_title":"SOLID Principles with Examples","ord":4,"level":"Intermediate","priority":"High","question":"Explain the Liskov Substitution Principle with the Rectangle–Square example.","question_html":"Explain the Liskov Substitution Principle with the Rectangle–Square example.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Mathematically a square is a rectangle, but if <code>Square</code> overrides <code>Width</code>/<code>Height</code> setters to keep sides equal, code written for <code>Rectangle</code> (set width 5, height 4, expect area 20) breaks and gets 16.</p>\n<ul class=\"q-points\"><li>The subtype changed the base&#39;s behaviour, which violates LSP.</li><li>Fix: don&#39;t inherit; make both implement <code>IShape</code> with an <code>Area</code>, or make them immutable.</li><li>Practical LSP violations: overrides throwing <code>NotSupportedException</code>, or a read-only collection deriving from a writable one.</li></ul>\n"},{"id":216,"course_slug":"solid","course_title":"SOLID Principles with Examples","ord":5,"level":"Intermediate","priority":"High","question":"What is the difference between Dependency Inversion, Dependency Injection and Inversion of Control?","question_html":"What is the difference between Dependency Inversion, Dependency Injection and Inversion of Control?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> DIP is the design <strong>principle</strong>: depend on abstractions.</p>\n<ul class=\"q-points\"><li>IoC is the broader <strong>concept</strong> that control of object creation and flow is handed to a framework or container.</li><li>DI is a <strong>technique</strong> to achieve IoC/DIP: dependencies are supplied from outside (constructor injection preferred) rather than created with <code>new</code> inside the class.</li><li>ASP.NET Core&#39;s built-in container is an IoC container that performs DI.</li></ul>\n"},{"id":217,"course_slug":"solid","course_title":"SOLID Principles with Examples","ord":6,"level":"Intermediate","priority":"High","question":"What are the service lifetimes in ASP.NET Core DI and what is a captive dependency?","question_html":"What are the service lifetimes in ASP.NET Core DI and what is a captive dependency?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Transient (new each time), Scoped (one per request/scope), Singleton (one for the app).</p>\n<ul class=\"q-points\"><li>A captive dependency happens when a longer-lived service holds a shorter-lived one — e.g. a singleton injecting a scoped <code>DbContext</code>.</li><li>The <code>DbContext</code> then lives forever and is shared across threads, which causes concurrency exceptions and stale data.</li><li>Fix: make the consumer scoped, or inject <code>IServiceScopeFactory</code> and create a scope per operation (common in <code>BackgroundService</code>).</li></ul>\n"},{"id":223,"course_slug":"solid","course_title":"SOLID Principles with Examples","ord":12,"level":"Scenario","priority":"High","question":"Your NotificationService sends email via SMTP using new SmtpClient() inside the method. The business now wants SMS and WhatsApp too, and tests keep sending real emails. What do you change?","question_html":"Your <code>NotificationService</code> sends email via SMTP using <code>new SmtpClient()</code> inside the method. The business now wants SMS and WhatsApp too, and tests keep sending real emails. What do you change?","answer_html":"<ol>\n<li>Introduce <code>INotificationChannel { Task SendAsync(Notification n); }</code> (DIP).</li>\n<li>Implement <code>EmailChannel</code> (SMTP or SendGrid), <code>SmsChannel</code> and <code>WhatsAppChannel</code> (OCP: one class per channel).</li>\n<li>Inject <code>IEnumerable&lt;INotificationChannel&gt;</code> into <code>NotificationService</code> and select by the user&#39;s preference.</li>\n<li>Move settings to <code>IOptions&lt;SmtpSettings&gt;</code>.</li>\n<li>In unit tests, use a fake channel, so no real emails are sent.</li>\n<li>Optional: a decorator for retry/logging (OCP), and a queue so sending doesn&#39;t block the request.</li>\n</ol>\n"},{"id":224,"course_slug":"solid","course_title":"SOLID Principles with Examples","ord":13,"level":"Scenario","priority":"High","question":"A code review shows if (shape is Circle) ... else if (shape is Square) ... in five places. What principle is violated and how do you fix it?","question_html":"A code review shows <code>if (shape is Circle) ... else if (shape is Square) ...</code> in five places. What principle is violated and how do you fix it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> It violates <strong>OCP</strong> (every new shape edits five places) and usually <strong>LSP/polymorphism</strong>.</p>\n<ul class=\"q-points\"><li>Move the behaviour into the types: <code>abstract double Area()</code> (or an interface method) implemented by each shape, and callers just call <code>shape.Area()</code>.</li><li>If the operation shouldn&#39;t live in the shape (e.g. rendering), use the <strong>Visitor</strong> pattern, or a dictionary of strategies keyed by type.</li></ul>\n"},{"id":218,"course_slug":"solid","course_title":"SOLID Principles with Examples","ord":7,"level":"Intermediate","priority":"Medium","question":"Give an Interface Segregation example from .NET itself.","question_html":"Give an Interface Segregation example from .NET itself.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>IEnumerable&lt;T&gt;</code> (iterate only) → <code>IReadOnlyCollection&lt;T&gt;</code> (+Count) → <code>IReadOnlyList&lt;T&gt;</code> (+indexer) vs <code>ICollection&lt;T&gt;</code>/<code>IList&lt;T&gt;</code> (mutation).</p>\n<ul class=\"q-points\"><li>A method that only reads should accept <code>IEnumerable&lt;T&gt;</code>/<code>IReadOnlyList&lt;T&gt;</code>.</li><li>Similarly, ASP.NET Core splits <code>IConfiguration</code> and <code>IOptions&lt;T&gt;</code>, and logging into <code>ILogger</code> and <code>ILoggerFactory</code>.</li></ul>\n"},{"id":219,"course_slug":"solid","course_title":"SOLID Principles with Examples","ord":8,"level":"Intermediate","priority":"Medium","question":"Is it OK to violate SOLID sometimes?","question_html":"Is it OK to violate SOLID sometimes?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Yes.</p>\n<ul class=\"q-points\"><li>SOLID is a set of guidelines, not laws.</li><li>Over-applying them creates &quot;interface for everything&quot; designs, needless indirection and many tiny files.</li><li>Apply them where change is <strong>likely</strong> or testing needs seams (external services, business rules that vary).</li><li>For stable, simple code, KISS and YAGNI win.</li><li>Good answer: &quot;I refactor towards SOLID when a second variant or a test need appears.&quot;</li></ul>\n"},{"id":220,"course_slug":"solid","course_title":"SOLID Principles with Examples","ord":9,"level":"Intermediate","priority":"Medium","question":"Which design patterns support which SOLID principles?","question_html":"Which design patterns support which SOLID principles?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Strategy, Decorator, Template Method, Observer → <strong>OCP</strong>.</p>\n<ul class=\"q-points\"><li>Adapter, Facade → <strong>DIP/ISP</strong> (wrap details behind your own abstraction).</li><li>Factory/Abstract Factory → <strong>DIP</strong> (hide creation).</li><li>Repository → <strong>DIP/SRP</strong>.</li><li>Chain of Responsibility/middleware → <strong>SRP + OCP</strong>.</li><li>Composite → <strong>LSP</strong> (leaf and composite are interchangeable).</li></ul>\n"},{"id":221,"course_slug":"solid","course_title":"SOLID Principles with Examples","ord":10,"level":"Advanced","priority":"Medium","question":"How does Clean Architecture apply the Dependency Inversion Principle?","question_html":"How does Clean Architecture apply the Dependency Inversion Principle?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The <strong>Domain</strong> and <strong>Application</strong> layers define interfaces (ports) such as <code>IOrderRepository</code> or <code>IEmailSender</code>.</p>\n<ul class=\"q-points\"><li>The <strong>Infrastructure</strong> layer implements them with EF Core, SMTP or Azure.</li><li>The API project (composition root) wires them together.</li><li>Source-code dependencies point inward, so business rules don&#39;t reference EF Core or ASP.NET.</li><li>You can test them with in-memory fakes and swap infrastructure without touching them.</li></ul>\n"},{"id":225,"course_slug":"solid","course_title":"SOLID Principles with Examples","ord":14,"level":"Scenario","priority":"Medium","question":"A background service crashes with \"Cannot consume scoped service from singleton\". Explain and fix.","question_html":"A background service crashes with &quot;Cannot consume scoped service from singleton&quot;. Explain and fix.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>AddHostedService</code> registers hosted services as singletons.</p>\n<ul class=\"q-points\"><li>Injecting a scoped service (like <code>DbContext</code>) into the constructor is a captive dependency, so the container refuses it.</li><li>Inject <code>IServiceScopeFactory</code> instead;</li><li>inside <code>ExecuteAsync</code>, for each unit of work, do `using var scope = factory.CreateScope();</li><li>var db = scope.ServiceProvider.GetRequiredService<AppDbContext>();`.</li><li>Each iteration then gets a fresh, correctly disposed context.</li></ul>\n"},{"id":226,"course_slug":"solid","course_title":"SOLID Principles with Examples","ord":15,"level":"Scenario","priority":"Medium","question":"How would you explain where you applied SOLID in your last project?","question_html":"How would you explain where you applied SOLID in your last project?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Give a concrete STAR-style example.</p>\n<ul class=\"q-points\"><li>&quot;Our reporting module had exports to PDF and Excel inside one 2,000-line class.</li><li>I introduced <code>IReportExporter</code> with one class per format and registered them in DI.</li><li>The controller picks one by format key (OCP, SRP).</li><li>Data access moved behind <code>IReportRepository</code> (DIP), which let us unit-test the exporters with fake data.</li><li>Adding CSV later took half a day and touched no existing code.&quot;</li></ul>\n"},{"id":222,"course_slug":"solid","course_title":"SOLID Principles with Examples","ord":11,"level":"Advanced","priority":"Low","question":"What is the Stable Dependencies / Stable Abstractions principle?","question_html":"What is the Stable Dependencies / Stable Abstractions principle?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> They are package-level principles from Robert C.</p>\n<ul class=\"q-points\"><li>Martin.</li><li><strong>Stable Dependencies:</strong> depend in the direction of stability (packages that many others rely on should change rarely).</li><li><strong>Stable Abstractions:</strong> stable packages should be abstract (interfaces), so they can be extended without modification.</li><li>Together they explain why the domain/interfaces project sits at the centre and has no dependencies.</li></ul>\n"},{"id":227,"course_slug":"design-patterns","course_title":"Design Patterns (GoF + Enterprise) in C#","ord":1,"level":"Beginner","priority":"High","question":"What are design patterns? Name the three GoF categories.","question_html":"What are design patterns? Name the three GoF categories.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Reusable, named solutions to recurring design problems.</p>\n<ul class=\"q-points\"><li>GoF (1994) lists 23 in three categories: <strong>Creational</strong> (Singleton, Factory Method, Abstract Factory, Builder, Prototype), <strong>Structural</strong> (Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Proxy), <strong>Behavioural</strong> (Chain of Responsibility, Command, Interpreter, Iterator, Mediator, Memento, Observer, State, Strategy, Template Method, Visitor).</li></ul>\n"},{"id":228,"course_slug":"design-patterns","course_title":"Design Patterns (GoF + Enterprise) in C#","ord":2,"level":"Beginner","priority":"High","question":"How do you implement a thread-safe Singleton in C#?","question_html":"How do you implement a thread-safe Singleton in C#?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use <code>Lazy&lt;T&gt;</code>: <code>private static readonly Lazy&lt;Svc&gt; _i = new(() =&gt; new Svc()); public static Svc Instance =&gt; _i.Value;</code> with a private constructor and a <code>sealed</code> class.</p>\n<ul class=\"q-points\"><li><code>Lazy&lt;T&gt;</code> is thread-safe by default (<code>ExecutionAndPublication</code>).</li><li>Alternatives: a <code>static readonly</code> field (thread-safe because of the type initialiser), or double-checked locking with <code>volatile</code>.</li><li>In ASP.NET Core, prefer <code>services.AddSingleton&lt;ISvc, Svc&gt;()</code>.</li><li>It&#39;s testable and the container manages the lifetime.</li></ul>\n"},{"id":229,"course_slug":"design-patterns","course_title":"Design Patterns (GoF + Enterprise) in C#","ord":3,"level":"Beginner","priority":"High","question":"What is the difference between Factory Method and Abstract Factory?","question_html":"What is the difference between Factory Method and Abstract Factory?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Factory Method creates <strong>one product</strong>, and subclasses (or a method) decide which concrete class to create.</p>\n<ul class=\"q-points\"><li>Abstract Factory creates a <strong>family of related products</strong> through an interface with several create methods (button + textbox for a theme;</li><li>connection + command + parameter for a DB provider).</li><li>Factory Method uses inheritance; Abstract Factory uses composition (you pass the factory object).</li></ul>\n"},{"id":230,"course_slug":"design-patterns","course_title":"Design Patterns (GoF + Enterprise) in C#","ord":4,"level":"Beginner","priority":"High","question":"What is the Strategy pattern? Where have you used it?","question_html":"What is the Strategy pattern? Where have you used it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> It encapsulates interchangeable algorithms behind an interface and selects one at runtime.</p>\n<ul class=\"q-points\"><li>Examples: discount rules, shipping cost calculators, payment gateways, export formats, tax rules by country.</li><li>With DI, register every strategy and inject <code>IEnumerable&lt;IStrategy&gt;</code>, or use keyed services (.NET 8).</li><li>It removes <code>switch</code> statements and satisfies OCP.</li></ul>\n"},{"id":231,"course_slug":"design-patterns","course_title":"Design Patterns (GoF + Enterprise) in C#","ord":5,"level":"Intermediate","priority":"High","question":"What is the difference between Decorator and Adapter?","question_html":"What is the difference between Decorator and Adapter?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A Decorator keeps the <strong>same interface</strong> and <strong>adds behaviour</strong> (caching, logging, retry) by wrapping an object.</p>\n<ul class=\"q-points\"><li>You can stack several.</li><li>An Adapter <strong>changes the interface</strong> so an incompatible class fits what the client expects (wrapping a vendor SDK behind <code>ISmsSender</code>).</li><li>In short, Decorator = same interface + extra behaviour; Adapter = different interface, same behaviour.</li></ul>\n"},{"id":232,"course_slug":"design-patterns","course_title":"Design Patterns (GoF + Enterprise) in C#","ord":6,"level":"Intermediate","priority":"High","question":"Explain the Repository and Unit of Work patterns. Do you need them with EF Core?","question_html":"Explain the Repository and Unit of Work patterns. Do you need them with EF Core?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A Repository hides data access behind a collection-like interface; Unit of Work groups changes into one transaction.</p>\n<ul class=\"q-points\"><li>EF Core already implements both (<code>DbSet&lt;T&gt;</code>, <code>DbContext.SaveChanges</code>).</li><li>Adding them on top is optional.</li><li><strong>Pros:</strong> domain code doesn&#39;t reference EF, queries are centralised, testing is easier.</li><li><strong>Cons:</strong> extra layers, and generic repositories often leak <code>IQueryable</code> or limit EF features.</li><li>A balanced answer: aggregate-specific repositories in DDD/Clean Architecture;</li><li>direct <code>DbContext</code> usage in simpler apps, with integration tests using SQLite/Testcontainers.</li></ul>\n"},{"id":233,"course_slug":"design-patterns","course_title":"Design Patterns (GoF + Enterprise) in C#","ord":7,"level":"Intermediate","priority":"High","question":"How is ASP.NET Core middleware an example of Chain of Responsibility?","question_html":"How is ASP.NET Core middleware an example of Chain of Responsibility?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Each middleware receives the <code>HttpContext</code> and a <code>next</code> delegate.</p>\n<ul class=\"q-points\"><li>It can act before and after calling <code>next</code>, or short-circuit (e.g. return 401 without calling the rest).</li><li>The order of <code>app.Use...</code> calls defines the chain: exception handler → HTTPS redirection → static files → routing → CORS → authentication → authorization → endpoints.</li></ul>\n"},{"id":234,"course_slug":"design-patterns","course_title":"Design Patterns (GoF + Enterprise) in C#","ord":8,"level":"Intermediate","priority":"High","question":"What is the Observer pattern and how does C# support it?","question_html":"What is the Observer pattern and how does C# support it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Observers subscribe to a subject and get notified of changes.</p>\n<ul class=\"q-points\"><li>C# supports it with <strong>events and delegates</strong> (<code>event EventHandler&lt;T&gt;</code>), <code>IObservable&lt;T&gt;</code>/<code>IObserver&lt;T&gt;</code> (with Rx.NET), <code>INotifyPropertyChanged</code> in UI binding, and at architecture level pub/sub messaging (Azure Service Bus topics, Kafka).</li><li>Pitfall: forgetting to unsubscribe causes memory leaks.</li></ul>\n"},{"id":239,"course_slug":"design-patterns","course_title":"Design Patterns (GoF + Enterprise) in C#","ord":13,"level":"Advanced","priority":"High","question":"Explain CQRS. When is it worth it?","question_html":"Explain CQRS. When is it worth it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Command Query Responsibility Segregation splits writes (commands, rich domain model, validation) from reads (queries, flat DTOs, maybe Dapper/views/a separate read DB).</p>\n<ul class=\"q-points\"><li>It&#39;s worth it when read and write workloads or shapes differ a lot, for complex domains, or for high read scale.</li><li>It can be as light as separate command and query handler classes on one DB.</li><li>It adds complexity, and with separate stores you get <strong>eventual consistency</strong>.</li><li>Don&#39;t use it for simple CRUD.</li></ul>\n"},{"id":240,"course_slug":"design-patterns","course_title":"Design Patterns (GoF + Enterprise) in C#","ord":14,"level":"Advanced","priority":"High","question":"What is the Outbox pattern and why is it needed?","question_html":"What is the Outbox pattern and why is it needed?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> It&#39;s for publishing an integration event reliably when a DB change commits.</p>\n<ul class=\"q-points\"><li>Writing to the DB and then publishing to a broker is not atomic (dual-write problem).</li><li>With Outbox, the event row is inserted into an <code>OutboxMessages</code> table <strong>in the same transaction</strong> as the business change.</li><li>A background processor reads unsent rows, publishes them, and marks them sent.</li><li>Delivery is <strong>at-least-once</strong>, so consumers must be idempotent (Inbox table or dedupe key).</li><li>Libraries: MassTransit, NServiceBus, Wolverine, CAP.</li></ul>\n"},{"id":241,"course_slug":"design-patterns","course_title":"Design Patterns (GoF + Enterprise) in C#","ord":15,"level":"Advanced","priority":"High","question":"How do Retry and Circuit Breaker work together?","question_html":"How do Retry and Circuit Breaker work together?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Retry handles brief transient faults (timeouts, 503, 429) with exponential backoff and jitter.</p>\n<ul class=\"q-points\"><li>The Circuit Breaker wraps retries: if failures exceed a threshold, it <strong>opens</strong> and fails fast for a break period, protecting the struggling dependency and your own threads.</li><li>Then it goes <strong>half-open</strong> to probe, and <strong>closes</strong> on success.</li><li>In .NET 8+, <code>AddStandardResilienceHandler()</code> configures them with timeouts and rate limiting.</li><li>Retry only idempotent operations, or use idempotency keys.</li></ul>\n"},{"id":244,"course_slug":"design-patterns","course_title":"Design Patterns (GoF + Enterprise) in C#","ord":18,"level":"Scenario","priority":"High","question":"The product details page calls the DB for every request and is slow. You can't change the repository class. Which pattern helps?","question_html":"The product details page calls the DB for every request and is slow. You can&#39;t change the repository class. Which pattern helps?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A <strong>Decorator</strong>: <code>CachedProductRepository : IProductRepository</code> wraps the existing repository, checks <code>IMemoryCache</code>/<code>IDistributedCache</code> (Redis) first, and falls back to the inner repository on a miss.</p>\n<ul class=\"q-points\"><li>Register it with Scrutor&#39;s <code>Decorate&lt;,&gt;</code> or manual factory registration.</li><li>No existing code changes (OCP).</li><li>Add expiration, and invalidate on product updates (remove the cache key in the update path, or publish an event).</li></ul>\n"},{"id":245,"course_slug":"design-patterns","course_title":"Design Patterns (GoF + Enterprise) in C#","ord":19,"level":"Scenario","priority":"High","question":"Your app must support three SMS vendors and switch between them by configuration or when one is down. Design it.","question_html":"Your app must support three SMS vendors and switch between them by configuration or when one is down. Design it.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Define <code>ISmsSender</code>.</p>\n<ul class=\"q-points\"><li>Write an <strong>Adapter</strong> per vendor SDK (<code>TwilioSender</code>, <code>GupshupSender</code>, <code>MsgKitSender</code>), registered as keyed services or <code>IEnumerable&lt;ISmsSender&gt;</code>.</li><li>Choose the active one from <code>IOptionsMonitor&lt;SmsOptions&gt;</code> (Strategy) so config changes apply without a restart.</li><li>Add a <strong>failover decorator</strong> that tries the primary and, on failure or an open circuit (Polly Circuit Breaker), uses the secondary.</li><li>Log the vendor used, and make sends idempotent with a message ID.</li></ul>\n"},{"id":235,"course_slug":"design-patterns","course_title":"Design Patterns (GoF + Enterprise) in C#","ord":9,"level":"Intermediate","priority":"Medium","question":"What is the Facade pattern? Give a real example.","question_html":"What is the Facade pattern? Give a real example.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A Facade provides a simple API over a complicated subsystem.</p>\n<ul class=\"q-points\"><li>Example: a <code>CheckoutService.PlaceOrder()</code> that coordinates inventory, payment, shipping and email so the controller makes one call.</li><li>In .NET, <code>File.ReadAllText</code> is a facade over <code>FileStream</code> + <code>StreamReader</code> + encoding detection.</li></ul>\n"},{"id":236,"course_slug":"design-patterns","course_title":"Design Patterns (GoF + Enterprise) in C#","ord":10,"level":"Intermediate","priority":"Medium","question":"What is the Builder pattern? Show .NET examples.","question_html":"What is the Builder pattern? Show .NET examples.","answer_html":"<p>Builder constructs complex objects step by step, often fluently, and validates at <code>Build()</code>. .NET examples: <code>WebApplication.CreateBuilder(args)</code> → <code>builder.Build()</code>, <code>StringBuilder</code>, <code>UriBuilder</code>, <code>SqlConnectionStringBuilder</code>, <code>HostBuilder</code>, EF Core&#39;s <code>ModelBuilder</code> fluent API, and test-data builders in unit tests.</p>\n"},{"id":237,"course_slug":"design-patterns","course_title":"Design Patterns (GoF + Enterprise) in C#","ord":11,"level":"Intermediate","priority":"Medium","question":"What is the Mediator pattern and what does MediatR do?","question_html":"What is the Mediator pattern and what does MediatR do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Mediator centralises communication so components don&#39;t reference each other directly.</p>\n<ul class=\"q-points\"><li>MediatR implements an in-process mediator: controllers <code>Send</code> a request object, and exactly one handler processes it.</li><li>Notifications can go to many handlers.</li><li>Pipeline behaviours add cross-cutting concerns (validation, logging, transactions).</li><li>Note: MediatR moved to a commercial licence from version 13 (2025).</li><li>Some teams write a small mediator themselves or call handlers directly.</li></ul>\n"},{"id":238,"course_slug":"design-patterns","course_title":"Design Patterns (GoF + Enterprise) in C#","ord":12,"level":"Intermediate","priority":"Medium","question":"Template Method vs Strategy?","question_html":"Template Method vs Strategy?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Both vary part of an algorithm.</p>\n<ul class=\"q-points\"><li><strong>Template Method</strong> uses <strong>inheritance</strong>: the base class fixes the skeleton and subclasses override steps, decided at compile time.</li><li><strong>Strategy</strong> uses <strong>composition</strong>: the whole algorithm is an injected object, swappable at runtime.</li><li>Prefer Strategy for flexibility; Template Method suits frameworks with a fixed workflow (e.g. ETL importers, <code>BackgroundService.ExecuteAsync</code>).</li></ul>\n"},{"id":242,"course_slug":"design-patterns","course_title":"Design Patterns (GoF + Enterprise) in C#","ord":16,"level":"Advanced","priority":"Medium","question":"What is the Saga pattern?","question_html":"What is the Saga pattern?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> It coordinates a distributed transaction across microservices without 2PC: a sequence of local transactions, each publishing an event or command.</p>\n<ul class=\"q-points\"><li>If a step fails, <strong>compensating transactions</strong> undo earlier steps (refund the payment, release the stock).</li><li><strong>Orchestration</strong>: a central saga orchestrator (state machine) tells services what to do.</li><li><strong>Choreography</strong>: services react to each other&#39;s events.</li><li>Orchestration is easier to follow; choreography is more decoupled.</li></ul>\n"},{"id":246,"course_slug":"design-patterns","course_title":"Design Patterns (GoF + Enterprise) in C#","ord":20,"level":"Scenario","priority":"Medium","question":"An expense approval needs Team Lead below ₹10,000, Manager up to ₹1,00,000, and Director above. Which pattern?","question_html":"An expense approval needs Team Lead below ₹10,000, Manager up to ₹1,00,000, and Director above. Which pattern?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <strong>Chain of Responsibility</strong>: <code>IApprover</code> with <code>SetNext(IApprover)</code> and <code>Handle(Expense)</code>.</p>\n<ul class=\"q-points\"><li>Each approver handles it if the amount is within its limit, otherwise it passes it on.</li><li>Build the chain from configuration so limits and new levels don&#39;t need code changes.</li><li>A <strong>State</strong> pattern can track the expense&#39;s lifecycle (Submitted → Approved/Rejected → Paid).</li></ul>\n"},{"id":247,"course_slug":"design-patterns","course_title":"Design Patterns (GoF + Enterprise) in C#","ord":21,"level":"Scenario","priority":"Medium","question":"When an order is placed you must save it, publish OrderPlaced to Service Bus, and never lose the message even if the broker is down. How?","question_html":"When an order is placed you must save it, publish <code>OrderPlaced</code> to Service Bus, and never lose the message even if the broker is down. How?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use the <strong>Transactional Outbox</strong>: in the same <code>SaveChanges</code> transaction, insert the order and an outbox row with the serialized event.</p>\n<ul class=\"q-points\"><li>A <code>BackgroundService</code> polls unsent outbox rows, publishes them to Service Bus, and marks them sent, retrying while the broker is down.</li><li>Consumers dedupe by message ID (idempotent consumer / Inbox).</li><li>MassTransit&#39;s EF Core outbox does this out of the box.</li></ul>\n"},{"id":243,"course_slug":"design-patterns","course_title":"Design Patterns (GoF + Enterprise) in C#","ord":17,"level":"Advanced","priority":"Low","question":"What is the Specification pattern?","question_html":"What is the Specification pattern?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> It encapsulates a business rule or query criterion in an object (<code>IsActiveCustomerSpec</code>, <code>OrdersAboveAmountSpec(1000)</code>).</p>\n<ul class=\"q-points\"><li>You can combine them (And/Or/Not) and reuse them for in-memory checks and EF Core queries (as <code>Expression&lt;Func&lt;T,bool&gt;&gt;</code>).</li><li>It keeps query logic out of controllers and avoids duplicated <code>Where</code> clauses.</li><li>Ardalis.Specification is a popular library.</li></ul>\n"},{"id":248,"course_slug":"adonet","course_title":"ADO.NET — Connected & Disconnected Data Access","ord":1,"level":"Beginner","priority":"High","question":"What is ADO.NET? Name its main objects.","question_html":"What is ADO.NET? Name its main objects.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> ADO.NET is .NET&#39;s core data access library (<code>System.Data</code> + provider packages).</p>\n<ul class=\"q-points\"><li>Main objects: <code>Connection</code> (connects to the DB), <code>Command</code> (executes SQL/procs), <code>Parameter</code>, <code>DataReader</code> (forward-only fast read), <code>DataAdapter</code> (fills/updates DataSets), <code>DataSet</code>/<code>DataTable</code> (in-memory data), <code>Transaction</code>.</li><li>For SQL Server use <code>Microsoft.Data.SqlClient</code> (<code>SqlConnection</code>, <code>SqlCommand</code>...).</li></ul>\n"},{"id":249,"course_slug":"adonet","course_title":"ADO.NET — Connected & Disconnected Data Access","ord":2,"level":"Beginner","priority":"High","question":"What is the difference between connected and disconnected architecture?","question_html":"What is the difference between connected and disconnected architecture?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Connected: the connection stays open while you read with a <code>DataReader</code> — forward-only, read-only, very fast, minimal memory.</p>\n<ul class=\"q-points\"><li>Disconnected: a <code>DataAdapter</code> fills a <code>DataSet</code>/<code>DataTable</code>, then closes the connection;</li><li>you can navigate, edit and later push changes back with <code>Update()</code> — more memory, more flexibility.</li><li>Modern apps mostly use the connected model (directly or via Dapper/EF).</li></ul>\n"},{"id":250,"course_slug":"adonet","course_title":"ADO.NET — Connected & Disconnected Data Access","ord":3,"level":"Beginner","priority":"High","question":"What is the difference between ExecuteReader, ExecuteScalar and ExecuteNonQuery?","question_html":"What is the difference between ExecuteReader, ExecuteScalar and ExecuteNonQuery?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>ExecuteReader</code> returns a <code>DataReader</code> for one or more result sets.</p>\n<ul class=\"q-points\"><li><code>ExecuteScalar</code> returns the first column of the first row (COUNT, SUM, new identity via <code>OUTPUT</code>/<code>SCOPE_IDENTITY()</code>).</li><li><code>ExecuteNonQuery</code> runs INSERT/UPDATE/DELETE/DDL and returns the number of rows affected (-1 for statements that don&#39;t affect rows, or when <code>SET NOCOUNT ON</code> is set).</li></ul>\n"},{"id":251,"course_slug":"adonet","course_title":"ADO.NET — Connected & Disconnected Data Access","ord":4,"level":"Beginner","priority":"High","question":"DataReader vs DataSet?","question_html":"DataReader vs DataSet?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> DataReader: connected, forward-only, read-only, one row at a time, fastest and lowest memory — use for streaming results to APIs.</p>\n<ul class=\"q-points\"><li>DataSet: disconnected, in-memory collection of DataTables with relations and constraints, random access and editable, can be serialised to XML — heavier;</li><li>used in legacy WinForms/reporting.</li><li>EF/Dapper map to objects instead.</li></ul>\n"},{"id":252,"course_slug":"adonet","course_title":"ADO.NET — Connected & Disconnected Data Access","ord":5,"level":"Beginner","priority":"High","question":"How do you prevent SQL injection in ADO.NET?","question_html":"How do you prevent SQL injection in ADO.NET?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Always use parameters (<code>@name</code> placeholders + <code>SqlParameter</code> with explicit type/size) or stored procedures with parameters — never concatenate user input into SQL.</p>\n<ul class=\"q-points\"><li>Validate input, use least-privilege DB accounts, and for dynamic identifiers (table/column names) use an allow-list.</li><li>ORMs (EF, Dapper) parameterise automatically.</li></ul>\n"},{"id":254,"course_slug":"adonet","course_title":"ADO.NET — Connected & Disconnected Data Access","ord":7,"level":"Intermediate","priority":"High","question":"What is connection pooling? How do you troubleshoot pool exhaustion?","question_html":"What is connection pooling? How do you troubleshoot pool exhaustion?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> ADO.NET reuses open physical connections from a pool keyed by the exact connection string.</p>\n<ul class=\"q-points\"><li><code>Open()</code> borrows, <code>Close()/Dispose()</code> returns.</li><li>Default max is 100 per pool.</li><li>Exhaustion symptoms: &quot;Timeout expired… obtaining a connection from the pool&quot;.</li><li>Causes: missing <code>using</code>/dispose, connections held across long work or <code>await</code>s of slow external calls, long transactions, or traffic beyond 100 concurrent DB operations.</li><li>Fix: dispose properly, shorten connection lifetimes, async I/O, raise <code>Max Pool Size</code> only after fixing leaks, monitor with performance counters/<code>sys.dm_exec_sessions</code>.</li></ul>\n"},{"id":255,"course_slug":"adonet","course_title":"ADO.NET — Connected & Disconnected Data Access","ord":8,"level":"Intermediate","priority":"High","question":"How do you implement a transaction in ADO.NET?","question_html":"How do you implement a transaction in ADO.NET?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>var tx = conn.BeginTransaction(isolationLevel)</code>, assign <code>tx</code> to every command (<code>new SqlCommand(sql, conn, tx)</code>), execute, then <code>tx.Commit()</code>;</p>\n<ul class=\"q-points\"><li>on exception <code>tx.Rollback()</code>.</li><li>Disposing an uncommitted transaction rolls it back.</li><li>For multiple connections/resources use <code>TransactionScope</code> (async flow enabled), avoiding distributed escalation in the cloud.</li><li>Keep transactions short to reduce locking.</li></ul>\n"},{"id":256,"course_slug":"adonet","course_title":"ADO.NET — Connected & Disconnected Data Access","ord":9,"level":"Intermediate","priority":"High","question":"Why is AddWithValue considered bad practice?","question_html":"Why is <code>AddWithValue</code> considered bad practice?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> It infers the SQL type from the .NET value: strings become <code>nvarchar</code> with a length equal to the value, decimals get inferred precision.</p>\n<ul class=\"q-points\"><li>Mismatches with column types (e.g. <code>varchar</code> column vs <code>nvarchar</code> parameter) force implicit conversions that can turn index seeks into scans, and varying lengths create many cached plans.</li><li>Use <code>Parameters.Add(&quot;@p&quot;, SqlDbType.VarChar, 50).Value = x</code> with explicit type and size.</li></ul>\n"},{"id":257,"course_slug":"adonet","course_title":"ADO.NET — Connected & Disconnected Data Access","ord":10,"level":"Intermediate","priority":"High","question":"How do you call a stored procedure with output parameters?","question_html":"How do you call a stored procedure with output parameters?","answer_html":"<p>Set <code>CommandType = CommandType.StoredProcedure</code>, add input parameters, add an output parameter with <code>Direction = ParameterDirection.Output</code> (and size for strings), optionally a <code>ReturnValue</code> parameter, execute (<code>ExecuteNonQuery</code>), then read <code>param.Value</code> after execution (after closing the reader if you used <code>ExecuteReader</code>).</p>\n"},{"id":260,"course_slug":"adonet","course_title":"ADO.NET — Connected & Disconnected Data Access","ord":13,"level":"Intermediate","priority":"High","question":"What is Dapper and how does it compare with EF Core and raw ADO.NET?","question_html":"What is Dapper and how does it compare with EF Core and raw ADO.NET?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Dapper is a micro-ORM: extension methods (<code>Query&lt;T&gt;</code>, <code>Execute</code>, <code>QueryMultiple</code>) on <code>IDbConnection</code> that map rows to objects using cached IL.</p>\n<ul class=\"q-points\"><li>Compared with raw ADO.NET it removes mapping boilerplate with almost the same speed;</li><li>compared with EF Core it has no change tracking, LINQ, migrations or relationship management — you write all SQL.</li><li>Use Dapper for read-heavy, performance-critical or complex SQL/stored procedures; EF Core for domain-rich write models.</li><li>They combine well.</li></ul>\n"},{"id":263,"course_slug":"adonet","course_title":"ADO.NET — Connected & Disconnected Data Access","ord":16,"level":"Scenario","priority":"High","question":"Under load the API logs \"Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool.\" How do you fix it?","question_html":"Under load the API logs &quot;Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool.&quot; How do you fix it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Pool exhaustion.</p>\n<ul class=\"q-points\"><li>1) Search for connections/readers not in <code>using</code> blocks and for code holding connections across slow calls (HTTP, file I/O) or long transactions.</li><li>2) Check sync-over-async blocking that keeps connections open longer.</li><li>3) Check slow queries (Query Store) — slow queries hold connections.</li><li>4) Monitor active connections (<code>sys.dm_exec_sessions</code> by program name).</li><li>5) Only then tune <code>Max Pool Size</code>, and consider caching or fewer round trips (batching).</li><li>Also ensure one consistent connection string.</li></ul>\n"},{"id":264,"course_slug":"adonet","course_title":"ADO.NET — Connected & Disconnected Data Access","ord":17,"level":"Scenario","priority":"High","question":"You must import a 2-million-row CSV into SQL Server nightly. How would you do it in .NET?","question_html":"You must import a 2-million-row CSV into SQL Server nightly. How would you do it in .NET?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Stream the file (don&#39;t load it all) with a CSV reader (CsvHelper) exposing an <code>IDataReader</code> or batches of <code>DataTable</code>s;</p>\n<ul class=\"q-points\"><li><code>SqlBulkCopy</code> into a staging table with <code>TableLock</code> and a batch size (10k–50k);</li><li>then a set-based stored procedure validates and <code>MERGE</code>s/<code>INSERT</code>s into target tables inside a transaction;</li><li>log rejected rows;</li><li>make it idempotent (truncate staging first, track file/batch IDs).</li><li>Alternatives: SSIS or Azure Data Factory for ops-managed pipelines.</li></ul>\n"},{"id":253,"course_slug":"adonet","course_title":"ADO.NET — Connected & Disconnected Data Access","ord":6,"level":"Beginner","priority":"Medium","question":"What is the using statement's role with SqlConnection?","question_html":"What is the <code>using</code> statement&#39;s role with SqlConnection?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>SqlConnection</code>, <code>SqlCommand</code> and <code>SqlDataReader</code> implement <code>IDisposable</code>.</p>\n<ul class=\"q-points\"><li><code>using</code> guarantees <code>Dispose()</code> (which closes the connection and returns it to the pool) even if an exception occurs.</li><li>Forgetting to dispose leaks pooled connections and eventually causes pool-timeout errors.</li></ul>\n"},{"id":258,"course_slug":"adonet","course_title":"ADO.NET — Connected & Disconnected Data Access","ord":11,"level":"Intermediate","priority":"Medium","question":"What is SqlBulkCopy and when do you use it?","question_html":"What is SqlBulkCopy and when do you use it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A class that streams large volumes of rows into a SQL Server table using the bulk insert protocol — from a <code>DataTable</code>, <code>DataReader</code> or <code>DataRow[]</code>.</p>\n<ul class=\"q-points\"><li>It&#39;s orders of magnitude faster than individual INSERTs.</li><li>Configure <code>BatchSize</code>, <code>BulkCopyTimeout</code>, column mappings and <code>TableLock</code>.</li><li>Typical use: ETL staging loads, imports from CSV/Excel.</li><li>Load into a staging table, then MERGE into the final table.</li></ul>\n"},{"id":259,"course_slug":"adonet","course_title":"ADO.NET — Connected & Disconnected Data Access","ord":12,"level":"Intermediate","priority":"Medium","question":"What is MARS?","question_html":"What is MARS?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Multiple Active Result Sets (<code>MultipleActiveResultSets=True</code> in the connection string) lets you have more than one open <code>DataReader</code> (or execute commands while reading) on the same connection.</p>\n<ul class=\"q-points\"><li>Useful in some EF lazy-loading scenarios, but it adds overhead; usually better to restructure queries.</li></ul>\n"},{"id":261,"course_slug":"adonet","course_title":"ADO.NET — Connected & Disconnected Data Access","ord":14,"level":"Advanced","priority":"Medium","question":"How do you handle transient errors (e.g. Azure SQL failovers) in ADO.NET?","question_html":"How do you handle transient errors (e.g. Azure SQL failovers) in ADO.NET?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use retry logic for transient error numbers (e.g. 40613, 40501, 40197, 10928/10929, 4060, 49918–49920, timeouts): SqlClient&#39;s configurable retry logic (<code>SqlRetryLogicBaseProvider</code> via <code>RetryLogicProvider</code> on the connection/command), Polly with exponential backoff, or EF Core&#39;s <code>EnableRetryOnFailure</code>.</p>\n<ul class=\"q-points\"><li>Only retry idempotent operations or whole transactions, and keep <code>Connect Retry Count</code> for idle connection resiliency.</li></ul>\n"},{"id":262,"course_slug":"adonet","course_title":"ADO.NET — Connected & Disconnected Data Access","ord":15,"level":"Advanced","priority":"Medium","question":"How would you pass a list of 5,000 IDs to a SQL query efficiently?","question_html":"How would you pass a list of 5,000 IDs to a SQL query efficiently?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Options: a <strong>table-valued parameter</strong> (TVP;</p>\n<ul class=\"q-points\"><li>best for SQL Server;</li><li>plan-stable), <code>STRING_SPLIT</code> on a delimited string or <code>OPENJSON</code> on a JSON array parameter (EF Core 8 does this for <code>Contains</code>), or bulk-insert into a temp/staging table and join.</li><li>Avoid building <code>IN (1,2,3,...)</code> strings — injection risk, plan-cache pollution and the 2,100-parameter limit for individual parameters.</li></ul>\n"},{"id":265,"course_slug":"adonet","course_title":"ADO.NET — Connected & Disconnected Data Access","ord":18,"level":"Scenario","priority":"Medium","question":"A query is fast in SSMS but slow from the application. Why?","question_html":"A query is fast in SSMS but slow from the application. Why?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Common causes: (1) <strong>different SET options</strong> — SSMS uses <code>ARITHABORT ON</code>, apps usually OFF, so they get different cached plans;</p>\n<ul class=\"q-points\"><li>(2) <strong>parameter sniffing</strong> — the app&#39;s cached plan was compiled for an atypical parameter value;</li><li>(3) parameter <strong>type mismatch</strong> (nvarchar parameter vs varchar column → implicit conversion, scan);</li><li>(4) app reading huge result sets slowly or network latency.</li><li>Investigate with Query Store / actual execution plans, fix types, consider <code>OPTION (RECOMPILE)</code> or <code>OPTIMIZE FOR</code>, update statistics, add proper indexes.</li></ul>\n"},{"id":266,"course_slug":"linq","course_title":"LINQ — Language Integrated Query","ord":1,"level":"Beginner","priority":"High","question":"What is LINQ and what are its advantages?","question_html":"What is LINQ and what are its advantages?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> LINQ (Language Integrated Query, C# 3.0/.NET 3.5) gives a uniform, strongly typed query syntax for in-memory collections, databases (EF Core), XML and more.</p>\n<ul class=\"q-points\"><li>Advantages: compile-time checking and IntelliSense, less boilerplate than loops, readable declarative code, composable queries, deferred execution, and one skill across data sources.</li></ul>\n"},{"id":267,"course_slug":"linq","course_title":"LINQ — Language Integrated Query","ord":2,"level":"Beginner","priority":"High","question":"What is deferred execution? Which operators execute immediately?","question_html":"What is deferred execution? Which operators execute immediately?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A deferred query isn&#39;t executed when defined.</p>\n<ul class=\"q-points\"><li>It runs each time it is enumerated, so it sees the current data.</li><li><code>Where</code>, <code>Select</code>, <code>OrderBy</code>, <code>GroupBy</code>, <code>Skip</code>/<code>Take</code> and <code>Join</code> are deferred.</li><li><code>ToList</code>, <code>ToArray</code>, <code>ToDictionary</code>, <code>Count</code>, <code>Sum</code>, <code>Max</code>, <code>First</code>, <code>Single</code>, <code>Any</code>, <code>All</code> and <code>Aggregate</code> execute immediately.</li><li>Pitfalls: enumerating the same query twice runs it twice; captured variables are read at execution time, not definition time.</li></ul>\n"},{"id":268,"course_slug":"linq","course_title":"LINQ — Language Integrated Query","ord":3,"level":"Beginner","priority":"High","question":"What is the difference between First, FirstOrDefault, Single and SingleOrDefault?","question_html":"What is the difference between First, FirstOrDefault, Single and SingleOrDefault?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>First</code> returns the first match and throws if there are none.</p>\n<ul class=\"q-points\"><li><code>FirstOrDefault</code> returns default/null if there are none.</li><li><code>Single</code> expects <strong>exactly one</strong> match and throws for none or several.</li><li><code>SingleOrDefault</code> returns default for none and throws for several.</li><li>Use <code>Single</code> when duplicates would indicate a data bug (unique keys).</li><li>Use <code>First</code> with an <code>OrderBy</code> for &quot;top 1&quot;.</li><li>In EF, <code>Single</code> fetches 2 rows to check uniqueness.</li></ul>\n"},{"id":269,"course_slug":"linq","course_title":"LINQ — Language Integrated Query","ord":4,"level":"Beginner","priority":"High","question":"What is the difference between Select and SelectMany?","question_html":"What is the difference between Select and SelectMany?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>Select</code> projects each element to exactly one result; if the result is a collection you get nested collections.</p>\n<ul class=\"q-points\"><li><code>SelectMany</code> projects each element to a sequence and <strong>flattens</strong> them into one sequence.</li><li>Example: <code>orders.Select(o =&gt; o.Lines)</code> gives <code>IEnumerable&lt;List&lt;Line&gt;&gt;</code>, while <code>orders.SelectMany(o =&gt; o.Lines)</code> gives <code>IEnumerable&lt;Line&gt;</code>.</li></ul>\n"},{"id":270,"course_slug":"linq","course_title":"LINQ — Language Integrated Query","ord":5,"level":"Beginner","priority":"High","question":"What is the difference between IEnumerable and IQueryable?","question_html":"What is the difference between IEnumerable and IQueryable?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>IEnumerable&lt;T&gt;</code> executes in memory with compiled delegates (LINQ to Objects).</p>\n<ul class=\"q-points\"><li><code>IQueryable&lt;T&gt;</code> builds an expression tree that a provider (EF Core) translates into SQL and executes in the database.</li><li>Filtering an <code>IQueryable</code> reduces the rows transferred; casting a <code>DbSet</code> to <code>IEnumerable</code> before <code>Where</code> loads the whole table into memory.</li><li>Keep queries as <code>IQueryable</code> until the final materialisation.</li></ul>\n"},{"id":272,"course_slug":"linq","course_title":"LINQ — Language Integrated Query","ord":7,"level":"Intermediate","priority":"High","question":"How do you perform a left outer join in LINQ?","question_html":"How do you perform a left outer join in LINQ?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Before .NET 10: <code>GroupJoin</code> followed by <code>SelectMany</code> with <code>DefaultIfEmpty()</code>.</p>\n<ul class=\"q-points\"><li>In query syntax: `join o in orders on c.Id equals o.CustomerId into g from o in g.DefaultIfEmpty() select new { c.Name, Total = o == null ?</li><li>0 : o.Total }<code>. .NET 10 adds a </code>LeftJoin<code>operator, and EF Core 10 translates it to</code>LEFT JOIN`.</li><li>In EF Core you often don&#39;t need explicit joins at all: navigation properties generate them.</li></ul>\n"},{"id":273,"course_slug":"linq","course_title":"LINQ — Language Integrated Query","ord":8,"level":"Intermediate","priority":"High","question":"Write a LINQ query to find the second highest salary.","question_html":"Write a LINQ query to find the second highest salary.","answer_html":"<div class=\"code-block\"><span class=\"code-lang\">csharp</span><button class=\"copy-btn\" type=\"button\" data-copy>Copy</button><pre><code class=\"hljs\"><span class=\"hljs-keyword\">var</span> second = employees.Select(e =&gt; e.Salary).Distinct()\n                      .OrderByDescending(s =&gt; s).Skip(<span class=\"hljs-number\">1</span>).FirstOrDefault();\n<span class=\"hljs-comment\">// Nth highest: .Skip(n - 1)</span>\n<span class=\"hljs-comment\">// with ties (employees having that salary):</span>\n<span class=\"hljs-keyword\">var</span> who = employees.Where(e =&gt; e.Salary == second);</code></pre></div>\n"},{"id":274,"course_slug":"linq","course_title":"LINQ — Language Integrated Query","ord":9,"level":"Intermediate","priority":"High","question":"How do you group data and get counts or sums per group?","question_html":"How do you group data and get counts or sums per group?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>GroupBy(key)</code> followed by <code>Select(g =&gt; new { g.Key, Count = g.Count(), Total = g.Sum(x =&gt; x.Amount) })</code>.</p>\n<ul class=\"q-points\"><li>Group by multiple keys with an anonymous type: <code>GroupBy(o =&gt; new { o.CustomerId, o.Date.Year })</code>.</li><li>Filter groups with <code>Where</code> after grouping (like SQL <code>HAVING</code>). .NET 9 adds <code>CountBy</code> and <code>AggregateBy</code> for the common cases.</li></ul>\n"},{"id":275,"course_slug":"linq","course_title":"LINQ — Language Integrated Query","ord":10,"level":"Intermediate","priority":"High","question":"What is the difference between Any() and Count() > 0?","question_html":"What is the difference between <code>Any()</code> and <code>Count() &gt; 0</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>Any()</code> stops at the first element (O(1) for most sequences); in EF it generates <code>EXISTS</code>, which is efficient.</p>\n<ul class=\"q-points\"><li><code>Count()</code> enumerates everything (for non-collections) or runs <code>COUNT(*)</code> over all matching rows.</li><li>Use <code>Any()</code> to check existence.</li><li>(For <code>ICollection&lt;T&gt;</code>, <code>Count()</code> uses the <code>Count</code> property, but <code>Any()</code> is still clearer.)</li></ul>\n"},{"id":279,"course_slug":"linq","course_title":"LINQ — Language Integrated Query","ord":14,"level":"Advanced","priority":"High","question":"What are expression trees and why does EF Core need them?","question_html":"What are expression trees and why does EF Core need them?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> An expression tree (<code>Expression&lt;Func&lt;T,bool&gt;&gt;</code>) represents code as an inspectable data structure instead of compiled IL.</p>\n<ul class=\"q-points\"><li>EF Core walks the tree to understand the lambda (<code>o =&gt; o.Total &gt; 1000</code>) and translate it into SQL.</li><li>That&#39;s why only translatable constructs work in <code>IQueryable</code> queries.</li><li>You can build expression trees dynamically for runtime filters, or compile them into delegates.</li></ul>\n"},{"id":280,"course_slug":"linq","course_title":"LINQ — Language Integrated Query","ord":15,"level":"Advanced","priority":"High","question":"What is the N+1 problem in LINQ/EF and how do you fix it?","question_html":"What is the N+1 problem in LINQ/EF and how do you fix it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> One query loads N parent rows, then accessing a navigation property per row triggers N extra queries (lazy loading, or querying inside a loop).</p>\n<ul class=\"q-points\"><li>Fix: eager load with <code>Include</code>/<code>ThenInclude</code>, project with <code>Select</code> into DTOs (one SQL with joins/subqueries), use <code>AsSplitQuery()</code> for multiple collection includes, or batch-load children with <code>Where(x =&gt; ids.Contains(x.ParentId))</code>.</li><li>Detect it with EF logging, MiniProfiler or Application Insights dependency counts.</li></ul>\n"},{"id":283,"course_slug":"linq","course_title":"LINQ — Language Integrated Query","ord":18,"level":"Scenario","priority":"High","question":"A report screen calls db.Orders.ToList().Where(o => o.CustomerId == id) and is slow with 2 million orders. What's wrong?","question_html":"A report screen calls <code>db.Orders.ToList().Where(o =&gt; o.CustomerId == id)</code> and is slow with 2 million orders. What&#39;s wrong?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>ToList()</code> executes immediately and loads all 2 million rows into memory, then filters in C#.</p>\n<ul class=\"q-points\"><li>Move the filter before materialisation: <code>await db.Orders.Where(o =&gt; o.CustomerId == id).Select(o =&gt; new OrderDto(...)).ToListAsync()</code>.</li><li>The <code>WHERE</code> then runs in SQL with an index on <code>CustomerId</code>.</li><li>Add paging and <code>AsNoTracking</code>, and project only the needed columns.</li></ul>\n"},{"id":284,"course_slug":"linq","course_title":"LINQ — Language Integrated Query","ord":19,"level":"Scenario","priority":"High","question":"Given a list of employees, write LINQ to return each department's highest-paid employee and the department's average salary.","question_html":"Given a list of employees, write LINQ to return each department&#39;s highest-paid employee and the department&#39;s average salary.","answer_html":"<div class=\"code-block\"><span class=\"code-lang\">csharp</span><button class=\"copy-btn\" type=\"button\" data-copy>Copy</button><pre><code class=\"hljs\"><span class=\"hljs-keyword\">var</span> result = employees\n    .GroupBy(e =&gt; e.Department)\n    .Select(g =&gt; <span class=\"hljs-keyword\">new</span>\n    {\n        Department = g.Key,\n        TopEarner = g.MaxBy(e =&gt; e.Salary)!.Name,\n        AverageSalary = g.Average(e =&gt; e.Salary),\n        Headcount = g.Count()\n    })\n    .OrderByDescending(x =&gt; x.AverageSalary);</code></pre></div>\n<p>For ties at the top, use <code>g.Where(e =&gt; e.Salary == g.Max(x =&gt; x.Salary))</code>.</p>\n"},{"id":271,"course_slug":"linq","course_title":"LINQ — Language Integrated Query","ord":6,"level":"Beginner","priority":"Medium","question":"Query syntax vs method syntax — which is better?","question_html":"Query syntax vs method syntax — which is better?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> They compile to the same method calls.</p>\n<ul class=\"q-points\"><li>Query syntax reads like SQL and is convenient for joins, <code>let</code> and grouping.</li><li>Method syntax supports every operator (<code>Count</code>, <code>Distinct</code>, <code>Take</code>, <code>Any</code>...) and is more common in codebases.</li><li>They can be mixed: <code>(from p in products where p.Stock &gt; 0 select p).Count()</code>.</li></ul>\n"},{"id":276,"course_slug":"linq","course_title":"LINQ — Language Integrated Query","ord":11,"level":"Intermediate","priority":"Medium","question":"What is the difference between ToList(), ToArray(), ToDictionary() and ToLookup()?","question_html":"What is the difference between <code>ToList()</code>, <code>ToArray()</code>, <code>ToDictionary()</code> and <code>ToLookup()</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> All materialise immediately.</p>\n<ul class=\"q-points\"><li><code>ToList</code> gives a growable <code>List&lt;T&gt;</code>, <code>ToArray</code> a fixed array (slightly more compact).</li><li><code>ToDictionary(key)</code> maps unique keys to values and <strong>throws on duplicate keys</strong>.</li><li><code>ToLookup(key)</code> groups into a key → many-values structure, allows duplicates, and returns an empty sequence for missing keys.</li></ul>\n"},{"id":277,"course_slug":"linq","course_title":"LINQ — Language Integrated Query","ord":12,"level":"Intermediate","priority":"Medium","question":"What is the difference between Union and Concat? Distinct with custom objects?","question_html":"What is the difference between <code>Union</code> and <code>Concat</code>? <code>Distinct</code> with custom objects?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>Concat</code> appends one sequence to another, keeping duplicates.</p>\n<ul class=\"q-points\"><li><code>Union</code> returns distinct elements from both.</li><li>For classes, <code>Distinct</code>/<code>Union</code> use default equality (reference equality unless <code>Equals</code>/<code>GetHashCode</code> are overridden).</li><li>Use records, implement <code>IEquatable&lt;T&gt;</code>, pass an <code>IEqualityComparer&lt;T&gt;</code>, or use <code>DistinctBy</code>/<code>UnionBy</code> (.NET 6).</li></ul>\n"},{"id":278,"course_slug":"linq","course_title":"LINQ — Language Integrated Query","ord":13,"level":"Intermediate","priority":"Medium","question":"What does let do in query syntax?","question_html":"What does <code>let</code> do in query syntax?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> It introduces a range variable that stores an intermediate calculation, so you don&#39;t repeat it: <code>from p in products let discounted = p.Price * 0.9m where discounted &gt; 1000 select new { p.Name, discounted }</code>.</p>\n<ul class=\"q-points\"><li>It compiles to a <code>Select</code> into an anonymous type.</li></ul>\n"},{"id":281,"course_slug":"linq","course_title":"LINQ — Language Integrated Query","ord":16,"level":"Advanced","priority":"Medium","question":"Why might a LINQ query throw \"could not be translated\"?","question_html":"Why might a LINQ query throw &quot;could not be translated&quot;?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The expression contains something the provider can&#39;t convert to SQL: a custom C# method, an unsupported .NET method, complex client-side logic, or certain <code>GroupBy</code> shapes.</p>\n<ul class=\"q-points\"><li>EF Core 3.0+ throws instead of silently evaluating on the client (except in the final projection).</li><li>Fix: rewrite with translatable operations, move the logic after <code>AsEnumerable()</code>/<code>ToListAsync()</code> (only after filtering), map a DB function (<code>HasDbFunction</code>) or use raw SQL.</li></ul>\n"},{"id":282,"course_slug":"linq","course_title":"LINQ — Language Integrated Query","ord":17,"level":"Advanced","priority":"Medium","question":"When would you use PLINQ, and when not?","question_html":"When would you use PLINQ, and when not?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> For CPU-bound operations on large in-memory collections where each element&#39;s work is independent (image processing, heavy calculations): <code>AsParallel()</code> spreads the work across cores.</p>\n<ul class=\"q-points\"><li>Not for I/O-bound work (use async with <code>Task.WhenAll</code>/<code>Parallel.ForEachAsync</code>), small collections (overhead dominates), order-sensitive results (unless <code>AsOrdered</code>, which costs), or code with shared mutable state (race conditions).</li></ul>\n"},{"id":285,"course_slug":"linq","course_title":"LINQ — Language Integrated Query","ord":20,"level":"Scenario","priority":"Medium","question":"Find duplicate emails in a customer list and keep only the first record of each.","question_html":"Find duplicate emails in a customer list and keep only the first record of each.","answer_html":"<div class=\"code-block\"><span class=\"code-lang\">csharp</span><button class=\"copy-btn\" type=\"button\" data-copy>Copy</button><pre><code class=\"hljs\"><span class=\"hljs-keyword\">var</span> duplicates = customers.GroupBy(c =&gt; c.Email.ToLowerInvariant())\n                          .Where(g =&gt; g.Count() &gt; <span class=\"hljs-number\">1</span>)\n                          .Select(g =&gt; <span class=\"hljs-keyword\">new</span> { Email = g.Key, Count = g.Count() });\n\n<span class=\"hljs-keyword\">var</span> deduped = customers.DistinctBy(c =&gt; c.Email.ToLowerInvariant()).ToList();   <span class=\"hljs-comment\">// keeps first occurrence</span>\n<span class=\"hljs-comment\">// pre-.NET 6: customers.GroupBy(c =&gt; c.Email).Select(g =&gt; g.First())</span></code></pre></div>\n"},{"id":286,"course_slug":"linq","course_title":"LINQ — Language Integrated Query","ord":21,"level":"Scenario","priority":"Medium","question":"A method returns IEnumerable<Order> from a DB query, and two foreach loops over it hit the database twice. Why, and how do you fix it?","question_html":"A method returns <code>IEnumerable&lt;Order&gt;</code> from a DB query, and two <code>foreach</code> loops over it hit the database twice. Why, and how do you fix it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The method returns a deferred query, so each enumeration executes it again (two SQL round trips, possibly different results).</p>\n<ul class=\"q-points\"><li>Materialise once with <code>ToList()</code>/<code>ToListAsync()</code>, and return <code>IReadOnlyList&lt;Order&gt;</code> to make it explicit.</li><li>Analyzers (CA1851, ReSharper&#39;s &quot;possible multiple enumeration&quot;) warn about this.</li></ul>\n"},{"id":287,"course_slug":"efcore","course_title":"Entity Framework (EF6 & EF Core)","ord":1,"level":"Beginner","priority":"High","question":"What is Entity Framework Core and what are its advantages?","question_html":"What is Entity Framework Core and what are its advantages?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> An open-source, cross-platform ORM that maps C# classes to database tables.</p>\n<ul class=\"q-points\"><li>You query with LINQ and EF generates parameterised SQL, tracks changes and saves them in a transaction.</li><li>Advantages: productivity (less data-access boilerplate), strong typing and compile-time checks, migrations for schema evolution, multiple DB providers, built-in protection from SQL injection, relationships and change tracking handled for you.</li><li>Trade-offs: generated SQL must be monitored for performance; complex reports may be better in raw SQL/Dapper.</li></ul>\n"},{"id":288,"course_slug":"efcore","course_title":"Entity Framework (EF6 & EF Core)","ord":2,"level":"Beginner","priority":"High","question":"Code-first vs database-first?","question_html":"Code-first vs database-first?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Code-first: you design entity classes and DbContext; migrations create and evolve the schema — the model is the source of truth (common for new projects).</p>\n<ul class=\"q-points\"><li>Database-first: the database exists (or DBAs own it);</li><li>you scaffold entities and context from it with <code>dotnet ef dbcontext scaffold</code> and re-scaffold when the schema changes.</li><li>EF Core has no EDMX designer (that was EF6).</li></ul>\n"},{"id":289,"course_slug":"efcore","course_title":"Entity Framework (EF6 & EF Core)","ord":3,"level":"Beginner","priority":"High","question":"What is DbContext? Is it thread-safe? What lifetime should it have?","question_html":"What is DbContext? Is it thread-safe? What lifetime should it have?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> DbContext represents a session with the database: it holds DbSets, the change tracker, configuration, and implements unit of work (<code>SaveChanges</code>).</p>\n<ul class=\"q-points\"><li>It is <strong>not thread-safe</strong> — never share it across concurrent operations (no parallel <code>await</code>s on the same context).</li><li>Register it <strong>scoped</strong> in ASP.NET Core (one per request) and keep it short-lived; use <code>IDbContextFactory</code> for background services, Blazor Server or parallel work.</li></ul>\n"},{"id":290,"course_slug":"efcore","course_title":"Entity Framework (EF6 & EF Core)","ord":4,"level":"Beginner","priority":"High","question":"What are migrations? What commands do you use?","question_html":"What are migrations? What commands do you use?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Migrations are versioned C# files describing schema changes (Up/Down), generated by comparing the current model with the model snapshot.</p>\n<ul class=\"q-points\"><li>Commands: <code>dotnet ef migrations add &lt;Name&gt;</code>, <code>dotnet ef database update [target]</code>, <code>dotnet ef migrations remove</code>, <code>dotnet ef migrations list</code>, <code>dotnet ef migrations script --idempotent</code>, <code>dotnet ef migrations bundle</code>.</li><li>Applied migrations are recorded in <code>__EFMigrationsHistory</code>.</li></ul>\n"},{"id":291,"course_slug":"efcore","course_title":"Entity Framework (EF6 & EF Core)","ord":5,"level":"Beginner","priority":"High","question":"What is the difference between eager, lazy and explicit loading?","question_html":"What is the difference between eager, lazy and explicit loading?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Eager: related data loaded in the same query with <code>Include</code>/<code>ThenInclude</code>.</p>\n<ul class=\"q-points\"><li>Explicit: load later on demand with <code>Entry(x).Collection(...).Load()</code> / <code>.Reference(...).Load()</code>.</li><li>Lazy: navigation properties load automatically on first access (needs proxies or <code>ILazyLoader</code>, virtual navigations) — convenient but causes hidden N+1 queries.</li><li>Projections (<code>Select</code>) are often better than any of them for read models.</li></ul>\n"},{"id":293,"course_slug":"efcore","course_title":"Entity Framework (EF6 & EF Core)","ord":7,"level":"Intermediate","priority":"High","question":"What is change tracking? What is AsNoTracking?","question_html":"What is change tracking? What is AsNoTracking?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> When EF loads entities it keeps a snapshot of their original values.</p>\n<ul class=\"q-points\"><li>On <code>SaveChanges</code>, <code>DetectChanges</code> compares current vs original values and generates UPDATEs for changed columns; entity states drive INSERT/DELETE.</li><li><code>AsNoTracking()</code> skips this — faster and less memory for read-only queries, but changes to those objects won&#39;t be saved unless you attach them.</li></ul>\n"},{"id":294,"course_slug":"efcore","course_title":"Entity Framework (EF6 & EF Core)","ord":8,"level":"Intermediate","priority":"High","question":"Explain entity states in EF Core.","question_html":"Explain entity states in EF Core.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Detached (not tracked), Added (INSERT on save), Unchanged (loaded, no changes), Modified (UPDATE on save), Deleted (DELETE on save).</p>\n<ul class=\"q-points\"><li>Inspect/set with <code>db.Entry(entity).State</code>.</li><li><code>Attach</code> → Unchanged; <code>Update</code> → Modified (all properties); <code>Add</code> → Added; <code>Remove</code> → Deleted (or detached if it was Added).</li><li>After a successful save, Added/Modified become Unchanged and Deleted become Detached.</li></ul>\n"},{"id":295,"course_slug":"efcore","course_title":"Entity Framework (EF6 & EF Core)","ord":9,"level":"Intermediate","priority":"High","question":"What is the N+1 problem and how do you avoid it in EF Core?","question_html":"What is the N+1 problem and how do you avoid it in EF Core?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Loading N parent entities with one query and then triggering one query per parent for its related data (usually lazy loading in a loop or view).</p>\n<ul class=\"q-points\"><li>Avoid by eager loading (<code>Include</code>), projecting into DTOs with the needed related fields in one query, using <code>AsSplitQuery</code> when including collections, and disabling lazy loading.</li><li>Detect via SQL logging or profilers showing many similar queries.</li></ul>\n"},{"id":296,"course_slug":"efcore","course_title":"Entity Framework (EF6 & EF Core)","ord":10,"level":"Intermediate","priority":"High","question":"How does EF Core handle concurrency?","question_html":"How does EF Core handle concurrency?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Optimistic concurrency via concurrency tokens: a <code>[Timestamp]</code>/<code>IsRowVersion()</code> <code>rowversion</code> column (SQL Server updates it automatically) or <code>IsConcurrencyToken()</code> on specific properties.</p>\n<ul class=\"q-points\"><li>EF adds the original value to the UPDATE/DELETE <code>WHERE</code> clause;</li><li>if 0 rows are affected it throws <code>DbUpdateConcurrencyException</code>, which you handle by reloading, overwriting (client wins) or merging.</li><li>No database locks are held between read and write.</li></ul>\n"},{"id":297,"course_slug":"efcore","course_title":"Entity Framework (EF6 & EF Core)","ord":11,"level":"Intermediate","priority":"High","question":"How do you configure relationships? Data annotations vs Fluent API?","question_html":"How do you configure relationships? Data annotations vs Fluent API?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> By convention (navigation properties + <code>XxxId</code> FK), data annotations (<code>[ForeignKey]</code>, <code>[InverseProperty]</code>, <code>[Required]</code>), or Fluent API (<code>HasOne/WithMany/HasForeignKey/OnDelete</code>).</p>\n<ul class=\"q-points\"><li>Fluent API has the highest precedence, keeps domain classes free of persistence attributes and supports everything (composite keys, indexes, delete behaviour, owned types, filters).</li><li>Organise it in <code>IEntityTypeConfiguration&lt;T&gt;</code> classes.</li></ul>\n"},{"id":301,"course_slug":"efcore","course_title":"Entity Framework (EF6 & EF Core)","ord":15,"level":"Advanced","priority":"High","question":"How do you improve EF Core query performance?","question_html":"How do you improve EF Core query performance?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Project only needed columns;</p>\n<ul class=\"q-points\"><li><code>AsNoTracking</code>;</li><li>avoid N+1 and lazy loading;</li><li><code>AsSplitQuery</code> for multiple collection includes;</li><li>paginate;</li><li>add indexes for filters and sorts;</li><li>set-based <code>ExecuteUpdate/Delete</code>;</li><li>compiled queries and DbContext pooling for hot paths;</li><li>check generated SQL and execution plans;</li><li>avoid client evaluation;</li><li>batch writes;</li><li>keep contexts small;</li><li>cache read-mostly data;</li><li>and use Dapper or views/stored procedures for complex reporting queries.</li></ul>\n"},{"id":304,"course_slug":"efcore","course_title":"Entity Framework (EF6 & EF Core)","ord":18,"level":"Scenario","priority":"High","question":"A page listing 50 orders takes 5 seconds and the log shows 51 SQL queries. Fix it.","question_html":"A page listing 50 orders takes 5 seconds and the log shows 51 SQL queries. Fix it.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Classic N+1: one query for orders and one per order for its customer (lazy loading).</p>\n<ul class=\"q-points\"><li>Replace with a single projection: <code>db.Orders.AsNoTracking().OrderByDescending(o =&gt; o.CreatedAt).Take(50).Select(o =&gt; new OrderRow(o.Id, o.Customer.Name, o.Total)).ToListAsync()</code> → one SQL with a JOIN.</li><li>Disable lazy loading globally, add an index on <code>CreatedAt</code>, and confirm with logging that only one query runs.</li></ul>\n"},{"id":305,"course_slug":"efcore","course_title":"Entity Framework (EF6 & EF Core)","ord":19,"level":"Scenario","priority":"High","question":"Two users edit the same product price at the same time and the later save silently overwrites the earlier one. How do you prevent lost updates?","question_html":"Two users edit the same product price at the same time and the later save silently overwrites the earlier one. How do you prevent lost updates?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Add a <code>rowversion</code> concurrency token (<code>[Timestamp] byte[] RowVersion</code>).</p>\n<ul class=\"q-points\"><li>Send the RowVersion to the client with the data and back on update;</li><li>set it as the original value (<code>db.Entry(p).Property(x =&gt; x.RowVersion).OriginalValue = dto.RowVersion</code>).</li><li>If someone else saved first, EF throws <code>DbUpdateConcurrencyException</code>;</li><li>return <strong>409 Conflict</strong> (or 412 with ETags) with the current values so the user can review and retry.</li></ul>\n"},{"id":306,"course_slug":"efcore","course_title":"Entity Framework (EF6 & EF Core)","ord":20,"level":"Scenario","priority":"High","question":"You need to delete 5 million log rows older than 90 days nightly without blocking the app. What do you do?","question_html":"You need to delete 5 million log rows older than 90 days nightly without blocking the app. What do you do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Don&#39;t load entities.</p>\n<ul class=\"q-points\"><li>Use <code>ExecuteDeleteAsync</code> in <strong>batches</strong> (e.g. loop deleting <code>Take(10_000)</code> by key range or <code>TOP (10000)</code> raw SQL until 0 rows) to keep transactions small and avoid lock escalation and log growth;</li><li>run off-peak via a background job;</li><li>ensure an index on the date column.</li><li>Better long-term: <strong>table partitioning</strong> by month and <code>TRUNCATE</code>/switch out old partitions, or a retention policy in a time-series store.</li></ul>\n"},{"id":292,"course_slug":"efcore","course_title":"Entity Framework (EF6 & EF Core)","ord":6,"level":"Beginner","priority":"Medium","question":"What is the difference between Find and FirstOrDefault?","question_html":"What is the difference between <code>Find</code> and <code>FirstOrDefault</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>Find(key)</code> looks up by primary key and first checks the <strong>change tracker</strong> — if the entity is already tracked, no DB query is sent.</p>\n<ul class=\"q-points\"><li><code>FirstOrDefault(predicate)</code> always queries the database (with any predicate) and supports <code>Include</code>/ordering.</li><li><code>Find</code> can&#39;t use <code>Include</code>.</li></ul>\n"},{"id":298,"course_slug":"efcore","course_title":"Entity Framework (EF6 & EF Core)","ord":12,"level":"Intermediate","priority":"Medium","question":"What are global query filters? Give use cases.","question_html":"What are global query filters? Give use cases.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> LINQ predicates configured per entity type in <code>OnModelCreating</code> (<code>HasQueryFilter</code>) that EF automatically adds to every query for that type — e.g. soft delete (<code>!IsDeleted</code>) and multi-tenancy (<code>TenantId == currentTenant</code>).</p>\n<ul class=\"q-points\"><li>Bypass with <code>IgnoreQueryFilters()</code>.</li><li>EF Core 10 adds named filters so you can disable them individually.</li></ul>\n"},{"id":299,"course_slug":"efcore","course_title":"Entity Framework (EF6 & EF Core)","ord":13,"level":"Intermediate","priority":"Medium","question":"How do you execute raw SQL or stored procedures in EF Core?","question_html":"How do you execute raw SQL or stored procedures in EF Core?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>FromSql($&quot;...&quot;)</code> (interpolated → parameterised) or <code>FromSqlRaw(sql, params)</code> on a DbSet returns entities and can be composed with LINQ (if the SQL is composable).</p>\n<ul class=\"q-points\"><li><code>Database.SqlQuery&lt;T&gt;($&quot;...&quot;)</code> returns unmapped types (EF 8).</li><li><code>Database.ExecuteSql($&quot;...&quot;)</code>/<code>ExecuteSqlRaw</code> for non-queries/stored procedures.</li><li>Never concatenate user input into the raw variants.</li></ul>\n"},{"id":300,"course_slug":"efcore","course_title":"Entity Framework (EF6 & EF Core)","ord":14,"level":"Intermediate","priority":"Medium","question":"What are ExecuteUpdate and ExecuteDelete?","question_html":"What are ExecuteUpdate and ExecuteDelete?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> EF Core 7 set-based operations that translate directly into a single <code>UPDATE</code>/`DELETE ...</p>\n<ul class=\"q-points\"><li>WHERE<code>statement without loading entities into memory or using the change tracker — e.g.</code>db.Orders.Where(o =&gt; o.Expired).ExecuteDeleteAsync()`.</li><li>Much faster for bulk changes.</li><li>Caveats: they run immediately (not part of <code>SaveChanges</code> unless inside an explicit transaction) and tracked entities aren&#39;t updated.</li></ul>\n"},{"id":302,"course_slug":"efcore","course_title":"Entity Framework (EF6 & EF Core)","ord":16,"level":"Advanced","priority":"Medium","question":"What is the difference between Update() and attaching then setting properties?","question_html":"What is the difference between <code>Update()</code> and attaching then setting properties?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>db.Update(entity)</code> attaches a detached entity and marks <strong>all</strong> properties as Modified → UPDATE writes every column (can overwrite concurrent changes in other columns).</p>\n<ul class=\"q-points\"><li>Loading the entity and setting properties (or <code>Attach</code> + marking specific properties <code>IsModified = true</code>) updates only changed columns.</li><li>In APIs, prefer loading → mapping the DTO onto the tracked entity → saving, with a concurrency token.</li></ul>\n"},{"id":303,"course_slug":"efcore","course_title":"Entity Framework (EF6 & EF Core)","ord":17,"level":"Advanced","priority":"Medium","question":"EF Core vs EF6 — key differences?","question_html":"EF Core vs EF6 — key differences?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> EF Core: cross-platform, lighter, faster, supports more DB providers incl. Cosmos, has features like global query filters, <code>ExecuteUpdate</code>, JSON columns, compiled models, split queries;</p>\n<ul class=\"q-points\"><li>no EDMX designer, no ObjectContext.</li><li>EF6: .NET Framework-centric (also runs on .NET Core 3.1+), EDMX/database-first designer, mature but maintenance only.</li><li>New development should use EF Core.</li></ul>\n"},{"id":307,"course_slug":"efcore","course_title":"Entity Framework (EF6 & EF Core)","ord":21,"level":"Scenario","priority":"Medium","question":"Deploying a migration renamed a column and dropped production data. How do you prevent this?","question_html":"Deploying a migration renamed a column and dropped production data. How do you prevent this?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> EF scaffolded the rename as drop + add.</p>\n<ul class=\"q-points\"><li>Prevention: always review generated migrations;</li><li>use <code>migrationBuilder.RenameColumn</code> explicitly (or <code>HasColumnName</code> to keep the DB name);</li><li>apply schema changes through reviewed <strong>idempotent SQL scripts</strong> in the pipeline with a DBA/peer review;</li><li>take backups before deploying;</li><li>use expand-contract (add new column → backfill → switch code → drop old later) for zero-downtime changes;</li><li>test migrations against a production-like copy.</li></ul>\n"},{"id":308,"course_slug":"efcore","course_title":"Entity Framework (EF6 & EF Core)","ord":22,"level":"Scenario","priority":"Medium","question":"A BackgroundService throws \"A second operation was started on this context instance before a previous operation completed.\" Why?","question_html":"A BackgroundService throws &quot;A second operation was started on this context instance before a previous operation completed.&quot; Why?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The same DbContext was used concurrently — e.g. parallel tasks (<code>Task.WhenAll</code>) or a singleton service holding one context.</p>\n<ul class=\"q-points\"><li>DbContext isn&#39;t thread-safe.</li><li>Fix: create a new scope/context per unit of work (<code>IServiceScopeFactory</code> or <code>IDbContextFactory&lt;T&gt;.CreateDbContext()</code> per task), and <code>await</code> each operation before starting the next on the same context.</li></ul>\n"},{"id":309,"course_slug":"efcore","course_title":"Entity Framework (EF6 & EF Core)","ord":23,"level":"Intermediate","priority":"Medium","question":"What is the difference between DbContext and ObjectContext?","question_html":"What is the difference between DbContext and ObjectContext?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>ObjectContext</code> was the original Entity Framework (EF 1–4) API: verbose, tied to EDMX models and <code>ObjectSet&lt;T&gt;</code>.</p>\n<ul class=\"q-points\"><li><code>DbContext</code> (EF 4.1+) is a simpler, lightweight wrapper over ObjectContext with <code>DbSet&lt;T&gt;</code>, Code First, change tracking via <code>ChangeTracker</code> and easy configuration;</li><li>you could still reach the ObjectContext through <code>IObjectContextAdapter</code> in EF6.</li><li>EF Core has only <code>DbContext</code> — ObjectContext doesn&#39;t exist there.</li></ul>\n"},{"id":310,"course_slug":"dapper","course_title":"Dapper — The Micro-ORM from Basics to Advanced","ord":1,"level":"Beginner","priority":"High","question":"What is Dapper and why use it?","question_html":"What is Dapper and why use it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A micro-ORM: extension methods on <code>IDbConnection</code> that execute SQL you write and map result rows to objects automatically.</p>\n<ul class=\"q-points\"><li>It&#39;s almost as fast as raw ADO.NET with far less code, gives full control over SQL (stored procedures, CTEs, window functions), and has no change tracking or migrations.</li><li>Ideal for read-heavy and performance-critical data access and for teams comfortable with SQL.</li></ul>\n"},{"id":311,"course_slug":"dapper","course_title":"Dapper — The Micro-ORM from Basics to Advanced","ord":2,"level":"Beginner","priority":"High","question":"Dapper vs Entity Framework Core?","question_html":"Dapper vs Entity Framework Core?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Dapper: you write SQL; minimal overhead; no change tracking, relationships, migrations or LINQ translation — perfect for reports and tuned queries.</p>\n<ul class=\"q-points\"><li>EF Core: LINQ queries translated to SQL, change tracking and <code>SaveChanges</code>, relationships, migrations, interceptors — faster to build CRUD and domain models, some overhead.</li><li>Many projects use both: EF Core for writes, Dapper for complex reads.</li></ul>\n"},{"id":312,"course_slug":"dapper","course_title":"Dapper — The Micro-ORM from Basics to Advanced","ord":3,"level":"Beginner","priority":"High","question":"How does Dapper prevent SQL injection?","question_html":"How does Dapper prevent SQL injection?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> When you pass values in the parameter object (<code>new { Id = id }</code>) or <code>DynamicParameters</code>, Dapper creates real <code>DbParameter</code>s, so the database treats them as data, never as SQL.</p>\n<ul class=\"q-points\"><li>Injection is only possible if you concatenate user input into the SQL string — never do that; whitelist identifiers like sort columns.</li></ul>\n"},{"id":313,"course_slug":"dapper","course_title":"Dapper — The Micro-ORM from Basics to Advanced","ord":4,"level":"Beginner","priority":"High","question":"Difference between Query, QueryFirst, QuerySingle and Execute?","question_html":"Difference between Query, QueryFirst, QuerySingle and Execute?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>Query</code> returns all rows (<code>IEnumerable&lt;T&gt;</code>).</p>\n<ul class=\"q-points\"><li><code>QueryFirst</code> returns the first row and throws if none (<code>OrDefault</code> returns default).</li><li><code>QuerySingle</code> expects exactly one row and throws on zero or multiple (<code>OrDefault</code> allows zero).</li><li><code>Execute</code> runs a command and returns the number of affected rows; <code>ExecuteScalar</code> returns the first column of the first row.</li></ul>\n"},{"id":314,"course_slug":"dapper","course_title":"Dapper — The Micro-ORM from Basics to Advanced","ord":5,"level":"Intermediate","priority":"High","question":"How do you call a stored procedure with output parameters in Dapper?","question_html":"How do you call a stored procedure with output parameters in Dapper?","answer_html":"<p>Create <code>DynamicParameters</code>, add inputs and add outputs with <code>direction: ParameterDirection.Output</code> (and <code>ReturnValue</code> if needed), call <code>Query</code>/<code>Execute</code> with <code>commandType: CommandType.StoredProcedure</code>, then read outputs with <code>p.Get&lt;T&gt;(&quot;@Name&quot;)</code> after the results have been consumed.</p>\n"},{"id":315,"course_slug":"dapper","course_title":"Dapper — The Micro-ORM from Basics to Advanced","ord":6,"level":"Intermediate","priority":"High","question":"What is multi-mapping and what does splitOn do?","question_html":"What is multi-mapping and what does splitOn do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Mapping one row from a JOIN into several related objects: <code>Query&lt;Order, Customer, Order&gt;(sql, (o, c) =&gt; { o.Customer = c; return o; }, splitOn: &quot;Id&quot;)</code>.</p>\n<ul class=\"q-points\"><li><code>splitOn</code> tells Dapper at which column the next object&#39;s columns begin (default &quot;Id&quot;).</li><li>For one-to-many, use a dictionary to de-duplicate parent objects and add children.</li></ul>\n"},{"id":316,"course_slug":"dapper","course_title":"Dapper — The Micro-ORM from Basics to Advanced","ord":7,"level":"Intermediate","priority":"High","question":"How do you use transactions with Dapper?","question_html":"How do you use transactions with Dapper?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Open the connection, <code>BeginTransaction</code>, pass the transaction to every Dapper call (<code>transaction: tx</code> or positional argument), <code>Commit</code> on success and <code>Rollback</code> in a catch (or let <code>Dispose</code> roll back).</p>\n<ul class=\"q-points\"><li>For multiple repositories in one operation, share the connection and transaction through a unit-of-work object.</li><li><code>TransactionScope</code> also works (with async flow enabled).</li></ul>\n"},{"id":322,"course_slug":"dapper","course_title":"Dapper — The Micro-ORM from Basics to Advanced","ord":13,"level":"Scenario","priority":"High","question":"A Dapper search endpoint is slow even though the same SQL is fast in SSMS. What could cause it?","question_html":"A Dapper search endpoint is slow even though the same SQL is fast in SSMS. What could cause it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Different parameter types: Dapper sends <code>string</code> as <code>NVARCHAR</code>, and if the column is <code>VARCHAR</code> SQL Server converts the column, preventing an index seek — use <code>DbString { IsAnsi = true }</code>.</p>\n<ul class=\"q-points\"><li>Parameter sniffing: SSMS runs with literal values while the app reuses a plan compiled for different values — check the cached plan;</li><li>consider <code>OPTION (RECOMPILE)</code> or better indexes.</li><li>Also different SET options (ARITHABORT) produce different plans, and the app may be returning far more rows/columns or doing N+1 calls.</li></ul>\n"},{"id":317,"course_slug":"dapper","course_title":"Dapper — The Micro-ORM from Basics to Advanced","ord":8,"level":"Intermediate","priority":"Medium","question":"How do you insert thousands of rows efficiently?","question_html":"How do you insert thousands of rows efficiently?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Not by passing a list to <code>Execute</code> (one round trip per row).</p>\n<ul class=\"q-points\"><li>Use <code>SqlBulkCopy</code> for raw speed, a table-valued parameter to a stored procedure (or <code>MERGE</code>) for set-based logic, or JSON + <code>OPENJSON</code> in one statement.</li><li>Batch very large loads and use transactions appropriately.</li></ul>\n"},{"id":318,"course_slug":"dapper","course_title":"Dapper — The Micro-ORM from Basics to Advanced","ord":9,"level":"Intermediate","priority":"Medium","question":"What is buffered vs unbuffered querying in Dapper?","question_html":"What is buffered vs unbuffered querying in Dapper?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Buffered (default) reads all rows into a list before returning and closes the reader — simple and safe.</p>\n<ul class=\"q-points\"><li>Unbuffered (<code>buffered: false</code> or <code>QueryUnbufferedAsync</code>) yields rows while reading, keeping the reader and connection open until enumeration finishes — lower memory for huge results, but you must finish iterating before using the connection again.</li></ul>\n"},{"id":319,"course_slug":"dapper","course_title":"Dapper — The Micro-ORM from Basics to Advanced","ord":10,"level":"Intermediate","priority":"Medium","question":"How does Dapper map columns to properties and how do you handle mismatched names?","question_html":"How does Dapper map columns to properties and how do you handle mismatched names?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> By name, case-insensitive, to public properties/fields or constructor parameters.</p>\n<ul class=\"q-points\"><li>For mismatches use SQL aliases (<code>SELECT product_name AS Name</code>), <code>DefaultTypeMap.MatchNamesWithUnderscores = true</code>, or a custom type map (<code>SqlMapper.SetTypeMap</code> with <code>CustomPropertyTypeMap</code>).</li><li>Custom value conversions use <code>SqlMapper.TypeHandler&lt;T&gt;</code>.</li></ul>\n"},{"id":320,"course_slug":"dapper","course_title":"Dapper — The Micro-ORM from Basics to Advanced","ord":11,"level":"Advanced","priority":"Medium","question":"How does Dapper achieve its performance?","question_html":"How does Dapper achieve its performance?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> It generates and caches mapping code per (SQL, parameter type, result type) the first time a query runs — IL-emitted delegates that read the data reader directly into objects and write parameters — so later calls avoid reflection.</p>\n<ul class=\"q-points\"><li>It adds very little on top of ADO.NET: no change tracking, no expression translation.</li><li>Dapper.AOT moves this generation to compile time with source generators.</li></ul>\n"},{"id":321,"course_slug":"dapper","course_title":"Dapper — The Micro-ORM from Basics to Advanced","ord":12,"level":"Advanced","priority":"Medium","question":"How do you manage connections with Dapper in ASP.NET Core?","question_html":"How do you manage connections with Dapper in ASP.NET Core?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Register a connection factory (singleton) that creates new <code>SqlConnection</code>s;</p>\n<ul class=\"q-points\"><li>create, use and dispose a connection per operation (<code>await using</code>), relying on connection pooling.</li><li>For multi-step transactions use a scoped unit of work holding one connection and transaction.</li><li>Avoid keeping connections open for the whole request or sharing one connection across threads.</li></ul>\n"},{"id":323,"course_slug":"dapper","course_title":"Dapper — The Micro-ORM from Basics to Advanced","ord":14,"level":"Scenario","priority":"Medium","question":"Your team builds SQL with string interpolation for filters in Dapper. What problems does this cause and how do you fix it?","question_html":"Your team builds SQL with string interpolation for filters in Dapper. What problems does this cause and how do you fix it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> SQL injection risk, no plan reuse in SQL Server and an ever-growing Dapper query cache (each distinct SQL string is cached) → memory growth.</p>\n<ul class=\"q-points\"><li>Fix: parameterise all values, build optional filters with <code>WHERE (@x IS NULL OR Col = @x)</code> or a safe builder (DapperQueryBuilder / <code>SqlBuilder</code>) that appends parameterised fragments, and whitelist dynamic identifiers.</li></ul>\n"},{"id":324,"course_slug":"dapper","course_title":"Dapper — The Micro-ORM from Basics to Advanced","ord":15,"level":"Scenario","priority":"Medium","question":"How would you migrate a large ADO.NET DataReader-based data layer to Dapper?","question_html":"How would you migrate a large ADO.NET DataReader-based data layer to Dapper?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Keep the SQL and stored procedures;</p>\n<ul class=\"q-points\"><li>replace manual reader loops with <code>Query&lt;T&gt;</code> mapped to DTOs, <code>DynamicParameters</code> for procedures with outputs, and <code>QueryMultiple</code> for multi-result procedures.</li><li>Do it repository by repository behind existing interfaces, with integration tests comparing outputs before and after.</li><li>Watch column-name mismatches and type differences (DBNull handling, decimal/money, dates).</li></ul>\n"},{"id":325,"course_slug":"aspnet-webforms","course_title":"ASP.NET Web Forms — Page Life Cycle, ViewState, Controls and State Management","ord":1,"level":"Beginner","priority":"High","question":"Explain the ASP.NET Web Forms page life cycle.","question_html":"Explain the ASP.NET Web Forms page life cycle.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Page request → start (IsPostBack set) → PreInit (set master/theme, create dynamic controls) → Init (controls initialised) → InitComplete → load ViewState and postback data (postbacks) → PreLoad → Load (page then controls;</p>\n<ul class=\"q-points\"><li>load data in <code>!IsPostBack</code>) → control events (change events, then the Click that caused the postback) → LoadComplete → PreRender (final changes) → SaveStateComplete (ViewState saved) → Render (HTML written) → Unload (cleanup).</li><li>Mnemonic SILVER: Start, Init, Load, Validate, Event, Render.</li></ul>\n"},{"id":326,"course_slug":"aspnet-webforms","course_title":"ASP.NET Web Forms — Page Life Cycle, ViewState, Controls and State Management","ord":2,"level":"Beginner","priority":"High","question":"What is ViewState? Pros and cons?","question_html":"What is ViewState? Pros and cons?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A hidden form field (<code>__VIEWSTATE</code>) holding base64-encoded, MAC-signed state of controls (and your own values) so they survive postbacks of the same page without server memory.</p>\n<ul class=\"q-points\"><li>Pros: automatic, per-page, no server storage.</li><li>Cons: increases page size and request time, not secure by default (only signed, not encrypted), can&#39;t be used across pages.</li><li>Disable it where unnecessary and never store sensitive data.</li></ul>\n"},{"id":327,"course_slug":"aspnet-webforms","course_title":"ASP.NET Web Forms — Page Life Cycle, ViewState, Controls and State Management","ord":3,"level":"Beginner","priority":"High","question":"What is PostBack and IsPostBack?","question_html":"What is PostBack and IsPostBack?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A postback is the form submitting back to the same page so server-side events (button clicks, selection changes) can run.</p>\n<ul class=\"q-points\"><li><code>IsPostBack</code> is false on the first request and true on postbacks — load initial data only when <code>!IsPostBack</code>, otherwise you overwrite the user&#39;s input and waste database calls.</li></ul>\n"},{"id":328,"course_slug":"aspnet-webforms","course_title":"ASP.NET Web Forms — Page Life Cycle, ViewState, Controls and State Management","ord":4,"level":"Beginner","priority":"High","question":"What state management options exist in ASP.NET?","question_html":"What state management options exist in ASP.NET?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Client-side: ViewState, ControlState, hidden fields, cookies, query strings.</p>\n<ul class=\"q-points\"><li>Server-side: Session (InProc, StateServer, SQLServer, custom), Application, Cache, Profile.</li><li>Choose by scope (page, user, all users), size, security and whether it must survive restarts or work in a web farm.</li></ul>\n"},{"id":329,"course_slug":"aspnet-webforms","course_title":"ASP.NET Web Forms — Page Life Cycle, ViewState, Controls and State Management","ord":5,"level":"Beginner","priority":"High","question":"Response.Redirect vs Server.Transfer?","question_html":"Response.Redirect vs Server.Transfer?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>Response.Redirect</code> sends a 302 to the browser, which makes a new request — URL changes, works for any URL, an extra round trip, previous page data lost unless passed.</p>\n<ul class=\"q-points\"><li><code>Server.Transfer</code> switches execution to another page on the server within the same request — URL in the browser stays the same, faster, can access the previous page (<code>PreviousPage</code>), only within the same application.</li></ul>\n"},{"id":330,"course_slug":"aspnet-webforms","course_title":"ASP.NET Web Forms — Page Life Cycle, ViewState, Controls and State Management","ord":6,"level":"Intermediate","priority":"High","question":"What are the Session state modes? Which would you use in a web farm?","question_html":"What are the Session state modes? Which would you use in a web farm?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> InProc (in the worker process memory — fastest, lost on app-pool recycle, not shared), StateServer (aspnet_state service — survives recycles, shared, serialisation needed), SQLServer (stored in SQL — durable, shared, slower), Custom (e.g. Redis provider), Off.</p>\n<ul class=\"q-points\"><li>In a web farm use SQLServer, StateServer or a Redis custom provider (or sticky sessions as a weaker alternative).</li></ul>\n"},{"id":331,"course_slug":"aspnet-webforms","course_title":"ASP.NET Web Forms — Page Life Cycle, ViewState, Controls and State Management","ord":7,"level":"Intermediate","priority":"High","question":"User control vs custom control?","question_html":"User control vs custom control?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A user control (.ascx) is markup + code-behind built visually and reused within one application (registered with <code>@Register Src=</code>).</p>\n<ul class=\"q-points\"><li>A custom (server) control is a class deriving from <code>Control</code>/<code>WebControl</code>/<code>CompositeControl</code> that renders its own HTML, compiled into a DLL, reusable across applications, can appear in the Toolbox and support design-time features — more work to build.</li></ul>\n"},{"id":332,"course_slug":"aspnet-webforms","course_title":"ASP.NET Web Forms — Page Life Cycle, ViewState, Controls and State Management","ord":8,"level":"Intermediate","priority":"High","question":"What are master pages and how do content pages use them?","question_html":"What are master pages and how do content pages use them?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A master page (<code>.master</code>) defines a shared layout with <code>ContentPlaceHolder</code>s; content pages specify <code>MasterPageFile</code> and fill placeholders with <code>&lt;asp:Content&gt;</code>.</p>\n<ul class=\"q-points\"><li>At runtime the master page is merged into the page&#39;s control tree (as a child control).</li><li>Access it with <code>Master</code> (strongly typed via <code>@MasterType</code>), switch it dynamically in <code>PreInit</code>, nest masters for sections.</li></ul>\n"},{"id":333,"course_slug":"aspnet-webforms","course_title":"ASP.NET Web Forms — Page Life Cycle, ViewState, Controls and State Management","ord":9,"level":"Intermediate","priority":"High","question":"What is the role of Global.asax and web.config?","question_html":"What is the role of Global.asax and web.config?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Global.asax holds application-level event handlers: Application_Start/End, Session_Start/End, BeginRequest, AuthenticateRequest, Application_Error.</p>\n<ul class=\"q-points\"><li>Web.config holds hierarchical configuration: connection strings, app settings, authentication/authorization, session, custom errors, modules/handlers, compilation;</li><li>changes restart the app.</li></ul>\n"},{"id":339,"course_slug":"aspnet-webforms","course_title":"ASP.NET Web Forms — Page Life Cycle, ViewState, Controls and State Management","ord":15,"level":"Scenario","priority":"High","question":"A Web Forms page with a big GridView is very slow to post back. How do you fix it?","question_html":"A Web Forms page with a big GridView is very slow to post back. How do you fix it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Measure page size: ViewState of the GridView is likely hundreds of KB.</p>\n<ul class=\"q-points\"><li>Disable ViewState on the grid and rebind on postback, or keep only keys;</li><li>use server-side paging (load only the current page from the database) instead of binding thousands of rows;</li><li>replace UpdatePanels around the grid with lighter AJAX calls if needed;</li><li>cache reference data;</li><li>check SQL queries and session locking.</li></ul>\n"},{"id":340,"course_slug":"aspnet-webforms","course_title":"ASP.NET Web Forms — Page Life Cycle, ViewState, Controls and State Management","ord":16,"level":"Scenario","priority":"High","question":"You must add a new feature to a legacy Web Forms app while the company plans to move to ASP.NET Core. How do you build it?","question_html":"You must add a new feature to a legacy Web Forms app while the company plans to move to ASP.NET Core. How do you build it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Put the business logic in a separate class library (netstandard2.0 or .NET Framework library with clean interfaces) and unit-test it;</p>\n<ul class=\"q-points\"><li>keep code-behind thin, calling services.</li><li>If the feature is a new area, consider building it directly in the new ASP.NET Core app behind a reverse proxy sharing authentication (strangler pattern), so it doesn&#39;t need to be migrated later.</li></ul>\n"},{"id":334,"course_slug":"aspnet-webforms","course_title":"ASP.NET Web Forms — Page Life Cycle, ViewState, Controls and State Management","ord":10,"level":"Intermediate","priority":"Medium","question":"HTTP module vs HTTP handler?","question_html":"HTTP module vs HTTP handler?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Modules (<code>IHttpModule</code>) subscribe to pipeline events and run for every request — authentication, logging, URL rewriting, compression.</p>\n<ul class=\"q-points\"><li>Handlers (<code>IHttpHandler</code>) generate the response for specific requests/extensions — the Page handler for <code>.aspx</code>, <code>.ashx</code> generic handlers for images or files.</li><li>A request passes through many modules but is processed by one handler.</li></ul>\n"},{"id":335,"course_slug":"aspnet-webforms","course_title":"ASP.NET Web Forms — Page Life Cycle, ViewState, Controls and State Management","ord":11,"level":"Intermediate","priority":"Medium","question":"What does an UpdatePanel actually do?","question_html":"What does an UpdatePanel actually do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> It turns a full postback into an asynchronous partial postback: the browser still posts the whole form including ViewState, the server runs the full page life cycle, but only the panel&#39;s markup (and updated ViewState) is returned and replaced.</p>\n<ul class=\"q-points\"><li>It improves perceived responsiveness, not server load.</li><li>For light calls use page methods or Web API with JavaScript.</li></ul>\n"},{"id":336,"course_slug":"aspnet-webforms","course_title":"ASP.NET Web Forms — Page Life Cycle, ViewState, Controls and State Management","ord":12,"level":"Intermediate","priority":"Medium","question":"How do you handle errors globally in Web Forms?","question_html":"How do you handle errors globally in Web Forms?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Try/catch for expected errors in handlers;</p>\n<ul class=\"q-points\"><li><code>Page_Error</code> for page-level handling;</li><li><code>Application_Error</code> in Global.asax to log every unhandled exception (<code>Server.GetLastError()</code>), then <code>customErrors</code>/<code>httpErrors</code> in web.config to show friendly error pages (404, 500) instead of details.</li><li>Use a logging framework or ELMAH.</li></ul>\n"},{"id":337,"course_slug":"aspnet-webforms","course_title":"ASP.NET Web Forms — Page Life Cycle, ViewState, Controls and State Management","ord":13,"level":"Advanced","priority":"Medium","question":"Why does a dynamically added control lose its value or events after postback?","question_html":"Why does a dynamically added control lose its value or events after postback?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Because controls created in code must be recreated on every request, with the same IDs, <strong>early enough</strong> (PreInit/Init) for ViewState and posted data to be applied and events to fire.</p>\n<ul class=\"q-points\"><li>Creating them in Load or only on the first request (<code>!IsPostBack</code>) means the control doesn&#39;t exist when the framework restores state and raises events.</li></ul>\n"},{"id":338,"course_slug":"aspnet-webforms","course_title":"ASP.NET Web Forms — Page Life Cycle, ViewState, Controls and State Management","ord":14,"level":"Advanced","priority":"Medium","question":"What is the difference between a Web Site project and a Web Application project?","question_html":"What is the difference between a Web Site project and a Web Application project?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Web Site: no project file, files compiled dynamically on the server (each page/folder its own assembly), <code>App_Code</code> for shared classes, easy to edit live but harder to manage.</p>\n<ul class=\"q-points\"><li>Web Application: <code>.csproj</code>, compiled ahead into one assembly in <code>bin</code>, designer files, better for builds, refactoring, source control and deployment — the standard for professional projects.</li></ul>\n"},{"id":341,"course_slug":"aspnet-webforms","course_title":"ASP.NET Web Forms — Page Life Cycle, ViewState, Controls and State Management","ord":17,"level":"Scenario","priority":"Medium","question":"Users randomly lose their session (shopping cart) in production. What could cause it?","question_html":"Users randomly lose their session (shopping cart) in production. What could cause it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> InProc session lost when the app pool recycles (scheduled recycling, memory limits, web.config/bin changes, crashes) or when requests hit different servers in a web farm without shared session;</p>\n<ul class=\"q-points\"><li>session timeout too short;</li><li>cookieless/cookie issues.</li><li>Fix: StateServer/SQLServer/Redis session, review recycling settings, store less in session, sticky sessions only as a stop-gap.</li></ul>\n"},{"id":342,"course_slug":"aspnet-mvc5","course_title":"ASP.NET MVC 5 (.NET Framework) — Folder Structure, Request Life Cycle and Features","ord":1,"level":"Beginner","priority":"High","question":"What is MVC? Explain Model, View and Controller.","question_html":"What is MVC? Explain Model, View and Controller.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> An architectural pattern separating concerns: the Model holds data and business rules, the View renders the UI (Razor templates), and the Controller receives requests, works with the model/services and chooses the response.</p>\n<ul class=\"q-points\"><li>Benefits: testable controllers, clean URLs, full HTML control, parallel work on UI and logic.</li></ul>\n"},{"id":343,"course_slug":"aspnet-mvc5","course_title":"ASP.NET MVC 5 (.NET Framework) — Folder Structure, Request Life Cycle and Features","ord":2,"level":"Beginner","priority":"High","question":"Explain the ASP.NET MVC 5 request life cycle.","question_html":"Explain the ASP.NET MVC 5 request life cycle.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Request → IIS/ASP.NET pipeline → UrlRoutingModule matches a route → MvcRouteHandler → MvcHandler → controller factory creates the controller → ControllerActionInvoker selects the action → authentication and authorization filters → model binding and validation → action filters (before) → action executes and returns an ActionResult → action filters (after) → result filters → result executes (ViewResult → Razor view engine finds and renders the view) → response.</p>\n<ul class=\"q-points\"><li>Exception filters handle errors along the way.</li></ul>\n"},{"id":344,"course_slug":"aspnet-mvc5","course_title":"ASP.NET MVC 5 (.NET Framework) — Folder Structure, Request Life Cycle and Features","ord":3,"level":"Beginner","priority":"High","question":"Describe the MVC 5 folder structure.","question_html":"Describe the MVC 5 folder structure.","answer_html":"<p><code>Controllers</code> (classes ending in Controller), <code>Models</code>, <code>Views/&lt;Controller&gt;/&lt;Action&gt;.cshtml</code> with <code>Views/Shared</code> for layouts/partials and <code>_ViewStart.cshtml</code>, <code>App_Start</code> (RouteConfig, FilterConfig, BundleConfig, IdentityConfig), <code>Areas</code> for modules with their own MVC folders, <code>Content</code> (CSS), <code>Scripts</code> (JS), <code>App_Data</code>, <code>Global.asax</code> for startup, <code>Web.config</code> (plus <code>Views/web.config</code> for Razor settings).</p>\n"},{"id":345,"course_slug":"aspnet-mvc5","course_title":"ASP.NET MVC 5 (.NET Framework) — Folder Structure, Request Life Cycle and Features","ord":4,"level":"Beginner","priority":"High","question":"ViewData vs ViewBag vs TempData?","question_html":"ViewData vs ViewBag vs TempData?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> ViewData is a string-keyed dictionary and ViewBag a dynamic wrapper over the same data — both live only for the current request (controller → view).</p>\n<ul class=\"q-points\"><li>TempData survives until it is read in a subsequent request (stored in session by default), so it&#39;s used for messages after a redirect; <code>Keep</code>/<code>Peek</code> retain it longer.</li><li>Prefer strongly typed view models for real data.</li></ul>\n"},{"id":346,"course_slug":"aspnet-mvc5","course_title":"ASP.NET MVC 5 (.NET Framework) — Folder Structure, Request Life Cycle and Features","ord":5,"level":"Beginner","priority":"High","question":"What types of ActionResult are there?","question_html":"What types of ActionResult are there?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> ViewResult (<code>View</code>), PartialViewResult, RedirectResult/RedirectToRouteResult (<code>Redirect</code>, <code>RedirectToAction</code>), JsonResult, ContentResult, FileResult (<code>File</code>), JavaScriptResult, HttpStatusCodeResult/HttpNotFoundResult, EmptyResult.</p>\n<ul class=\"q-points\"><li>Actions can also return plain types, which are converted to ContentResult.</li></ul>\n"},{"id":347,"course_slug":"aspnet-mvc5","course_title":"ASP.NET MVC 5 (.NET Framework) — Folder Structure, Request Life Cycle and Features","ord":6,"level":"Intermediate","priority":"High","question":"What are filters in MVC? Name the types and their order.","question_html":"What are filters in MVC? Name the types and their order.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Attributes/classes that run logic before or after stages of action execution: authentication filters, authorization filters (<code>[Authorize]</code>), action filters (<code>OnActionExecuting/Executed</code>), result filters (<code>OnResultExecuting/Executed</code>) and exception filters (<code>[HandleError]</code>).</p>\n<ul class=\"q-points\"><li>Order: authentication → authorization → action → result, with exception filters on errors; they can be applied globally, per controller or per action.</li></ul>\n"},{"id":348,"course_slug":"aspnet-mvc5","course_title":"ASP.NET MVC 5 (.NET Framework) — Folder Structure, Request Life Cycle and Features","ord":7,"level":"Intermediate","priority":"High","question":"Conventional routing vs attribute routing?","question_html":"Conventional routing vs attribute routing?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Conventional routes are defined centrally (<code>MapRoute(&quot;{controller}/{action}/{id}&quot;)</code>) and matched in order.</p>\n<ul class=\"q-points\"><li>Attribute routing (MVC 5, <code>routes.MapMvcAttributeRoutes()</code>) puts <code>[Route]</code>/<code>[RoutePrefix]</code> on controllers/actions — clearer for REST-style or custom URLs, with inline constraints (<code>{id:int}</code>).</li><li>Both can be combined; attribute routes are usually registered first.</li></ul>\n"},{"id":349,"course_slug":"aspnet-mvc5","course_title":"ASP.NET MVC 5 (.NET Framework) — Folder Structure, Request Life Cycle and Features","ord":8,"level":"Intermediate","priority":"High","question":"How does model binding and validation work?","question_html":"How does model binding and validation work?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The DefaultModelBinder uses value providers (form, route, query string, files) to fill action parameters by name, including complex and nested objects and collections.</p>\n<ul class=\"q-points\"><li>Data annotations and <code>IValidatableObject</code> validate the model; errors go into <code>ModelState</code>, checked with <code>ModelState.IsValid</code>.</li><li>Unobtrusive jQuery validation mirrors the rules on the client.</li><li>Use view models to avoid over-posting.</li></ul>\n"},{"id":350,"course_slug":"aspnet-mvc5","course_title":"ASP.NET MVC 5 (.NET Framework) — Folder Structure, Request Life Cycle and Features","ord":9,"level":"Intermediate","priority":"High","question":"Partial view vs child action (vs view component in Core)?","question_html":"Partial view vs child action (vs view component in Core)?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A partial view is a reusable template rendered with data you pass (<code>Html.Partial</code>).</p>\n<ul class=\"q-points\"><li>A child action (<code>Html.Action</code>) invokes a controller action that loads its own data and returns a partial — for self-contained widgets.</li><li>ASP.NET Core removed child actions in favour of view components, which are lighter (no full action pipeline).</li></ul>\n"},{"id":356,"course_slug":"aspnet-mvc5","course_title":"ASP.NET MVC 5 (.NET Framework) — Folder Structure, Request Life Cycle and Features","ord":15,"level":"Scenario","priority":"High","question":"You must migrate a large MVC 5 app to ASP.NET Core without stopping feature work. How?","question_html":"You must migrate a large MVC 5 app to ASP.NET Core without stopping feature work. How?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Incremental migration: create an ASP.NET Core app in front with YARP proxying unmigrated routes to the MVC 5 app;</p>\n<ul class=\"q-points\"><li>share authentication (shared cookie/data protection or a common identity provider) and session via System.Web adapters;</li><li>move shared logic into netstandard libraries;</li><li>migrate controller by controller (largely copy with small changes), replace child actions with view components, bundling with a build tool, <code>HttpContext.Current</code> usages with injected services;</li><li>delete old routes as they move.</li></ul>\n"},{"id":351,"course_slug":"aspnet-mvc5","course_title":"ASP.NET MVC 5 (.NET Framework) — Folder Structure, Request Life Cycle and Features","ord":10,"level":"Intermediate","priority":"Medium","question":"How do you implement dependency injection in MVC 5?","question_html":"How do you implement dependency injection in MVC 5?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use a container (Unity, Autofac, Ninject, Simple Injector), register services with lifetimes (per-request for DbContext), and set it as the MVC <code>DependencyResolver</code> (and a separate resolver for Web API 2).</p>\n<ul class=\"q-points\"><li>The controller factory then constructs controllers with their dependencies through constructor injection.</li></ul>\n"},{"id":352,"course_slug":"aspnet-mvc5","course_title":"ASP.NET MVC 5 (.NET Framework) — Folder Structure, Request Life Cycle and Features","ord":11,"level":"Intermediate","priority":"Medium","question":"What is the Post-Redirect-Get pattern and why use it?","question_html":"What is the Post-Redirect-Get pattern and why use it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> After a successful POST, redirect (302) to a GET action instead of returning a view.</p>\n<ul class=\"q-points\"><li>It prevents duplicate submissions when the user refreshes, gives a clean URL, and pairs with TempData for success messages.</li></ul>\n"},{"id":353,"course_slug":"aspnet-mvc5","course_title":"ASP.NET MVC 5 (.NET Framework) — Folder Structure, Request Life Cycle and Features","ord":12,"level":"Intermediate","priority":"Medium","question":"How do you prevent CSRF and XSS in MVC 5?","question_html":"How do you prevent CSRF and XSS in MVC 5?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> CSRF: <code>@Html.AntiForgeryToken()</code> in forms and <code>[ValidateAntiForgeryToken]</code> on POST actions (plus SameSite cookies).</p>\n<ul class=\"q-points\"><li>XSS: Razor encodes <code>@</code> output by default — avoid <code>Html.Raw</code> on user input, validate input, use Content Security Policy.</li><li>Also <code>[Authorize]</code>, HTTPS, parameterised queries, and view models against over-posting.</li></ul>\n"},{"id":354,"course_slug":"aspnet-mvc5","course_title":"ASP.NET MVC 5 (.NET Framework) — Folder Structure, Request Life Cycle and Features","ord":13,"level":"Advanced","priority":"Medium","question":"How do you handle errors globally in MVC 5?","question_html":"How do you handle errors globally in MVC 5?","answer_html":"<p>Register a global exception filter (<code>HandleErrorAttribute</code> or a custom <code>IExceptionFilter</code>) for errors inside controllers/views, override <code>OnException</code> where needed, use <code>Application_Error</code> in Global.asax for everything else (including 404s from routing), log with a logging framework, and configure <code>customErrors</code>/<code>httpErrors</code> for friendly error pages with correct status codes.</p>\n"},{"id":355,"course_slug":"aspnet-mvc5","course_title":"ASP.NET MVC 5 (.NET Framework) — Folder Structure, Request Life Cycle and Features","ord":14,"level":"Advanced","priority":"Medium","question":"What are Areas and when do you use them?","question_html":"What are Areas and when do you use them?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Areas divide a large MVC application into functional sections (Admin, Billing, Reports), each with its own Controllers, Models and Views and route registration (<code>AreaRegistration</code>).</p>\n<ul class=\"q-points\"><li>They keep large projects organised and allow same-named controllers in different areas.</li><li>In ASP.NET Core they work similarly with <code>[Area(&quot;Admin&quot;)]</code>.</li></ul>\n"},{"id":357,"course_slug":"aspnet-mvc5","course_title":"ASP.NET MVC 5 (.NET Framework) — Folder Structure, Request Life Cycle and Features","ord":16,"level":"Scenario","priority":"Medium","question":"An action returns stale data because of [OutputCache]. How do you fix it while keeping performance?","question_html":"An action returns stale data because of <code>[OutputCache]</code>. How do you fix it while keeping performance?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Review the cache key: vary by the right parameters (<code>VaryByParam</code>, <code>VaryByCustom</code> for user/culture), shorten the duration, use <code>Location = Client</code>/<code>None</code> for per-user data, or move to data caching in the service layer with explicit invalidation when data changes (remove the cache entry on update).</p>\n<ul class=\"q-points\"><li>Never cache personalised pages server-side without varying by user.</li></ul>\n"},{"id":358,"course_slug":"dotnet-platform","course_title":"Modern .NET — Hosting, Configuration, DI & Deployment","ord":1,"level":"Beginner","priority":"High","question":"What is the difference between .NET Framework, .NET Core and .NET 5/6/8/10?","question_html":"What is the difference between .NET Framework, .NET Core and .NET 5/6/8/10?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> .NET Framework is the original Windows-only implementation (last version 4.8.1, maintenance only). .NET Core was a cross-platform, open-source, high-performance rewrite (2016–2019).</p>\n<ul class=\"q-points\"><li>From .NET 5 (2020) the platform is unified as just &quot;.NET&quot;, the successor of .NET Core, with yearly November releases (even = LTS, 3 years; odd = STS, 2 years).</li><li>New projects should target the current LTS, .NET 10.</li></ul>\n"},{"id":359,"course_slug":"dotnet-platform","course_title":"Modern .NET — Hosting, Configuration, DI & Deployment","ord":2,"level":"Beginner","priority":"High","question":"What is the CLR and what does it do?","question_html":"What is the CLR and what does it do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The Common Language Runtime is .NET&#39;s execution engine.</p>\n<ul class=\"q-points\"><li>It loads assemblies, verifies and JIT-compiles IL to native code, manages memory with the garbage collector, enforces type safety, handles exceptions, manages threads and the thread pool, and provides interop with native code.</li><li>Code running under the CLR is &quot;managed code&quot;.</li></ul>\n"},{"id":360,"course_slug":"dotnet-platform","course_title":"Modern .NET — Hosting, Configuration, DI & Deployment","ord":3,"level":"Beginner","priority":"High","question":"What is JIT compilation? What are ReadyToRun and Native AOT?","question_html":"What is JIT compilation? What are ReadyToRun and Native AOT?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> JIT (Just-In-Time) compiles IL to machine code at runtime, the first time each method is called.</p>\n<ul class=\"q-points\"><li>Tiered compilation first produces quick code, then re-optimises hot methods, with Dynamic PGO using live profiling.</li><li><strong>ReadyToRun</strong> ships precompiled code inside assemblies to cut startup time, while keeping JIT as a fallback.</li><li><strong>Native AOT</strong> compiles the entire app to a native executable at publish time: fastest startup, smallest memory, no JIT.</li><li>The cost is no dynamic code generation and limited reflection, so it needs trimming-compatible libraries.</li></ul>\n"},{"id":361,"course_slug":"dotnet-platform","course_title":"Modern .NET — Hosting, Configuration, DI & Deployment","ord":4,"level":"Beginner","priority":"High","question":"What are LTS and STS releases?","question_html":"What are LTS and STS releases?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> LTS (Long-Term Support) releases ship in even-numbered years&#39; November (.NET 6, 8, 10) and get 3 years of free patches.</p>\n<ul class=\"q-points\"><li>STS (Standard-Term Support) releases are odd-numbered (.NET 7, 9) and get 24 months of support (18 months before .NET 9).</li><li>Enterprises usually standardise on LTS.</li><li>Both .NET 8 and .NET 9 reach end of support on 10 November 2026, and .NET 10 is supported until November 2028.</li></ul>\n"},{"id":364,"course_slug":"dotnet-platform","course_title":"Modern .NET — Hosting, Configuration, DI & Deployment","ord":7,"level":"Intermediate","priority":"High","question":"Explain the order of configuration sources in ASP.NET Core.","question_html":"Explain the order of configuration sources in ASP.NET Core.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Default for <code>WebApplication.CreateBuilder</code>: <code>appsettings.json</code> → <code>appsettings.{Environment}.json</code> → User Secrets (Development only) → environment variables → command-line arguments.</p>\n<ul class=\"q-points\"><li>Later sources override earlier ones, so env vars in production override JSON files.</li><li>Hierarchical keys use <code>:</code> in code (<code>Smtp:Host</code>) and <code>__</code> in environment variables (<code>Smtp__Host</code>).</li><li>Production secrets belong in Azure Key Vault or the hosting platform&#39;s secret store, not in JSON.</li></ul>\n"},{"id":365,"course_slug":"dotnet-platform","course_title":"Modern .NET — Hosting, Configuration, DI & Deployment","ord":8,"level":"Intermediate","priority":"High","question":"What is the difference between IOptions, IOptionsSnapshot and IOptionsMonitor?","question_html":"What is the difference between IOptions, IOptionsSnapshot and IOptionsMonitor?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>IOptions&lt;T&gt;</code> is a singleton that reads values once at first use and never reloads.</p>\n<ul class=\"q-points\"><li><code>IOptionsSnapshot&lt;T&gt;</code> is scoped and recomputed per request, so it picks up config file changes between requests; it can&#39;t be injected into singletons.</li><li><code>IOptionsMonitor&lt;T&gt;</code> is a singleton that always returns the current value via <code>CurrentValue</code> and offers <code>OnChange</code> callbacks;</li><li>use it in singletons and background services.</li></ul>\n"},{"id":366,"course_slug":"dotnet-platform","course_title":"Modern .NET — Hosting, Configuration, DI & Deployment","ord":9,"level":"Intermediate","priority":"High","question":"What is a BackgroundService / IHostedService?","question_html":"What is a BackgroundService / IHostedService?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>IHostedService</code> has <code>StartAsync</code>/<code>StopAsync</code>, called by the host at startup and shutdown.</p>\n<ul class=\"q-points\"><li><code>BackgroundService</code> is a base class where you implement <code>ExecuteAsync(CancellationToken)</code> for long-running loops: queue consumers, schedulers, outbox publishers.</li><li>It&#39;s registered as a singleton via <code>AddHostedService&lt;T&gt;()</code>, so create DI scopes for scoped services.</li><li>Honour the stopping token for graceful shutdown.</li><li>For complex schedules, use Quartz.NET or Hangfire.</li></ul>\n"},{"id":369,"course_slug":"dotnet-platform","course_title":"Modern .NET — Hosting, Configuration, DI & Deployment","ord":12,"level":"Advanced","priority":"High","question":"How does the .NET garbage collector work? Workstation vs Server GC?","question_html":"How does the .NET garbage collector work? Workstation vs Server GC?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> It&#39;s a generational, mark-and-compact (tracing) collector.</p>\n<ul class=\"q-points\"><li>It marks objects reachable from roots, then sweeps or compacts Gen 0/1/2; the LOH holds objects of 85,000 bytes or more and is collected with Gen 2.</li><li>Collections are triggered by allocation budgets.</li><li><strong>Workstation GC</strong> uses one heap, tuned for responsiveness on client apps.</li><li><strong>Server GC</strong> uses a heap and GC thread per core for throughput and is the ASP.NET Core default; DATAS in .NET 9+ adapts the heap count dynamically.</li><li><strong>Background GC</strong> collects Gen 2 concurrently while Gen 0/1 collections continue.</li></ul>\n"},{"id":372,"course_slug":"dotnet-platform","course_title":"Modern .NET — Hosting, Configuration, DI & Deployment","ord":15,"level":"Scenario","priority":"High","question":"Your ASP.NET Core API on .NET 8 must keep getting security patches after November 2026. What do you do and when?","question_html":"Your ASP.NET Core API on .NET 8 must keep getting security patches after November 2026. What do you do and when?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> .NET 8 reaches end of support on 10 November 2026, after which there are no security fixes.</p>\n<ul class=\"q-points\"><li>Plan the upgrade to <strong>.NET 10 (LTS, supported to Nov 2028)</strong> well before then.</li><li>Bump the TargetFramework, update Microsoft.* and EF Core packages to 10.x, read the breaking-changes docs, run the full test suite, fix analyzer warnings, update the Docker base images (<code>aspnet:10.0</code>) and CI SDK versions (<code>global.json</code>, the <code>UseDotNet</code> task), deploy to staging, run load tests, then roll out.</li><li>Budget time for third-party packages that lag behind.</li></ul>\n"},{"id":373,"course_slug":"dotnet-platform","course_title":"Modern .NET — Hosting, Configuration, DI & Deployment","ord":16,"level":"Scenario","priority":"High","question":"An API's CPU is fine but requests queue up and latency spikes under load. Thread count keeps growing. What's happening?","question_html":"An API&#39;s CPU is fine but requests queue up and latency spikes under load. Thread count keeps growing. What&#39;s happening?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> That points to <strong>thread-pool starvation</strong>: synchronous blocking (<code>.Result</code>, <code>.Wait()</code>, sync I/O, <code>Thread.Sleep</code>) inside request handling.</p>\n<ul class=\"q-points\"><li>Each blocked thread waits on I/O, the pool injects new threads slowly (about one or two per second), and requests queue.</li><li>Confirm with <code>dotnet-counters</code> (ThreadPool Queue Length and Thread Count rising) and <code>dotnet-stack</code>/a dump showing blocked threads.</li><li>Fix by going async end to end, using async DB/HTTP APIs, and removing sync-over-async.</li></ul>\n"},{"id":362,"course_slug":"dotnet-platform","course_title":"Modern .NET — Hosting, Configuration, DI & Deployment","ord":5,"level":"Beginner","priority":"Medium","question":"What is an assembly? What is the GAC?","question_html":"What is an assembly? What is the GAC?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> An assembly is a compiled unit (<code>.dll</code>/<code>.exe</code>) containing IL code, type metadata, a manifest (name, version, culture, references) and resources.</p>\n<ul class=\"q-points\"><li>It is the unit of deployment, versioning and security.</li><li>The <strong>Global Assembly Cache</strong> was a machine-wide store for strongly named shared assemblies in .NET Framework.</li><li>Modern .NET has no GAC: each app carries its dependencies, or uses the shared framework installed side by side.</li></ul>\n"},{"id":363,"course_slug":"dotnet-platform","course_title":"Modern .NET — Hosting, Configuration, DI & Deployment","ord":6,"level":"Beginner","priority":"Medium","question":"What is .NET Standard? Do I still need it?","question_html":"What is .NET Standard? Do I still need it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> .NET Standard is a formal specification of APIs available on all .NET implementations (2.0 is the widely used version; 2.1 is not supported by .NET Framework).</p>\n<ul class=\"q-points\"><li>Target <code>netstandard2.0</code> only if a library must also be consumed by .NET Framework apps.</li><li>Otherwise target modern TFMs like <code>net8.0</code>/<code>net10.0</code>, or multi-target <code>&lt;TargetFrameworks&gt;net48;net8.0&lt;/TargetFrameworks&gt;</code>.</li></ul>\n"},{"id":367,"course_slug":"dotnet-platform","course_title":"Modern .NET — Hosting, Configuration, DI & Deployment","ord":10,"level":"Intermediate","priority":"Medium","question":"What is Kestrel? Do you still need IIS?","question_html":"What is Kestrel? Do you still need IIS?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Kestrel is ASP.NET Core&#39;s built-in, cross-platform, high-performance web server.</p>\n<ul class=\"q-points\"><li>It can face the internet directly.</li><li>A reverse proxy (IIS, Nginx, Azure Front Door, YARP) is still often used for TLS termination, port sharing, load balancing and static file caching.</li><li>On Windows, IIS hosts ASP.NET Core through the ASP.NET Core Module, <strong>in-process</strong> (default, fastest) or out-of-process (proxying to Kestrel).</li></ul>\n"},{"id":368,"course_slug":"dotnet-platform","course_title":"Modern .NET — Hosting, Configuration, DI & Deployment","ord":11,"level":"Intermediate","priority":"Medium","question":"Framework-dependent vs self-contained deployment?","question_html":"Framework-dependent vs self-contained deployment?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Framework-dependent: small output, but requires the matching .NET runtime on the server.</p>\n<ul class=\"q-points\"><li>Ops can patch the runtime centrally.</li><li>Self-contained: includes the runtime for a specific RID (e.g. <code>linux-x64</code>), so nothing needs installing, but the output is bigger and you must republish to get runtime patches.</li><li>Containers make this mostly moot: the base image provides the runtime.</li></ul>\n"},{"id":370,"course_slug":"dotnet-platform","course_title":"Modern .NET — Hosting, Configuration, DI & Deployment","ord":13,"level":"Advanced","priority":"Medium","question":"What are the limitations of Native AOT?","question_html":"What are the limitations of Native AOT?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> No runtime code generation (<code>Reflection.Emit</code>, some dynamic proxies), limited reflection (trimming removes unused code, so you need source generators or annotations), no dynamic assembly loading, and a platform-specific build per OS/architecture.</p>\n<ul class=\"q-points\"><li>Some libraries are incompatible: classic EF Core full model building has AOT limitations, MVC controllers are not supported (Minimal APIs are).</li><li>It&#39;s best for microservices, serverless functions and CLI tools where startup time and memory matter.</li></ul>\n"},{"id":371,"course_slug":"dotnet-platform","course_title":"Modern .NET — Hosting, Configuration, DI & Deployment","ord":14,"level":"Advanced","priority":"Medium","question":"How would you migrate a large ASP.NET MVC 5 app on .NET Framework 4.8 to .NET 10?","question_html":"How would you migrate a large ASP.NET MVC 5 app on .NET Framework 4.8 to .NET 10?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Incrementally, with the <strong>Strangler Fig</strong> pattern.</p>\n<ul class=\"q-points\"><li>Put a new ASP.NET Core app with <strong>YARP</strong> in front, which proxies unknown routes to the old app.</li><li>Use <strong>System.Web adapters</strong> to share session/auth.</li><li>Move class libraries to <code>netstandard2.0</code>/multi-target first, then migrate controllers and views route by route, replacing <code>System.Web</code> dependencies, <code>HttpContext.Current</code>, <code>web.config</code> settings and Global.asax with modern equivalents.</li><li>Use the Upgrade Assistant for mechanical changes.</li><li>EF6 can stay initially (it runs on modern .NET) and move to EF Core later.</li><li>Ship each slice to production behind the proxy.</li></ul>\n"},{"id":374,"course_slug":"dotnet-platform","course_title":"Modern .NET — Hosting, Configuration, DI & Deployment","ord":17,"level":"Scenario","priority":"Medium","question":"Configuration works locally but in Azure App Service the app uses the wrong connection string. How do you debug it?","question_html":"Configuration works locally but in Azure App Service the app uses the wrong connection string. How do you debug it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Check <code>ASPNETCORE_ENVIRONMENT</code> on the App Service (it decides which appsettings.{env}.json loads).</p>\n<ul class=\"q-points\"><li>App Service <strong>Connection strings</strong> and <strong>App settings</strong> become environment variables and override JSON.</li><li>Check the key names (<code>ConnectionStrings__Db</code>, or the connection-strings section with the right type).</li><li>Check slot settings after a swap and Key Vault references resolving (managed identity permissions).</li><li>Log the configuration <em>source</em> (never the secret value) at startup, or use <code>builder.Configuration.GetDebugView()</code> locally.</li></ul>\n"},{"id":375,"course_slug":"aspnet-core-mvc","course_title":"ASP.NET Core MVC (and Razor Pages)","ord":1,"level":"Beginner","priority":"High","question":"What is MVC? Explain the role of each component.","question_html":"What is MVC? Explain the role of each component.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Model–View–Controller separates an app into three parts.</p>\n<ul class=\"q-points\"><li>The <strong>Model</strong> holds data, business rules and validation (entities, view models).</li><li>The <strong>View</strong> renders UI from a model (Razor <code>.cshtml</code>).</li><li>The <strong>Controller</strong> receives the request, works with services and models, and returns a result (view, redirect, JSON).</li><li>Benefits: separation of concerns, testable controllers, parallel work on UI and logic, and clean URLs through routing.</li></ul>\n"},{"id":376,"course_slug":"aspnet-core-mvc","course_title":"ASP.NET Core MVC (and Razor Pages)","ord":2,"level":"Beginner","priority":"High","question":"Explain the ASP.NET Core MVC request lifecycle.","question_html":"Explain the ASP.NET Core MVC request lifecycle.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Kestrel receives the request, which flows through the middleware pipeline (exception handling, HTTPS, static files, routing, authentication, authorisation).</p>\n<ul class=\"q-points\"><li>Endpoint routing selects the controller action.</li><li>The controller is created via DI, then the filter pipeline runs: authorisation filters → resource filters → model binding and validation → action filters → the action executes → result filters → result execution (the view engine renders the view with its layout and partials).</li><li>Exception filters handle errors in that stage, and the response goes back out through the middleware.</li></ul>\n"},{"id":377,"course_slug":"aspnet-core-mvc","course_title":"ASP.NET Core MVC (and Razor Pages)","ord":3,"level":"Beginner","priority":"High","question":"What is the difference between ViewData, ViewBag and TempData?","question_html":"What is the difference between ViewData, ViewBag and TempData?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>ViewData</code> is a string-keyed dictionary and <code>ViewBag</code> is a <code>dynamic</code> wrapper over the same data.</p>\n<ul class=\"q-points\"><li>Both live only for the current request (controller → view) and need no casting with ViewBag.</li><li><code>TempData</code> persists until it is <strong>read</strong>, typically across one redirect (PRG flash messages); it&#39;s stored in a cookie by default or in session.</li><li><code>Keep()</code>/<code>Peek()</code> retain values.</li><li>Prefer strongly typed view models over all three for real data.</li></ul>\n"},{"id":378,"course_slug":"aspnet-core-mvc","course_title":"ASP.NET Core MVC (and Razor Pages)","ord":4,"level":"Beginner","priority":"High","question":"What is the difference between conventional and attribute routing?","question_html":"What is the difference between conventional and attribute routing?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Conventional routing defines URL templates centrally (<code>{controller=Home}/{action=Index}/{id?}</code>) and is good for uniform MVC apps.</p>\n<ul class=\"q-points\"><li>Attribute routing puts templates on controllers/actions (<code>[Route(&quot;products/{id:int}&quot;)]</code>), giving precise control, constraints and versioning;</li><li>it&#39;s required for <code>[ApiController]</code>.</li><li>Both can coexist.</li><li>Attribute routes are matched without the conventional patterns.</li></ul>\n"},{"id":379,"course_slug":"aspnet-core-mvc","course_title":"ASP.NET Core MVC (and Razor Pages)","ord":5,"level":"Beginner","priority":"High","question":"What is model binding?","question_html":"What is model binding?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The process of mapping HTTP request data (form fields, route values, query string, headers, body, files) to action parameters and model properties by name.</p>\n<ul class=\"q-points\"><li>Attributes <code>[FromForm]</code>, <code>[FromQuery]</code>, <code>[FromRoute]</code>, <code>[FromHeader]</code>, <code>[FromBody]</code> and <code>[FromServices]</code> control the source.</li><li>After binding, validation runs and fills <code>ModelState</code>.</li></ul>\n"},{"id":380,"course_slug":"aspnet-core-mvc","course_title":"ASP.NET Core MVC (and Razor Pages)","ord":6,"level":"Beginner","priority":"High","question":"How does validation work in ASP.NET Core MVC?","question_html":"How does validation work in ASP.NET Core MVC?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Data annotations (<code>[Required]</code>, <code>[StringLength]</code>, <code>[Range]</code>, <code>[EmailAddress]</code>, <code>[RegularExpression]</code>, <code>[Compare]</code>) on models are checked after model binding, and the results go into <code>ModelState</code>.</p>\n<ul class=\"q-points\"><li>Check <code>ModelState.IsValid</code> in the action and redisplay the view with errors.</li><li>Tag helpers emit <code>data-val-*</code> attributes, so jQuery Unobtrusive Validation validates on the client too.</li><li>Custom rules use a <code>ValidationAttribute</code>, <code>IValidatableObject</code> or FluentValidation.</li><li>Server-side validation is mandatory because the client side can be bypassed.</li></ul>\n"},{"id":382,"course_slug":"aspnet-core-mvc","course_title":"ASP.NET Core MVC (and Razor Pages)","ord":8,"level":"Intermediate","priority":"High","question":"Partial view vs view component — when do you use which?","question_html":"Partial view vs view component — when do you use which?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use a <strong>partial view</strong> to reuse markup when the parent already has the data (e.g. a product card in a list).</p>\n<ul class=\"q-points\"><li>Use a <strong>view component</strong> when the widget needs its own logic and data from services, independent of the page&#39;s model (shopping cart badge, navigation menu, &quot;latest posts&quot;).</li><li>View components replace MVC 5 child actions and can be invoked as tag helpers (<code>&lt;vc:cart /&gt;</code>).</li></ul>\n"},{"id":383,"course_slug":"aspnet-core-mvc","course_title":"ASP.NET Core MVC (and Razor Pages)","ord":9,"level":"Intermediate","priority":"High","question":"What are filters? List the types and their execution order.","question_html":"What are filters? List the types and their execution order.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Filters run code at specific stages of the MVC action pipeline: <strong>Authorization</strong> → <strong>Resource</strong> → (model binding) → <strong>Action</strong> → action → <strong>Action</strong> (after) → <strong>Result</strong> → result execution → <strong>Result</strong> (after).</p>\n<ul class=\"q-points\"><li><strong>Exception</strong> filters catch unhandled exceptions from these stages.</li><li>They can be applied globally, per controller or per action (in that order on the way in), and use DI via <code>ServiceFilter</code>/<code>TypeFilter</code>.</li><li>Use cases: auth, logging, caching, validation, error handling.</li></ul>\n"},{"id":384,"course_slug":"aspnet-core-mvc","course_title":"ASP.NET Core MVC (and Razor Pages)","ord":10,"level":"Intermediate","priority":"High","question":"What is the difference between middleware and filters?","question_html":"What is the difference between middleware and filters?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Middleware is part of the ASP.NET Core pipeline.</p>\n<ul class=\"q-points\"><li>It runs for every request, including static files and non-MVC endpoints, works with <code>HttpContext</code> only, and its order is set in Program.cs.</li><li>Filters are part of MVC.</li><li>They run only for controller actions and Razor Pages, and can see MVC context such as <code>ModelState</code>, action arguments and <code>IActionResult</code>.</li><li>Use middleware for cross-cutting HTTP concerns (logging, CORS, exception handling) and filters for action-specific concerns (validation, audit per action).</li></ul>\n"},{"id":385,"course_slug":"aspnet-core-mvc","course_title":"ASP.NET Core MVC (and Razor Pages)","ord":11,"level":"Intermediate","priority":"High","question":"What are tag helpers? How are they better than HTML helpers?","question_html":"What are tag helpers? How are they better than HTML helpers?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Tag helpers are server-side C# classes that enhance HTML-looking elements via <code>asp-*</code> attributes (<code>&lt;input asp-for=&quot;Name&quot; /&gt;</code>, <code>&lt;a asp-action=&quot;Details&quot; asp-route-id=&quot;5&quot;&gt;</code>).</p>\n<ul class=\"q-points\"><li>Compared with HTML helpers (<code>@Html.TextBoxFor</code>), they look like plain HTML, give better IntelliSense, are friendlier to designers, and add features automatically (antiforgery tokens in forms, cache-busting with <code>asp-append-version</code>).</li><li>Custom tag helpers derive from <code>TagHelper</code>.</li></ul>\n"},{"id":386,"course_slug":"aspnet-core-mvc","course_title":"ASP.NET Core MVC (and Razor Pages)","ord":12,"level":"Intermediate","priority":"High","question":"How do you prevent CSRF attacks in ASP.NET Core MVC?","question_html":"How do you prevent CSRF attacks in ASP.NET Core MVC?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use antiforgery tokens.</p>\n<ul class=\"q-points\"><li>The form tag helper injects a hidden <code>__RequestVerificationToken</code> field paired with a cookie.</li><li>Validate with <code>[ValidateAntiForgeryToken]</code> per action or globally with <code>AutoValidateAntiforgeryTokenAttribute</code>.</li><li>For AJAX, send the token in a header (<code>RequestVerificationToken</code>) configured via <code>AddAntiforgery(o =&gt; o.HeaderName = ...)</code>.</li><li><code>SameSite</code> cookies add defence in depth.</li><li>APIs using JWT in the Authorization header aren&#39;t vulnerable in the same way.</li></ul>\n"},{"id":391,"course_slug":"aspnet-core-mvc","course_title":"ASP.NET Core MVC (and Razor Pages)","ord":17,"level":"Advanced","priority":"High","question":"How does authentication differ between an MVC app and a Web API?","question_html":"How does authentication differ between an MVC app and a Web API?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> MVC apps usually use <strong>cookie authentication</strong>: after login (Identity or OpenID Connect via Entra ID), an encrypted auth cookie identifies the user on each request, and antiforgery tokens protect forms.</p>\n<ul class=\"q-points\"><li>Web APIs consumed by SPAs or mobile apps usually use <strong>JWT bearer tokens</strong> in the <code>Authorization</code> header, validated statelessly (issuer, audience, signature, expiry).</li><li>In both, authorisation uses <code>[Authorize]</code> with roles, claims or policies.</li><li>For SPAs, a BFF (Backend-for-Frontend) that keeps tokens server-side and uses cookies is now recommended for security.</li></ul>\n"},{"id":394,"course_slug":"aspnet-core-mvc","course_title":"ASP.NET Core MVC (and Razor Pages)","ord":20,"level":"Scenario","priority":"High","question":"Users double-click \"Place Order\" and two orders are created. How do you fix it?","question_html":"Users double-click &quot;Place Order&quot; and two orders are created. How do you fix it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Defence in layers: (1) disable the button on submit with JavaScript;</p>\n<ul class=\"q-points\"><li>(2) use <strong>Post-Redirect-Get</strong>;</li><li>(3) make the server <strong>idempotent</strong> — generate an order token (GUID) when rendering the form, store it in a hidden field, and enforce a unique constraint on it in the DB, so a second POST with the same token is rejected or returns the existing order.</li><li>The DB unique constraint is the only fully reliable guard.</li></ul>\n"},{"id":395,"course_slug":"aspnet-core-mvc","course_title":"ASP.NET Core MVC (and Razor Pages)","ord":21,"level":"Scenario","priority":"High","question":"A product page shows another customer's order when the URL ID is changed. What is the bug and the fix?","question_html":"A product page shows another customer&#39;s order when the URL ID is changed. What is the bug and the fix?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> It&#39;s an <strong>IDOR</strong> (Insecure Direct Object Reference) / broken access control.</p>\n<ul class=\"q-points\"><li>The action loads by ID without checking ownership.</li><li>Fix: always scope queries by the current user (<code>db.Orders.Where(o =&gt; o.Id == id &amp;&amp; o.CustomerId == userId)</code>), or use resource-based authorisation.</li><li>Return 404 (not 403) to avoid revealing existence.</li><li>Audit other endpoints, add integration tests for access control, and consider EF Core global query filters for multi-tenant data.</li></ul>\n"},{"id":381,"course_slug":"aspnet-core-mvc","course_title":"ASP.NET Core MVC (and Razor Pages)","ord":7,"level":"Beginner","priority":"Medium","question":"What are _Layout, _ViewStart and _ViewImports?","question_html":"What are <code>_Layout</code>, <code>_ViewStart</code> and <code>_ViewImports</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>_Layout.cshtml</code> is the master template (header, nav, footer) with <code>@RenderBody()</code> and optional <code>@RenderSection</code>.</p>\n<ul class=\"q-points\"><li><code>_ViewStart.cshtml</code> runs before every view in its folder and usually sets <code>Layout = &quot;_Layout&quot;</code>.</li><li><code>_ViewImports.cshtml</code> holds shared directives — <code>@using</code>, <code>@addTagHelper</code>, <code>@inject</code> — for all views in that folder hierarchy.</li></ul>\n"},{"id":387,"course_slug":"aspnet-core-mvc","course_title":"ASP.NET Core MVC (and Razor Pages)","ord":13,"level":"Intermediate","priority":"Medium","question":"What is the difference between RedirectToAction, Redirect and LocalRedirect?","question_html":"What is the difference between <code>RedirectToAction</code>, <code>Redirect</code> and <code>LocalRedirect</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> All send a 302 by default (<code>*Permanent</code> variants send 301/308).</p>\n<ul class=\"q-points\"><li><code>RedirectToAction(&quot;Details&quot;, new { id })</code> builds the URL from routing.</li><li><code>Redirect(url)</code> goes to any URL, including external ones, which is risky with user input (open redirect).</li><li><code>LocalRedirect(url)</code> only allows local URLs and throws otherwise, so use it for <code>returnUrl</code> after login.</li></ul>\n"},{"id":388,"course_slug":"aspnet-core-mvc","course_title":"ASP.NET Core MVC (and Razor Pages)","ord":14,"level":"Intermediate","priority":"Medium","question":"What is Post-Redirect-Get and why is it used?","question_html":"What is Post-Redirect-Get and why is it used?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> After a successful POST, the server responds with a redirect (302/303) to a GET page instead of rendering a view directly.</p>\n<ul class=\"q-points\"><li>Refreshing the browser then repeats the harmless GET instead of resubmitting the form, which prevents duplicate orders or payments.</li><li><code>TempData</code> carries the success message across the redirect.</li></ul>\n"},{"id":389,"course_slug":"aspnet-core-mvc","course_title":"ASP.NET Core MVC (and Razor Pages)","ord":15,"level":"Intermediate","priority":"Medium","question":"What is an Area in MVC?","question_html":"What is an Area in MVC?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A way to partition a large MVC app into functional sections (Admin, Billing, Customer), each with its own Controllers, Views and Models folders.</p>\n<ul class=\"q-points\"><li>Controllers are marked <code>[Area(&quot;Admin&quot;)]</code> and routes include <code>{area:exists}</code>.</li><li>Tag helpers use <code>asp-area</code>.</li></ul>\n"},{"id":390,"course_slug":"aspnet-core-mvc","course_title":"ASP.NET Core MVC (and Razor Pages)","ord":16,"level":"Intermediate","priority":"Medium","question":"How do you handle errors globally in MVC?","question_html":"How do you handle errors globally in MVC?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> In production, <code>app.UseExceptionHandler(&quot;/Home/Error&quot;)</code> (shows a friendly error page, logs the exception) plus <code>app.UseStatusCodePagesWithReExecute(&quot;/Error/{0}&quot;)</code> for 404s.</p>\n<ul class=\"q-points\"><li>In development, the developer exception page is enabled by default.</li><li>Exception filters handle MVC-specific cases. .NET 8 adds <code>IExceptionHandler</code> implementations registered with <code>AddExceptionHandler&lt;T&gt;()</code>.</li><li>Always log with a correlation ID and never show stack traces to users.</li></ul>\n"},{"id":392,"course_slug":"aspnet-core-mvc","course_title":"ASP.NET Core MVC (and Razor Pages)","ord":18,"level":"Advanced","priority":"Medium","question":"How would you implement resource-based authorisation (e.g. only the owner can edit a document)?","question_html":"How would you implement resource-based authorisation (e.g. only the owner can edit a document)?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Attribute-based roles can&#39;t express &quot;owner of this specific document&quot;.</p>\n<ul class=\"q-points\"><li>Load the resource, then call <code>IAuthorizationService.AuthorizeAsync(User, document, &quot;EditPolicy&quot;)</code>.</li><li>Write an <code>AuthorizationHandler&lt;SameOwnerRequirement, Document&gt;</code> that succeeds when <code>document.OwnerId == user id</code> or the user is an admin.</li><li>Return <code>Forbid()</code> on failure.</li><li>This also prevents IDOR attacks.</li></ul>\n"},{"id":393,"course_slug":"aspnet-core-mvc","course_title":"ASP.NET Core MVC (and Razor Pages)","ord":19,"level":"Advanced","priority":"Medium","question":"How do you unit-test an MVC controller?","question_html":"How do you unit-test an MVC controller?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Inject dependencies through interfaces and mock them (Moq/NSubstitute).</p>\n<ul class=\"q-points\"><li>Instantiate the controller, call the action, and assert on the <code>IActionResult</code> type and model: `var result = Assert.IsType<ViewResult>(await controller.Details(5));</li><li>Assert.IsType<Product>(result.Model);`.</li><li>Set <code>controller.ControllerContext</code> with a fake <code>HttpContext</code>/<code>User</code> when needed.</li><li>For routing, filters and views end to end, use integration tests with <code>WebApplicationFactory</code>.</li></ul>\n"},{"id":396,"course_slug":"aspnet-core-mvc","course_title":"ASP.NET Core MVC (and Razor Pages)","ord":22,"level":"Scenario","priority":"Medium","question":"Your MVC home page takes 4 seconds. Profiling shows 120 SQL queries per request. What do you do?","question_html":"Your MVC home page takes 4 seconds. Profiling shows 120 SQL queries per request. What do you do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> That&#39;s an <strong>N+1 query problem</strong>: views or lazy loading trigger a query per item.</p>\n<ul class=\"q-points\"><li>Fix: load all needed data in the controller/service with one or a few queries using <code>Include</code> or, better, projections (<code>Select</code> into a view model).</li><li>Disable lazy loading.</li><li>Cache rarely changing data (categories, menus) with <code>IMemoryCache</code>/<code>HybridCache</code> or the <code>&lt;cache&gt;</code> tag helper.</li><li>Add output caching for anonymous pages.</li><li>Measure again with logging of EF queries or MiniProfiler.</li></ul>\n"},{"id":397,"course_slug":"aspnet-core-mvc","course_title":"ASP.NET Core MVC (and Razor Pages)","ord":23,"level":"Scenario","priority":"Medium","question":"After deploying, users see old CSS/JS from browser cache. How do you prevent this?","question_html":"After deploying, users see old CSS/JS from browser cache. How do you prevent this?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use cache busting.</p>\n<ul class=\"q-points\"><li><code>asp-append-version=&quot;true&quot;</code> on <code>&lt;script&gt;</code>, <code>&lt;link&gt;</code> and <code>&lt;img&gt;</code> adds a hash query string that changes when the file changes.</li><li>In .NET 9+, <code>MapStaticAssets()</code> with <code>.WithStaticAssets()</code> fingerprints and compresses assets at build time with long-lived caching headers.</li><li>Bundlers (Vite/webpack) produce hashed file names.</li></ul>\n"},{"id":398,"course_slug":"aspnet-core-webapi","course_title":"ASP.NET Core Web API & REST","ord":1,"level":"Beginner","priority":"High","question":"What is REST? What are its constraints?","question_html":"What is REST? What are its constraints?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> REST is an architectural style for networked APIs (Roy Fielding, 2000).</p>\n<ul class=\"q-points\"><li>Constraints: client–server separation, <strong>statelessness</strong> (each request carries everything needed, e.g. a token), cacheability, a <strong>uniform interface</strong> (resources identified by URIs, standard methods, self-descriptive messages, optionally hypermedia), a layered system, and optional code-on-demand.</li><li>In practice: resource-oriented URLs, HTTP verbs, status codes, and JSON representations.</li></ul>\n"},{"id":399,"course_slug":"aspnet-core-webapi","course_title":"ASP.NET Core Web API & REST","ord":2,"level":"Beginner","priority":"High","question":"What is the difference between PUT, POST and PATCH?","question_html":"What is the difference between PUT, POST and PATCH?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <strong>POST</strong> creates a resource (server assigns the ID) or triggers a process; not idempotent; returns 201 + Location.</p>\n<ul class=\"q-points\"><li><strong>PUT</strong> replaces the whole resource at a known URI; idempotent (sending it twice gives the same state).</li><li><strong>PATCH</strong> partially updates (JSON Patch or JSON Merge Patch); not necessarily idempotent.</li><li>Missing fields in PUT usually mean &quot;set to default/null&quot;, in PATCH they mean &quot;leave unchanged&quot;.</li></ul>\n"},{"id":400,"course_slug":"aspnet-core-webapi","course_title":"ASP.NET Core Web API & REST","ord":3,"level":"Beginner","priority":"High","question":"What is the difference between 401 and 403?","question_html":"What is the difference between 401 and 403?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <strong>401 Unauthorized</strong> really means <em>unauthenticated</em>: no valid credentials, so the client should log in or refresh its token (the response includes <code>WWW-Authenticate</code>).</p>\n<ul class=\"q-points\"><li><strong>403 Forbidden</strong> means the identity is known but lacks permission, and re-authenticating won&#39;t help.</li><li>In ASP.NET Core, <code>Challenge()</code> produces 401 and <code>Forbid()</code> produces 403.</li></ul>\n"},{"id":401,"course_slug":"aspnet-core-webapi","course_title":"ASP.NET Core Web API & REST","ord":4,"level":"Beginner","priority":"High","question":"What does the [ApiController] attribute do?","question_html":"What does the <code>[ApiController]</code> attribute do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> It enables API conventions: attribute routing is required, invalid <code>ModelState</code> automatically returns <strong>400 with ValidationProblemDetails</strong> (no <code>if (!ModelState.IsValid)</code> needed), binding sources are inferred (<code>[FromBody]</code> for complex types, route/query for simple ones, <code>IFormFile</code> from the form), and error status codes get ProblemDetails bodies.</p>\n<ul class=\"q-points\"><li>Apply it to the class or the whole assembly.</li></ul>\n"},{"id":402,"course_slug":"aspnet-core-webapi","course_title":"ASP.NET Core Web API & REST","ord":5,"level":"Beginner","priority":"High","question":"What is middleware? How do you write custom middleware?","question_html":"What is middleware? How do you write custom middleware?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Middleware are components in the request pipeline.</p>\n<ul class=\"q-points\"><li>Each receives <code>HttpContext</code>, can do work, call <code>next</code> to pass the request on, and do more work on the way back, or short-circuit.</li><li>Write a class with a constructor taking <code>RequestDelegate next</code> and an <code>InvokeAsync(HttpContext)</code> method, then register it with <code>app.UseMiddleware&lt;T&gt;()</code>;</li><li>or use inline <code>app.Use(async (ctx, next) =&gt; ...)</code>.</li><li><code>Run</code> is terminal; <code>Map</code> branches.</li><li>Order defines behaviour.</li></ul>\n"},{"id":403,"course_slug":"aspnet-core-webapi","course_title":"ASP.NET Core Web API & REST","ord":6,"level":"Beginner","priority":"High","question":"What is the difference between IActionResult and ActionResult<T>?","question_html":"What is the difference between <code>IActionResult</code> and <code>ActionResult&lt;T&gt;</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>IActionResult</code> can return any result but carries no type information.</p>\n<ul class=\"q-points\"><li><code>ActionResult&lt;T&gt;</code> (2.1+) lets you return either a <code>T</code> (implicitly wrapped in a 200 OK) or any <code>ActionResult</code> (<code>NotFound()</code>), and lets OpenAPI tools infer the response type.</li><li>Minimal APIs use <code>TypedResults</code> and <code>Results&lt;Ok&lt;T&gt;, NotFound&gt;</code> for the same purpose.</li></ul>\n"},{"id":404,"course_slug":"aspnet-core-webapi","course_title":"ASP.NET Core Web API & REST","ord":7,"level":"Intermediate","priority":"High","question":"Controllers vs Minimal APIs — which do you choose?","question_html":"Controllers vs Minimal APIs — which do you choose?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Both are fully supported and equally fast.</p>\n<ul class=\"q-points\"><li>Controllers suit large APIs with many endpoints, teams familiar with MVC, and heavy use of MVC filters and conventions.</li><li>Minimal APIs suit microservices and small services;</li><li>they have less ceremony, route groups, endpoint filters, typed results and <strong>Native AOT</strong> support (controllers aren&#39;t AOT-compatible).</li><li>They can coexist in one app.</li><li>Organise Minimal APIs with extension methods per feature (<code>app.MapOrders()</code>).</li></ul>\n"},{"id":405,"course_slug":"aspnet-core-webapi","course_title":"ASP.NET Core Web API & REST","ord":8,"level":"Intermediate","priority":"High","question":"How does JWT authentication work in ASP.NET Core?","question_html":"How does JWT authentication work in ASP.NET Core?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The client authenticates with an identity provider (Microsoft Entra ID, Auth0, Duende IdentityServer, or your own login endpoint) and receives a signed JWT access token.</p>\n<ul class=\"q-points\"><li>It sends <code>Authorization: Bearer &lt;token&gt;</code> on each request.</li><li>The JwtBearer handler validates the signature (via the authority&#39;s published keys or a configured key), issuer, audience and expiry, then builds <code>HttpContext.User</code> from the claims.</li><li><code>[Authorize]</code> with roles, scopes or policies decides access.</li><li>Tokens are stateless, so revocation needs short expiry plus refresh tokens or a deny list.</li></ul>\n"},{"id":406,"course_slug":"aspnet-core-webapi","course_title":"ASP.NET Core Web API & REST","ord":9,"level":"Intermediate","priority":"High","question":"What is CORS and why do you get CORS errors?","question_html":"What is CORS and why do you get CORS errors?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Browsers enforce the same-origin policy: a page from <code>https://app.com</code> can&#39;t read responses from <code>https://api.com</code> unless the API sends <code>Access-Control-Allow-Origin</code> (and related headers).</p>\n<ul class=\"q-points\"><li>For non-simple requests, the browser first sends a preflight <code>OPTIONS</code>.</li><li>CORS errors mean the server didn&#39;t allow that origin, method or header, or <code>UseCors</code> is misplaced in the pipeline.</li><li>Fix server-side with a named policy listing the exact origins.</li><li>CORS doesn&#39;t protect the API from non-browser clients.</li></ul>\n"},{"id":407,"course_slug":"aspnet-core-webapi","course_title":"ASP.NET Core Web API & REST","ord":10,"level":"Intermediate","priority":"High","question":"Why should you use IHttpClientFactory?","question_html":"Why should you use IHttpClientFactory?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Creating and disposing <code>HttpClient</code> per request leaves sockets in TIME_WAIT and can exhaust ports.</p>\n<ul class=\"q-points\"><li>A single long-lived static instance doesn&#39;t respect DNS changes.</li><li><code>IHttpClientFactory</code> manages pooled handlers with a rotation lifetime, supports named and typed clients, central configuration, and delegating handlers for logging, auth headers and resilience (<code>AddStandardResilienceHandler</code>).</li></ul>\n"},{"id":408,"course_slug":"aspnet-core-webapi","course_title":"ASP.NET Core Web API & REST","ord":11,"level":"Intermediate","priority":"High","question":"How do you handle exceptions globally in a Web API?","question_html":"How do you handle exceptions globally in a Web API?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use <code>UseExceptionHandler()</code> with <code>IExceptionHandler</code> implementations (.NET 8+) and <code>AddProblemDetails()</code> to return RFC 9457 ProblemDetails JSON.</p>\n<ul class=\"q-points\"><li>Map known exception types to statuses (NotFound → 404, Validation → 400, Conflict → 409), log unexpected ones as errors with a trace ID, and never return stack traces in production.</li><li>For expected failures, consider the Result pattern instead of exceptions.</li></ul>\n"},{"id":409,"course_slug":"aspnet-core-webapi","course_title":"ASP.NET Core Web API & REST","ord":12,"level":"Intermediate","priority":"High","question":"How do you version an API?","question_html":"How do you version an API?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use the <code>Asp.Versioning</code> packages.</p>\n<ul class=\"q-points\"><li>Strategies: URL segment (<code>/api/v2/orders</code>, most common and cache-friendly), query string (<code>?api-version=2.0</code>), header (<code>api-version</code>), or media type.</li><li>Keep old versions running for a deprecation period, report supported/deprecated versions in headers, document each version in OpenAPI, and introduce a new major version only for breaking changes (removing or renaming fields, changing types or semantics).</li></ul>\n"},{"id":413,"course_slug":"aspnet-core-webapi","course_title":"ASP.NET Core Web API & REST","ord":16,"level":"Advanced","priority":"High","question":"How do you make a POST endpoint idempotent (e.g. payments)?","question_html":"How do you make a POST endpoint idempotent (e.g. payments)?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Require an <code>Idempotency-Key</code> header (a client-generated UUID).</p>\n<ul class=\"q-points\"><li>On the first request, store the key with request hash, status and response in a table (unique constraint on key + client).</li><li>Concurrent duplicates hit the constraint and wait or get 409.</li><li>Later repeats return the stored response instead of re-executing.</li><li>Expire keys after a period.</li><li>Combine this with DB unique constraints on business identifiers.</li><li>Stripe&#39;s API popularised the pattern.</li></ul>\n"},{"id":414,"course_slug":"aspnet-core-webapi","course_title":"ASP.NET Core Web API & REST","ord":17,"level":"Advanced","priority":"High","question":"How would you secure a public Web API end to end?","question_html":"How would you secure a public Web API end to end?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> HTTPS only with HSTS;</p>\n<ul class=\"q-points\"><li>OAuth 2.0/OIDC with short-lived JWTs (Authorization Code + PKCE for user clients, client credentials for services);</li><li>scope/role/policy authorisation plus resource ownership checks (IDOR);</li><li>input validation and request size limits;</li><li>parameterised data access;</li><li>rate limiting and an API gateway/WAF (APIM, Front Door);</li><li>strict CORS;</li><li>secrets in Key Vault with managed identities;</li><li>security headers;</li><li>dependency scanning;</li><li>logging and alerting on auth failures;</li><li>no sensitive data in URLs or logs;</li><li>and regular penetration tests or OWASP ZAP scans.</li></ul>\n"},{"id":417,"course_slug":"aspnet-core-webapi","course_title":"ASP.NET Core Web API & REST","ord":20,"level":"Scenario","priority":"High","question":"Your API returns 200 OK with { \"success\": false, \"error\": \"Not found\" } for everything. How would you improve it?","question_html":"Your API returns 200 OK with <code>{ &quot;success&quot;: false, &quot;error&quot;: &quot;Not found&quot; }</code> for everything. How would you improve it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use proper HTTP semantics.</p>\n<ul class=\"q-points\"><li>Return 404 for not found, 400/422 with ValidationProblemDetails for invalid input, 409 for conflicts, 401/403 for auth, 201 + Location for creates, 204 for deletes, and 500 ProblemDetails with a traceId for unexpected errors.</li><li>Clients, proxies, caches and monitoring tools rely on status codes; with 200 for everything, error-rate dashboards and retries break.</li><li>Roll it out in a new API version so existing clients keep working.</li></ul>\n"},{"id":418,"course_slug":"aspnet-core-webapi","course_title":"ASP.NET Core Web API & REST","ord":21,"level":"Scenario","priority":"High","question":"An endpoint that lists orders is slow (3 s) for a customer with 50,000 orders. What do you do?","question_html":"An endpoint that lists orders is slow (3 s) for a customer with 50,000 orders. What do you do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Profile first (Application Insights, EF logging).</p>\n<ul class=\"q-points\"><li>Typical fixes: add pagination (keyset for deep lists), project only needed columns with <code>Select</code> into DTOs, use <code>AsNoTracking</code>, add a covering index on <code>(CustomerId, CreatedAt DESC) INCLUDE (Total, Status)</code>, avoid N+1 by not lazy loading, return totals separately or approximately, and cache hot results with HybridCache.</li><li>If the client needs everything for export, make it an async job (202 Accepted + status URL) that streams a file.</li></ul>\n"},{"id":419,"course_slug":"aspnet-core-webapi","course_title":"ASP.NET Core Web API & REST","ord":22,"level":"Scenario","priority":"High","question":"A downstream payment API is slow and occasionally down, and your API threads pile up. How do you protect your service?","question_html":"A downstream payment API is slow and occasionally down, and your API threads pile up. How do you protect your service?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Add <strong>timeouts</strong> (per attempt and total), <strong>retries</strong> with exponential backoff and jitter only for idempotent calls (or with idempotency keys), a <strong>circuit breaker</strong> to fail fast while it&#39;s down, and a <strong>bulkhead/concurrency limit</strong> so payment calls can&#39;t consume all resources.</p>\n<ul class=\"q-points\"><li><code>AddStandardResilienceHandler()</code> covers most of this.</li><li>For non-interactive flows, put requests on a queue (Service Bus) and process them asynchronously with status callbacks or webhooks.</li><li>Return a clear 503/202 to clients and alert on circuit-open events.</li></ul>\n"},{"id":410,"course_slug":"aspnet-core-webapi","course_title":"ASP.NET Core Web API & REST","ord":13,"level":"Intermediate","priority":"Medium","question":"What is content negotiation?","question_html":"What is content negotiation?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The client states the formats it accepts (<code>Accept: application/json</code> or <code>application/xml</code>), and the server picks an output formatter that matches.</p>\n<ul class=\"q-points\"><li>If none matches, it uses the default (JSON) or returns 406 if <code>ReturnHttpNotAcceptable = true</code>.</li><li>Input format is determined by <code>Content-Type</code>; an unsupported one gives 415.</li><li>XML support is added with <code>AddXmlSerializerFormatters()</code>.</li></ul>\n"},{"id":411,"course_slug":"aspnet-core-webapi","course_title":"ASP.NET Core Web API & REST","ord":14,"level":"Intermediate","priority":"Medium","question":"How do you implement pagination? Offset vs keyset?","question_html":"How do you implement pagination? Offset vs keyset?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Offset: <code>Skip((page-1)*size).Take(size)</code> plus a total count.</p>\n<ul class=\"q-points\"><li>It&#39;s simple and allows jumping to any page, but it gets slow for deep pages (the DB still scans skipped rows) and is unstable when data changes.</li><li>Keyset/cursor: <code>WHERE (CreatedAt, Id) &lt; (@lastCreatedAt, @lastId) ORDER BY CreatedAt DESC, Id DESC</code> with <code>Take(size)</code> and a <code>nextCursor</code> in the response.</li><li>It&#39;s fast and stable, suited to infinite scroll and large tables.</li><li>Always cap the page size.</li></ul>\n"},{"id":412,"course_slug":"aspnet-core-webapi","course_title":"ASP.NET Core Web API & REST","ord":15,"level":"Intermediate","priority":"Medium","question":"What are the rate-limiting algorithms in ASP.NET Core?","question_html":"What are the rate-limiting algorithms in ASP.NET Core?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Built-in since .NET 7 (<code>AddRateLimiter</code>): <strong>Fixed window</strong> (N requests per window;</p>\n<ul class=\"q-points\"><li>bursty at window edges), <strong>Sliding window</strong> (window split into segments;</li><li>smoother), <strong>Token bucket</strong> (tokens refill at a rate;</li><li>allows bursts up to bucket size), <strong>Concurrency</strong> (max simultaneous requests).</li><li>Partition by user, API key or IP; return 429 with <code>Retry-After</code>.</li><li>For multiple instances, apply limits at the gateway (APIM, Front Door) or use a distributed store.</li></ul>\n"},{"id":415,"course_slug":"aspnet-core-webapi","course_title":"ASP.NET Core Web API & REST","ord":18,"level":"Advanced","priority":"Medium","question":"gRPC vs REST — when do you use gRPC?","question_html":"gRPC vs REST — when do you use gRPC?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> gRPC uses HTTP/2 with Protobuf binary serialisation, has contract-first <code>.proto</code> definitions with generated strongly typed clients, supports bidirectional streaming, and has lower latency and smaller payloads.</p>\n<ul class=\"q-points\"><li>Use it for internal microservice-to-microservice communication, streaming or polyglot environments.</li><li>Use REST/JSON for public APIs and browser clients (gRPC needs gRPC-Web in browsers), and where human readability and HTTP caching matter.</li></ul>\n"},{"id":416,"course_slug":"aspnet-core-webapi","course_title":"ASP.NET Core Web API & REST","ord":19,"level":"Advanced","priority":"Medium","question":"How do you test a Web API?","question_html":"How do you test a Web API?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Unit tests for services and handlers with mocked dependencies.</p>\n<ul class=\"q-points\"><li><strong>Integration tests</strong> with <code>WebApplicationFactory&lt;Program&gt;</code>: spin up the real pipeline in memory, replace infrastructure with Testcontainers SQL Server or a test DB, call endpoints with <code>HttpClient</code>, and assert status codes and JSON.</li><li>Add auth tests (fake JWT or a test auth handler), contract tests (OpenAPI diff, Pact), and load tests (k6, Azure Load Testing) before release.</li></ul>\n"},{"id":420,"course_slug":"aspnet-core-webapi","course_title":"ASP.NET Core Web API & REST","ord":23,"level":"Scenario","priority":"Medium","question":"Mobile clients on an old app version break when you rename a JSON field. How do you avoid this in future?","question_html":"Mobile clients on an old app version break when you rename a JSON field. How do you avoid this in future?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Treat the API as a contract.</p>\n<ul class=\"q-points\"><li>Make only <strong>additive</strong> changes in the current version (new optional fields; never rename or remove).</li><li>Introduce a new version (<code>/v2</code>) for breaking changes, and keep v1 alive with a published deprecation timeline (<code>Deprecation</code>/<code>Sunset</code> headers).</li><li>Add OpenAPI diff checks in CI to catch breaking changes, and use consumer-driven contract tests.</li><li>Clients should ignore unknown fields (tolerant reader).</li></ul>\n"},{"id":421,"course_slug":"aspnet-core-webapi","course_title":"ASP.NET Core Web API & REST","ord":24,"level":"Scenario","priority":"Medium","question":"After scaling the API to 3 instances, users randomly get logged out and in-memory cache data differs. Why?","question_html":"After scaling the API to 3 instances, users randomly get logged out and in-memory cache data differs. Why?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The state was per instance: in-memory session or cache, and maybe Data Protection keys (used for cookies and antiforgery) generated per instance.</p>\n<ul class=\"q-points\"><li>Fix: keep the API stateless (JWT), store session/cache in <strong>Redis</strong> (<code>IDistributedCache</code>/HybridCache L2), and persist <strong>Data Protection keys</strong> to a shared store (Azure Blob + Key Vault, Redis or a DB) with the same application name.</li><li>Avoid sticky sessions as a crutch.</li></ul>\n"},{"id":422,"course_slug":"aspnet-core-webapi","course_title":"ASP.NET Core Web API & REST","ord":25,"level":"Beginner","priority":"Medium","question":"What is Swagger/OpenAPI and how do you add it to an ASP.NET Core API?","question_html":"What is Swagger/OpenAPI and how do you add it to an ASP.NET Core API?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> OpenAPI is a standard, machine-readable description of an HTTP API (endpoints, parameters, schemas, auth);</p>\n<ul class=\"q-points\"><li>Swagger is the original name and the tooling around it (Swagger UI to explore and try endpoints).</li><li>In .NET 9+ use the built-in <code>builder.Services.AddOpenApi()</code> + <code>app.MapOpenApi()</code> (serves <code>/openapi/v1.json</code>) and add a UI such as Scalar or Swagger UI;</li><li>earlier versions use Swashbuckle (<code>AddSwaggerGen</code>, <code>UseSwagger</code>, <code>UseSwaggerUI</code>) or NSwag.</li><li>The document also lets you generate typed clients for Angular/React and test tools.</li></ul>\n"},{"id":423,"course_slug":"exception-handling","course_title":"Exception Handling & Custom Error Handling in .NET — Every Way, Every App Type","ord":1,"level":"Beginner","priority":"High","question":"What is the difference between throw and throw ex?","question_html":"What is the difference between throw and throw ex?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>throw;</code> rethrows the current exception and preserves the original stack trace.</p>\n<ul class=\"q-points\"><li><code>throw ex;</code> throws the same object as if it originated at that line, resetting the stack trace and hiding where the error really happened.</li><li>Use <code>throw;</code> or wrap in a new exception with the original as <code>InnerException</code>.</li></ul>\n"},{"id":424,"course_slug":"exception-handling","course_title":"Exception Handling & Custom Error Handling in .NET — Every Way, Every App Type","ord":2,"level":"Beginner","priority":"High","question":"What are best practices for exception handling in .NET?","question_html":"What are best practices for exception handling in .NET?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Validate early with guard clauses;</p>\n<ul class=\"q-points\"><li>catch only specific exceptions you can handle;</li><li>never swallow exceptions silently;</li><li>use <code>using</code> for cleanup;</li><li>rethrow with <code>throw;</code>;</li><li>wrap with context and inner exceptions;</li><li>don&#39;t use exceptions for normal flow (<code>TryParse</code>);</li><li>have one global handler at each application boundary that logs with a correlation id and returns safe responses;</li><li>custom exceptions only when callers handle them specifically.</li></ul>\n"},{"id":425,"course_slug":"exception-handling","course_title":"Exception Handling & Custom Error Handling in .NET — Every Way, Every App Type","ord":3,"level":"Beginner","priority":"High","question":"What does finally do? When doesn't it run?","question_html":"What does finally do? When doesn&#39;t it run?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>finally</code> runs after the try (and any catch) whether an exception occurred or not — for cleanup.</p>\n<ul class=\"q-points\"><li>It doesn&#39;t run if the process is killed, on <code>Environment.FailFast</code>, on a StackOverflowException, or if the thread hangs inside try.</li><li><code>using</code> statements compile to try/finally.</li></ul>\n"},{"id":426,"course_slug":"exception-handling","course_title":"Exception Handling & Custom Error Handling in .NET — Every Way, Every App Type","ord":4,"level":"Beginner","priority":"High","question":"How do you create a custom exception?","question_html":"How do you create a custom exception?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Derive from <code>Exception</code> (or your own base like <code>AppException</code>), name it <code>...Exception</code>, provide constructors for message and inner exception, and add properties with useful data (entity, key, error code).</p>\n<ul class=\"q-points\"><li>Create one when callers need to distinguish that case (e.g. map to 404 or 409); otherwise use built-in exceptions.</li></ul>\n"},{"id":427,"course_slug":"exception-handling","course_title":"Exception Handling & Custom Error Handling in .NET — Every Way, Every App Type","ord":5,"level":"Intermediate","priority":"High","question":"How do you implement global exception handling in ASP.NET Core?","question_html":"How do you implement global exception handling in ASP.NET Core?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use <code>UseExceptionHandler()</code> with <code>AddProblemDetails()</code> and one or more <code>IExceptionHandler</code> implementations (.NET 8+) — or custom middleware registered first in older versions — to log the exception with a trace id and map exception types to status codes (404, 409, 422, 500) with ProblemDetails bodies.</p>\n<ul class=\"q-points\"><li>Add <code>UseStatusCodePages</code> for empty error responses, exception filters for MVC-specific mapping, and the developer exception page only in development.</li></ul>\n"},{"id":428,"course_slug":"exception-handling","course_title":"Exception Handling & Custom Error Handling in .NET — Every Way, Every App Type","ord":6,"level":"Intermediate","priority":"High","question":"Middleware vs exception filter for handling exceptions — which and why?","question_html":"Middleware vs exception filter for handling exceptions — which and why?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Exception middleware/handler wraps the whole pipeline, so it catches errors from routing, other middleware, controllers, minimal APIs and views — the right place for global logging and response shaping.</p>\n<ul class=\"q-points\"><li>Exception filters only see exceptions from MVC actions and filters but have access to MVC context (action, model state) — useful for controller-specific mapping.</li><li>Typically: a global handler plus optional filters.</li></ul>\n"},{"id":429,"course_slug":"exception-handling","course_title":"Exception Handling & Custom Error Handling in .NET — Every Way, Every App Type","ord":7,"level":"Intermediate","priority":"High","question":"How are errors handled in ASP.NET MVC 5 and Web Forms?","question_html":"How are errors handled in ASP.NET MVC 5 and Web Forms?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Web Forms: try/catch → <code>Page_Error</code> → <code>Application_Error</code> in Global.asax → <code>customErrors</code>/<code>httpErrors</code> in web.config (ELMAH or log frameworks for logging).</p>\n<ul class=\"q-points\"><li>MVC 5: try/catch → controller <code>OnException</code> → <code>[HandleError]</code>/custom <code>IExceptionFilter</code> (global in FilterConfig) → <code>Application_Error</code> (for routing/404 and non-MVC errors) → customErrors/httpErrors.</li><li>Web API 2 adds <code>IExceptionHandler</code>/<code>IExceptionLogger</code>.</li></ul>\n"},{"id":430,"course_slug":"exception-handling","course_title":"Exception Handling & Custom Error Handling in .NET — Every Way, Every App Type","ord":8,"level":"Intermediate","priority":"High","question":"Exceptions or Result objects — when to use which?","question_html":"Exceptions or Result objects — when to use which?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use exceptions for unexpected or exceptional conditions (bugs, infrastructure down, broken invariants) — they bubble to a global handler.</p>\n<ul class=\"q-points\"><li>Use Result objects for expected outcomes that callers must handle (validation failed, not found in a lookup, business rule rejected) — explicit in the signature and cheaper.</li><li>Mixing them consistently (documented in the team) is common.</li></ul>\n"},{"id":436,"course_slug":"exception-handling","course_title":"Exception Handling & Custom Error Handling in .NET — Every Way, Every App Type","ord":14,"level":"Scenario","priority":"High","question":"Users see a yellow error page with SQL details in production. What do you change?","question_html":"Users see a yellow error page with SQL details in production. What do you change?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Turn on custom errors (<code>customErrors mode=&quot;On&quot;</code>/<code>RemoteOnly</code> and IIS <code>httpErrors</code> in .NET Framework;</p>\n<ul class=\"q-points\"><li><code>UseExceptionHandler</code> and not the developer page outside Development in Core), make sure <code>ASPNETCORE_ENVIRONMENT=Production</code> / <code>compilation debug=&quot;false&quot;</code>, add a global handler that logs the full exception with a correlation id and shows a friendly page with that id, and review what else leaked (connection strings, versions).</li></ul>\n"},{"id":437,"course_slug":"exception-handling","course_title":"Exception Handling & Custom Error Handling in .NET — Every Way, Every App Type","ord":15,"level":"Scenario","priority":"High","question":"An API returns 500 for \"customer not found\" and \"invalid quantity\". How do you improve it?","question_html":"An API returns 500 for &quot;customer not found&quot; and &quot;invalid quantity&quot;. How do you improve it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Distinguish expected failures from bugs: validate input (400 via <code>[ApiController]</code>/FluentValidation), throw or return a NotFound result (404), map business rule violations to 409/422 with error codes — all through a global <code>IExceptionHandler</code> producing ProblemDetails.</p>\n<ul class=\"q-points\"><li>Keep 500 for real unexpected errors only, which then become meaningful alerts.</li></ul>\n"},{"id":431,"course_slug":"exception-handling","course_title":"Exception Handling & Custom Error Handling in .NET — Every Way, Every App Type","ord":9,"level":"Intermediate","priority":"Medium","question":"How do exceptions behave with async/await and Task.WhenAll?","question_html":"How do exceptions behave with async/await and Task.WhenAll?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>await</code> unwraps and rethrows the task&#39;s exception directly (the first one).</p>\n<ul class=\"q-points\"><li><code>Task.WhenAll</code> faults with all exceptions in <code>AggregateException</code>, but <code>await</code> rethrows only the first — inspect <code>task.Exception.InnerExceptions</code> for all.</li><li><code>.Result</code>/<code>.Wait()</code> wrap in <code>AggregateException</code> and risk deadlocks.</li><li><code>async void</code> exceptions can&#39;t be caught by callers and crash the process.</li></ul>\n"},{"id":432,"course_slug":"exception-handling","course_title":"Exception Handling & Custom Error Handling in .NET — Every Way, Every App Type","ord":10,"level":"Intermediate","priority":"Medium","question":"What is ProblemDetails?","question_html":"What is ProblemDetails?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A standard JSON format (RFC 9457, previously 7807) for HTTP API errors with <code>type</code>, <code>title</code>, <code>status</code>, <code>detail</code>, <code>instance</code> and extension fields (e.g. <code>traceId</code>, <code>errorCode</code>, validation <code>errors</code>).</p>\n<ul class=\"q-points\"><li>ASP.NET Core produces it for validation errors (<code>[ApiController]</code>) and, with <code>AddProblemDetails</code>, for exceptions and status codes — clients get one consistent error shape.</li></ul>\n"},{"id":433,"course_slug":"exception-handling","course_title":"Exception Handling & Custom Error Handling in .NET — Every Way, Every App Type","ord":11,"level":"Intermediate","priority":"Medium","question":"How do you handle a unique-key violation from SQL Server?","question_html":"How do you handle a unique-key violation from SQL Server?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Catch <code>DbUpdateException</code> (EF) or <code>SqlException</code> with <code>Number</code> 2627/2601, translate it to a domain/conflict exception, and return 409 with a friendly message (&quot;email already registered&quot;).</p>\n<ul class=\"q-points\"><li>Better still, check for duplicates first for a nicer UX, but keep the unique constraint as the real guarantee against race conditions.</li></ul>\n"},{"id":434,"course_slug":"exception-handling","course_title":"Exception Handling & Custom Error Handling in .NET — Every Way, Every App Type","ord":12,"level":"Advanced","priority":"Medium","question":"What happens to an unhandled exception in a background thread or BackgroundService?","question_html":"What happens to an unhandled exception in a background thread or BackgroundService?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> An unhandled exception on a thread (not a Task) terminates the process after raising <code>AppDomain.UnhandledException</code>.</p>\n<ul class=\"q-points\"><li>In a <code>BackgroundService</code>, an exception escaping <code>ExecuteAsync</code> stops the host by default since .NET 6 (configurable with <code>BackgroundServiceExceptionBehavior</code>).</li><li>Unobserved faulted tasks raise <code>TaskScheduler.UnobservedTaskException</code> but no longer crash the process.</li><li>Wrap each unit of work in try/catch, log, and continue or back off.</li></ul>\n"},{"id":435,"course_slug":"exception-handling","course_title":"Exception Handling & Custom Error Handling in .NET — Every Way, Every App Type","ord":13,"level":"Advanced","priority":"Medium","question":"Why should you not catch System.Exception everywhere?","question_html":"Why should you not catch System.Exception everywhere?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> It hides bugs and unexpected states, makes the program continue with corrupted data, catches exceptions you can&#39;t handle (OutOfMemory, cancellation) and duplicates logging.</p>\n<ul class=\"q-points\"><li>Catch <code>Exception</code> only at boundaries — global handlers, top of background loops, plug-in hosts — where you log and fail safely.</li></ul>\n"},{"id":438,"course_slug":"exception-handling","course_title":"Exception Handling & Custom Error Handling in .NET — Every Way, Every App Type","ord":16,"level":"Scenario","priority":"Medium","question":"Intermittent \"deadlock victim\" errors appear under load. How do you handle them in code?","question_html":"Intermittent &quot;deadlock victim&quot; errors appear under load. How do you handle them in code?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> They are SQL error 1205 — transient by nature.</p>\n<ul class=\"q-points\"><li>Retry the whole transaction a few times with backoff (EF Core execution strategy / Polly), keeping the operation idempotent.</li><li>In parallel fix the cause: consistent access order of tables, shorter transactions, proper indexes, RCSI isolation to reduce reader/writer blocking.</li></ul>\n"},{"id":439,"course_slug":"logging","course_title":"Logging & Custom Logging in .NET — ILogger, Serilog, NLog, log4net and Your Own Logger","ord":1,"level":"Beginner","priority":"High","question":"What are the log levels in .NET and when do you use each?","question_html":"What are the log levels in .NET and when do you use each?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Trace (very detailed internals, off in production), Debug (developer diagnostics), Information (normal business events: order placed, user logged in), Warning (unexpected but handled: retry, slow dependency), Error (an operation failed — with the exception), Critical (system-wide failure needing immediate attention).</p>\n<ul class=\"q-points\"><li>Configure the minimum level per category so production logs stay useful and affordable.</li></ul>\n"},{"id":440,"course_slug":"logging","course_title":"Logging & Custom Logging in .NET — ILogger, Serilog, NLog, log4net and Your Own Logger","ord":2,"level":"Beginner","priority":"High","question":"What is structured logging and why is it better than string logs?","question_html":"What is structured logging and why is it better than string logs?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Logging a message template with named properties (<code>&quot;Order {OrderId} placed&quot;, id</code>) so each property is stored as a separate field.</p>\n<ul class=\"q-points\"><li>You can search, filter and aggregate by <code>OrderId</code> or <code>Total</code> across millions of entries, build dashboards and alerts, and the logger avoids formatting work when the level is disabled.</li><li>Interpolated strings lose that structure.</li></ul>\n"},{"id":441,"course_slug":"logging","course_title":"Logging & Custom Logging in .NET — ILogger, Serilog, NLog, log4net and Your Own Logger","ord":3,"level":"Beginner","priority":"High","question":"How does logging work in ASP.NET Core?","question_html":"How does logging work in ASP.NET Core?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Through <code>Microsoft.Extensions.Logging</code>: inject <code>ILogger&lt;T&gt;</code> (category = class name), call <code>LogInformation/LogError</code> etc. Providers (Console, Debug, EventLog, Application Insights, OpenTelemetry, Serilog/NLog) write the entries;</p>\n<ul class=\"q-points\"><li><code>appsettings.json</code> &quot;Logging&quot; section filters by category and level;</li><li>scopes add contextual properties like RequestId and TraceId.</li></ul>\n"},{"id":443,"course_slug":"logging","course_title":"Logging & Custom Logging in .NET — ILogger, Serilog, NLog, log4net and Your Own Logger","ord":5,"level":"Intermediate","priority":"High","question":"Serilog vs NLog vs log4net vs built-in ILogger?","question_html":"Serilog vs NLog vs log4net vs built-in ILogger?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> ILogger is the abstraction your code depends on; the others are implementations plugged in as providers.</p>\n<ul class=\"q-points\"><li>Serilog: structured logging first, rich sinks and enrichers, code or JSON configuration — the popular choice for modern .NET.</li><li>NLog: mature, XML/JSON config, many targets, good performance, works in Framework and Core. log4net: older, XML-configured, common in legacy .NET Framework apps, limited structured support.</li><li>Built-in providers + OpenTelemetry/App Insights are enough for many cloud apps.</li></ul>\n"},{"id":444,"course_slug":"logging","course_title":"Logging & Custom Logging in .NET — ILogger, Serilog, NLog, log4net and Your Own Logger","ord":6,"level":"Intermediate","priority":"High","question":"How do you correlate logs across multiple services?","question_html":"How do you correlate logs across multiple services?","answer_html":"<p>Use a correlation/trace id generated at the edge and propagated in headers (W3C <code>traceparent</code> automatically via <code>Activity</code>/OpenTelemetry, or <code>X-Correlation-ID</code>), include it in every log (scope/enricher), return it to clients in error responses, and send logs from all services to one store where you can filter by that id or open the distributed trace.</p>\n"},{"id":445,"course_slug":"logging","course_title":"Logging & Custom Logging in .NET — ILogger, Serilog, NLog, log4net and Your Own Logger","ord":7,"level":"Intermediate","priority":"High","question":"How would you write a custom logger in .NET?","question_html":"How would you write a custom logger in .NET?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Implement <code>ILoggerProvider</code> (creates <code>ILogger</code> instances per category and holds shared resources) and <code>ILogger</code> (<code>IsEnabled</code>, <code>Log</code>, <code>BeginScope</code>), register it with <code>builder.Logging.AddProvider(...)</code>.</p>\n<ul class=\"q-points\"><li>Make writing asynchronous and batched through a bounded queue (Channel) so logging never blocks requests, handle sink failures without throwing, and dispose/flush on shutdown.</li></ul>\n"},{"id":452,"course_slug":"logging","course_title":"Logging & Custom Logging in .NET — ILogger, Serilog, NLog, log4net and Your Own Logger","ord":14,"level":"Scenario","priority":"High","question":"Production has an intermittent bug you can't reproduce. How do you use logging to find it?","question_html":"Production has an intermittent bug you can&#39;t reproduce. How do you use logging to find it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Check existing logs around the failure times (filter by error, user, trace id);</p>\n<ul class=\"q-points\"><li>if insufficient, add targeted structured logs (inputs, decisions, external call results) at Information/Debug for that category, temporarily raise its level via configuration without redeploying, correlate with traces and metrics (load, dependency latency), and look for patterns (specific tenant, data, time, server).</li><li>Remove or lower the extra logging afterwards.</li></ul>\n"},{"id":442,"course_slug":"logging","course_title":"Logging & Custom Logging in .NET — ILogger, Serilog, NLog, log4net and Your Own Logger","ord":4,"level":"Beginner","priority":"Medium","question":"What should never be logged?","question_html":"What should never be logged?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Passwords, tokens/API keys, connection strings, full card numbers/CVV, secrets, and personal data beyond what&#39;s needed (Aadhaar/PAN, health data, full addresses) — logs are widely accessible and kept long.</p>\n<ul class=\"q-points\"><li>Mask or redact, log identifiers instead of content, and review log output in code reviews.</li></ul>\n"},{"id":446,"course_slug":"logging","course_title":"Logging & Custom Logging in .NET — ILogger, Serilog, NLog, log4net and Your Own Logger","ord":8,"level":"Intermediate","priority":"Medium","question":"What are logging scopes?","question_html":"What are logging scopes?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A way to attach contextual properties to all log entries written within a block (<code>using (logger.BeginScope(...))</code>) — e.g. OrderId, TenantId, CorrelationId.</p>\n<ul class=\"q-points\"><li>ASP.NET Core adds request scopes automatically.</li><li>Providers must support scopes (Serilog&#39;s <code>Enrich.FromLogContext</code>, console <code>IncludeScopes</code>).</li></ul>\n"},{"id":447,"course_slug":"logging","course_title":"Logging & Custom Logging in .NET — ILogger, Serilog, NLog, log4net and Your Own Logger","ord":9,"level":"Intermediate","priority":"Medium","question":"What is the difference between audit logging and application logging?","question_html":"What is the difference between audit logging and application logging?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Application (diagnostic) logs help developers and operators troubleshoot — technical, short retention, can be sampled.</p>\n<ul class=\"q-points\"><li>Audit logs record who did what to which data and when (often with before/after values) for compliance and security — complete, tamper-evident, long retention, stored separately (audit tables, temporal tables, SQL Server Audit, immutable storage).</li></ul>\n"},{"id":448,"course_slug":"logging","course_title":"Logging & Custom Logging in .NET — ILogger, Serilog, NLog, log4net and Your Own Logger","ord":10,"level":"Advanced","priority":"Medium","question":"How do you make logging fast and avoid performance problems?","question_html":"How do you make logging fast and avoid performance problems?","answer_html":"<p>Use message templates (no interpolation), check <code>IsEnabled</code> before expensive work, use the <code>[LoggerMessage]</code> source generator for hot paths, avoid logging large objects or inside tight loops, set sensible minimum levels per category, use asynchronous/batching sinks, and sample high-volume diagnostic data.</p>\n"},{"id":449,"course_slug":"logging","course_title":"Logging & Custom Logging in .NET — ILogger, Serilog, NLog, log4net and Your Own Logger","ord":11,"level":"Advanced","priority":"Medium","question":"How did you log errors in .NET Framework Web Forms/MVC apps?","question_html":"How did you log errors in .NET Framework Web Forms/MVC apps?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Typically log4net or NLog configured in web.config/separate config, initialised in <code>Application_Start</code>;</p>\n<ul class=\"q-points\"><li>unhandled errors captured in <code>Application_Error</code> (and MVC exception filters) and logged with the request URL and user;</li><li>ELMAH for automatic error capture with a protected viewer;</li><li>Windows Event Log for critical service events;</li><li>health monitoring in older apps.</li></ul>\n"},{"id":450,"course_slug":"logging","course_title":"Logging & Custom Logging in .NET — ILogger, Serilog, NLog, log4net and Your Own Logger","ord":12,"level":"Intermediate","priority":"Medium","question":"How do you change log levels in production without redeploying?","question_html":"How do you change log levels in production without redeploying?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Keep levels in configuration (<code>appsettings.json</code>, environment variables, Azure App Configuration) with <code>reloadOnChange</code> so <code>ILogger</code> filters update live;</p>\n<ul class=\"q-points\"><li>Serilog supports <code>LoggingLevelSwitch</code> controlled from configuration or an admin endpoint;</li><li>NLog reloads <code>nlog.config</code> automatically (<code>autoReload=&quot;true&quot;</code>).</li><li>Raise the level only for the affected category and lower it again afterwards.</li></ul>\n"},{"id":451,"course_slug":"logging","course_title":"Logging & Custom Logging in .NET — ILogger, Serilog, NLog, log4net and Your Own Logger","ord":13,"level":"Beginner","priority":"Medium","question":"What is the difference between Console.WriteLine/Debug.WriteLine and a logging framework?","question_html":"What is the difference between Console.WriteLine/Debug.WriteLine and a logging framework?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>Console.WriteLine</code> writes plain text to stdout with no levels, categories, structure or filtering; <code>Debug.WriteLine</code> only works in debug builds with a debugger listener.</p>\n<ul class=\"q-points\"><li>A logging framework adds levels, categories, structured properties, scopes, multiple outputs (files, Seq, App Insights), filtering by configuration, async batching and correlation with traces — essential for production.</li></ul>\n"},{"id":453,"course_slug":"logging","course_title":"Logging & Custom Logging in .NET — ILogger, Serilog, NLog, log4net and Your Own Logger","ord":15,"level":"Scenario","priority":"Medium","question":"Logging costs on the cloud are exploding. What do you change?","question_html":"Logging costs on the cloud are exploding. What do you change?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Measure which categories produce the most volume;</p>\n<ul class=\"q-points\"><li>raise minimum levels for noisy framework categories (EF commands, ASP.NET routing) and Debug/Trace in production;</li><li>replace per-item logs in loops with summaries;</li><li>sample high-volume telemetry;</li><li>shorten retention for diagnostic logs (keep audit logs separately);</li><li>use metrics instead of logs for counts;</li><li>drop duplicate logging of the same exception at multiple layers.</li></ul>\n"},{"id":454,"course_slug":"logging","course_title":"Logging & Custom Logging in .NET — ILogger, Serilog, NLog, log4net and Your Own Logger","ord":16,"level":"Scenario","priority":"Medium","question":"The app writes logs to a database, and when the database is slow, requests become slow too. Fix it.","question_html":"The app writes logs to a database, and when the database is slow, requests become slow too. Fix it.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Logging is synchronous on the request path.</p>\n<ul class=\"q-points\"><li>Make it asynchronous with a bounded in-memory queue and a background writer that batches inserts;</li><li>drop or spill to a local file when the queue is full;</li><li>use a separate logging database or, better, a dedicated log platform (Seq/App Insights/ELK);</li><li>never let logging failures throw into business code.</li></ul>\n"},{"id":455,"course_slug":"custom-controls","course_title":"Custom Controls & Reusable UI Components in .NET — Web Forms to Blazor","ord":1,"level":"Beginner","priority":"High","question":"What is the difference between a user control and a custom control in ASP.NET?","question_html":"What is the difference between a user control and a custom control in ASP.NET?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> User control (.ascx): created with markup + code-behind, easy to build, reusable only within the same web application (the .ascx file must be present), limited design-time support.</p>\n<ul class=\"q-points\"><li>Custom server control: a compiled class deriving from <code>Control</code>/<code>WebControl</code>/<code>CompositeControl</code> that renders its own HTML;</li><li>reusable across applications via a DLL, can be added to the Toolbox with designer support, more effort to build.</li></ul>\n"},{"id":456,"course_slug":"custom-controls","course_title":"Custom Controls & Reusable UI Components in .NET — Web Forms to Blazor","ord":2,"level":"Beginner","priority":"High","question":"What is a custom HTML helper in MVC and how do you create one?","question_html":"What is a custom HTML helper in MVC and how do you create one?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> An extension method on <code>HtmlHelper</code> (or <code>HtmlHelper&lt;TModel&gt;</code>) returning <code>MvcHtmlString</code>/<code>IHtmlContent</code> that generates reusable markup, e.g. <code>@Html.Money(total)</code>.</p>\n<ul class=\"q-points\"><li>Build HTML with <code>TagBuilder</code> (which encodes text), import the namespace in <code>Views/web.config</code> (MVC 5) or <code>_ViewImports.cshtml</code> (Core).</li></ul>\n"},{"id":457,"course_slug":"custom-controls","course_title":"Custom Controls & Reusable UI Components in .NET — Web Forms to Blazor","ord":3,"level":"Beginner","priority":"High","question":"What are tag helpers? How do they differ from HTML helpers?","question_html":"What are tag helpers? How do they differ from HTML helpers?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Tag helpers are classes that process HTML elements/attributes in Razor (<code>&lt;input asp-for=&quot;Name&quot;&gt;</code>, custom <code>&lt;money amount=&quot;...&quot;&gt;</code>), producing HTML on the server.</p>\n<ul class=\"q-points\"><li>They look like HTML (designer-friendly, attribute IntelliSense) versus HTML helpers which are C# method calls (<code>@Html.TextBoxFor(...)</code>).</li><li>Tag helpers exist only in ASP.NET Core; both can be mixed.</li></ul>\n"},{"id":458,"course_slug":"custom-controls","course_title":"Custom Controls & Reusable UI Components in .NET — Web Forms to Blazor","ord":4,"level":"Intermediate","priority":"High","question":"View component vs partial view?","question_html":"View component vs partial view?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A partial view renders markup with data provided by the caller;</p>\n<ul class=\"q-points\"><li>a view component is a class with its own logic and dependencies (constructor injection, async <code>InvokeAsync</code>) plus a view — for widgets that fetch their own data (cart summary, navigation menu).</li><li>View components replace MVC 5 child actions and are lighter than a full controller action.</li></ul>\n"},{"id":459,"course_slug":"custom-controls","course_title":"Custom Controls & Reusable UI Components in .NET — Web Forms to Blazor","ord":5,"level":"Intermediate","priority":"High","question":"How do you create a reusable Blazor component? How does a child notify a parent?","question_html":"How do you create a reusable Blazor component? How does a child notify a parent?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Create a <code>.razor</code> file with markup and an <code>@code</code> block;</p>\n<ul class=\"q-points\"><li>expose inputs as <code>[Parameter]</code> properties, content slots as <code>RenderFragment</code> (<code>ChildContent</code>, templates <code>RenderFragment&lt;T&gt;</code>), and notify the parent through <code>[Parameter] EventCallback</code>/<code>EventCallback&lt;T&gt;</code> invoked with <code>InvokeAsync</code>, which also triggers the parent&#39;s re-render.</li><li>For two-way binding expose <code>Value</code> + <code>ValueChanged</code>.</li></ul>\n"},{"id":468,"course_slug":"custom-controls","course_title":"Custom Controls & Reusable UI Components in .NET — Web Forms to Blazor","ord":14,"level":"Scenario","priority":"High","question":"Twenty MVC pages repeat the same \"price with discount badge\" markup with slight differences. What do you build?","question_html":"Twenty MVC pages repeat the same &quot;price with discount badge&quot; markup with slight differences. What do you build?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> In ASP.NET Core: a tag helper (<code>&lt;price amount=&quot;..&quot; discount=&quot;..&quot;&gt;</code>) if it only needs values passed in, or a partial view/display template for richer markup;</p>\n<ul class=\"q-points\"><li>a view component if it must fetch data (e.g. live offers).</li><li>In MVC 5: a custom HTML helper or a display template with <code>[UIHint]</code>.</li><li>Centralising fixes formatting bugs once and keeps pages consistent.</li></ul>\n"},{"id":460,"course_slug":"custom-controls","course_title":"Custom Controls & Reusable UI Components in .NET — Web Forms to Blazor","ord":6,"level":"Intermediate","priority":"Medium","question":"How do you keep a custom Web Forms control's property value across postbacks?","question_html":"How do you keep a custom Web Forms control&#39;s property value across postbacks?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Store it in <code>ViewState</code> in the property getter/setter (<code>ViewState[&quot;Amount&quot;]</code>), which is saved and restored automatically;</p>\n<ul class=\"q-points\"><li>for essential state that must work even with ViewState disabled use ControlState (<code>RegisterRequiresControlState</code>, <code>SaveControlState/LoadControlState</code>).</li><li>Child controls of composite controls must be recreated in <code>CreateChildControls</code> on every request.</li></ul>\n"},{"id":461,"course_slug":"custom-controls","course_title":"Custom Controls & Reusable UI Components in .NET — Web Forms to Blazor","ord":7,"level":"Intermediate","priority":"Medium","question":"What is a Razor Class Library?","question_html":"What is a Razor Class Library?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A class library project that contains Razor views, Razor Pages, view components, tag helpers, Blazor components and static web assets, which other ASP.NET Core apps reference (project or NuGet).</p>\n<ul class=\"q-points\"><li>It lets teams share UI (layouts, admin areas, component kits) across applications; static files are served from <code>_content/{LibraryName}/</code>.</li></ul>\n"},{"id":462,"course_slug":"custom-controls","course_title":"Custom Controls & Reusable UI Components in .NET — Web Forms to Blazor","ord":8,"level":"Advanced","priority":"Medium","question":"What are dependency properties in WPF and why do custom controls use them?","question_html":"What are dependency properties in WPF and why do custom controls use them?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Properties registered with the WPF property system (<code>DependencyProperty.Register</code>) whose values can come from bindings, styles, templates, animations and inheritance, with change notifications and default values.</p>\n<ul class=\"q-points\"><li>Custom controls expose their public properties as dependency properties so consumers can data-bind and style them.</li></ul>\n"},{"id":463,"course_slug":"custom-controls","course_title":"Custom Controls & Reusable UI Components in .NET — Web Forms to Blazor","ord":9,"level":"Advanced","priority":"Medium","question":"How do you test UI components?","question_html":"How do you test UI components?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Blazor: bUnit renders components in memory, sets parameters, triggers events and asserts markup/callbacks.</p>\n<ul class=\"q-points\"><li>Tag helpers: unit test <code>Process</code> with fake <code>TagHelperContext</code>/<code>TagHelperOutput</code>.</li><li>View components: unit test <code>InvokeAsync</code> results with mocked services.</li><li>Web Forms controls: test logic extracted from the control; render tests via <code>HtmlTextWriter</code>.</li><li>End-to-end: Playwright/Selenium.</li></ul>\n"},{"id":464,"course_slug":"custom-controls","course_title":"Custom Controls & Reusable UI Components in .NET — Web Forms to Blazor","ord":10,"level":"Beginner","priority":"Medium","question":"What is the difference between Control, WebControl and CompositeControl in Web Forms?","question_html":"What is the difference between Control, WebControl and CompositeControl in Web Forms?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>Control</code> is the base of all server controls — no styling properties; you override <code>Render</code> and write all HTML.</p>\n<ul class=\"q-points\"><li><code>WebControl</code> adds common style properties (CssClass, Style, Font, Enabled) and a tag-rendering model (<code>TagKey</code>, <code>AddAttributesToRender</code>, <code>RenderContents</code>).</li><li><code>CompositeControl</code> builds its UI from child controls in <code>CreateChildControls</code> (reusing TextBoxes, Buttons, validators) and handles naming and child-control lifetime for you.</li></ul>\n"},{"id":465,"course_slug":"custom-controls","course_title":"Custom Controls & Reusable UI Components in .NET — Web Forms to Blazor","ord":11,"level":"Intermediate","priority":"Medium","question":"How do you make a Blazor component support two-way binding with @bind-Value?","question_html":"How do you make a Blazor component support two-way binding with @bind-Value?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Expose a <code>[Parameter] public T Value</code> and a <code>[Parameter] public EventCallback&lt;T&gt; ValueChanged</code> (optionally <code>ValueExpression</code> for validation).</p>\n<ul class=\"q-points\"><li>When the component&#39;s internal value changes, call <code>await ValueChanged.InvokeAsync(newValue)</code>.</li><li>The parent can then write <code>&lt;MyInput @bind-Value=&quot;model.Name&quot; /&gt;</code>, which Blazor expands to Value + ValueChanged.</li></ul>\n"},{"id":466,"course_slug":"custom-controls","course_title":"Custom Controls & Reusable UI Components in .NET — Web Forms to Blazor","ord":12,"level":"Intermediate","priority":"Medium","question":"What are display and editor templates in MVC?","question_html":"What are display and editor templates in MVC?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Razor partials placed in <code>Views/Shared/DisplayTemplates</code> or <code>EditorTemplates</code> (or per controller) named after a type (<code>DateTime.cshtml</code>, <code>Money.cshtml</code>) or selected with <code>[UIHint(&quot;Money&quot;)]</code>.</p>\n<ul class=\"q-points\"><li><code>Html.DisplayFor</code>/<code>EditorFor</code> automatically use them, so every property of that type renders consistently across the site — a lightweight way to build reusable UI without code.</li></ul>\n"},{"id":467,"course_slug":"custom-controls","course_title":"Custom Controls & Reusable UI Components in .NET — Web Forms to Blazor","ord":13,"level":"Intermediate","priority":"Medium","question":"How do you share UI components across several ASP.NET Core applications?","question_html":"How do you share UI components across several ASP.NET Core applications?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Put them in a Razor Class Library — views, partials, view components, tag helpers, Blazor components and static assets — and reference it as a project or publish it as an internal NuGet package with semantic versioning.</p>\n<ul class=\"q-points\"><li>Consumers add <code>@addTagHelper</code> / <code>@using</code> in <code>_ViewImports</code>, and static files are available under <code>_content/{LibraryName}/</code>.</li></ul>\n"},{"id":469,"course_slug":"custom-controls","course_title":"Custom Controls & Reusable UI Components in .NET — Web Forms to Blazor","ord":15,"level":"Scenario","priority":"Medium","question":"A dynamically created custom control in Web Forms loses its value and its Click event doesn't fire. Why?","question_html":"A dynamically created custom control in Web Forms loses its value and its Click event doesn&#39;t fire. Why?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Its child controls aren&#39;t recreated early enough or with the same IDs on postback, so ViewState and posted data can&#39;t be applied and the event source isn&#39;t found.</p>\n<ul class=\"q-points\"><li>Create children in <code>CreateChildControls</code> (called via <code>EnsureChildControls</code>) on every request, implement <code>INamingContainer</code>, and add dynamic instances of the control in <code>Page_Init</code>/<code>PreInit</code>, not inside <code>if (!IsPostBack)</code>.</li></ul>\n"},{"id":470,"course_slug":"custom-controls","course_title":"Custom Controls & Reusable UI Components in .NET — Web Forms to Blazor","ord":16,"level":"Scenario","priority":"Medium","question":"A Blazor grid component with 5,000 rows makes the page slow. How do you improve it?","question_html":"A Blazor grid component with 5,000 rows makes the page slow. How do you improve it?","answer_html":"<p>Virtualize rows (<code>&lt;Virtualize&gt;</code> component) or page server-side, add <code>@key</code> to row elements, avoid re-rendering the whole grid on every change (<code>ShouldRender</code>, immutable parameters, split into smaller components), avoid heavy work in <code>OnParametersSet</code>, and use QuickGrid or a component library&#39;s optimised grid.</p>\n"},{"id":471,"course_slug":"project-architecture","course_title":".NET Project Architectures & Folder Structures — Layered, Clean, Onion, Vertical Slice","ord":1,"level":"Beginner","priority":"High","question":"Explain 3-tier (N-layer) architecture.","question_html":"Explain 3-tier (N-layer) architecture.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Presentation (UI), business logic (services/BLL) and data access (DAL/repositories), each calling only the layer below.</p>\n<ul class=\"q-points\"><li>It separates concerns and lets teams work on layers independently.</li><li>Layers are logical; tiers are physical machines.</li><li>Weakness: business logic often depends directly on data access, making it hard to test and change.</li></ul>\n"},{"id":472,"course_slug":"project-architecture","course_title":".NET Project Architectures & Folder Structures — Layered, Clean, Onion, Vertical Slice","ord":2,"level":"Beginner","priority":"High","question":"What is Clean Architecture? What is the dependency rule?","question_html":"What is Clean Architecture? What is the dependency rule?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> An architecture that places the domain (entities, business rules) and application use cases at the centre and frameworks, UI and databases at the outside.</p>\n<ul class=\"q-points\"><li>The dependency rule: source-code dependencies only point inward — the domain depends on nothing;</li><li>the application defines interfaces that infrastructure implements;</li><li>the web project is the composition root that wires everything with DI.</li></ul>\n"},{"id":473,"course_slug":"project-architecture","course_title":".NET Project Architectures & Folder Structures — Layered, Clean, Onion, Vertical Slice","ord":3,"level":"Beginner","priority":"High","question":"How do you structure a typical ASP.NET Core Web API solution?","question_html":"How do you structure a typical ASP.NET Core Web API solution?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>src/</code> with Domain (entities, value objects), Application (use cases, DTOs, interfaces, validation), Infrastructure (EF Core DbContext, migrations, external services) and Api (controllers/endpoints, middleware, Program.cs) projects;</p>\n<ul class=\"q-points\"><li><code>tests/</code> with unit, integration and functional test projects;</li><li>shared settings in Directory.Build.props, central package versions, global.json, .editorconfig;</li><li>Dockerfile and pipelines alongside.</li></ul>\n"},{"id":474,"course_slug":"project-architecture","course_title":".NET Project Architectures & Folder Structures — Layered, Clean, Onion, Vertical Slice","ord":4,"level":"Intermediate","priority":"High","question":"Onion vs Clean vs Hexagonal architecture?","question_html":"Onion vs Clean vs Hexagonal architecture?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Same core idea with different vocabulary: business logic at the centre, independent of infrastructure, connected through interfaces.</p>\n<ul class=\"q-points\"><li>Hexagonal talks about ports (interfaces) and adapters (implementations/drivers);</li><li>Onion about concentric rings (domain model, domain services, application services, infrastructure/UI);</li><li>Clean about entities, use cases, interface adapters and frameworks with the explicit dependency rule.</li><li>In .NET they produce similar project structures.</li></ul>\n"},{"id":475,"course_slug":"project-architecture","course_title":".NET Project Architectures & Folder Structures — Layered, Clean, Onion, Vertical Slice","ord":5,"level":"Intermediate","priority":"High","question":"Vertical Slice vs layered architecture?","question_html":"Vertical Slice vs layered architecture?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Layered organises by technical concern (controllers, services, repositories) so one feature spans many folders and projects.</p>\n<ul class=\"q-points\"><li>Vertical Slice organises by feature/use case — request, validation, handler, endpoint together — so changes are local and each slice can choose its data access.</li><li>Slices can still share a domain model.</li><li>Vertical slices suit CQRS-style APIs with many independent use cases.</li></ul>\n"},{"id":476,"course_slug":"project-architecture","course_title":".NET Project Architectures & Folder Structures — Layered, Clean, Onion, Vertical Slice","ord":6,"level":"Intermediate","priority":"High","question":"Where do you put the repository interfaces and why?","question_html":"Where do you put the repository interfaces and why?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> In the Application (or Domain) layer — the inner layer defines what it needs (<code>IOrderRepository</code>), and Infrastructure implements it.</p>\n<ul class=\"q-points\"><li>This is Dependency Inversion: the business logic doesn&#39;t depend on EF Core or SQL, can be unit-tested with fakes, and the implementation can change without touching use cases.</li></ul>\n"},{"id":483,"course_slug":"project-architecture","course_title":".NET Project Architectures & Folder Structures — Layered, Clean, Onion, Vertical Slice","ord":13,"level":"Scenario","priority":"High","question":"You join a project where controllers contain SQL, business rules and email sending. How do you restructure it safely?","question_html":"You join a project where controllers contain SQL, business rules and email sending. How do you restructure it safely?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Add characterization tests around key endpoints first.</p>\n<ul class=\"q-points\"><li>Extract business logic into application services/handlers with interfaces for data access and email;</li><li>move SQL into repositories or query classes in an infrastructure project;</li><li>introduce DI registration;</li><li>keep controllers thin (bind, call, return).</li><li>Do it feature by feature (strangler within the codebase), not as a big-bang rewrite, and agree on the target structure in an ADR.</li></ul>\n"},{"id":477,"course_slug":"project-architecture","course_title":".NET Project Architectures & Folder Structures — Layered, Clean, Onion, Vertical Slice","ord":7,"level":"Intermediate","priority":"Medium","question":"What is a modular monolith?","question_html":"What is a modular monolith?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A single deployable application split into well-defined modules by business capability, each with its own code, data (separate schema) and public API;</p>\n<ul class=\"q-points\"><li>modules interact only through contracts or events.</li><li>You get microservice-like boundaries without distributed-system complexity, and modules can be extracted into services later if needed.</li></ul>\n"},{"id":478,"course_slug":"project-architecture","course_title":".NET Project Architectures & Folder Structures — Layered, Clean, Onion, Vertical Slice","ord":8,"level":"Intermediate","priority":"Medium","question":"Layer vs tier?","question_html":"Layer vs tier?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A layer is a logical grouping of code by responsibility (UI, business, data).</p>\n<ul class=\"q-points\"><li>A tier is a physical deployment boundary (client device, web server, application server, database server).</li><li>You can deploy several layers on one tier; crossing tiers adds network calls, latency and failure modes.</li></ul>\n"},{"id":479,"course_slug":"project-architecture","course_title":".NET Project Architectures & Folder Structures — Layered, Clean, Onion, Vertical Slice","ord":9,"level":"Intermediate","priority":"Medium","question":"What is CQRS? Do you need MediatR for it?","question_html":"What is CQRS? Do you need MediatR for it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Command Query Responsibility Segregation: separate models/handlers for writes (commands that change state) and reads (queries that return data).</p>\n<ul class=\"q-points\"><li>It allows optimised read models (Dapper, views, caches) and rich write models.</li><li>MediatR is just one way to dispatch requests to handlers with pipeline behaviours; you can implement CQRS with plain interfaces and DI.</li></ul>\n"},{"id":480,"course_slug":"project-architecture","course_title":".NET Project Architectures & Folder Structures — Layered, Clean, Onion, Vertical Slice","ord":10,"level":"Advanced","priority":"Medium","question":"How do you prevent architecture erosion over time?","question_html":"How do you prevent architecture erosion over time?","answer_html":"<p>Make rules explicit (ADRs, diagrams), enforce dependencies with project references (inner projects simply can&#39;t reference outer ones) and architecture tests (NetArchTest/ArchUnitNET in CI), code reviews with a checklist, templates for new features, internal visibility (<code>internal</code> + <code>InternalsVisibleTo</code>) to hide implementation details, and regular refactoring.</p>\n"},{"id":481,"course_slug":"project-architecture","course_title":".NET Project Architectures & Folder Structures — Layered, Clean, Onion, Vertical Slice","ord":11,"level":"Advanced","priority":"Medium","question":"What are aggregates and why do they matter for structure?","question_html":"What are aggregates and why do they matter for structure?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> An aggregate is a cluster of domain objects treated as one unit for changes, with a root entity that enforces invariants (Order with OrderLines).</p>\n<ul class=\"q-points\"><li>Outside code references only the root and changes go through its methods; one transaction modifies one aggregate.</li><li>This defines repository boundaries (one repository per aggregate root) and keeps business rules in one place.</li></ul>\n"},{"id":482,"course_slug":"project-architecture","course_title":".NET Project Architectures & Folder Structures — Layered, Clean, Onion, Vertical Slice","ord":12,"level":"Beginner","priority":"Medium","question":"What is the composition root?","question_html":"What is the composition root?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The single place where the application&#39;s object graph is wired together — in ASP.NET Core, <code>Program.cs</code> (often via <code>AddApplication()</code>/<code>AddInfrastructure()</code> extension methods) registers interfaces with their implementations in the DI container.</p>\n<ul class=\"q-points\"><li>Only the composition root knows about all projects; inner layers depend only on abstractions.</li></ul>\n"},{"id":484,"course_slug":"project-architecture","course_title":".NET Project Architectures & Folder Structures — Layered, Clean, Onion, Vertical Slice","ord":14,"level":"Scenario","priority":"Medium","question":"A small internal tool (5 screens) is being built with 8 projects in Clean Architecture. Is that right?","question_html":"A small internal tool (5 screens) is being built with 8 projects in Clean Architecture. Is that right?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Probably over-engineered: more projects, mapping and indirection than the problem needs, slowing the team.</p>\n<ul class=\"q-points\"><li>A single project with clear folders (Features or Controllers/Services/Data) and good tests is enough; keep the door open by keeping logic out of controllers.</li><li>Choose architecture by complexity and expected lifetime, not by habit.</li></ul>\n"},{"id":485,"course_slug":"project-architecture","course_title":".NET Project Architectures & Folder Structures — Layered, Clean, Onion, Vertical Slice","ord":15,"level":"Scenario","priority":"Medium","question":"How would you organise a solution with an ASP.NET Core API, an Angular front end and background workers?","question_html":"How would you organise a solution with an ASP.NET Core API, an Angular front end and background workers?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Monorepo: <code>src/Shop.Api</code>, <code>src/Shop.Worker</code> (BackgroundService/queue consumers), shared <code>Shop.Application</code>/<code>Shop.Domain</code>/<code>Shop.Infrastructure</code> projects used by both, <code>web/shop-ui</code> (Angular workspace), <code>tests/</code> for each, <code>deploy/</code> with Dockerfiles per deployable, CI pipelines that build only what changed.</p>\n<ul class=\"q-points\"><li>Or with .NET Aspire, an AppHost project orchestrating API, worker, database and the front end locally.</li></ul>\n"},{"id":486,"course_slug":"clean-code","course_title":"Clean Code, Testing & Best Practices","ord":1,"level":"Beginner","priority":"High","question":"What is clean code? What practices do you follow?","question_html":"What is clean code? What practices do you follow?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Code that is easy to read, change and test.</p>\n<ul class=\"q-points\"><li>My practices: meaningful names, small single-purpose methods, guard clauses instead of deep nesting, no magic numbers, consistent formatting enforced by <code>.editorconfig</code>/<code>dotnet format</code>, comments for <em>why</em>, unit tests for business logic, small PRs and code review, and the Boy Scout rule — leave code slightly better each time.</li></ul>\n"},{"id":487,"course_slug":"clean-code","course_title":"Clean Code, Testing & Best Practices","ord":2,"level":"Beginner","priority":"High","question":"What is unit testing? What makes a good unit test?","question_html":"What is unit testing? What makes a good unit test?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A unit test verifies a small piece of logic (a method/class) in isolation from external dependencies (DB, network, time), which are replaced with test doubles.</p>\n<ul class=\"q-points\"><li>Good tests are FIRST (Fast, Isolated, Repeatable, Self-validating, Timely), follow Arrange-Act-Assert, test <strong>behaviour</strong> not implementation details, have one logical assertion focus, and have descriptive names.</li></ul>\n"},{"id":488,"course_slug":"clean-code","course_title":"Clean Code, Testing & Best Practices","ord":3,"level":"Beginner","priority":"High","question":"What is the difference between [Fact] and [Theory] in xUnit?","question_html":"What is the difference between <code>[Fact]</code> and <code>[Theory]</code> in xUnit?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>[Fact]</code> is a test with no parameters that always runs once.</p>\n<ul class=\"q-points\"><li><code>[Theory]</code> is a parameterised test that runs once per data set, supplied by <code>[InlineData]</code>, <code>[MemberData]</code> or <code>[ClassData]</code>.</li><li>Use theories to test the same rule with many inputs (boundary values).</li></ul>\n"},{"id":490,"course_slug":"clean-code","course_title":"Clean Code, Testing & Best Practices","ord":5,"level":"Intermediate","priority":"High","question":"What is mocking? Mock vs stub vs fake?","question_html":"What is mocking? Mock vs stub vs fake?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Mocking replaces a real dependency with a controllable test double.</p>\n<ul class=\"q-points\"><li>A <strong>stub</strong> returns predefined data (state-based testing).</li><li>A <strong>mock</strong> also verifies that expected interactions happened (<code>Verify(..., Times.Once)</code>).</li><li>A <strong>fake</strong> is a working lightweight implementation (in-memory repository, fake clock).</li><li>Use stubs/fakes by default; verify interactions only when the interaction <em>is</em> the behaviour (e.g. &quot;an email was sent&quot;).</li></ul>\n"},{"id":491,"course_slug":"clean-code","course_title":"Clean Code, Testing & Best Practices","ord":6,"level":"Intermediate","priority":"High","question":"How do you unit-test code that uses DateTime.Now, HttpClient or a database?","question_html":"How do you unit-test code that uses <code>DateTime.Now</code>, <code>HttpClient</code> or a database?","answer_html":"<ul>\n<li>Time: inject <code>TimeProvider</code> (.NET 8 built-in abstraction; <code>FakeTimeProvider</code> in tests) or your own <code>IClock</code>.</li>\n<li>HttpClient: inject a typed client and in tests provide a fake <code>HttpMessageHandler</code> returning canned responses — or wrap the external API behind an interface and mock that.</li>\n<li>Database: hide it behind a repository interface for unit tests; for the data layer itself, write <strong>integration tests</strong> against a real engine (SQL Server in Testcontainers, or SQLite) rather than EF&#39;s InMemory provider, which doesn&#39;t behave like a relational DB.</li>\n</ul>\n"},{"id":492,"course_slug":"clean-code","course_title":"Clean Code, Testing & Best Practices","ord":7,"level":"Intermediate","priority":"High","question":"What is TDD? Have you used it?","question_html":"What is TDD? Have you used it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Test-Driven Development: Red (write a failing test for the next small behaviour), Green (write the minimum code to pass), Refactor (clean up with tests protecting you).</p>\n<ul class=\"q-points\"><li>It produces testable, decoupled designs and high meaningful coverage.</li><li>Honest answer: &quot;I use TDD for business rules and bug fixes — I first write a test that reproduces the bug — and test-after for thin glue code.&quot;</li></ul>\n"},{"id":493,"course_slug":"clean-code","course_title":"Clean Code, Testing & Best Practices","ord":8,"level":"Intermediate","priority":"High","question":"What is the test pyramid?","question_html":"What is the test pyramid?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Many fast, cheap <strong>unit tests</strong> at the base;</p>\n<ul class=\"q-points\"><li>fewer <strong>integration/API tests</strong> (real DB, real HTTP pipeline via <code>WebApplicationFactory</code>) in the middle;</li><li>very few slow, brittle <strong>end-to-end UI tests</strong> (Playwright) at the top.</li><li>An inverted pyramid (&quot;ice-cream cone&quot;) with mostly manual/UI tests is slow and flaky.</li></ul>\n"},{"id":494,"course_slug":"clean-code","course_title":"Clean Code, Testing & Best Practices","ord":9,"level":"Intermediate","priority":"High","question":"What do you check in a code review?","question_html":"What do you check in a code review?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Correctness and edge cases, tests, design (SOLID, right layer), readability, performance (N+1 queries, sync-over-async, unbounded loads), security (injection, authorisation, secrets, logging PII), and operability (logging, config, migrations, backward compatibility).</p>\n<ul class=\"q-points\"><li>I keep comments respectful and specific, separate blocking issues from nits, and prefer small PRs.</li></ul>\n"},{"id":500,"course_slug":"clean-code","course_title":"Clean Code, Testing & Best Practices","ord":15,"level":"Scenario","priority":"High","question":"You join a team with a 10-year-old codebase, no tests and frequent production bugs. What's your plan?","question_html":"You join a team with a 10-year-old codebase, no tests and frequent production bugs. What&#39;s your plan?","answer_html":"<ol>\n<li>Understand: talk to the team, read bug history, find the riskiest, most-changed areas (Git churn).</li>\n<li>Add a CI pipeline with build + analyzers if missing.</li>\n<li>Write characterisation/integration tests around the critical flows before touching them.</li>\n<li>Fix bugs test-first (a regression test per bug).</li>\n<li>Refactor incrementally in touched areas (Boy Scout rule), not a big-bang rewrite.</li>\n<li>Add logging/monitoring to see failures early.</li>\n<li>Agree on coding standards and PR reviews.</li>\n<li>Measure: bug count, deployment frequency, time to fix.</li>\n</ol>\n"},{"id":501,"course_slug":"clean-code","course_title":"Clean Code, Testing & Best Practices","ord":16,"level":"Scenario","priority":"High","question":"A reviewer rejects your PR saying the method is too long and untestable. How do you respond and fix it?","question_html":"A reviewer rejects your PR saying the method is too long and untestable. How do you respond and fix it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Accept feedback professionally — ask for specifics if unclear.</p>\n<ul class=\"q-points\"><li>Then extract cohesive parts into well-named private methods or separate classes, move external calls (DB, HTTP, time) behind injected interfaces so the logic is testable, add unit tests for the extracted logic, and keep the PR focused.</li><li>Reply to each comment with what you changed.</li></ul>\n"},{"id":489,"course_slug":"clean-code","course_title":"Clean Code, Testing & Best Practices","ord":4,"level":"Beginner","priority":"Medium","question":"What are xUnit, NUnit and MSTest? Differences?","question_html":"What are xUnit, NUnit and MSTest? Differences?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> All three are .NET test frameworks.</p>\n<ul class=\"q-points\"><li><strong>xUnit</strong> (most common in new .NET Core projects): new class instance per test, constructor/<code>IDisposable</code> for setup/teardown, <code>[Fact]/[Theory]</code>, fixtures for shared state.</li><li><strong>NUnit</strong>: <code>[Test]</code>, <code>[TestCase]</code>, <code>[SetUp]/[TearDown]</code>, rich constraint assertions.</li><li><strong>MSTest</strong>: Microsoft&#39;s, <code>[TestMethod]</code>, <code>[DataRow]</code>, <code>[TestInitialize]</code>, well integrated into Visual Studio.</li><li>Functionally similar; teams pick by convention.</li></ul>\n"},{"id":495,"course_slug":"clean-code","course_title":"Clean Code, Testing & Best Practices","ord":10,"level":"Intermediate","priority":"Medium","question":"What are code smells? Name five and their fixes.","question_html":"What are code smells? Name five and their fixes.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Symptoms that suggest a deeper design problem: <strong>Long Method</strong> → Extract Method;</p>\n<ul class=\"q-points\"><li><strong>God Class</strong> → Extract Class (SRP);</li><li><strong>Duplicate Code</strong> → extract shared method;</li><li><strong>Switch on type</strong> → polymorphism/Strategy;</li><li><strong>Primitive Obsession</strong> → value objects;</li><li><strong>Long Parameter List</strong> → parameter object;</li><li><strong>Feature Envy</strong> → Move Method.</li></ul>\n"},{"id":496,"course_slug":"clean-code","course_title":"Clean Code, Testing & Best Practices","ord":11,"level":"Intermediate","priority":"Medium","question":"Merge vs rebase? What is a squash merge?","question_html":"Merge vs rebase? What is a squash merge?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>merge</code> combines branches and keeps both histories with a merge commit (non-destructive).</p>\n<ul class=\"q-points\"><li><code>rebase</code> replays your commits on top of another branch, which rewrites them for a linear history — never on shared/public branches.</li><li><strong>Squash merge</strong> combines all PR commits into one commit on <code>main</code>, keeping history clean (one commit per feature).</li></ul>\n"},{"id":497,"course_slug":"clean-code","course_title":"Clean Code, Testing & Best Practices","ord":12,"level":"Intermediate","priority":"Medium","question":"Trunk-based development vs GitFlow?","question_html":"Trunk-based development vs GitFlow?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <strong>Trunk-based</strong>: everyone integrates into <code>main</code> at least daily via short-lived branches; incomplete features hidden behind feature flags; enables CI/CD.</p>\n<ul class=\"q-points\"><li><strong>GitFlow</strong>: long-lived <code>develop</code>, <code>release/*</code>, <code>hotfix/*</code> branches; fits scheduled releases and multiple supported versions but causes merge pain.</li><li>Most modern teams use trunk-based or GitHub Flow.</li></ul>\n"},{"id":498,"course_slug":"clean-code","course_title":"Clean Code, Testing & Best Practices","ord":13,"level":"Advanced","priority":"Medium","question":"What is mutation testing?","question_html":"What is mutation testing?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A tool (Stryker.NET) makes small changes (&quot;mutants&quot;) to your code — flipping <code>&gt;</code> to <code>&gt;=</code>, removing a call — and reruns the tests.</p>\n<ul class=\"q-points\"><li>If tests still pass, the mutant &quot;survived&quot;, meaning your tests don&#39;t really check that behaviour.</li><li>It measures test <em>quality</em>, unlike line coverage.</li></ul>\n"},{"id":499,"course_slug":"clean-code","course_title":"Clean Code, Testing & Best Practices","ord":14,"level":"Advanced","priority":"Medium","question":"How do you prevent SQL injection and IDOR in a .NET API?","question_html":"How do you prevent SQL injection and IDOR in a .NET API?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> SQL injection: never concatenate user input into SQL; use EF Core LINQ, <code>FromSql($&quot;...&quot;)</code> (interpolation is parameterised), Dapper parameters or <code>SqlParameter</code>.</p>\n<ul class=\"q-points\"><li>IDOR (Insecure Direct Object Reference): don&#39;t trust IDs from the URL — always check the resource belongs to the current user or tenant (<code>WHERE Id = @id AND UserId = @currentUser</code>), using resource-based authorisation or global query filters for multi-tenant data.</li></ul>\n"},{"id":502,"course_slug":"clean-code","course_title":"Clean Code, Testing & Best Practices","ord":17,"level":"Scenario","priority":"Medium","question":"A test passes locally but fails randomly in CI. What could cause it?","question_html":"A test passes locally but fails randomly in CI. What could cause it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Flaky test causes: dependence on time/date or time zone, test order or shared static state, parallel tests sharing a DB/file, race conditions with async code (missing <code>await</code>), relying on dictionary/hash ordering, network calls to real services, culture-specific formatting.</p>\n<ul class=\"q-points\"><li>Fix by isolating state (fresh DB per test or transactions/Respawn), injecting <code>TimeProvider</code>, awaiting properly, fixing culture, and removing external calls.</li></ul>\n"},{"id":503,"course_slug":"clean-code","course_title":"Clean Code, Testing & Best Practices","ord":18,"level":"Scenario","priority":"Medium","question":"Production logs show Object reference not set to an instance of an object with no context. How do you make this debuggable next time?","question_html":"Production logs show <code>Object reference not set to an instance of an object</code> with no context. How do you make this debuggable next time?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Enable nullable reference types and fix warnings;</p>\n<ul class=\"q-points\"><li>validate inputs with guard clauses (<code>ArgumentNullException.ThrowIfNull</code>);</li><li>use structured logging with context (OrderId, UserId, CorrelationId);</li><li>a global exception handler that logs the full exception with request path and trace ID;</li><li>OpenTelemetry/Application Insights for distributed traces;</li><li>publish symbols (portable PDBs) so stack traces have line numbers.</li></ul>\n"},{"id":504,"course_slug":"microservices","course_title":"Microservices & System Design with .NET","ord":1,"level":"Beginner","priority":"High","question":"What are microservices? What are their advantages and disadvantages?","question_html":"What are microservices? What are their advantages and disadvantages?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Small, independently deployable services, each owning one business capability and its own data, talking over HTTP/gRPC or messages.</p>\n<ul class=\"q-points\"><li>Advantages: independent deployment and scaling, team autonomy, fault isolation, technology freedom per service.</li><li>Disadvantages: distributed-system complexity (network failures, latency), no cross-service transactions (eventual consistency, sagas), harder testing and debugging, much more DevOps and monitoring work, data duplication.</li></ul>\n"},{"id":505,"course_slug":"microservices","course_title":"Microservices & System Design with .NET","ord":2,"level":"Beginner","priority":"High","question":"Monolith vs microservices — which would you choose for a new project?","question_html":"Monolith vs microservices — which would you choose for a new project?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Usually start with a <strong>modular monolith</strong>: one deployable with strict module boundaries and separate schemas.</p>\n<ul class=\"q-points\"><li>It is faster to build and easier to operate, and the boundaries let you extract services later.</li><li>Choose microservices when there is a concrete need — independent scaling, separate teams with separate release cycles, very different technology or reliability needs — and the organisation can afford the DevOps cost.</li></ul>\n"},{"id":506,"course_slug":"microservices","course_title":"Microservices & System Design with .NET","ord":3,"level":"Beginner","priority":"High","question":"How do microservices communicate?","question_html":"How do microservices communicate?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Synchronously with REST over HTTP (public/browser APIs) or gRPC (fast internal calls, contracts in <code>.proto</code>), usually through an API gateway;</p>\n<ul class=\"q-points\"><li>asynchronously with messages through a broker (RabbitMQ, Azure Service Bus, Kafka) using queues for commands and topics for events.</li><li>Prefer async for anything that doesn&#39;t need an immediate reply — it decouples availability and absorbs load spikes.</li></ul>\n"},{"id":507,"course_slug":"microservices","course_title":"Microservices & System Design with .NET","ord":4,"level":"Beginner","priority":"High","question":"What is an API gateway and why use one?","question_html":"What is an API gateway and why use one?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A single entry point in front of the services.</p>\n<ul class=\"q-points\"><li>It routes requests, terminates TLS, validates tokens, applies rate limiting and CORS, can aggregate several calls into one response and hides the internal topology from clients. .NET: YARP or Ocelot;</li><li>Azure: API Management or Application Gateway.</li><li>A Backend-for-Frontend is a gateway tailored to one client type.</li></ul>\n"},{"id":508,"course_slug":"microservices","course_title":"Microservices & System Design with .NET","ord":5,"level":"Intermediate","priority":"High","question":"What is \"database per service\" and how do you query data across services?","question_html":"What is &quot;database per service&quot; and how do you query data across services?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Each service owns its tables; nobody else reads or writes them directly.</p>\n<ul class=\"q-points\"><li>Cross-service data is obtained by calling the owner&#39;s API, by API composition (gateway/BFF calls several services and merges), or by keeping a local read-only copy updated via events (CQRS read model).</li><li>Reporting usually goes to a separate data warehouse fed by events or CDC.</li></ul>\n"},{"id":509,"course_slug":"microservices","course_title":"Microservices & System Design with .NET","ord":6,"level":"Intermediate","priority":"High","question":"Explain the saga pattern. Choreography vs orchestration?","question_html":"Explain the saga pattern. Choreography vs orchestration?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A saga is a sequence of local transactions across services, each with a compensating action to undo it if a later step fails (charge → refund).</p>\n<ul class=\"q-points\"><li>Choreography: each service listens for events and publishes the next one — simple, decentralised, but the overall flow is hard to see.</li><li>Orchestration: a central coordinator (state machine) sends commands and tracks state — explicit and easier to monitor and change, but one more component.</li></ul>\n"},{"id":510,"course_slug":"microservices","course_title":"Microservices & System Design with .NET","ord":7,"level":"Intermediate","priority":"High","question":"What is the outbox pattern and what problem does it solve?","question_html":"What is the outbox pattern and what problem does it solve?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The dual-write problem: saving to the database and publishing a message are two systems, so a crash between them leaves them inconsistent.</p>\n<ul class=\"q-points\"><li>With an outbox, the business data and the message are written in <strong>one local transaction</strong> (message into an Outbox table);</li><li>a separate relay publishes outbox rows to the broker and marks them sent.</li><li>Delivery becomes at-least-once, so consumers must be idempotent (often an Inbox table of processed ids).</li></ul>\n"},{"id":511,"course_slug":"microservices","course_title":"Microservices & System Design with .NET","ord":8,"level":"Intermediate","priority":"High","question":"How do you make a service resilient to failures of its dependencies?","question_html":"How do you make a service resilient to failures of its dependencies?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Timeouts on every call;</p>\n<ul class=\"q-points\"><li>retries with exponential backoff and jitter for transient, idempotent operations;</li><li>circuit breaker to fail fast while a dependency is down;</li><li>bulkheads to limit concurrency;</li><li>fallbacks/cached data;</li><li>async messaging so work is queued rather than lost;</li><li>health checks and auto-restart.</li><li>In .NET: <code>AddStandardResilienceHandler()</code> / Polly.</li></ul>\n"},{"id":512,"course_slug":"microservices","course_title":"Microservices & System Design with .NET","ord":9,"level":"Intermediate","priority":"High","question":"What is idempotency and why is it important in distributed systems?","question_html":"What is idempotency and why is it important in distributed systems?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> An operation is idempotent if doing it twice has the same effect as once.</p>\n<ul class=\"q-points\"><li>Messages are delivered at least once and clients retry on timeouts, so duplicates are normal.</li><li>Techniques: idempotency keys on POST (store key + result, return the same result on repeat), natural keys/unique constraints, processed-message tables, &quot;set&quot; operations instead of &quot;increment&quot;.</li></ul>\n"},{"id":515,"course_slug":"microservices","course_title":"Microservices & System Design with .NET","ord":12,"level":"Advanced","priority":"High","question":"How do you handle data consistency without distributed transactions?","question_html":"How do you handle data consistency without distributed transactions?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Accept eventual consistency and design for it: keep each aggregate&#39;s invariants inside one service and one local transaction;</p>\n<ul class=\"q-points\"><li>use sagas with compensations for multi-service workflows;</li><li>outbox + idempotent consumers for reliable events;</li><li>reservation patterns (reserve stock, confirm later, expire if unpaid);</li><li>show pending states in the UI.</li><li>Two-phase commit (MSDTC) is avoided — it blocks and doesn&#39;t work across most cloud services and brokers.</li></ul>\n"},{"id":516,"course_slug":"microservices","course_title":"Microservices & System Design with .NET","ord":13,"level":"Advanced","priority":"High","question":"Explain CQRS. When is it worth it?","question_html":"Explain CQRS. When is it worth it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Separate models for writes (commands that enforce business rules) and reads (queries/views optimised for screens).</p>\n<ul class=\"q-points\"><li>Worth it when reads vastly outnumber writes, read shapes differ a lot from the write model, or reads and writes need to scale separately.</li><li>Overkill for simple CRUD.</li><li>It doesn&#39;t require event sourcing or separate databases; a common form is EF Core for commands and Dapper over views for queries.</li></ul>\n"},{"id":519,"course_slug":"microservices","course_title":"Microservices & System Design with .NET","ord":16,"level":"Scenario","priority":"High","question":"Design a URL shortener.","question_html":"Design a URL shortener.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Requirements: create short link, redirect fast, optional expiry and analytics; e.g. 100M links, read-heavy (100:1).</p>\n<ul class=\"q-points\"><li>API: <code>POST /links</code> → <code>{ code }</code>, <code>GET /{code}</code> → 301/302.</li><li>Key generation: base62 of a unique id (DB sequence or Snowflake-style id) or a random 7-char code with uniqueness check.</li><li>Store code → URL in a key-value store or SQL with a unique index; cache hot codes in Redis; CDN/edge for redirects.</li><li>Analytics: publish click events to a queue/stream and aggregate asynchronously so redirects stay fast.</li><li>Discuss collisions, abuse (rate limits, malware checks) and custom aliases.</li></ul>\n"},{"id":520,"course_slug":"microservices","course_title":"Microservices & System Design with .NET","ord":17,"level":"Scenario","priority":"High","question":"An order service calls payment, which calls a slow fraud check; under load the whole site times out. What do you change?","question_html":"An order service calls payment, which calls a slow fraud check; under load the whole site times out. What do you change?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Cascading failure from synchronous chains.</p>\n<ul class=\"q-points\"><li>Add timeouts and a circuit breaker around the fraud call, a bulkhead so slow calls can&#39;t use every connection, and a fallback (accept low-value orders, flag for review).</li><li>Better: make the flow asynchronous — accept the order as Pending, send a message for payment/fraud processing, update status by events, and notify the user.</li><li>Scale the fraud service, and add tracing to prove where the time goes.</li></ul>\n"},{"id":521,"course_slug":"microservices","course_title":"Microservices & System Design with .NET","ord":18,"level":"Scenario","priority":"High","question":"Customers are charged twice when the client retries a payment request. Fix it.","question_html":"Customers are charged twice when the client retries a payment request. Fix it.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Make the payment endpoint idempotent: the client sends an <code>Idempotency-Key</code> header (GUID per checkout attempt);</p>\n<ul class=\"q-points\"><li>the server stores the key with the result in the same transaction as the charge;</li><li>a repeat request with the same key returns the stored result instead of charging again.</li><li>Also pass an idempotency key to the payment provider (Stripe and others support this) and use a unique constraint on (OrderId, PaymentAttempt).</li></ul>\n"},{"id":513,"course_slug":"microservices","course_title":"Microservices & System Design with .NET","ord":10,"level":"Intermediate","priority":"Medium","question":"REST vs gRPC — when would you choose gRPC?","question_html":"REST vs gRPC — when would you choose gRPC?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> gRPC for internal service-to-service calls where performance and strict contracts matter: binary Protobuf, HTTP/2 multiplexing, code-generated clients, streaming.</p>\n<ul class=\"q-points\"><li>REST for public APIs, browser clients, easy debugging and broad tooling. gRPC needs gRPC-Web or a gateway for browsers.</li></ul>\n"},{"id":514,"course_slug":"microservices","course_title":"Microservices & System Design with .NET","ord":11,"level":"Intermediate","priority":"Medium","question":"How do you implement distributed tracing in .NET?","question_html":"How do you implement distributed tracing in .NET?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use OpenTelemetry: add ASP.NET Core, HttpClient and SqlClient instrumentation and an exporter (OTLP to Jaeger, Aspire dashboard, Application Insights). .NET&#39;s <code>Activity</code> API propagates the W3C <code>traceparent</code> header automatically, so all spans of one request share a trace id.</p>\n<ul class=\"q-points\"><li>Add the trace id to logs to jump from a log line to the full trace.</li></ul>\n"},{"id":517,"course_slug":"microservices","course_title":"Microservices & System Design with .NET","ord":14,"level":"Advanced","priority":"Medium","question":"How do you version APIs and events without breaking consumers?","question_html":"How do you version APIs and events without breaking consumers?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Prefer additive, backward-compatible changes (new optional fields; consumers ignore unknown fields).</p>\n<ul class=\"q-points\"><li>For breaking changes: URL or header versioning (Asp.Versioning), run old and new side by side, deprecate with a timeline.</li><li>For events: include a version, never change meaning of existing fields, publish new event types for big changes, use a schema registry for Kafka/Avro.</li><li>Consumer-driven contract tests (Pact) catch breaks in CI.</li></ul>\n"},{"id":518,"course_slug":"microservices","course_title":"Microservices & System Design with .NET","ord":15,"level":"Advanced","priority":"Medium","question":"How do you scale a .NET service horizontally?","question_html":"How do you scale a .NET service horizontally?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Make it stateless (no in-memory session or local files;</p>\n<ul class=\"q-points\"><li>use Redis, cookies, Blob storage), run multiple instances behind a load balancer, use a distributed cache and a shared Data Protection key ring, keep DB connections pooled and queries efficient, and autoscale on CPU/RPS or queue length (Kubernetes HPA/KEDA, Container Apps rules).</li><li>Background jobs need a lock or a queue so they don&#39;t run on every instance.</li></ul>\n"},{"id":522,"course_slug":"microservices","course_title":"Microservices & System Design with .NET","ord":19,"level":"Scenario","priority":"Medium","question":"You must split a large .NET monolith into services. How do you start?","question_html":"You must split a large .NET monolith into services. How do you start?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Don&#39;t big-bang rewrite.</p>\n<ul class=\"q-points\"><li>Map bounded contexts and coupling first; make the monolith modular (clear modules, separate schemas, no cross-module table access).</li><li>Use the <strong>strangler fig</strong> pattern: put a gateway (YARP) in front, extract one well-bounded, high-value module at a time (often notifications, catalog or reporting), give it its own data (sync via events during migration), route its traffic to the new service, then remove the old code.</li><li>Invest early in CI/CD, containers and observability.</li></ul>\n"},{"id":523,"course_slug":"microservices","course_title":"Microservices & System Design with .NET","ord":20,"level":"Scenario","priority":"Medium","question":"A message consumer keeps failing on one bad message and blocks the queue. What do you do?","question_html":"A message consumer keeps failing on one bad message and blocks the queue. What do you do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Configure limited retries with backoff, then move the message to the <strong>dead-letter queue</strong> so processing continues.</p>\n<ul class=\"q-points\"><li>Alert on DLQ depth, log the failure with the message id, fix the bug or the data, then replay from the DLQ.</li><li>Make the consumer idempotent so replays are safe, and validate message schemas.</li></ul>\n"},{"id":524,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":1,"level":"Beginner","priority":"High","question":"What is the difference between DELETE, TRUNCATE and DROP?","question_html":"What is the difference between DELETE, TRUNCATE and DROP?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> DELETE (DML) removes rows one by one, supports WHERE, fires triggers, logs each row and keeps the identity counter.</p>\n<ul class=\"q-points\"><li>TRUNCATE (DDL) removes all rows by deallocating pages, is minimally logged and much faster, resets IDENTITY, doesn&#39;t fire triggers and isn&#39;t allowed on tables referenced by a foreign key.</li><li>DROP removes the whole table definition, data, indexes and permissions.</li><li>In SQL Server all three can be rolled back inside an explicit transaction.</li></ul>\n"},{"id":525,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":2,"level":"Beginner","priority":"High","question":"What are the different types of joins?","question_html":"What are the different types of joins?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> INNER JOIN (matching rows in both), LEFT/RIGHT OUTER JOIN (all rows from one side + matches, NULLs otherwise), FULL OUTER JOIN (all rows from both), CROSS JOIN (Cartesian product), SELF JOIN (table joined to itself, e.g. employee–manager).</p>\n<ul class=\"q-points\"><li>T-SQL also has CROSS APPLY/OUTER APPLY for correlated table expressions.</li><li>Physical algorithms: nested loops, merge, hash.</li></ul>\n"},{"id":526,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":3,"level":"Beginner","priority":"High","question":"What is the difference between WHERE and HAVING?","question_html":"What is the difference between WHERE and HAVING?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> WHERE filters individual rows <strong>before</strong> grouping and can&#39;t use aggregates.</p>\n<ul class=\"q-points\"><li>HAVING filters groups <strong>after</strong> GROUP BY and can use aggregates (<code>HAVING COUNT(*) &gt; 5</code>).</li><li>Put non-aggregate conditions in WHERE for performance — fewer rows get grouped.</li></ul>\n"},{"id":527,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":4,"level":"Beginner","priority":"High","question":"What is a primary key vs a unique key vs a foreign key?","question_html":"What is a primary key vs a unique key vs a foreign key?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Primary key: uniquely identifies each row, NOT NULL, one per table, creates a clustered index by default.</p>\n<ul class=\"q-points\"><li>Unique key: enforces uniqueness on other columns, allows one NULL in SQL Server, many per table, creates a non-clustered index by default.</li><li>Foreign key: a column referencing another table&#39;s primary/unique key to enforce referential integrity (with cascade options).</li></ul>\n"},{"id":528,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":5,"level":"Beginner","priority":"High","question":"What is normalisation? Explain 1NF, 2NF and 3NF.","question_html":"What is normalisation? Explain 1NF, 2NF and 3NF.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Organising tables to reduce redundancy and update anomalies.</p>\n<ul class=\"q-points\"><li>1NF: atomic columns and no repeating groups.</li><li>2NF: 1NF and every non-key column depends on the <strong>whole</strong> primary key (no partial dependency — relevant for composite keys).</li><li>3NF: 2NF and no transitive dependency (non-key columns depend only on the key, e.g. move DeptName out of Employees into Departments).</li><li>Data warehouses deliberately denormalise for read speed.</li></ul>\n"},{"id":529,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":6,"level":"Beginner","priority":"High","question":"Clustered vs non-clustered index?","question_html":"Clustered vs non-clustered index?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A clustered index sorts and stores the table&#39;s data rows in key order — the leaf level is the data; only one per table.</p>\n<ul class=\"q-points\"><li>A non-clustered index is a separate structure with key columns and a pointer (clustered key or RID) back to the row; up to 999 per table.</li><li>Clustered is ideal for range queries on the key; non-clustered for selective lookups on other columns, ideally covering with INCLUDE columns.</li></ul>\n"},{"id":530,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":7,"level":"Beginner","priority":"High","question":"Write a query to find the second (or Nth) highest salary.","question_html":"Write a query to find the second (or Nth) highest salary.","answer_html":"<div class=\"code-block\"><span class=\"code-lang\">sql</span><button class=\"copy-btn\" type=\"button\" data-copy>Copy</button><pre><code class=\"hljs\"><span class=\"hljs-comment\">-- Handles ties correctly; change 2 to N</span>\n<span class=\"hljs-keyword\">SELECT</span> <span class=\"hljs-keyword\">DISTINCT</span> Salary <span class=\"hljs-keyword\">FROM</span> (\n    <span class=\"hljs-keyword\">SELECT</span> Salary, <span class=\"hljs-built_in\">DENSE_RANK</span>() <span class=\"hljs-keyword\">OVER</span> (<span class=\"hljs-keyword\">ORDER</span> <span class=\"hljs-keyword\">BY</span> Salary <span class=\"hljs-keyword\">DESC</span>) <span class=\"hljs-keyword\">AS</span> rnk <span class=\"hljs-keyword\">FROM</span> dbo.Employees\n) t <span class=\"hljs-keyword\">WHERE</span> rnk <span class=\"hljs-operator\">=</span> <span class=\"hljs-number\">2</span>;\n\n<span class=\"hljs-comment\">-- Alternative</span>\n<span class=\"hljs-keyword\">SELECT</span> <span class=\"hljs-built_in\">MAX</span>(Salary) <span class=\"hljs-keyword\">FROM</span> dbo.Employees <span class=\"hljs-keyword\">WHERE</span> Salary <span class=\"hljs-operator\">&lt;</span> (<span class=\"hljs-keyword\">SELECT</span> <span class=\"hljs-built_in\">MAX</span>(Salary) <span class=\"hljs-keyword\">FROM</span> dbo.Employees);\n\n<span class=\"hljs-comment\">-- OFFSET/FETCH</span>\n<span class=\"hljs-keyword\">SELECT</span> <span class=\"hljs-keyword\">DISTINCT</span> Salary <span class=\"hljs-keyword\">FROM</span> dbo.Employees <span class=\"hljs-keyword\">ORDER</span> <span class=\"hljs-keyword\">BY</span> Salary <span class=\"hljs-keyword\">DESC</span> <span class=\"hljs-keyword\">OFFSET</span> <span class=\"hljs-number\">1</span> <span class=\"hljs-keyword\">ROWS</span> <span class=\"hljs-keyword\">FETCH</span> NEXT <span class=\"hljs-number\">1</span> <span class=\"hljs-keyword\">ROWS</span> <span class=\"hljs-keyword\">ONLY</span>;</code></pre></div>\n"},{"id":531,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":8,"level":"Beginner","priority":"High","question":"How do you find and delete duplicate rows?","question_html":"How do you find and delete duplicate rows?","answer_html":"<div class=\"code-block\"><span class=\"code-lang\">sql</span><button class=\"copy-btn\" type=\"button\" data-copy>Copy</button><pre><code class=\"hljs\"><span class=\"hljs-comment\">-- find</span>\n<span class=\"hljs-keyword\">SELECT</span> Email, <span class=\"hljs-built_in\">COUNT</span>(<span class=\"hljs-operator\">*</span>) <span class=\"hljs-keyword\">AS</span> Cnt <span class=\"hljs-keyword\">FROM</span> dbo.Customers <span class=\"hljs-keyword\">GROUP</span> <span class=\"hljs-keyword\">BY</span> Email <span class=\"hljs-keyword\">HAVING</span> <span class=\"hljs-built_in\">COUNT</span>(<span class=\"hljs-operator\">*</span>) <span class=\"hljs-operator\">&gt;</span> <span class=\"hljs-number\">1</span>;\n\n<span class=\"hljs-comment\">-- delete all but one (keep lowest Id)</span>\n<span class=\"hljs-keyword\">WITH</span> d <span class=\"hljs-keyword\">AS</span> (\n    <span class=\"hljs-keyword\">SELECT</span> <span class=\"hljs-operator\">*</span>, <span class=\"hljs-built_in\">ROW_NUMBER</span>() <span class=\"hljs-keyword\">OVER</span> (<span class=\"hljs-keyword\">PARTITION</span> <span class=\"hljs-keyword\">BY</span> Email <span class=\"hljs-keyword\">ORDER</span> <span class=\"hljs-keyword\">BY</span> CustomerId) <span class=\"hljs-keyword\">AS</span> rn <span class=\"hljs-keyword\">FROM</span> dbo.Customers\n)\n<span class=\"hljs-keyword\">DELETE</span> <span class=\"hljs-keyword\">FROM</span> d <span class=\"hljs-keyword\">WHERE</span> rn <span class=\"hljs-operator\">&gt;</span> <span class=\"hljs-number\">1</span>;</code></pre></div>\n<p>Then add a UNIQUE constraint so it can&#39;t happen again.</p>\n"},{"id":534,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":11,"level":"Intermediate","priority":"High","question":"Explain ROW_NUMBER, RANK and DENSE_RANK.","question_html":"Explain ROW_NUMBER, RANK and DENSE_RANK.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> All are window ranking functions.</p>\n<ul class=\"q-points\"><li>For salaries 100, 90, 90, 80: ROW_NUMBER gives 1,2,3,4 (unique, arbitrary order among ties), RANK gives 1,2,2,4 (ties share a rank, gaps follow), DENSE_RANK gives 1,2,2,3 (ties share, no gaps).</li><li>Use ROW_NUMBER for deduplication and paging, DENSE_RANK for &quot;Nth highest&quot; with ties.</li></ul>\n"},{"id":535,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":12,"level":"Intermediate","priority":"High","question":"What is a CTE? When would you use a recursive CTE?","question_html":"What is a CTE? When would you use a recursive CTE?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A Common Table Expression (<code>WITH name AS (...)</code>) is a named temporary result set for a single statement — improves readability, can be referenced multiple times in that statement, and supports recursion.</p>\n<ul class=\"q-points\"><li>A recursive CTE has an anchor member UNION ALL a recursive member referencing the CTE;</li><li>used for hierarchies (org charts, category trees, bill of materials) and generating sequences.</li><li>Default max recursion 100 (<code>OPTION (MAXRECURSION n)</code>).</li></ul>\n"},{"id":536,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":13,"level":"Intermediate","priority":"High","question":"Stored procedure vs function?","question_html":"Stored procedure vs function?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Procedures can return multiple result sets, output parameters and an integer return code;</p>\n<ul class=\"q-points\"><li>can modify data, use transactions and TRY/CATCH;</li><li>are called with EXEC and can&#39;t be used inside SELECT.</li><li>Functions return a scalar or a table, must be side-effect free (no INSERT/UPDATE to tables), can&#39;t use TRY/CATCH or transactions, and can be used in SELECT/WHERE/JOIN/APPLY.</li><li>Prefer inline TVFs for reusable query logic.</li></ul>\n"},{"id":537,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":14,"level":"Intermediate","priority":"High","question":"What are the transaction isolation levels in SQL Server?","question_html":"What are the transaction isolation levels in SQL Server?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> READ UNCOMMITTED (dirty reads possible;</p>\n<ul class=\"q-points\"><li><code>NOLOCK</code>), READ COMMITTED (default;</li><li>no dirty reads), REPEATABLE READ (no non-repeatable reads), SERIALIZABLE (no phantoms;</li><li>range locks), SNAPSHOT (row versioning, consistent view as of transaction start, readers don&#39;t block writers), and READ COMMITTED SNAPSHOT (database setting making read committed use versioning per statement;</li><li>default in Azure SQL Database).</li><li>Higher isolation = more consistency, more blocking.</li></ul>\n"},{"id":538,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":15,"level":"Intermediate","priority":"High","question":"What is a deadlock and how do you handle it?","question_html":"What is a deadlock and how do you handle it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Two (or more) transactions each hold locks the other needs, so neither can proceed.</p>\n<ul class=\"q-points\"><li>SQL Server&#39;s lock monitor detects it and kills the cheapest transaction (error 1205).</li><li>Investigate with the <code>system_health</code> Extended Events session (deadlock graphs).</li><li>Prevent: access tables in a consistent order, keep transactions short, add indexes so fewer rows are locked, avoid user interaction inside transactions, use RCSI/SNAPSHOT for readers;</li><li>and retry 1205 in the application.</li></ul>\n"},{"id":539,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":16,"level":"Intermediate","priority":"High","question":"Temp table vs table variable vs CTE?","question_html":"Temp table vs table variable vs CTE?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Temp tables (<code>#t</code>) live in tempdb for the session/proc, have statistics, support any indexes, and are rolled back with transactions — good for larger intermediate data.</p>\n<ul class=\"q-points\"><li>Table variables (<code>@t</code>) are scoped to the batch, have no column statistics (estimates improved by 2019 deferred compilation), aren&#39;t affected by rollback, best for small sets.</li><li>CTEs aren&#39;t stored at all — they&#39;re inlined into the single statement.</li></ul>\n"},{"id":540,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":17,"level":"Intermediate","priority":"High","question":"What makes a query non-SARGable? Give examples.","question_html":"What makes a query non-SARGable? Give examples.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Using functions, calculations or conversions on an indexed column in WHERE/JOIN prevents index seeks: <code>WHERE YEAR(OrderDate) = 2026</code>, <code>WHERE ISNULL(Col, 0) = 5</code>, <code>WHERE Col + 1 = 10</code>, <code>LIKE &#39;%abc&#39;</code>, implicit conversions (nvarchar parameter vs varchar column).</p>\n<ul class=\"q-points\"><li>Rewrite as ranges or move the calculation to the parameter side: <code>OrderDate &gt;= &#39;2026-01-01&#39; AND OrderDate &lt; &#39;2027-01-01&#39;</code>.</li></ul>\n"},{"id":543,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":20,"level":"Advanced","priority":"High","question":"What is parameter sniffing and how do you fix it?","question_html":"What is parameter sniffing and how do you fix it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> When a parameterised query/proc compiles, the optimizer &quot;sniffs&quot; the first parameter values to estimate row counts and caches that plan.</p>\n<ul class=\"q-points\"><li>If data is skewed, later calls with different values reuse a plan that&#39;s bad for them (e.g. a nested-loop plan built for a customer with 5 orders reused for one with 5 million).</li><li>Fixes: <code>OPTION (RECOMPILE)</code> for infrequent queries, <code>OPTIMIZE FOR UNKNOWN</code>/specific value, local variables (generic estimate), separate procedures for different data shapes, Query Store plan forcing, and SQL Server 2022&#39;s Parameter Sensitive Plan optimisation.</li></ul>\n"},{"id":544,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":21,"level":"Advanced","priority":"High","question":"How do you approach tuning a slow query?","question_html":"How do you approach tuning a slow query?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> 1) Reproduce and measure (<code>SET STATISTICS IO, TIME ON</code>, actual execution plan, Query Store history).</p>\n<ul class=\"q-points\"><li>2) Read the plan: scans on large tables, key lookups, bad estimates, spills, implicit conversions, parallelism issues.</li><li>3) Fix the query: SARGable predicates, remove <code>SELECT *</code>, avoid scalar UDFs/cursors (set-based), rewrite correlated subqueries, correct data types.</li><li>4) Fix indexes: covering/composite indexes in the right column order, filtered indexes, remove unused.</li><li>5) Update statistics; handle parameter sniffing.</li><li>6) Check blocking/waits (<code>sys.dm_exec_requests</code>, <code>sp_WhoIsActive</code>).</li><li>7) Validate the improvement and watch write overhead.</li></ul>\n"},{"id":548,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":25,"level":"Scenario","priority":"High","question":"A report query that used to take 2 seconds now takes 2 minutes. Nothing in the code changed. What do you check?","question_html":"A report query that used to take 2 seconds now takes 2 minutes. Nothing in the code changed. What do you check?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Something changed in data or plans.</p>\n<ul class=\"q-points\"><li>Check Query Store for a <strong>plan regression</strong> (different plan since date X) and force the old plan as a stopgap;</li><li>check <strong>statistics</strong> staleness after big data loads (update them);</li><li><strong>parameter sniffing</strong> (different first-call parameters);</li><li>data growth crossing a threshold;</li><li>new blocking (<code>sp_WhoIsActive</code>, wait stats);</li><li>index changes or dropped indexes;</li><li>server pressure (memory grants, tempdb spills, CPU).</li><li>Then fix permanently with indexes/query rewrite.</li></ul>\n"},{"id":549,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":26,"level":"Scenario","priority":"High","question":"Write a query to get each department's top 3 earners.","question_html":"Write a query to get each department&#39;s top 3 earners.","answer_html":"<div class=\"code-block\"><span class=\"code-lang\">sql</span><button class=\"copy-btn\" type=\"button\" data-copy>Copy</button><pre><code class=\"hljs\"><span class=\"hljs-keyword\">WITH</span> ranked <span class=\"hljs-keyword\">AS</span> (\n    <span class=\"hljs-keyword\">SELECT</span> e.<span class=\"hljs-operator\">*</span>, <span class=\"hljs-built_in\">DENSE_RANK</span>() <span class=\"hljs-keyword\">OVER</span> (<span class=\"hljs-keyword\">PARTITION</span> <span class=\"hljs-keyword\">BY</span> DeptId <span class=\"hljs-keyword\">ORDER</span> <span class=\"hljs-keyword\">BY</span> Salary <span class=\"hljs-keyword\">DESC</span>) <span class=\"hljs-keyword\">AS</span> rnk\n    <span class=\"hljs-keyword\">FROM</span> dbo.Employees e\n)\n<span class=\"hljs-keyword\">SELECT</span> d.DeptName, r.FullName, r.Salary, r.rnk\n<span class=\"hljs-keyword\">FROM</span> ranked r <span class=\"hljs-keyword\">JOIN</span> dbo.Departments d <span class=\"hljs-keyword\">ON</span> d.DeptId <span class=\"hljs-operator\">=</span> r.DeptId\n<span class=\"hljs-keyword\">WHERE</span> r.rnk <span class=\"hljs-operator\">&lt;=</span> <span class=\"hljs-number\">3</span>\n<span class=\"hljs-keyword\">ORDER</span> <span class=\"hljs-keyword\">BY</span> d.DeptName, r.rnk;</code></pre></div>\n<p>Use ROW_NUMBER for exactly 3 rows per department regardless of ties; DENSE_RANK to include ties.</p>\n"},{"id":550,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":27,"level":"Scenario","priority":"High","question":"Users report the Orders screen freezes at month-end when the finance job runs. How do you investigate and fix?","question_html":"Users report the Orders screen freezes at month-end when the finance job runs. How do you investigate and fix?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Likely blocking: the finance job holds long locks (large UPDATEs, SERIALIZABLE, or lock escalation) while the screen&#39;s SELECTs wait.</p>\n<ul class=\"q-points\"><li>Investigate with <code>sp_WhoIsActive</code>/<code>sys.dm_exec_requests</code> (blocking_session_id, wait types like LCK_M_S) during the window and the job&#39;s plans.</li><li>Fixes: enable <strong>READ COMMITTED SNAPSHOT</strong> so readers don&#39;t block on writers, batch the job&#39;s updates into small transactions, add indexes so it locks fewer rows, schedule heavy parts off-hours, or read reports from a readable secondary/replica.</li></ul>\n"},{"id":553,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":30,"level":"Beginner","priority":"High","question":"What are the ACID properties of a transaction?","question_html":"What are the ACID properties of a transaction?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Atomicity — all statements in a transaction succeed or none do (rollback on failure).</p>\n<ul class=\"q-points\"><li>Consistency — a transaction moves the database from one valid state to another, respecting constraints, keys and rules.</li><li>Isolation — concurrent transactions don&#39;t see each other&#39;s uncommitted work, controlled by isolation levels and locks/row versions.</li><li>Durability — once committed, changes survive crashes because the log is hardened to disk (write-ahead logging).</li><li>Example: a money transfer debits one account and credits another inside one transaction so it can never half-complete.</li></ul>\n"},{"id":532,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":9,"level":"Beginner","priority":"Medium","question":"What is the difference between UNION and UNION ALL?","question_html":"What is the difference between UNION and UNION ALL?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> UNION combines result sets and removes duplicates (requires a sort/hash → slower).</p>\n<ul class=\"q-points\"><li>UNION ALL keeps all rows including duplicates and is faster.</li><li>Both need the same number of columns with compatible types.</li><li>Use UNION ALL unless you specifically need deduplication.</li></ul>\n"},{"id":533,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":10,"level":"Beginner","priority":"Medium","question":"What is the difference between CHAR, VARCHAR, NCHAR and NVARCHAR?","question_html":"What is the difference between CHAR, VARCHAR, NCHAR and NVARCHAR?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> CHAR(n)/NCHAR(n) are fixed-length (padded with spaces); VARCHAR(n)/NVARCHAR(n) are variable-length.</p>\n<ul class=\"q-points\"><li>N-types store Unicode (UTF-16, 2 bytes per character for most), needed for Hindi, Chinese etc.;</li><li>non-N types use 1 byte per character in the column&#39;s code page (or UTF-8 collations in 2019+).</li><li><code>MAX</code> variants hold up to 2 GB.</li><li>Prefix Unicode literals with <code>N&#39;...&#39;</code>.</li></ul>\n"},{"id":541,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":18,"level":"Intermediate","priority":"Medium","question":"What is the difference between ISNULL and COALESCE?","question_html":"What is the difference between ISNULL and COALESCE?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> ISNULL(expr, replacement) is T-SQL-specific, takes two arguments, and returns the data type of the first.</p>\n<ul class=\"q-points\"><li>COALESCE(a, b, c, ...) is ANSI standard, takes many arguments, returns the first non-NULL and uses data type precedence;</li><li>it&#39;s internally a CASE expression (may evaluate subqueries twice).</li><li>Nullability of computed results also differs.</li></ul>\n"},{"id":542,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":19,"level":"Intermediate","priority":"Medium","question":"What are the magic tables in triggers?","question_html":"What are the magic tables in triggers?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>inserted</code> and <code>deleted</code> — virtual tables available inside DML triggers (and OUTPUT clauses).</p>\n<ul class=\"q-points\"><li>INSERT: <code>inserted</code> has new rows.</li><li>DELETE: <code>deleted</code> has removed rows.</li><li>UPDATE: <code>deleted</code> holds old values and <code>inserted</code> new values.</li><li>Triggers fire once per statement, so always write set-based logic that handles multiple rows.</li></ul>\n"},{"id":545,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":22,"level":"Advanced","priority":"Medium","question":"What does NOLOCK do and why is it dangerous?","question_html":"What does NOLOCK do and why is it dangerous?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>WITH (NOLOCK)</code> = READ UNCOMMITTED for that table: no shared locks, so it isn&#39;t blocked by writers.</p>\n<ul class=\"q-points\"><li>Dangers: dirty reads of uncommitted data that may roll back, missing or duplicate rows due to page splits during scans, and errors (601) on data movement.</li><li>It isn&#39;t a performance fix for blocking — use READ COMMITTED SNAPSHOT isolation instead, which gives non-blocking reads of committed data.</li></ul>\n"},{"id":546,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":23,"level":"Advanced","priority":"Medium","question":"Explain the backup types and recovery models.","question_html":"Explain the backup types and recovery models.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Recovery models: SIMPLE (log truncated at checkpoint, no log backups, restore only to the last full/diff), FULL (all logged, log backups required, point-in-time restore), BULK_LOGGED (minimal logging for bulk ops, point-in-time limited).</p>\n<ul class=\"q-points\"><li>Backups: Full (whole DB), Differential (changes since the last full), Transaction log (log records since the last log backup — keeps the log from growing in FULL).</li><li>Restore sequence: full → latest differential → all log backups in order (<code>STOPAT</code> for point in time).</li><li>Test restores regularly.</li></ul>\n"},{"id":551,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":28,"level":"Scenario","priority":"Medium","question":"How would you design tables for an e-commerce order system?","question_html":"How would you design tables for an e-commerce order system?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Customers(CustomerId PK, Name, Email UNIQUE), Addresses(AddressId, CustomerId FK, ...), Products(ProductId PK, Sku UNIQUE, Name, Price, CategoryId FK), Categories(self-referencing ParentId), Orders(OrderId PK, CustomerId FK, OrderDate, Status, ShippingAddressId FK, Total), OrderItems(OrderId FK, ProductId FK, Qty, UnitPrice — copy the price at order time;</p>\n<ul class=\"q-points\"><li>PK (OrderId, ProductId) or surrogate), Payments(PaymentId, OrderId FK, Amount, Method, Status, ProviderRef UNIQUE), Inventory(ProductId, WarehouseId, Qty, RowVersion).</li><li>Indexes on FKs and common filters (Orders(CustomerId, OrderDate DESC)), CHECK constraints (Qty &gt; 0), rowversion for concurrency, audit columns.</li></ul>\n"},{"id":552,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":29,"level":"Scenario","priority":"Medium","question":"You must load 50 million rows into a table that is queried 24/7. How do you avoid downtime?","question_html":"You must load 50 million rows into a table that is queried 24/7. How do you avoid downtime?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Load into a <strong>staging table</strong> with the same structure (bulk insert, minimal logging, no indexes during load, then build indexes), validate, then <strong>partition switch</strong> it into the main partitioned table (metadata-only, near-instant) or swap via <code>sp_rename</code> inside a short transaction.</p>\n<ul class=\"q-points\"><li>Alternatively insert in small batches with throttling during low traffic.</li><li>Use RCSI so readers aren&#39;t blocked, and keep statistics updated afterwards.</li></ul>\n"},{"id":547,"course_slug":"sqlserver","course_title":"SQL Server & T-SQL","ord":24,"level":"Advanced","priority":"Low","question":"What is lock escalation?","question_html":"What is lock escalation?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> When a single statement acquires roughly 5,000+ row/page locks on one object, SQL Server may escalate to a table (or partition) lock to save memory, which increases blocking.</p>\n<ul class=\"q-points\"><li>Mitigate by batching large modifications (e.g. 4,000 rows at a time), proper indexes, `ALTER TABLE ...</li><li>SET (LOCK_ESCALATION = AUTO)` for partitioned tables, or row versioning isolation.</li></ul>\n"},{"id":554,"course_slug":"sqlserver-internals","course_title":"SQL Server Internals — How the Database Engine Really Works","ord":1,"level":"Beginner","priority":"High","question":"What is the difference between a clustered and a nonclustered index?","question_html":"What is the difference between a clustered and a nonclustered index?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A clustered index defines the physical order of the table: its B+ tree leaf level contains the actual data rows, so there can be only one.</p>\n<ul class=\"q-points\"><li>A nonclustered index is a separate B+ tree whose leaf rows contain the index key plus a pointer (the clustering key or RID) to the data row; there can be many.</li><li>Queries needing columns not in a nonclustered index do key lookups into the clustered index.</li></ul>\n"},{"id":555,"course_slug":"sqlserver-internals","course_title":"SQL Server Internals — How the Database Engine Really Works","ord":2,"level":"Beginner","priority":"High","question":"What is a page and an extent in SQL Server?","question_html":"What is a page and an extent in SQL Server?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A page is the basic 8 KB unit of storage and I/O, holding rows (≈8,060 bytes max in-row data) with a header and a row offset array.</p>\n<ul class=\"q-points\"><li>An extent is 8 contiguous pages (64 KB); SQL Server allocates space in extents.</li><li>Special pages (GAM, SGAM, PFS, IAM) track which extents and pages are free or belong to which object.</li></ul>\n"},{"id":556,"course_slug":"sqlserver-internals","course_title":"SQL Server Internals — How the Database Engine Really Works","ord":3,"level":"Beginner","priority":"High","question":"What are the transaction isolation levels in SQL Server?","question_html":"What are the transaction isolation levels in SQL Server?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> READ UNCOMMITTED (dirty reads possible), READ COMMITTED (default;</p>\n<ul class=\"q-points\"><li>no dirty reads), REPEATABLE READ (rows you read can&#39;t change), SERIALIZABLE (no phantoms — range locks) plus row-versioning options READ COMMITTED SNAPSHOT (statement-level consistent versions, readers don&#39;t block writers) and SNAPSHOT (transaction-level consistent snapshot with update-conflict detection).</li></ul>\n"},{"id":557,"course_slug":"sqlserver-internals","course_title":"SQL Server Internals — How the Database Engine Really Works","ord":4,"level":"Beginner","priority":"High","question":"What is an execution plan and how do you read it?","question_html":"What is an execution plan and how do you read it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The step-by-step strategy the optimizer chose to run a query (operators like seeks, scans, joins, sorts).</p>\n<ul class=\"q-points\"><li>Read it right to left following the data flow, check the most expensive operators, compare estimated vs actual row counts, and look for scans on large tables, key lookups repeated many times, sorts/hash spills, implicit conversion and missing-index warnings.</li><li>Use <code>SET STATISTICS IO</code> to measure logical reads before and after a change.</li></ul>\n"},{"id":558,"course_slug":"sqlserver-internals","course_title":"SQL Server Internals — How the Database Engine Really Works","ord":5,"level":"Intermediate","priority":"High","question":"How does SQL Server process a query internally?","question_html":"How does SQL Server process a query internally?","answer_html":"<p>Connection and TDS packets → parser (syntax) → algebrizer (binding names and types) → plan cache lookup → cost-based optimizer using statistics to choose a plan (cached) → executor runs the operators → storage engine reads pages via the buffer pool (from disk if not cached), taking locks or reading row versions per isolation level → rows streamed back to the client.</p>\n"},{"id":559,"course_slug":"sqlserver-internals","course_title":"SQL Server Internals — How the Database Engine Really Works","ord":6,"level":"Intermediate","priority":"High","question":"What are statistics and why do they matter?","question_html":"What are statistics and why do they matter?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Objects with a histogram (up to 200 steps) and density information about column value distributions, used by the optimizer to estimate how many rows each operation returns.</p>\n<ul class=\"q-points\"><li>Good estimates → good plans (right join type, memory grant, index choice).</li><li>Stale or missing statistics lead to bad plans; they&#39;re auto-created/updated, and can be updated manually (`UPDATE STATISTICS ...</li><li>WITH FULLSCAN`) after large data changes.</li></ul>\n"},{"id":560,"course_slug":"sqlserver-internals","course_title":"SQL Server Internals — How the Database Engine Really Works","ord":7,"level":"Intermediate","priority":"High","question":"What is parameter sniffing? How do you fix it?","question_html":"What is parameter sniffing? How do you fix it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> SQL Server compiles a parameterised query or procedure using the parameter values of the first execution and reuses that plan for all later values.</p>\n<ul class=\"q-points\"><li>If data is skewed, the plan can be terrible for other values.</li><li>Fixes: a covering index that suits all values, <code>OPTION (RECOMPILE)</code>, <code>OPTIMIZE FOR</code>, splitting logic, forcing a good plan with Query Store, or SQL Server 2022&#39;s Parameter Sensitive Plan optimisation.</li></ul>\n"},{"id":561,"course_slug":"sqlserver-internals","course_title":"SQL Server Internals — How the Database Engine Really Works","ord":8,"level":"Intermediate","priority":"High","question":"What is write-ahead logging and how does SQL Server recover after a crash?","question_html":"What is write-ahead logging and how does SQL Server recover after a crash?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Every modification is written to the transaction log (with an LSN) before the data page changes reach disk, and a commit waits until its log records are hardened.</p>\n<ul class=\"q-points\"><li>After a crash, recovery runs analysis (find dirty pages and open transactions), redo (replay logged changes since the last checkpoint) and undo (roll back uncommitted transactions), returning the database to a consistent state.</li></ul>\n"},{"id":562,"course_slug":"sqlserver-internals","course_title":"SQL Server Internals — How the Database Engine Really Works","ord":9,"level":"Intermediate","priority":"High","question":"What causes blocking and how do you troubleshoot it?","question_html":"What causes blocking and how do you troubleshoot it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A session holding locks (usually a long or open transaction, or one scanning many rows because of missing indexes) blocks others needing incompatible locks.</p>\n<ul class=\"q-points\"><li>Find it with <code>sys.dm_exec_requests</code> (<code>blocking_session_id</code>), <code>sp_WhoIsActive</code>, and the head blocker&#39;s query/plan;</li><li>fix by shortening transactions, adding indexes, committing promptly from the app, and enabling RCSI so readers don&#39;t block writers.</li></ul>\n"},{"id":566,"course_slug":"sqlserver-internals","course_title":"SQL Server Internals — How the Database Engine Really Works","ord":13,"level":"Advanced","priority":"High","question":"Why can NOLOCK be dangerous?","question_html":"Why can NOLOCK be dangerous?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> READ UNCOMMITTED doesn&#39;t take shared locks, so a query can read uncommitted data that later rolls back, read the same row twice or miss rows when pages split during an allocation-order scan, and still be blocked by schema locks.</p>\n<ul class=\"q-points\"><li>It&#39;s &quot;fast but wrong&quot;.</li><li>Use RCSI or SNAPSHOT for non-blocking consistent reads instead.</li></ul>\n"},{"id":569,"course_slug":"sqlserver-internals","course_title":"SQL Server Internals — How the Database Engine Really Works","ord":16,"level":"Scenario","priority":"High","question":"A query was fast yesterday and is slow today with no code change. How do you investigate?","question_html":"A query was fast yesterday and is slow today with no code change. How do you investigate?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Check Query Store for a plan change (regressed query) — often due to a statistics update, parameter sniffing with a different first value, or an index change.</p>\n<ul class=\"q-points\"><li>Compare old and new plans (estimated vs actual rows, seek vs scan, join types).</li><li>Quick fix: force the good plan in Query Store; real fix: update statistics, add/adjust a covering index, or rewrite non-SARGable predicates.</li><li>Also rule out blocking (<code>LCK_M_*</code> waits) and resource pressure (waits, memory, I/O).</li></ul>\n"},{"id":570,"course_slug":"sqlserver-internals","course_title":"SQL Server Internals — How the Database Engine Really Works","ord":17,"level":"Scenario","priority":"High","question":"Users get \"Transaction was deadlocked … chosen as the deadlock victim\". What do you do?","question_html":"Users get &quot;Transaction was deadlocked … chosen as the deadlock victim&quot;. What do you do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Capture the deadlock graph from the <code>system_health</code> Extended Events session, identify the statements, objects and lock types.</p>\n<ul class=\"q-points\"><li>Typical fixes: access tables in a consistent order, keep transactions short, add indexes so fewer rows are locked (especially on foreign keys and WHERE columns), use <code>UPDLOCK</code> for read-then-write, enable RCSI to remove reader/writer conflicts — and add retry logic for error 1205 in the application.</li></ul>\n"},{"id":563,"course_slug":"sqlserver-internals","course_title":"SQL Server Internals — How the Database Engine Really Works","ord":10,"level":"Intermediate","priority":"Medium","question":"What is a key lookup and how do you remove it?","question_html":"What is a key lookup and how do you remove it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> When a nonclustered index finds rows but the query needs columns not in that index, SQL Server looks up each row in the clustered index (key lookup) or heap (RID lookup).</p>\n<ul class=\"q-points\"><li>For many rows it&#39;s very expensive.</li><li>Remove it by adding the needed columns to the index with <code>INCLUDE</code> (covering index), or selecting fewer columns.</li></ul>\n"},{"id":564,"course_slug":"sqlserver-internals","course_title":"SQL Server Internals — How the Database Engine Really Works","ord":11,"level":"Intermediate","priority":"Medium","question":"What is the buffer pool?","question_html":"What is the buffer pool?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The main memory area where SQL Server caches 8 KB data and index pages.</p>\n<ul class=\"q-points\"><li>Queries read pages from the buffer pool (logical reads); if a page isn&#39;t there it&#39;s read from disk first (physical read).</li><li>Modified (dirty) pages are written back by checkpoint and the lazy writer.</li><li>Set max server memory so the buffer pool doesn&#39;t starve the OS.</li></ul>\n"},{"id":565,"course_slug":"sqlserver-internals","course_title":"SQL Server Internals — How the Database Engine Really Works","ord":12,"level":"Intermediate","priority":"Medium","question":"Latch vs lock?","question_html":"Latch vs lock?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Locks protect logical data consistency between transactions (rows, pages, tables), are held according to isolation level (possibly until commit) and are visible in <code>sys.dm_tran_locks</code>.</p>\n<ul class=\"q-points\"><li>Latches are lightweight, short-term internal synchronisation for in-memory structures like buffer pages and aren&#39;t controlled by isolation levels.</li><li>Latch contention (<code>PAGELATCH_*</code>) appears with hot pages such as the last page of an identity key under heavy inserts.</li></ul>\n"},{"id":567,"course_slug":"sqlserver-internals","course_title":"SQL Server Internals — How the Database Engine Really Works","ord":14,"level":"Advanced","priority":"Medium","question":"When would you use a columnstore index?","question_html":"When would you use a columnstore index?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> For analytical queries scanning and aggregating millions of rows — data warehouse fact tables (clustered columnstore) or real-time reporting on OLTP tables (nonclustered columnstore).</p>\n<ul class=\"q-points\"><li>Column-wise compressed storage and batch-mode execution dramatically reduce I/O and CPU.</li><li>Avoid as the only index for workloads of single-row lookups and frequent small updates.</li></ul>\n"},{"id":568,"course_slug":"sqlserver-internals","course_title":"SQL Server Internals — How the Database Engine Really Works","ord":15,"level":"Advanced","priority":"Medium","question":"Why does the transaction log keep growing?","question_html":"Why does the transaction log keep growing?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Log space can&#39;t be reused while something still needs it: in FULL/BULK_LOGGED recovery without regular log backups, long-running open transactions, replication or availability-group replicas behind, CDC.</p>\n<ul class=\"q-points\"><li>Check <code>log_reuse_wait_desc</code> in <code>sys.databases</code>; schedule log backups, find and end long transactions, and avoid shrinking repeatedly (causes VLF fragmentation).</li></ul>\n"},{"id":571,"course_slug":"sqlserver-internals","course_title":"SQL Server Internals — How the Database Engine Really Works","ord":18,"level":"Scenario","priority":"Medium","question":"An insert-heavy table with an IDENTITY clustered key shows PAGELATCH_EX waits under load. Why and how to fix?","question_html":"An insert-heavy table with an IDENTITY clustered key shows PAGELATCH_EX waits under load. Why and how to fix?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> All inserts go to the last page of the B-tree, so many threads compete for the latch on that single hot page.</p>\n<ul class=\"q-points\"><li>Options: <code>OPTIMIZE_FOR_SEQUENTIAL_KEY = ON</code> (2019+), a hash-partitioned table, a different clustering key spreading inserts (with trade-offs like page splits), In-Memory OLTP for extreme rates, or batching inserts.</li></ul>\n"},{"id":572,"course_slug":"etl","course_title":"ETL & Data Warehousing Concepts","ord":1,"level":"Beginner","priority":"High","question":"What is ETL? Explain each step.","question_html":"What is ETL? Explain each step.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> ETL is the process of moving data from source systems into a target (usually a data warehouse).</p>\n<ul class=\"q-points\"><li><strong>Extract</strong>: read data from databases, files, APIs — full or incremental.</li><li><strong>Transform</strong>: cleanse, validate, standardise, deduplicate, look up surrogate keys, apply business rules, aggregate.</li><li><strong>Load</strong>: write into dimension and fact tables (inserts, updates, SCD handling), then log and reconcile.</li><li>Goal: consistent, integrated, historical data for reporting.</li></ul>\n"},{"id":573,"course_slug":"etl","course_title":"ETL & Data Warehousing Concepts","ord":2,"level":"Beginner","priority":"High","question":"What is the difference between ETL and ELT?","question_html":"What is the difference between ETL and ELT?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> ETL transforms data in a separate engine before loading (SSIS, Informatica), good when the target is limited or data must be cleaned before landing.</p>\n<ul class=\"q-points\"><li>ELT loads raw data into a scalable target first and transforms it there with SQL/Spark (Synapse, Fabric, Snowflake, Databricks + dbt), keeping raw history and using elastic compute.</li><li>Modern cloud architectures mostly use ELT with a medallion design.</li></ul>\n"},{"id":574,"course_slug":"etl","course_title":"ETL & Data Warehousing Concepts","ord":3,"level":"Beginner","priority":"High","question":"What is a data warehouse? How is it different from an OLTP database?","question_html":"What is a data warehouse? How is it different from an OLTP database?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A data warehouse is a subject-oriented, integrated, time-variant, non-volatile store of data for analysis (Inmon&#39;s definition).</p>\n<ul class=\"q-points\"><li>OLTP databases serve day-to-day transactions: many small reads/writes, normalised, current data.</li><li>Warehouses serve analytical queries over large volumes: denormalised star schemas, history, bulk loads, read-optimised (columnstore).</li><li>Running analytics on OLTP harms the business application.</li></ul>\n"},{"id":575,"course_slug":"etl","course_title":"ETL & Data Warehousing Concepts","ord":4,"level":"Beginner","priority":"High","question":"What are fact and dimension tables?","question_html":"What are fact and dimension tables?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Fact tables store measurable business events (quantity, amount) at a defined grain plus foreign keys to dimensions.</p>\n<ul class=\"q-points\"><li>Dimension tables store descriptive attributes (customer name, city; product category; date parts) used to filter and group facts.</li><li>Example: FactSales(DateKey, ProductKey, CustomerKey, Qty, Amount) with DimDate, DimProduct, DimCustomer.</li></ul>\n"},{"id":576,"course_slug":"etl","course_title":"ETL & Data Warehousing Concepts","ord":5,"level":"Beginner","priority":"High","question":"What is the difference between a star schema and a snowflake schema?","question_html":"What is the difference between a star schema and a snowflake schema?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> In a star schema, each dimension is a single denormalised table directly joined to the fact — fewer joins, faster and simpler for BI tools.</p>\n<ul class=\"q-points\"><li>In a snowflake schema, dimensions are normalised into multiple related tables (Product → Subcategory → Category) — less redundancy but more joins and complexity.</li><li>Kimball recommends star schemas; Power BI performs best with them.</li></ul>\n"},{"id":578,"course_slug":"etl","course_title":"ETL & Data Warehousing Concepts","ord":7,"level":"Intermediate","priority":"High","question":"Explain Slowly Changing Dimensions Types 1, 2 and 3.","question_html":"Explain Slowly Changing Dimensions Types 1, 2 and 3.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> They control how dimension attribute changes are stored.</p>\n<ul class=\"q-points\"><li>Type 1 overwrites the old value (no history — corrections).</li><li>Type 2 inserts a new row with a new surrogate key and validity columns (ValidFrom, ValidTo, IsCurrent), preserving full history so old facts keep pointing to the old version.</li><li>Type 3 adds a column for the previous value (only one level of history).</li><li>Type 0 never changes; Type 6 combines 1, 2 and 3.</li></ul>\n"},{"id":579,"course_slug":"etl","course_title":"ETL & Data Warehousing Concepts","ord":8,"level":"Intermediate","priority":"High","question":"What is a surrogate key and why use it in a warehouse?","question_html":"What is a surrogate key and why use it in a warehouse?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A system-generated integer key (IDENTITY/sequence) used as the dimension&#39;s primary key instead of the source&#39;s natural key.</p>\n<ul class=\"q-points\"><li>Reasons: integrates multiple sources with overlapping IDs, enables SCD Type 2 (several rows per business key), protects from source key changes/reuse, smaller and faster joins, supports special members like &quot;Unknown&quot; (-1).</li></ul>\n"},{"id":580,"course_slug":"etl","course_title":"ETL & Data Warehousing Concepts","ord":9,"level":"Intermediate","priority":"High","question":"How do you implement an incremental load?","question_html":"How do you implement an incremental load?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Detect changes since the last successful run using a watermark (ModifiedDate/rowversion stored in a control table), CDC or Change Tracking, or hash comparison.</p>\n<ul class=\"q-points\"><li>Extract only those rows into staging, then upsert into the target (MERGE or UPDATE + INSERT;</li><li>SCD logic for dimensions), handle deletes (soft-delete flags, CDC delete records, or periodic full compare), and update the watermark only after the load succeeds so failures don&#39;t skip data.</li></ul>\n"},{"id":581,"course_slug":"etl","course_title":"ETL & Data Warehousing Concepts","ord":10,"level":"Intermediate","priority":"High","question":"How do you handle errors and bad data in ETL?","question_html":"How do you handle errors and bad data in ETL?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Validate early;</p>\n<ul class=\"q-points\"><li>redirect bad rows to error tables with the reason instead of failing the whole batch (unless the threshold is exceeded);</li><li>use an &quot;Unknown&quot; dimension member for missing lookups (late-arriving dimensions) and fix later;</li><li>log every run in an audit table (counts, durations, status);</li><li>send alerts;</li><li>make loads idempotent and restartable;</li><li>reconcile counts and totals with the source;</li><li>keep raw data for reprocessing.</li></ul>\n"},{"id":587,"course_slug":"etl","course_title":"ETL & Data Warehousing Concepts","ord":16,"level":"Scenario","priority":"High","question":"The nightly ETL that used to take 1 hour now takes 5 hours and misses the SLA. How do you troubleshoot?","question_html":"The nightly ETL that used to take 1 hour now takes 5 hours and misses the SLA. How do you troubleshoot?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Find which step slowed (audit log durations per task).</p>\n<ul class=\"q-points\"><li>Check data volume growth (switch full loads to incremental), source query plans and missing indexes, blocking on target tables during loads, row-by-row operations (OLE DB Command, cursors, SCD wizard on big dimensions → replace with set-based MERGE), blocking SSIS transformations (sort/aggregate), lookups in full-cache mode with huge reference tables, index maintenance on targets (disable/rebuild), log growth, server resources (memory, tempdb), and parallelism between independent loads.</li></ul>\n"},{"id":588,"course_slug":"etl","course_title":"ETL & Data Warehousing Concepts","ord":17,"level":"Scenario","priority":"High","question":"Business reports show sales totals 3% higher than the ERP. How do you find the cause?","question_html":"Business reports show sales totals 3% higher than the ERP. How do you find the cause?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Reconcile step by step: compare counts and sums source → staging → warehouse for the same period and filters.</p>\n<ul class=\"q-points\"><li>Typical causes: duplicate extraction (overlapping incremental windows, reruns without idempotency), join fan-out (fact joined to a dimension with duplicate business keys, SCD2 lookup not restricted to the valid row), different business rules (cancelled orders, returns, tax/currency, time zones/cut-off), late-arriving corrections not applied.</li><li>Fix the logic, add automated reconciliation checks and uniqueness tests.</li></ul>\n"},{"id":577,"course_slug":"etl","course_title":"ETL & Data Warehousing Concepts","ord":6,"level":"Beginner","priority":"Medium","question":"What is a staging area and why use it?","question_html":"What is a staging area and why use it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A temporary storage layer where extracted raw data lands before transformation.</p>\n<ul class=\"q-points\"><li>It minimises the time and load on source systems, allows transformations and validations with SQL, supports reruns without re-extracting, helps debugging and reconciliation, and decouples source availability from the warehouse load schedule.</li><li>Usually truncated and reloaded each run (or kept as bronze history in lakehouses).</li></ul>\n"},{"id":582,"course_slug":"etl","course_title":"ETL & Data Warehousing Concepts","ord":11,"level":"Intermediate","priority":"Medium","question":"What is the grain of a fact table and why is it important?","question_html":"What is the grain of a fact table and why is it important?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The grain is what one row represents (one order line, one customer per day, one account per month-end).</p>\n<ul class=\"q-points\"><li>It must be declared before choosing dimensions and measures.</li><li>Mixing grains causes double counting.</li><li>The most atomic grain gives the most flexibility; aggregates can be built on top.</li></ul>\n"},{"id":583,"course_slug":"etl","course_title":"ETL & Data Warehousing Concepts","ord":12,"level":"Intermediate","priority":"Medium","question":"What are additive, semi-additive and non-additive measures?","question_html":"What are additive, semi-additive and non-additive measures?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Additive measures can be summed across all dimensions (sales amount, quantity).</p>\n<ul class=\"q-points\"><li>Semi-additive can be summed across some dimensions but not time (account balance, inventory level — use last/average over time).</li><li>Non-additive can&#39;t be summed at all (ratios, percentages, unit price) — store numerator and denominator and calculate in the report.</li></ul>\n"},{"id":584,"course_slug":"etl","course_title":"ETL & Data Warehousing Concepts","ord":13,"level":"Intermediate","priority":"Medium","question":"What is CDC (Change Data Capture)?","question_html":"What is CDC (Change Data Capture)?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A SQL Server feature (also in Azure SQL and other databases) that reads the transaction log asynchronously and records inserts, updates and deletes with column values into change tables (<code>cdc.&lt;schema&gt;_&lt;table&gt;_CT</code>), queried via <code>cdc.fn_cdc_get_all_changes_...</code> using LSN ranges.</p>\n<ul class=\"q-points\"><li>ETL reads only changes — including deletes — with low impact on the source.</li><li>Change Tracking is lighter: it records which rows changed, not the values.</li></ul>\n"},{"id":585,"course_slug":"etl","course_title":"ETL & Data Warehousing Concepts","ord":14,"level":"Advanced","priority":"Medium","question":"Inmon vs Kimball — which approach would you choose?","question_html":"Inmon vs Kimball — which approach would you choose?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Inmon builds a normalised enterprise DW first (top-down) — consistent, but long time-to-value.</p>\n<ul class=\"q-points\"><li>Kimball builds dimensional data marts per business process using conformed dimensions (bottom-up) — faster delivery and BI-friendly.</li><li>Many organisations use a hybrid: a raw/normalised (or Data Vault) integration layer with Kimball star schemas for presentation — similar to the medallion bronze/silver/gold pattern.</li></ul>\n"},{"id":586,"course_slug":"etl","course_title":"ETL & Data Warehousing Concepts","ord":15,"level":"Advanced","priority":"Medium","question":"What is a late-arriving dimension (early-arriving fact) and how do you handle it?","question_html":"What is a late-arriving dimension (early-arriving fact) and how do you handle it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A fact arrives referencing a dimension member that doesn&#39;t exist yet (e.g. sale for a new customer not yet loaded from CRM).</p>\n<ul class=\"q-points\"><li>Options: assign the &quot;Unknown&quot; member (-1) and update the fact later;</li><li>or insert an <strong>inferred member</strong> (placeholder row with just the business key) and update its attributes when the real dimension data arrives (SSIS SCD wizard supports inferred members).</li></ul>\n"},{"id":589,"course_slug":"etl","course_title":"ETL & Data Warehousing Concepts","ord":18,"level":"Scenario","priority":"Medium","question":"Design an ETL for daily sales from 50 store databases into a central warehouse.","question_html":"Design an ETL for daily sales from 50 store databases into a central warehouse.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Parameterised pipeline looped over a store config table (ADF ForEach or SSIS Foreach with a project parameter for the connection).</p>\n<ul class=\"q-points\"><li>Incremental extract per store using a watermark/CDC into a staging table tagged with StoreId and BatchId.</li><li>Transform centrally: conform codes, dedupe, look up surrogate keys (DimStore, DimProduct, DimDate, DimCustomer with SCD2).</li><li>Load dimensions then FactSales (partitioned by date).</li><li>Audit table per store per run, error rows redirected, alerts for stores that failed, rerun only failed stores.</li><li>Schedule after stores close; monitor SLA.</li></ul>\n"},{"id":590,"course_slug":"etl","course_title":"ETL & Data Warehousing Concepts","ord":19,"level":"Scenario","priority":"Medium","question":"How do you test an ETL pipeline?","question_html":"How do you test an ETL pipeline?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Unit-test transformations (sample inputs → expected outputs), validate mappings against the source-to-target document, test row counts and sums (reconciliation), null/duplicate/RI checks, SCD behaviour (insert, change, no-change cases), incremental logic (no duplicates on rerun, late changes captured, deletes handled), error handling (bad rows go to error tables), performance with production-like volumes, and restart/idempotency.</p>\n<ul class=\"q-points\"><li>Automate with tSQLt, dbt tests or Great Expectations in CI.</li></ul>\n"},{"id":591,"course_slug":"ssis","course_title":"SSIS — SQL Server Integration Services","ord":1,"level":"Beginner","priority":"High","question":"What is SSIS and what is it used for?","question_html":"What is SSIS and what is it used for?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> SQL Server Integration Services is Microsoft&#39;s ETL and workflow tool shipped with SQL Server.</p>\n<ul class=\"q-points\"><li>It extracts data from many sources (SQL, Oracle, flat files, Excel, XML, APIs), transforms it in a high-performance in-memory pipeline, and loads it into targets such as data warehouses.</li><li>Also used for data migration, file automation and database maintenance.</li><li>Packages are built in Visual Studio and deployed to the SSISDB catalog.</li></ul>\n"},{"id":592,"course_slug":"ssis","course_title":"SSIS — SQL Server Integration Services","ord":2,"level":"Beginner","priority":"High","question":"What is the difference between Control Flow and Data Flow?","question_html":"What is the difference between Control Flow and Data Flow?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Control Flow orchestrates the workflow: tasks (Execute SQL, Data Flow, File System, Script, Send Mail), containers and precedence constraints determining execution order.</p>\n<ul class=\"q-points\"><li>Data Flow is inside a Data Flow Task and moves rows from sources through transformations to destinations in memory buffers.</li><li>Control Flow deals with tasks; Data Flow deals with rows.</li></ul>\n"},{"id":593,"course_slug":"ssis","course_title":"SSIS — SQL Server Integration Services","ord":3,"level":"Beginner","priority":"High","question":"What are the different types of containers?","question_html":"What are the different types of containers?","answer_html":"<p>Sequence Container (groups tasks, scopes variables, shares transactions, lets you enable/disable a group), For Loop Container (repeats while a condition holds — counter-based), Foreach Loop Container (iterates over a collection: files in a folder, rows of an ADO recordset, items, nodes, blobs), and the Task Host container that wraps every single task.</p>\n"},{"id":594,"course_slug":"ssis","course_title":"SSIS — SQL Server Integration Services","ord":4,"level":"Beginner","priority":"High","question":"What is a precedence constraint?","question_html":"What is a precedence constraint?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A connector between control-flow executables that controls whether the next task runs, based on the outcome of the previous one: Success, Failure or Completion, optionally combined with an expression (e.g. only if <code>@RowCount &gt; 0</code>).</p>\n<ul class=\"q-points\"><li>With multiple constraints into one task, choose logical AND (all) or OR (any).</li></ul>\n"},{"id":595,"course_slug":"ssis","course_title":"SSIS — SQL Server Integration Services","ord":5,"level":"Beginner","priority":"High","question":"What is the difference between variables and parameters?","question_html":"What is the difference between variables and parameters?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Parameters (introduced in 2012) pass values into a package or project from outside before execution — server names, folders, dates — and are set from SSISDB environments or <code>dtexec</code>.</p>\n<ul class=\"q-points\"><li>They are read-only during execution.</li><li>Variables store values during execution (row counts, file names, result sets), can be changed by tasks/scripts, and are scoped to package, container or task.</li></ul>\n"},{"id":597,"course_slug":"ssis","course_title":"SSIS — SQL Server Integration Services","ord":7,"level":"Intermediate","priority":"High","question":"What are synchronous and asynchronous transformations? Give examples of blocking transformations.","question_html":"What are synchronous and asynchronous transformations? Give examples of blocking transformations.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Synchronous (non-blocking) transformations process rows in the same buffer and output exactly one row per input row — Derived Column, Data Conversion, Conditional Split, Lookup, Multicast, Row Count.</p>\n<ul class=\"q-points\"><li>Asynchronous transformations create new buffers.</li><li>Semi-blocking ones (Merge, Merge Join, Union All, Pivot) can output before reading all input;</li><li>fully blocking ones (Sort, Aggregate, Fuzzy Grouping/Lookup) must read all input first, consuming memory and slowing large flows.</li></ul>\n"},{"id":598,"course_slug":"ssis","course_title":"SSIS — SQL Server Integration Services","ord":8,"level":"Intermediate","priority":"High","question":"Explain the Lookup transformation cache modes.","question_html":"Explain the Lookup transformation cache modes.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Full cache loads the whole reference query into memory before processing (fastest, needs memory, reference must be stable).</p>\n<ul class=\"q-points\"><li>Partial cache starts empty and queries the database on misses, caching the results (good for large references with few used keys).</li><li>No cache queries the database for every row (slowest; use when the reference changes during the load).</li><li>A Cache Connection Manager can pre-build a cache from any source and reuse it across lookups/packages.</li></ul>\n"},{"id":599,"course_slug":"ssis","course_title":"SSIS — SQL Server Integration Services","ord":9,"level":"Intermediate","priority":"High","question":"How do you handle errors in SSIS?","question_html":"How do you handle errors in SSIS?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> At row level, configure component error outputs to redirect failing rows (conversion/truncation/lookup no-match) to error tables with ErrorCode/ErrorColumn instead of failing.</p>\n<ul class=\"q-points\"><li>At task level, use precedence constraints on Failure to run cleanup/notification tasks, event handlers (OnError logs to an audit table and sends email), MaximumErrorCount, and checkpoints for restart.</li><li>Logging in SSISDB captures messages; SQL Agent alerts on job failure.</li></ul>\n"},{"id":600,"course_slug":"ssis","course_title":"SSIS — SQL Server Integration Services","ord":10,"level":"Intermediate","priority":"High","question":"How do you implement an incremental load in SSIS?","question_html":"How do you implement an incremental load in SSIS?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Store the last successful load watermark (date/rowversion) in a control table;</p>\n<ul class=\"q-points\"><li>Execute SQL Task reads it into a variable;</li><li>the source query extracts rows changed since then;</li><li>Lookup against the target splits new (No Match → insert) vs existing rows (Match → conditional split on changes → staging table → set-based UPDATE);</li><li>final Execute SQL Task updates the watermark.</li><li>Alternatives: CDC components, or load staging and run a T-SQL MERGE.</li></ul>\n"},{"id":601,"course_slug":"ssis","course_title":"SSIS — SQL Server Integration Services","ord":11,"level":"Intermediate","priority":"High","question":"What is the difference between the project and package deployment models?","question_html":"What is the difference between the project and package deployment models?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The package deployment model (legacy) deploys individual .dtsx files to the file system or msdb and uses package configurations.</p>\n<ul class=\"q-points\"><li>The project deployment model (2012+) deploys the whole project as an .ispac to the SSISDB catalog, uses project/package parameters with environments per server, keeps versions, and provides built-in logging and execution reports.</li><li>New work should use the project model.</li></ul>\n"},{"id":605,"course_slug":"ssis","course_title":"SSIS — SQL Server Integration Services","ord":15,"level":"Advanced","priority":"High","question":"How do you improve the performance of a slow SSIS package?","question_html":"How do you improve the performance of a slow SSIS package?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Filter and select only needed columns at the source;</p>\n<ul class=\"q-points\"><li>sort in SQL and mark outputs as sorted;</li><li>remove blocking transformations;</li><li>replace OLE DB Command and SCD wizard with staging + set-based SQL;</li><li>use full-cache lookups with minimal columns;</li><li>fast-load destinations with table lock and batch settings;</li><li>drop/disable indexes during huge loads;</li><li>tune buffer size/rows (or AutoAdjustBufferSize);</li><li>run independent flows in parallel (MaxConcurrentExecutables, EngineThreads);</li><li>avoid unnecessary data conversions;</li><li>check for buffer spooling and server memory;</li><li>switch to incremental loads.</li></ul>\n"},{"id":608,"course_slug":"ssis","course_title":"SSIS — SQL Server Integration Services","ord":18,"level":"Scenario","priority":"High","question":"A package that loads 10 million rows nightly suddenly fails with a truncation error on one column. How do you handle it?","question_html":"A package that loads 10 million rows nightly suddenly fails with a truncation error on one column. How do you handle it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Identify the column from the error (ErrorColumn ID → lineage ID/name in the advanced editor or catalog messages).</p>\n<ul class=\"q-points\"><li>Short term: configure that component&#39;s error output to <strong>redirect</strong> truncated rows to an error table so the rest loads, and alert.</li><li>Root cause: the source started sending longer values — confirm with data profiling, then widen the staging/target column and the SSIS metadata (refresh external columns), or apply a business rule (trim/substring) agreed with the business.</li><li>Add a data-quality check that reports length violations.</li></ul>\n"},{"id":609,"course_slug":"ssis","course_title":"SSIS — SQL Server Integration Services","ord":19,"level":"Scenario","priority":"High","question":"You need to process every CSV file that lands in a folder, archive successfully processed files and move bad files to an error folder. Design it.","question_html":"You need to process every CSV file that lands in a folder, archive successfully processed files and move bad files to an error folder. Design it.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Foreach Loop Container (File enumerator on the inbound folder, <code>*.csv</code>, map the file name to a variable).</p>\n<ul class=\"q-points\"><li>Inside: Flat File connection manager with its ConnectionString set by an expression from the variable;</li><li>Data Flow (Flat File Source → Data Conversion/validation → error output to an error table → OLE DB Destination fast-load to staging);</li><li>Execute SQL to merge staging into targets and log the file name/BatchId;</li><li>File System Task on Success moves the file to Archive (with timestamp), on Failure moves it to Error.</li><li>Event handler for alerts.</li><li>Set <code>DelayValidation=True</code> because the file doesn&#39;t exist at design validation time.</li></ul>\n"},{"id":596,"course_slug":"ssis","course_title":"SSIS — SQL Server Integration Services","ord":6,"level":"Beginner","priority":"Medium","question":"What is a connection manager?","question_html":"What is a connection manager?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A reusable object holding connection information (connection string, credentials) for a data source/destination — OLE DB, ADO.NET, Flat File, Excel, FTP, SMTP, Cache, Azure.</p>\n<ul class=\"q-points\"><li>Tasks and components reference it.</li><li>Project-level connection managers are shared across packages.</li><li>Make them dynamic with parameters/expressions for each environment.</li></ul>\n"},{"id":602,"course_slug":"ssis","course_title":"SSIS — SQL Server Integration Services","ord":12,"level":"Intermediate","priority":"Medium","question":"What are checkpoints in SSIS?","question_html":"What are checkpoints in SSIS?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A restart mechanism: when enabled (CheckpointFileName, CheckpointUsage=IfExists, SaveCheckpoints=True, and FailPackageOnFailure=True on tasks), SSIS writes completed tasks to a checkpoint file;</p>\n<ul class=\"q-points\"><li>on rerun after failure it skips completed tasks and resumes from the failed one.</li><li>Data flows restart from their beginning, so design them idempotently.</li><li>The file is deleted after a successful run.</li></ul>\n"},{"id":603,"course_slug":"ssis","course_title":"SSIS — SQL Server Integration Services","ord":13,"level":"Intermediate","priority":"Medium","question":"Merge vs Merge Join vs Union All?","question_html":"Merge vs Merge Join vs Union All?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Union All combines multiple inputs into one without requiring sorted input (like SQL UNION ALL) — preferred.</p>\n<ul class=\"q-points\"><li>Merge combines exactly two <strong>sorted</strong> inputs into one sorted output.</li><li>Merge Join joins two <strong>sorted</strong> inputs (inner, left outer, full outer) on keys, like a SQL join.</li><li>Both Merge and Merge Join need sorted inputs — sort in the source queries, not with Sort transformations.</li></ul>\n"},{"id":604,"course_slug":"ssis","course_title":"SSIS — SQL Server Integration Services","ord":14,"level":"Intermediate","priority":"Medium","question":"How do you deploy and schedule SSIS packages?","question_html":"How do you deploy and schedule SSIS packages?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Build the project to an .ispac;</p>\n<ul class=\"q-points\"><li>deploy to the SSISDB catalog with the Deployment Wizard, SSMS or a CI/CD pipeline (Azure DevOps SSIS deploy task);</li><li>create environments with server-specific values and map parameters;</li><li>schedule with a SQL Server Agent job step of type SSIS package referencing the catalog and environment;</li><li>monitor through SSISDB reports and Agent job history.</li><li>In Azure, run on an Azure-SSIS Integration Runtime triggered by Azure Data Factory.</li></ul>\n"},{"id":606,"course_slug":"ssis","course_title":"SSIS — SQL Server Integration Services","ord":16,"level":"Advanced","priority":"Medium","question":"What are the SSISDB logging levels?","question_html":"What are the SSISDB logging levels?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> None, <strong>Basic</strong> (default — errors, warnings, task start/finish), <strong>Performance</strong> (performance stats and errors/warnings, less detail), <strong>Verbose</strong> (all events including data flow component details — heavy), <strong>RuntimeLineage</strong> (lineage tracking data), plus custom levels (2016+) choosing specific events.</p>\n<ul class=\"q-points\"><li>Choose Basic for production; Verbose only for troubleshooting.</li><li>Clean up old logs via the catalog retention settings (<code>Retention Period</code>).</li></ul>\n"},{"id":607,"course_slug":"ssis","course_title":"SSIS — SQL Server Integration Services","ord":17,"level":"Advanced","priority":"Medium","question":"How do you run SSIS in the cloud?","question_html":"How do you run SSIS in the cloud?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Provision an <strong>Azure-SSIS Integration Runtime</strong> in Azure Data Factory (or Synapse) — a managed cluster of VMs that runs SSIS packages;</p>\n<ul class=\"q-points\"><li>host SSISDB in Azure SQL Database/Managed Instance or deploy packages to Azure Files;</li><li>trigger with ADF&#39;s Execute SSIS Package activity.</li><li>Use a self-hosted IR as proxy or VNet join to reach on-prem sources.</li><li>Longer-term, migrate logic to native ADF/Fabric pipelines and dataflows.</li></ul>\n"},{"id":610,"course_slug":"ssis","course_title":"SSIS — SQL Server Integration Services","ord":20,"level":"Scenario","priority":"Medium","question":"The same package must run against DEV, QA and PROD servers with different connection strings and file paths. How do you configure it?","question_html":"The same package must run against DEV, QA and PROD servers with different connection strings and file paths. How do you configure it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use the project deployment model: create project parameters (ServerName, DatabaseName, InboundFolder) and use them in connection manager expressions;</p>\n<ul class=\"q-points\"><li>deploy the same .ispac to each server&#39;s SSISDB;</li><li>create an environment per server with variables holding the values (mark passwords as sensitive);</li><li>reference the environment from the project and map parameters;</li><li>SQL Agent job steps choose the environment.</li><li>No package edits between environments.</li></ul>\n"},{"id":611,"course_slug":"ssis","course_title":"SSIS — SQL Server Integration Services","ord":21,"level":"Scenario","priority":"Medium","question":"Your Lookup returns \"No Match\" for values that clearly exist in the reference table. Why?","question_html":"Your Lookup returns &quot;No Match&quot; for values that clearly exist in the reference table. Why?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Full-cache Lookup comparisons are <strong>case-sensitive, accent-sensitive and type/whitespace-sensitive</strong> (done in SSIS memory, not with the SQL collation).</p>\n<ul class=\"q-points\"><li>Differences in case, trailing spaces, data type (DT_STR vs DT_WSTR, int vs bigint) or code page cause misses.</li><li>Fix: UPPER/TRIM both sides (in the reference query and a Derived Column), convert to identical types, or use partial/no cache so SQL&#39;s collation applies.</li></ul>\n"},{"id":612,"course_slug":"ssrs","course_title":"SSRS — SQL Server Reporting Services","ord":1,"level":"Beginner","priority":"High","question":"What is SSRS and what are its main components?","question_html":"What is SSRS and what are its main components?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> SQL Server Reporting Services is a server-based reporting platform for creating, deploying and delivering paginated reports.</p>\n<ul class=\"q-points\"><li>Components: report designers (Visual Studio Reporting Services Projects, Report Builder), the Report Server Windows service (processing, rendering, scheduling), the ReportServer and ReportServerTempDB databases, the web portal and web service, and Report Server Configuration Manager.</li><li>Reports are RDL (XML) files.</li></ul>\n"},{"id":613,"course_slug":"ssrs","course_title":"SSRS — SQL Server Reporting Services","ord":2,"level":"Beginner","priority":"High","question":"What is the difference between a table, matrix and list?","question_html":"What is the difference between a table, matrix and list?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> All three are forms of the tablix data region.</p>\n<ul class=\"q-points\"><li>A table has fixed columns and dynamic rows (detail and group rows).</li><li>A matrix has dynamic rows and dynamic columns based on groups — a pivot/cross-tab (e.g. products × months with totals).</li><li>A list repeats a free-form layout per row or group — good for cards, labels or forms.</li></ul>\n"},{"id":614,"course_slug":"ssrs","course_title":"SSRS — SQL Server Reporting Services","ord":3,"level":"Beginner","priority":"High","question":"What is the difference between a shared and an embedded data source?","question_html":"What is the difference between a shared and an embedded data source?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A shared data source (.rds) is stored once on the report server and reused by many reports; changing it (e.g. server name, credentials) updates all of them.</p>\n<ul class=\"q-points\"><li>An embedded data source belongs to a single report.</li><li>Shared ones simplify environment changes and credential management; subscriptions and caching need stored credentials.</li></ul>\n"},{"id":615,"course_slug":"ssrs","course_title":"SSRS — SQL Server Reporting Services","ord":4,"level":"Beginner","priority":"High","question":"What are report parameters? How do you create cascading parameters?","question_html":"What are report parameters? How do you create cascading parameters?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Parameters let users filter reports (dates, region) and are passed into dataset queries.</p>\n<ul class=\"q-points\"><li>Cascading parameters are dependent: the available values of a child parameter come from a dataset that uses the parent parameter (Country → State → City).</li><li>The parent must appear before the child in the parameter list; changing the parent refreshes the child&#39;s list.</li></ul>\n"},{"id":617,"course_slug":"ssrs","course_title":"SSRS — SQL Server Reporting Services","ord":6,"level":"Intermediate","priority":"High","question":"What is the difference between drill-down and drill-through reports?","question_html":"What is the difference between drill-down and drill-through reports?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Drill-down shows/hides detail rows within the same report by toggling group visibility (+/− icons) — all data is already retrieved.</p>\n<ul class=\"q-points\"><li>Drill-through opens a different (target) report when you click an item, passing parameters (e.g. click a region total → regional detail report) — the target runs its own query only when requested.</li></ul>\n"},{"id":618,"course_slug":"ssrs","course_title":"SSRS — SQL Server Reporting Services","ord":7,"level":"Intermediate","priority":"High","question":"How do you pass a multi-value parameter to a stored procedure?","question_html":"How do you pass a multi-value parameter to a stored procedure?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Stored procedures can&#39;t receive SSRS multi-value arrays directly.</p>\n<ul class=\"q-points\"><li>In the dataset parameter, pass <code>=Join(Parameters!Region.Value, &quot;,&quot;)</code> and split it in SQL using <code>STRING_SPLIT(@Regions, &#39;,&#39;)</code> (2016+), a table-valued function or XML/JSON.</li><li>With an embedded text query, <code>WHERE Region IN (@Region)</code> works natively because SSRS expands the list.</li></ul>\n"},{"id":619,"course_slug":"ssrs","course_title":"SSRS — SQL Server Reporting Services","ord":8,"level":"Intermediate","priority":"High","question":"What are subscriptions? Standard vs data-driven?","question_html":"What are subscriptions? Standard vs data-driven?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Subscriptions automatically deliver reports on a schedule or event to email, a file share or SharePoint.</p>\n<ul class=\"q-points\"><li>Standard subscriptions have fixed recipients, parameters and format defined by the user.</li><li>Data-driven subscriptions (Enterprise edition) get recipients, delivery settings and parameter values from a query at runtime, so each person receives a personalised report.</li><li>Both rely on SQL Server Agent and stored credentials.</li></ul>\n"},{"id":620,"course_slug":"ssrs","course_title":"SSRS — SQL Server Reporting Services","ord":9,"level":"Intermediate","priority":"High","question":"How do you improve SSRS report performance?","question_html":"How do you improve SSRS report performance?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Check ExecutionLog3 to see whether data retrieval, processing or rendering dominates.</p>\n<ul class=\"q-points\"><li>Optimise queries/stored procedures and indexes, return only needed rows/columns, filter in SQL rather than dataset filters, push aggregations to SQL, avoid subreports in detail rows (use joins/Lookup/drill-through), reduce complex expressions, use caching, snapshots or shared dataset caching for expensive reports, and schedule heavy reports via subscriptions.</li></ul>\n"},{"id":626,"course_slug":"ssrs","course_title":"SSRS — SQL Server Reporting Services","ord":15,"level":"Scenario","priority":"High","question":"A report takes 3 minutes to open. ExecutionLog3 shows TimeDataRetrieval 170 seconds. What do you do?","question_html":"A report takes 3 minutes to open. ExecutionLog3 shows TimeDataRetrieval 170 seconds. What do you do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The bottleneck is the query.</p>\n<ul class=\"q-points\"><li>Capture the dataset&#39;s SQL (stored procedure) with the actual execution plan;</li><li>look for scans, missing indexes, non-SARGable predicates on date parameters, parameter sniffing (the same proc fast in SSMS but slow from SSRS — use <code>OPTION (RECOMPILE)</code> or local variables), and returning far more rows than displayed.</li><li>Add covering indexes, pre-aggregate in SQL, limit default parameter ranges, and consider caching/snapshots or a summary table refreshed by ETL.</li></ul>\n"},{"id":627,"course_slug":"ssrs","course_title":"SSRS — SQL Server Reporting Services","ord":16,"level":"Scenario","priority":"High","question":"Managers want each region's sales report emailed to them every Monday, but only their region. How?","question_html":"Managers want each region&#39;s sales report emailed to them every Monday, but only their region. How?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use a <strong>data-driven subscription</strong> (Enterprise edition): a query against a table of managers (Email, RegionId, Format) drives the subscription;</p>\n<ul class=\"q-points\"><li>map the Region parameter to RegionId and the To field to Email;</li><li>schedule weekly Monday 8 AM;</li><li>deliver as PDF.</li><li>On Standard edition, create one standard subscription per manager, or use a SQL Agent job/.NET service that calls the SSRS REST/URL API to render per region and email it.</li></ul>\n"},{"id":616,"course_slug":"ssrs","course_title":"SSRS — SQL Server Reporting Services","ord":5,"level":"Beginner","priority":"Medium","question":"What rendering/export formats does SSRS support?","question_html":"What rendering/export formats does SSRS support?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> HTML (web), PDF, Excel (XLSX), Word (DOCX), PowerPoint (PPTX, 2016+), CSV, XML, TIFF/image, MHTML (web archive).</p>\n<ul class=\"q-points\"><li>Data-only formats (CSV, XML) ignore layout.</li><li>Page breaks, page size and hidden items behave differently per renderer — test each required format.</li></ul>\n"},{"id":621,"course_slug":"ssrs","course_title":"SSRS — SQL Server Reporting Services","ord":10,"level":"Intermediate","priority":"Medium","question":"What is the difference between caching and snapshots?","question_html":"What is the difference between caching and snapshots?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A cached report is a temporary copy of a processed report (per parameter set) kept for a configured time after the first user runs it; it expires and refreshes on demand.</p>\n<ul class=\"q-points\"><li>A snapshot is executed on a schedule and stored as a point-in-time copy that all users see until the next snapshot; report history can retain old snapshots.</li><li>Both require stored credentials and reduce load on the source database.</li></ul>\n"},{"id":622,"course_slug":"ssrs","course_title":"SSRS — SQL Server Reporting Services","ord":11,"level":"Intermediate","priority":"Medium","question":"How do you show \"Page X of Y\" and alternating row colours?","question_html":"How do you show &quot;Page X of Y&quot; and alternating row colours?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Footer textbox: <code>=&quot;Page &quot; &amp; Globals!PageNumber &amp; &quot; of &quot; &amp; Globals!TotalPages</code>.</p>\n<ul class=\"q-points\"><li>Alternating rows: set the detail row&#39;s BackgroundColor to <code>=IIf(RowNumber(Nothing) Mod 2 = 0, &quot;WhiteSmoke&quot;, &quot;White&quot;)</code>.</li></ul>\n"},{"id":623,"course_slug":"ssrs","course_title":"SSRS — SQL Server Reporting Services","ord":12,"level":"Intermediate","priority":"Medium","question":"How do you implement row-level security in SSRS?","question_html":"How do you implement row-level security in SSRS?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Pass the built-in <code>User!UserID</code> (domain\\user) to the dataset query or stored procedure and filter data by a user-to-region mapping table.</p>\n<ul class=\"q-points\"><li>Hide the parameter (or make it internal) so users can&#39;t change it.</li><li>Alternatively use database-level security with Kerberos delegation (the user&#39;s identity flows to SQL Server with Row-Level Security).</li><li>Item-level roles control who can open the report at all.</li></ul>\n"},{"id":624,"course_slug":"ssrs","course_title":"SSRS — SQL Server Reporting Services","ord":13,"level":"Advanced","priority":"Medium","question":"What is the Lookup function? How is it different from a subreport?","question_html":"What is the Lookup function? How is it different from a subreport?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>Lookup(source_expr, dest_expr, result_expr, &quot;Dataset&quot;)</code> returns a value from another dataset by matching keys (<code>LookupSet</code> returns many, <code>MultiLookup</code> takes many keys).</p>\n<ul class=\"q-points\"><li>It combines data from two datasets (even different data sources) within one tablix without a SQL join.</li><li>A subreport is a whole separate report rendered inside the container and executes its own query per instance — heavier.</li><li>Lookup works in memory, so very large lookup datasets are slow too.</li></ul>\n"},{"id":625,"course_slug":"ssrs","course_title":"SSRS — SQL Server Reporting Services","ord":14,"level":"Advanced","priority":"Medium","question":"What happened to SSRS after SQL Server 2022?","question_html":"What happened to SSRS after SQL Server 2022?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Microsoft announced that SQL Server 2022 Reporting Services is the last SSRS release;</p>\n<ul class=\"q-points\"><li>from SQL Server 2025, <strong>Power BI Report Server</strong> is the on-premises reporting solution, hosting both paginated (RDL) reports and Power BI reports.</li><li>SSRS 2022 stays supported under its normal lifecycle.</li><li>Cloud reporting moves to paginated reports in the Power BI service/Fabric.</li><li>Existing RDL skills carry over.</li></ul>\n"},{"id":628,"course_slug":"ssrs","course_title":"SSRS — SQL Server Reporting Services","ord":17,"level":"Scenario","priority":"Medium","question":"A report looks fine in the browser but the PDF export has blank pages. Why?","question_html":"A report looks fine in the browser but the PDF export has blank pages. Why?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The report body width + left/right margins exceeds the page width (Report Properties → Page size), so the renderer spills onto extra pages;</p>\n<ul class=\"q-points\"><li>or there&#39;s empty space at the right edge of the body;</li><li>or <code>ConsumeContainerWhitespace</code> is false.</li><li>Fix: make body width ≤ page width − margins, set ConsumeContainerWhitespace = True, shrink the body to fit the content, and check page break settings.</li></ul>\n"},{"id":629,"course_slug":"ssrs","course_title":"SSRS — SQL Server Reporting Services","ord":18,"level":"Scenario","priority":"Medium","question":"Subscriptions suddenly stopped sending emails. How do you troubleshoot?","question_html":"Subscriptions suddenly stopped sending emails. How do you troubleshoot?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Check SQL Server Agent is running and the subscription jobs exist and succeed;</p>\n<ul class=\"q-points\"><li>review the subscription&#39;s status in the web portal;</li><li>check the SSRS logs (<code>LogFiles</code> folder) and <code>ExecutionLog3</code>;</li><li>verify the SMTP settings in Configuration Manager (server, port, sender address, authentication) and that the SMTP server accepts relays from the report server;</li><li>confirm stored credentials of the data source are still valid (expired passwords break unattended runs);</li><li>and check whether the report&#39;s parameters changed and invalidated the subscription.</li></ul>\n"},{"id":630,"course_slug":"iis","course_title":"IIS — Internet Information Services and Hosting .NET Applications","ord":1,"level":"Beginner","priority":"High","question":"What is IIS and what can it host?","question_html":"What is IIS and what can it host?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Microsoft&#39;s Windows web server.</p>\n<ul class=\"q-points\"><li>It hosts static sites, ASP.NET Framework apps (Web Forms, MVC 5, Web API 2, WCF), ASP.NET Core apps via the ASP.NET Core Module, and through modules/ARR can proxy to Node.js, Next.js or other servers.</li><li>It provides bindings, HTTPS, authentication (including Windows auth), compression, caching, URL rewriting and logging.</li></ul>\n"},{"id":631,"course_slug":"iis","course_title":"IIS — Internet Information Services and Hosting .NET Applications","ord":2,"level":"Beginner","priority":"High","question":"What is an application pool and why is it used?","question_html":"What is an application pool and why is it used?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A group of one or more applications served by the same worker process (<code>w3wp.exe</code>) with shared settings: .NET CLR version, pipeline mode, identity, recycling and limits.</p>\n<ul class=\"q-points\"><li>Pools isolate applications — a crash, memory leak or recycle in one pool doesn&#39;t affect apps in other pools — and define the security identity the app runs as.</li></ul>\n"},{"id":632,"course_slug":"iis","course_title":"IIS — Internet Information Services and Hosting .NET Applications","ord":3,"level":"Beginner","priority":"High","question":"What is w3wp.exe?","question_html":"What is w3wp.exe?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The IIS worker process.</p>\n<ul class=\"q-points\"><li>Each application pool runs in its own w3wp.exe (or several in a web garden);</li><li>it hosts the IIS pipeline, modules and your application code (including in-process ASP.NET Core apps).</li><li>You attach the Visual Studio debugger to w3wp.exe to debug IIS-hosted apps and see it in Task Manager with the pool identity as the user.</li></ul>\n"},{"id":633,"course_slug":"iis","course_title":"IIS — Internet Information Services and Hosting .NET Applications","ord":4,"level":"Beginner","priority":"High","question":"How do you deploy an ASP.NET Core app to IIS?","question_html":"How do you deploy an ASP.NET Core app to IIS?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Install the .NET Hosting Bundle on the server, <code>dotnet publish -c Release</code>, create an app pool with &quot;No Managed Code&quot;, create a site pointing to the publish folder with bindings and a certificate, grant the pool identity read permissions (write for logs/uploads), set environment variables (ASPNETCORE_ENVIRONMENT, connection strings) and browse.</p>\n<ul class=\"q-points\"><li>The published web.config configures the ASP.NET Core Module (in-process by default).</li></ul>\n"},{"id":635,"course_slug":"iis","course_title":"IIS — Internet Information Services and Hosting .NET Applications","ord":6,"level":"Intermediate","priority":"High","question":"In-process vs out-of-process hosting for ASP.NET Core in IIS?","question_html":"In-process vs out-of-process hosting for ASP.NET Core in IIS?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> In-process runs the app inside the IIS worker process using IIS&#39;s HTTP server — no extra network hop, best performance, but only one ASP.NET Core app per pool.</p>\n<ul class=\"q-points\"><li>Out-of-process runs the app as a separate Kestrel process with IIS (ANCM) forwarding requests over loopback — slower, but multiple apps per pool and Kestrel-specific features.</li><li>Configured with <code>hostingModel</code> in web.config / <code>AspNetCoreHostingModel</code> in the project.</li></ul>\n"},{"id":636,"course_slug":"iis","course_title":"IIS — Internet Information Services and Hosting .NET Applications","ord":7,"level":"Intermediate","priority":"High","question":"What is app pool recycling and what are its effects?","question_html":"What is app pool recycling and what are its effects?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> IIS periodically (default every 29 hours), on configuration changes, memory/request limits or on demand starts a new worker process and shuts down the old one.</p>\n<ul class=\"q-points\"><li>It frees leaked memory and refreshes the app, but in-memory state is lost (InProc session, MemoryCache, static data) and the first request after startup may be slow.</li><li>Schedule recycles off-peak, use out-of-process state and warm-up (Application Initialization).</li></ul>\n"},{"id":637,"course_slug":"iis","course_title":"IIS — Internet Information Services and Hosting .NET Applications","ord":8,"level":"Intermediate","priority":"High","question":"What is ApplicationPoolIdentity and how do you give it permissions?","question_html":"What is ApplicationPoolIdentity and how do you give it permissions?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A per-pool virtual account (<code>IIS AppPool\\&lt;PoolName&gt;</code>) created automatically, with minimal privileges.</p>\n<ul class=\"q-points\"><li>Grant it NTFS rights on the site folders (<code>icacls ... /grant &quot;IIS AppPool\\ShopPool&quot;:RX</code>), and for SQL Server with Windows authentication create a login for it locally or for the computer account (<code>DOMAIN\\SERVER$</code>) when SQL is remote — or use a dedicated domain service account.</li></ul>\n"},{"id":638,"course_slug":"iis","course_title":"IIS — Internet Information Services and Hosting .NET Applications","ord":9,"level":"Intermediate","priority":"High","question":"How do you troubleshoot a 500.30 / 502.5 error with ASP.NET Core on IIS?","question_html":"How do you troubleshoot a 500.30 / 502.5 error with ASP.NET Core on IIS?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The app failed to start.</p>\n<ul class=\"q-points\"><li>Check Event Viewer (Application log) for the ANCM and app exceptions, enable <code>stdoutLogEnabled</code> with a writable logs folder, run <code>dotnet YourApp.dll</code> from the publish folder on the server to see errors, verify the Hosting Bundle/runtime version and bitness, the app pool &quot;No Managed Code&quot;, file permissions, environment-specific configuration (missing connection string, Key Vault access) and database connectivity at startup.</li></ul>\n"},{"id":643,"course_slug":"iis","course_title":"IIS — Internet Information Services and Hosting .NET Applications","ord":14,"level":"Scenario","priority":"High","question":"After deployment the site returns 503 Service Unavailable. What do you check?","question_html":"After deployment the site returns 503 Service Unavailable. What do you check?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The application pool is likely stopped: open IIS Manager → Application Pools;</p>\n<ul class=\"q-points\"><li>check Event Viewer System log for WAS errors — rapid-fail protection after repeated crashes, wrong or expired password for a custom identity, missing .NET version, or a crash at startup.</li><li>Fix the cause and start the pool.</li><li>Also check the request queue limit and that the binding/host name is correct.</li></ul>\n"},{"id":644,"course_slug":"iis","course_title":"IIS — Internet Information Services and Hosting .NET Applications","ord":15,"level":"Scenario","priority":"High","question":"An intranet ASP.NET app on IIS must use Windows login and query SQL Server as the user. How do you configure it?","question_html":"An intranet ASP.NET app on IIS must use Windows login and query SQL Server as the user. How do you configure it?","answer_html":"<p>Enable Windows Authentication (disable Anonymous) on the site, <code>[Authorize]</code> in the app, and either connect to SQL Server with the app pool identity (simplest — grant that account the needed DB permissions and use <code>User.Identity.Name</code> for auditing) or, if SQL must see the end user, configure Kerberos constrained delegation (SPNs for the service account, delegation to the SQL service) and impersonation — more complex, so usually avoided.</p>\n"},{"id":634,"course_slug":"iis","course_title":"IIS — Internet Information Services and Hosting .NET Applications","ord":5,"level":"Beginner","priority":"Medium","question":"What is the difference between a site, an application and a virtual directory?","question_html":"What is the difference between a site, an application and a virtual directory?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A site is the top-level website with bindings and a root folder.</p>\n<ul class=\"q-points\"><li>An application is a sub-path that is its own ASP.NET application (own web.config root, can use a different app pool).</li><li>A virtual directory just maps a URL path to a physical folder inside an application without being a separate app.</li></ul>\n"},{"id":639,"course_slug":"iis","course_title":"IIS — Internet Information Services and Hosting .NET Applications","ord":10,"level":"Intermediate","priority":"Medium","question":"What does HTTP.sys do?","question_html":"What does HTTP.sys do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A kernel-mode HTTP listener used by IIS (and optionally ASP.NET Core directly).</p>\n<ul class=\"q-points\"><li>It accepts connections, parses requests, handles TLS with SChannel, maintains a request queue per application pool, serves cached responses from kernel mode and enforces limits — keeping IIS robust because requests queue in the kernel even while a worker process restarts.</li></ul>\n"},{"id":640,"course_slug":"iis","course_title":"IIS — Internet Information Services and Hosting .NET Applications","ord":11,"level":"Intermediate","priority":"Medium","question":"URL Rewrite vs Redirect? How do you host an Angular/React SPA on IIS?","question_html":"URL Rewrite vs Redirect? How do you host an Angular/React SPA on IIS?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A redirect tells the browser to request a different URL (301/302, address bar changes); a rewrite serves a different resource internally with the URL unchanged.</p>\n<ul class=\"q-points\"><li>For SPAs, add a rewrite rule that sends every request that isn&#39;t an existing file, folder or <code>/api/</code> path to <code>/index.html</code>, so deep links work on refresh;</li><li>add MIME types if needed and cache static assets.</li></ul>\n"},{"id":641,"course_slug":"iis","course_title":"IIS — Internet Information Services and Hosting .NET Applications","ord":12,"level":"Advanced","priority":"Medium","question":"How do you set up a web farm with IIS?","question_html":"How do you set up a web farm with IIS?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Multiple IIS servers behind a load balancer with health checks;</p>\n<ul class=\"q-points\"><li>identical code and config deployed by automation or shared configuration;</li><li>shared machine key / Data Protection keys so cookies and ViewState validate on any node;</li><li>out-of-process session (SQL Server/Redis) or sticky sessions;</li><li>centralised logging;</li><li>shared or replicated file storage for uploads;</li><li>rolling deployments one node at a time.</li></ul>\n"},{"id":642,"course_slug":"iis","course_title":"IIS — Internet Information Services and Hosting .NET Applications","ord":13,"level":"Advanced","priority":"Medium","question":"What is a web garden and when should you avoid it?","question_html":"What is a web garden and when should you avoid it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> An application pool with more than one worker process.</p>\n<ul class=\"q-points\"><li>It can help apps limited by per-process locks, but in-process state (session, cache, static variables) isn&#39;t shared between the processes, causing inconsistent behaviour.</li><li>Most apps should use one worker per pool and scale out across servers instead.</li></ul>\n"},{"id":645,"course_slug":"iis","course_title":"IIS — Internet Information Services and Hosting .NET Applications","ord":16,"level":"Scenario","priority":"Medium","question":"The first request every morning takes 30 seconds. How do you fix it?","question_html":"The first request every morning takes 30 seconds. How do you fix it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The app pool shuts down after the idle timeout (20 min) or recycled overnight, so the first request starts the worker, JITs code and warms caches.</p>\n<ul class=\"q-points\"><li>Set the pool&#39;s Start Mode to AlwaysRunning, idle timeout to 0, enable Application Initialization with <code>preloadEnabled</code> on the site (and a warm-up URL), schedule recycling during low traffic, and consider ReadyToRun publishing to reduce JIT time.</li></ul>\n"},{"id":646,"course_slug":"git","course_title":"Git & GitHub — Version Control from Basics to Advanced","ord":1,"level":"Beginner","priority":"High","question":"What is Git and how is it different from SVN/TFVC?","question_html":"What is Git and how is it different from SVN/TFVC?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Git is a distributed version control system: every clone has the full history, so commits, branches, diffs and logs work offline and are fast;</p>\n<ul class=\"q-points\"><li>you sync with remotes by push/pull.</li><li>SVN and TFVC are centralised: history lives on one server, many operations need the server, and branching is heavier.</li><li>Git&#39;s cheap branching enables feature branches and pull-request workflows.</li></ul>\n"},{"id":647,"course_slug":"git","course_title":"Git & GitHub — Version Control from Basics to Advanced","ord":2,"level":"Beginner","priority":"High","question":"What is the difference between git fetch and git pull?","question_html":"What is the difference between git fetch and git pull?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>git fetch</code> downloads new commits and updates remote-tracking branches (<code>origin/main</code>) without touching your working branch — safe to run anytime.</p>\n<ul class=\"q-points\"><li><code>git pull</code> = fetch + integrate (merge by default, or rebase with <code>--rebase</code>/<code>pull.rebase=true</code>) into your current branch, which can cause conflicts.</li></ul>\n"},{"id":648,"course_slug":"git","course_title":"Git & GitHub — Version Control from Basics to Advanced","ord":3,"level":"Beginner","priority":"High","question":"What is the staging area?","question_html":"What is the staging area?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The index between your working tree and the repository.</p>\n<ul class=\"q-points\"><li><code>git add</code> puts selected changes into it and <code>git commit</code> records exactly what is staged.</li><li>It lets you build clean, focused commits from a messy working tree (<code>git add -p</code> to stage parts of a file).</li></ul>\n"},{"id":649,"course_slug":"git","course_title":"Git & GitHub — Version Control from Basics to Advanced","ord":4,"level":"Beginner","priority":"High","question":"How do you resolve a merge conflict?","question_html":"How do you resolve a merge conflict?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Run <code>git status</code> to see conflicted files, open each, decide the correct code between the <code>&lt;&lt;&lt;&lt;&lt;&lt;&lt;</code>, <code>=======</code>, <code>&gt;&gt;&gt;&gt;&gt;&gt;&gt;</code> markers (keep one side, both, or rewrite), remove the markers, build and test, then <code>git add</code> the files and <code>git commit</code> (or <code>git rebase --continue</code>).</p>\n<ul class=\"q-points\"><li>Use <code>git merge --abort</code> to back out.</li><li>Prevent conflicts with small, frequent merges.</li></ul>\n"},{"id":651,"course_slug":"git","course_title":"Git & GitHub — Version Control from Basics to Advanced","ord":6,"level":"Intermediate","priority":"High","question":"Merge vs rebase — differences and when to use each?","question_html":"Merge vs rebase — differences and when to use each?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Merge joins histories with a merge commit, keeps the true history and never rewrites commits — safe for shared branches.</p>\n<ul class=\"q-points\"><li>Rebase replays your commits on top of another branch, giving a linear history but new commit ids — use it for local/private branches to update with main or clean up before a PR.</li><li>Never rebase commits others already have.</li></ul>\n"},{"id":652,"course_slug":"git","course_title":"Git & GitHub — Version Control from Basics to Advanced","ord":7,"level":"Intermediate","priority":"High","question":"git reset vs git revert?","question_html":"git reset vs git revert?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>reset</code> moves the current branch pointer back (soft keeps changes staged, mixed keeps them unstaged, hard discards them) — it rewrites history, so only for unpushed commits.</p>\n<ul class=\"q-points\"><li><code>revert</code> creates a new commit that undoes a previous commit — the safe way to undo something already pushed to a shared branch.</li></ul>\n"},{"id":653,"course_slug":"git","course_title":"Git & GitHub — Version Control from Basics to Advanced","ord":8,"level":"Intermediate","priority":"High","question":"Which branching strategy have you used? Explain it.","question_html":"Which branching strategy have you used? Explain it.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Describe yours concretely, e.g. &quot;GitFlow-like: <code>main</code> = production, <code>develop</code> for integration, <code>feature/*</code> per story with PRs into develop, <code>release/*</code> cut for UAT, <code>hotfix/*</code> from main merged back to both&quot; — or &quot;trunk-based: short-lived branches merged to main daily behind feature flags, every merge deploys to dev&quot;.</p>\n<ul class=\"q-points\"><li>Mention branch policies (reviewers, CI checks) and how releases are tagged.</li></ul>\n"},{"id":654,"course_slug":"git","course_title":"Git & GitHub — Version Control from Basics to Advanced","ord":9,"level":"Intermediate","priority":"High","question":"What is a pull request and what do you check in a code review?","question_html":"What is a pull request and what do you check in a code review?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A request to merge a branch, where teammates review the diff and CI validates it before merge.</p>\n<ul class=\"q-points\"><li>Check: does it meet the requirement, tests, edge cases and error handling, security (secrets, injection, authorization), performance (N+1, missing indexes), naming and readability, consistency with architecture, and that the PR is small and focused.</li></ul>\n"},{"id":660,"course_slug":"git","course_title":"Git & GitHub — Version Control from Basics to Advanced","ord":15,"level":"Scenario","priority":"High","question":"You committed a password and pushed it to GitHub. What do you do?","question_html":"You committed a password and pushed it to GitHub. What do you do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> First <strong>rotate/revoke the secret immediately</strong> — assume it is compromised (bots scan GitHub within minutes).</p>\n<ul class=\"q-points\"><li>Then remove it from the code (move to Key Vault/user secrets/environment variables), and purge it from history with <code>git filter-repo</code> or BFG, force-push and ask everyone to re-clone;</li><li>on GitHub contact support to clear cached views.</li><li>Prevent it next time: <code>.gitignore</code>, pre-commit secret scanning (gitleaks), GitHub push protection / secret scanning.</li></ul>\n"},{"id":661,"course_slug":"git","course_title":"Git & GitHub — Version Control from Basics to Advanced","ord":16,"level":"Scenario","priority":"High","question":"You made three commits on main by mistake instead of a feature branch (not pushed). Fix it.","question_html":"You made three commits on main by mistake instead of a feature branch (not pushed). Fix it.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>git branch feature/x</code> (new branch points at your commits) → <code>git reset --hard origin/main</code> (move main back to the remote state) → <code>git switch feature/x</code> and continue.</p>\n<ul class=\"q-points\"><li>Nothing is lost; if anything goes wrong, <code>git reflog</code> shows the old position.</li></ul>\n"},{"id":662,"course_slug":"git","course_title":"Git & GitHub — Version Control from Basics to Advanced","ord":17,"level":"Scenario","priority":"High","question":"A bad commit is already deployed from main. How do you undo it without rewriting history?","question_html":"A bad commit is already deployed from main. How do you undo it without rewriting history?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>git revert &lt;sha&gt;</code> (for a merge commit <code>git revert -m 1 &lt;merge-sha&gt;</code>), push through the normal PR/pipeline so the revert is reviewed and deployed.</p>\n<ul class=\"q-points\"><li>Don&#39;t <code>reset</code> + force-push a shared branch — it breaks everyone&#39;s clones and the audit trail.</li></ul>\n"},{"id":650,"course_slug":"git","course_title":"Git & GitHub — Version Control from Basics to Advanced","ord":5,"level":"Beginner","priority":"Medium","question":"What does .gitignore do? A file is still tracked after adding it to .gitignore — why?","question_html":"What does .gitignore do? A file is still tracked after adding it to .gitignore — why?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>.gitignore</code> stops <strong>untracked</strong> files from being added (bin/obj, node_modules, secrets).</p>\n<ul class=\"q-points\"><li>It doesn&#39;t affect files already tracked;</li><li>remove them from the index with <code>git rm --cached &lt;file&gt;</code> and commit, and they will be ignored from then on (if it was a secret, rotate it — it is still in history).</li></ul>\n"},{"id":655,"course_slug":"git","course_title":"Git & GitHub — Version Control from Basics to Advanced","ord":10,"level":"Intermediate","priority":"Medium","question":"What is git stash?","question_html":"What is git stash?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Temporarily shelves uncommitted changes so you can switch context: <code>git stash push -m &quot;msg&quot;</code> (add <code>-u</code> for untracked files), <code>git stash list</code>, <code>git stash pop</code> (apply and drop) or <code>git stash apply</code> (keep in stash).</p>\n<ul class=\"q-points\"><li>Useful when an urgent bug arrives mid-feature.</li></ul>\n"},{"id":656,"course_slug":"git","course_title":"Git & GitHub — Version Control from Basics to Advanced","ord":11,"level":"Intermediate","priority":"Medium","question":"What is cherry-pick and when would you use it?","question_html":"What is cherry-pick and when would you use it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>git cherry-pick &lt;sha&gt;</code> applies the changes of one commit onto the current branch as a new commit.</p>\n<ul class=\"q-points\"><li>Typical use: bring a hotfix from main into a release branch, or rescue a commit made on the wrong branch.</li><li>Overuse creates duplicate commits — prefer merging when you need a whole branch.</li></ul>\n"},{"id":657,"course_slug":"git","course_title":"Git & GitHub — Version Control from Basics to Advanced","ord":12,"level":"Advanced","priority":"Medium","question":"What is a detached HEAD?","question_html":"What is a detached HEAD?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> HEAD points directly to a commit instead of a branch — after checking out a tag or a commit sha.</p>\n<ul class=\"q-points\"><li>You can look around and even commit, but new commits belong to no branch and can be garbage-collected once you switch away.</li><li>Create a branch (<code>git switch -c fix-from-tag</code>) to keep them.</li></ul>\n"},{"id":658,"course_slug":"git","course_title":"Git & GitHub — Version Control from Basics to Advanced","ord":13,"level":"Advanced","priority":"Medium","question":"How does git bisect help find a bug?","question_html":"How does git bisect help find a bug?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> It binary-searches history between a known good and a known bad commit: Git checks out the midpoint, you mark it good or bad (or <code>git bisect run &lt;test script&gt;</code> does it automatically), and in log2(n) steps it names the first bad commit.</p>\n<ul class=\"q-points\"><li>Great for regressions in long histories.</li></ul>\n"},{"id":659,"course_slug":"git","course_title":"Git & GitHub — Version Control from Basics to Advanced","ord":14,"level":"Advanced","priority":"Medium","question":"How does Git store data internally?","question_html":"How does Git store data internally?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> As content-addressed objects (blob = file content, tree = directory, commit = tree + parents + metadata, annotated tag) named by their SHA-1 (SHA-256 optional) hash, compressed in <code>.git/objects</code> and packfiles.</p>\n<ul class=\"q-points\"><li>Branches/tags are refs pointing at commit ids; HEAD points at a ref.</li><li>Changing any commit changes its hash and all descendants&#39; hashes.</li></ul>\n"},{"id":663,"course_slug":"git","course_title":"Git & GitHub — Version Control from Basics to Advanced","ord":18,"level":"Scenario","priority":"Medium","question":"Your feature branch is two weeks behind main and has many conflicts. How do you bring it up to date?","question_html":"Your feature branch is two weeks behind main and has many conflicts. How do you bring it up to date?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Fetch first.</p>\n<ul class=\"q-points\"><li>If the branch is only yours: <code>git rebase origin/main</code>, resolve conflicts commit by commit (<code>git rebase --continue</code>), run tests, <code>git push --force-with-lease</code>.</li><li>If shared: <code>git merge origin/main</code> once and resolve in one merge commit.</li><li>Afterwards keep it short-lived and sync daily; consider splitting the work into smaller PRs behind a feature flag.</li></ul>\n"},{"id":664,"course_slug":"git","course_title":"Git & GitHub — Version Control from Basics to Advanced","ord":19,"level":"Scenario","priority":"Medium","question":"git push is rejected with \"non-fast-forward\". What does it mean?","question_html":"git push is rejected with &quot;non-fast-forward&quot;. What does it mean?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The remote branch has commits you don&#39;t have, so pushing would overwrite them.</p>\n<ul class=\"q-points\"><li><code>git pull --rebase</code> (or <code>git pull</code>), resolve any conflicts, test, then push.</li><li>Only force-push (<code>--force-with-lease</code>) when you intentionally rewrote your own branch.</li></ul>\n"},{"id":665,"course_slug":"docker","course_title":"Docker & Containers","ord":1,"level":"Beginner","priority":"High","question":"What is Docker and why use it?","question_html":"What is Docker and why use it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Docker is a platform to build, ship and run applications in containers.</p>\n<ul class=\"q-points\"><li>A container packages the app with its runtime and dependencies, so it runs identically everywhere (&quot;works on my machine&quot; disappears).</li><li>Benefits: consistent environments across dev/test/prod, fast startup, high density, isolation between apps, easy scaling, and a standard artifact for CI/CD and orchestrators like Kubernetes.</li></ul>\n"},{"id":666,"course_slug":"docker","course_title":"Docker & Containers","ord":2,"level":"Beginner","priority":"High","question":"What is the difference between a container and a virtual machine?","question_html":"What is the difference between a container and a virtual machine?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A VM virtualises hardware and runs a full guest OS with its own kernel on a hypervisor — strong isolation, GBs in size, minutes to boot.</p>\n<ul class=\"q-points\"><li>A container virtualises at the OS level: isolated processes sharing the host kernel using namespaces (isolation) and cgroups (resource limits) — MBs in size, starts in seconds, much higher density.</li><li>Containers can run inside VMs (as in most clouds).</li></ul>\n"},{"id":667,"course_slug":"docker","course_title":"Docker & Containers","ord":3,"level":"Beginner","priority":"High","question":"What is the difference between an image and a container?","question_html":"What is the difference between an image and a container?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> An image is a read-only, layered template (filesystem + metadata) built from a Dockerfile.</p>\n<ul class=\"q-points\"><li>A container is a running (or stopped) instance of an image with its own writable layer, network and process.</li><li>One image can start many containers, just like a class and its objects.</li></ul>\n"},{"id":668,"course_slug":"docker","course_title":"Docker & Containers","ord":4,"level":"Beginner","priority":"High","question":"Explain the common Dockerfile instructions. CMD vs ENTRYPOINT? COPY vs ADD?","question_html":"Explain the common Dockerfile instructions. CMD vs ENTRYPOINT? COPY vs ADD?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> FROM (base image), WORKDIR, COPY/ADD, RUN (build-time command), ENV/ARG, EXPOSE, USER, HEALTHCHECK, ENTRYPOINT and CMD.</p>\n<ul class=\"q-points\"><li>ENTRYPOINT defines the executable that always runs; CMD supplies default arguments (or a default command) that <code>docker run</code> arguments override.</li><li>COPY copies local files; ADD also auto-extracts local tar archives and can download URLs — prefer COPY for clarity and security.</li></ul>\n"},{"id":669,"course_slug":"docker","course_title":"Docker & Containers","ord":5,"level":"Beginner","priority":"High","question":"What is a multi-stage build and why use it?","question_html":"What is a multi-stage build and why use it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A Dockerfile with several FROM stages: an early stage (e.g. .NET SDK) compiles and publishes the app;</p>\n<ul class=\"q-points\"><li>the final stage starts from a small runtime image and copies only the build output with <code>COPY --from=build</code>.</li><li>Result: much smaller images without compilers or source code, faster deployments, smaller attack surface — all in one Dockerfile.</li></ul>\n"},{"id":671,"course_slug":"docker","course_title":"Docker & Containers","ord":7,"level":"Intermediate","priority":"High","question":"What is Docker Compose and when would you use it?","question_html":"What is Docker Compose and when would you use it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A tool for defining and running multi-container applications with a YAML file (<code>compose.yaml</code>): services, images/builds, ports, environment, volumes, networks, dependencies and health checks.</p>\n<ul class=\"q-points\"><li><code>docker compose up</code> starts everything.</li><li>Used for local development environments (API + SQL Server + Redis + RabbitMQ), integration tests and simple single-host deployments.</li><li>For production clusters, use Kubernetes or Azure Container Apps.</li></ul>\n"},{"id":672,"course_slug":"docker","course_title":"Docker & Containers","ord":8,"level":"Intermediate","priority":"High","question":"How do containers in Docker communicate with each other?","question_html":"How do containers in Docker communicate with each other?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Through Docker networks.</p>\n<ul class=\"q-points\"><li>On a user-defined bridge network (or Compose&#39;s default network), containers resolve each other by container/service name via Docker&#39;s embedded DNS (<code>http://api:8080</code>, <code>Server=sql</code>).</li><li>The default <code>bridge</code> network doesn&#39;t provide name resolution.</li><li>Published ports (<code>-p</code>) are only needed for access from the host or outside, not between containers.</li></ul>\n"},{"id":673,"course_slug":"docker","course_title":"Docker & Containers","ord":9,"level":"Intermediate","priority":"High","question":"How do you reduce Docker image size?","question_html":"How do you reduce Docker image size?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use multi-stage builds;</p>\n<ul class=\"q-points\"><li>small base images (aspnet runtime instead of SDK, chiseled/Alpine variants, runtime-deps with self-contained/AOT);</li><li>a <code>.dockerignore</code>;</li><li>combine RUN commands and remove caches in the same layer;</li><li>don&#39;t install unnecessary tools;</li><li>publish trimmed/AOT apps where suitable.</li><li>Check layers with <code>docker history</code> or Dive.</li></ul>\n"},{"id":674,"course_slug":"docker","course_title":"Docker & Containers","ord":10,"level":"Intermediate","priority":"High","question":"How do you handle secrets with Docker?","question_html":"How do you handle secrets with Docker?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Never bake secrets into images (ENV, ARG, or copied files persist in layers and history).</p>\n<ul class=\"q-points\"><li>Supply them at runtime: environment variables from a secure source, mounted secret files (Docker/Compose secrets, Kubernetes Secrets), or fetch from Azure Key Vault using managed identity.</li><li>For build-time secrets (private NuGet feed tokens), use BuildKit <code>RUN --mount=type=secret</code>.</li><li>Keep <code>.env</code> files out of Git.</li></ul>\n"},{"id":679,"course_slug":"docker","course_title":"Docker & Containers","ord":15,"level":"Scenario","priority":"High","question":"Your ASP.NET Core container starts but you get \"connection refused\" on http://localhost:8080. What do you check?","question_html":"Your ASP.NET Core container starts but you get &quot;connection refused&quot; on <a href=\"http://localhost:8080\">http://localhost:8080</a>. What do you check?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Is the port published (<code>-p 8080:8080</code>)?</p>\n<ul class=\"q-points\"><li>Which port does the app listen on — .NET 8+ images default to 8080 (<code>ASPNETCORE_HTTP_PORTS</code>), older ones to 80.</li><li>Is the app bound to <code>0.0.0.0</code>/<code>+</code> rather than <code>localhost</code> inside the container?</li><li>Did the container crash (<code>docker ps -a</code>, <code>docker logs</code>)?</li><li>Is HTTPS redirection forcing 443 without a certificate?</li><li>On Windows, is another process using the port?</li><li>Check <code>docker inspect</code> for port bindings and health status.</li></ul>\n"},{"id":680,"course_slug":"docker","course_title":"Docker & Containers","ord":16,"level":"Scenario","priority":"High","question":"The image is 2.1 GB and deploys slowly. How do you shrink it?","question_html":"The image is 2.1 GB and deploys slowly. How do you shrink it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Inspect with <code>docker history</code>/Dive.</p>\n<ul class=\"q-points\"><li>Typical fixes: switch to a multi-stage build so the SDK and source aren&#39;t in the final image;</li><li>use <code>mcr.microsoft.com/dotnet/aspnet</code> (or chiseled) as the final base;</li><li>add <code>.dockerignore</code> (bin/obj/.git/node_modules);</li><li>remove build tools and caches in the same RUN layer;</li><li>don&#39;t copy test projects;</li><li>consider trimming/AOT.</li><li>Target size: ~100–250 MB for a typical ASP.NET Core API.</li></ul>\n"},{"id":670,"course_slug":"docker","course_title":"Docker & Containers","ord":6,"level":"Beginner","priority":"Medium","question":"What is the difference between a volume and a bind mount?","question_html":"What is the difference between a volume and a bind mount?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Volumes are managed by Docker (stored under Docker&#39;s data directory), portable, easy to back up and the preferred way to persist container data like databases.</p>\n<ul class=\"q-points\"><li>Bind mounts map a specific host path into the container — great for live-editing source code in development but tied to the host&#39;s folder structure and permissions.</li><li>Data in the container&#39;s writable layer disappears when the container is removed.</li></ul>\n"},{"id":675,"course_slug":"docker","course_title":"Docker & Containers","ord":11,"level":"Intermediate","priority":"Medium","question":"What is layer caching? How do you write a cache-friendly Dockerfile?","question_html":"What is layer caching? How do you write a cache-friendly Dockerfile?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Each instruction produces a layer; Docker reuses a cached layer if the instruction and its inputs haven&#39;t changed, and invalidates all layers after the first change.</p>\n<ul class=\"q-points\"><li>Put rarely changing steps first: copy only <code>.csproj</code> files and run <code>dotnet restore</code> before copying the rest of the source, so code changes don&#39;t re-download packages.</li><li>Use BuildKit cache mounts for package caches.</li></ul>\n"},{"id":676,"course_slug":"docker","course_title":"Docker & Containers","ord":12,"level":"Intermediate","priority":"Medium","question":"What do container exit codes 0, 1, 137 and 143 mean?","question_html":"What do container exit codes 0, 1, 137 and 143 mean?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> 0 = normal exit;</p>\n<ul class=\"q-points\"><li>1 = application error;</li><li>137 = killed with SIGKILL (128+9) — often out-of-memory (OOMKilled) or forced stop after timeout;</li><li>143 = terminated by SIGTERM (128+15) — normal graceful stop;</li><li>139 = segmentation fault.</li><li>Check <code>docker inspect</code> (State.OOMKilled) and logs.</li></ul>\n"},{"id":677,"course_slug":"docker","course_title":"Docker & Containers","ord":13,"level":"Advanced","priority":"Medium","question":"How does Docker isolate containers under the hood?","question_html":"How does Docker isolate containers under the hood?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Linux <strong>namespaces</strong> isolate what a process can see — PID, network, mount, UTS (hostname), IPC, user and cgroup namespaces.</p>\n<ul class=\"q-points\"><li><strong>cgroups</strong> limit and account resources (CPU, memory, I/O).</li><li><strong>Union/overlay filesystems</strong> provide layered images with copy-on-write.</li><li>Security layers: capabilities, seccomp profiles, AppArmor/SELinux, user namespaces/rootless mode. containerd and runc (OCI runtime) actually create the containers.</li></ul>\n"},{"id":678,"course_slug":"docker","course_title":"Docker & Containers","ord":14,"level":"Advanced","priority":"Medium","question":"Why did Kubernetes \"remove Docker\" and does it matter?","question_html":"Why did Kubernetes &quot;remove Docker&quot; and does it matter?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Kubernetes 1.24 removed <strong>dockershim</strong>, the adapter that let the kubelet talk to Docker Engine.</p>\n<ul class=\"q-points\"><li>Kubernetes now talks to CRI-compatible runtimes (containerd, CRI-O) directly.</li><li>Images built with Docker are OCI images and run unchanged.</li><li>It only matters if something relied on the Docker socket inside nodes (e.g. Docker-in-Docker builds) — use BuildKit/Kaniko/ACR Tasks instead.</li></ul>\n"},{"id":681,"course_slug":"docker","course_title":"Docker & Containers","ord":17,"level":"Scenario","priority":"Medium","question":"A container keeps restarting with exit code 137. What's happening?","question_html":"A container keeps restarting with exit code 137. What&#39;s happening?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> It&#39;s being killed — most often <strong>out of memory</strong>: the container exceeded its memory limit (<code>docker inspect</code> shows <code>OOMKilled: true</code>, or Kubernetes shows <code>OOMKilled</code>).</p>\n<ul class=\"q-points\"><li>Investigate memory usage (<code>docker stats</code>, dotnet-counters), raise the limit appropriately, fix leaks, and make sure .NET respects container limits (it does by default;</li><li>tune <code>DOTNET_GCHeapHardLimit</code> or Server/Workstation GC if needed).</li><li>It can also be a failing liveness probe or a forced stop after SIGTERM timeout.</li></ul>\n"},{"id":682,"course_slug":"docker","course_title":"Docker & Containers","ord":18,"level":"Scenario","priority":"Medium","question":"Developers need SQL Server, Redis and RabbitMQ locally to run the API. How do you make onboarding one command?","question_html":"Developers need SQL Server, Redis and RabbitMQ locally to run the API. How do you make onboarding one command?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Write a <code>compose.yaml</code> with the API (built from its Dockerfile), SQL Server (named volume + health check), Redis and RabbitMQ (management image), a shared network, and environment variables pointing the API at service names;</p>\n<ul class=\"q-points\"><li>put passwords in a <code>.env</code> file excluded from Git with a <code>.env.example</code> template;</li><li>add a seed/migration step (EF migration bundle container or init script).</li><li>Onboarding = <code>git clone &amp;&amp; docker compose up -d</code>.</li><li>Alternatively use .NET Aspire&#39;s AppHost to orchestrate the same dependencies.</li></ul>\n"},{"id":683,"course_slug":"kubernetes","course_title":"Kubernetes (K8s) & AKS","ord":1,"level":"Beginner","priority":"High","question":"What is Kubernetes and what problems does it solve?","question_html":"What is Kubernetes and what problems does it solve?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Kubernetes is an open-source container orchestrator (from Google, now CNCF).</p>\n<ul class=\"q-points\"><li>It automates deploying, scaling and operating containers across a cluster: scheduling pods onto nodes, self-healing (restarting/rescheduling failed containers), service discovery and load balancing, rolling updates and rollbacks, horizontal autoscaling, configuration and secret management, and storage orchestration — all driven by declarative desired state.</li></ul>\n"},{"id":684,"course_slug":"kubernetes","course_title":"Kubernetes (K8s) & AKS","ord":2,"level":"Beginner","priority":"High","question":"Explain the Kubernetes architecture.","question_html":"Explain the Kubernetes architecture.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Control plane: kube-apiserver (API front end), etcd (cluster state store), kube-scheduler (places pods on nodes), kube-controller-manager (reconciliation loops), cloud-controller-manager (cloud integration).</p>\n<ul class=\"q-points\"><li>Worker nodes: kubelet (runs and monitors pods), kube-proxy (service networking rules), and a container runtime (containerd/CRI-O).</li><li>In AKS, Azure manages the control plane; you manage node pools and workloads.</li></ul>\n"},{"id":685,"course_slug":"kubernetes","course_title":"Kubernetes (K8s) & AKS","ord":3,"level":"Beginner","priority":"High","question":"What is a Pod? Why not run containers directly?","question_html":"What is a Pod? Why not run containers directly?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A Pod is the smallest deployable unit: one or more tightly coupled containers sharing an IP address, port space and volumes, scheduled together on one node (e.g. app + sidecar).</p>\n<ul class=\"q-points\"><li>Pods are ephemeral and replaceable, so you manage them through higher-level controllers (Deployments, StatefulSets, Jobs) that recreate and scale them, instead of running bare containers or bare pods.</li></ul>\n"},{"id":686,"course_slug":"kubernetes","course_title":"Kubernetes (K8s) & AKS","ord":4,"level":"Beginner","priority":"High","question":"What is the difference between a Deployment, a ReplicaSet and a StatefulSet?","question_html":"What is the difference between a Deployment, a ReplicaSet and a StatefulSet?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A ReplicaSet keeps a set number of identical pod replicas running.</p>\n<ul class=\"q-points\"><li>A Deployment manages ReplicaSets to provide declarative updates, rolling updates, rollbacks and revision history for stateless apps — you normally use Deployments, not ReplicaSets directly.</li><li>A StatefulSet is for stateful apps: pods get stable names (<code>app-0</code>, <code>app-1</code>), stable network identities via a headless Service, ordered start/stop, and their own persistent volumes.</li></ul>\n"},{"id":687,"course_slug":"kubernetes","course_title":"Kubernetes (K8s) & AKS","ord":5,"level":"Beginner","priority":"High","question":"What are the Service types in Kubernetes?","question_html":"What are the Service types in Kubernetes?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> ClusterIP (default;</p>\n<ul class=\"q-points\"><li>stable internal IP/DNS for pod-to-pod traffic), NodePort (exposes a port on each node), LoadBalancer (provisions a cloud load balancer with an external IP), ExternalName (DNS alias to an external name).</li><li>A headless Service (<code>clusterIP: None</code>) returns pod IPs directly.</li><li>Services select pods by labels and load-balance to ready endpoints.</li></ul>\n"},{"id":689,"course_slug":"kubernetes","course_title":"Kubernetes (K8s) & AKS","ord":7,"level":"Intermediate","priority":"High","question":"What is the difference between ConfigMap and Secret?","question_html":"What is the difference between ConfigMap and Secret?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Both inject configuration into pods as environment variables or mounted files.</p>\n<ul class=\"q-points\"><li>ConfigMaps hold non-sensitive data.</li><li>Secrets hold sensitive data (passwords, keys, certificates);</li><li>they&#39;re base64-encoded (not encrypted by default), can be encrypted at rest in etcd, have tighter RBAC, and are mounted on tmpfs.</li><li>In production, source secrets from Azure Key Vault (Secrets Store CSI driver / External Secrets) with Workload Identity.</li></ul>\n"},{"id":690,"course_slug":"kubernetes","course_title":"Kubernetes (K8s) & AKS","ord":8,"level":"Intermediate","priority":"High","question":"Explain liveness, readiness and startup probes.","question_html":"Explain liveness, readiness and startup probes.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Liveness checks whether the container is alive; failing it causes a restart (use for deadlocks/hangs; don&#39;t include dependency checks).</p>\n<ul class=\"q-points\"><li>Readiness checks whether it can serve traffic; failing removes the pod from Service endpoints without restarting (use for warm-up and dependency availability).</li><li>Startup probes protect slow-starting apps — liveness and readiness don&#39;t run until the startup probe succeeds.</li></ul>\n"},{"id":691,"course_slug":"kubernetes","course_title":"Kubernetes (K8s) & AKS","ord":9,"level":"Intermediate","priority":"High","question":"What is the difference between resource requests and limits? What happens when exceeded?","question_html":"What is the difference between resource requests and limits? What happens when exceeded?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Requests are the guaranteed amount used by the scheduler to place pods.</p>\n<ul class=\"q-points\"><li>Limits are the maximum a container may use.</li><li>Exceeding the CPU limit causes throttling (slower, not killed); exceeding the memory limit gets the container OOMKilled.</li><li>Requests/limits determine QoS (Guaranteed, Burstable, BestEffort), which affects eviction order under node pressure.</li><li>Set requests based on observed usage; many teams set memory limits but avoid CPU limits to prevent throttling.</li></ul>\n"},{"id":692,"course_slug":"kubernetes","course_title":"Kubernetes (K8s) & AKS","ord":10,"level":"Intermediate","priority":"High","question":"How does a rolling update work? How do you roll back?","question_html":"How does a rolling update work? How do you roll back?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> When the pod template changes (e.g. new image), the Deployment creates a new ReplicaSet and gradually scales it up while scaling the old one down, respecting <code>maxSurge</code> (extra pods allowed) and <code>maxUnavailable</code>, and waiting for readiness.</p>\n<ul class=\"q-points\"><li>If the new version is bad: <code>kubectl rollout undo deployment/name</code> (or <code>--to-revision</code>), or <code>helm rollback</code>.</li><li>Check with <code>kubectl rollout status/history</code>.</li></ul>\n"},{"id":693,"course_slug":"kubernetes","course_title":"Kubernetes (K8s) & AKS","ord":11,"level":"Intermediate","priority":"High","question":"What is an Ingress? How is it different from a LoadBalancer Service?","question_html":"What is an Ingress? How is it different from a LoadBalancer Service?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A LoadBalancer Service exposes one service with its own cloud load balancer at layer 4.</p>\n<ul class=\"q-points\"><li>An Ingress is a layer-7 (HTTP/HTTPS) routing rule set — host and path based routing, TLS termination — handled by an ingress controller behind a single load balancer for many services.</li><li>The Gateway API is the newer, more powerful successor.</li></ul>\n"},{"id":696,"course_slug":"kubernetes","course_title":"Kubernetes (K8s) & AKS","ord":14,"level":"Advanced","priority":"High","question":"How do you secure a Kubernetes cluster?","question_html":"How do you secure a Kubernetes cluster?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Entra ID integration and least-privilege RBAC;</p>\n<ul class=\"q-points\"><li>separate namespaces;</li><li>NetworkPolicies (default deny);</li><li>Pod Security Standards (non-root, read-only FS, no privilege escalation);</li><li>private registry with image scanning and admission policies (Azure Policy/Gatekeeper/Kyverno);</li><li>secrets in Key Vault via CSI + Workload Identity;</li><li>etcd encryption;</li><li>private cluster/API server authorised IP ranges;</li><li>keep Kubernetes and node images patched;</li><li>Defender for Containers;</li><li>audit logs;</li><li>limit <code>cluster-admin</code>.</li></ul>\n"},{"id":699,"course_slug":"kubernetes","course_title":"Kubernetes (K8s) & AKS","ord":17,"level":"Scenario","priority":"High","question":"A pod is stuck in CrashLoopBackOff. How do you troubleshoot?","question_html":"A pod is stuck in CrashLoopBackOff. How do you troubleshoot?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>kubectl describe pod</code> (events, last state, exit code, probe failures); <code>kubectl logs &lt;pod&gt; --previous</code> to see why the last run died.</p>\n<ul class=\"q-points\"><li>Common causes: unhandled exception at startup (bad connection string, missing env var/secret key), wrong command/entrypoint, liveness probe failing too early (add a startup probe/initialDelay), permission errors (non-root), OOMKilled (exit 137).</li><li>Reproduce locally with the same image and env; fix config and redeploy.</li></ul>\n"},{"id":700,"course_slug":"kubernetes","course_title":"Kubernetes (K8s) & AKS","ord":18,"level":"Scenario","priority":"High","question":"After deploying a new version, users get errors for a few seconds on every release. How do you get true zero-downtime deployments?","question_html":"After deploying a new version, users get errors for a few seconds on every release. How do you get true zero-downtime deployments?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Ensure readiness probes reflect real readiness so traffic only reaches ready pods;</p>\n<ul class=\"q-points\"><li>set <code>maxUnavailable: 0</code> and <code>maxSurge: 1+</code>;</li><li>handle SIGTERM gracefully (ASP.NET Core does — finish in-flight requests) and add a short <code>preStop</code> sleep so endpoints are removed from load balancers before shutdown;</li><li>set an adequate <code>terminationGracePeriodSeconds</code>;</li><li>run ≥ 2–3 replicas with a PodDisruptionBudget;</li><li>keep API and DB changes backward compatible (expand-contract) because old and new versions overlap.</li></ul>\n"},{"id":701,"course_slug":"kubernetes","course_title":"Kubernetes (K8s) & AKS","ord":19,"level":"Scenario","priority":"High","question":"Pods are Pending with \"0/3 nodes are available: insufficient memory\". What do you do?","question_html":"Pods are Pending with &quot;0/3 nodes are available: insufficient memory&quot;. What do you do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Pod requests exceed free allocatable memory on all nodes.</p>\n<ul class=\"q-points\"><li>Options: check whether requests are oversized (right-size them using actual usage), scale the node pool or enable the cluster autoscaler/node auto-provisioning, add a node pool with larger VMs, remove unused workloads, check ResourceQuotas and taints/node selectors preventing placement.</li><li>Verify with <code>kubectl describe nodes</code> (Allocated resources) and <code>kubectl top nodes</code>.</li></ul>\n"},{"id":688,"course_slug":"kubernetes","course_title":"Kubernetes (K8s) & AKS","ord":6,"level":"Beginner","priority":"Medium","question":"What is a namespace?","question_html":"What is a namespace?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A virtual partition inside a cluster that scopes names and lets you apply RBAC, resource quotas, limit ranges and network policies per team or environment.</p>\n<ul class=\"q-points\"><li>Default namespaces: <code>default</code>, <code>kube-system</code>, <code>kube-public</code>, <code>kube-node-lease</code>.</li><li>DNS for services includes the namespace (<code>svc.namespace.svc.cluster.local</code>).</li><li>Nodes and PersistentVolumes are cluster-scoped.</li></ul>\n"},{"id":694,"course_slug":"kubernetes","course_title":"Kubernetes (K8s) & AKS","ord":12,"level":"Intermediate","priority":"Medium","question":"What is Helm?","question_html":"What is Helm?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The package manager for Kubernetes.</p>\n<ul class=\"q-points\"><li>A chart bundles templated manifests plus default <code>values.yaml</code>; you install it as a release with environment-specific values, upgrade, view history and roll back.</li><li>It removes copy-paste YAML across environments and lets you share apps (e.g. installing ingress-nginx, cert-manager, Prometheus from public charts).</li></ul>\n"},{"id":695,"course_slug":"kubernetes","course_title":"Kubernetes (K8s) & AKS","ord":13,"level":"Intermediate","priority":"Medium","question":"How does autoscaling work in Kubernetes?","question_html":"How does autoscaling work in Kubernetes?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> HPA adjusts the number of pod replicas based on metrics (CPU/memory via metrics-server, or custom/external metrics).</p>\n<ul class=\"q-points\"><li>VPA adjusts pod resource requests.</li><li>Cluster Autoscaler (or Node Auto Provisioning/Karpenter) adds or removes nodes when pods are unschedulable or nodes are underused.</li><li>KEDA scales on event sources like queue length, including to zero.</li><li>Requests must be set for CPU-based HPA to work.</li></ul>\n"},{"id":697,"course_slug":"kubernetes","course_title":"Kubernetes (K8s) & AKS","ord":15,"level":"Advanced","priority":"Medium","question":"What is a sidecar container? Give examples.","question_html":"What is a sidecar container? Give examples.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A helper container in the same pod as the main app, sharing its network and volumes, that adds functionality without changing the app: service mesh proxies (Envoy/Istio), log shippers, config reloaders, Dapr sidecar, auth proxies.</p>\n<ul class=\"q-points\"><li>Kubernetes 1.29+ supports native sidecars (init containers with <code>restartPolicy: Always</code>) that start before and stop after the main container.</li></ul>\n"},{"id":698,"course_slug":"kubernetes","course_title":"Kubernetes (K8s) & AKS","ord":16,"level":"Advanced","priority":"Medium","question":"What happens when you run kubectl apply -f deployment.yaml?","question_html":"What happens when you run <code>kubectl apply -f deployment.yaml</code>?","answer_html":"<p>kubectl sends the manifest to the API server → authentication, authorisation (RBAC) and admission controllers (validation/mutation) → object stored in etcd → the Deployment controller sees it and creates/updates a ReplicaSet → the ReplicaSet controller creates Pod objects → the scheduler assigns each pod to a node → the kubelet on that node pulls images via the container runtime and starts containers → probes report health → endpoints controller adds ready pods to Services.</p>\n"},{"id":702,"course_slug":"kubernetes","course_title":"Kubernetes (K8s) & AKS","ord":20,"level":"Scenario","priority":"Medium","question":"The API in AKS must read secrets from Azure Key Vault without storing any credentials. How?","question_html":"The API in AKS must read secrets from Azure Key Vault without storing any credentials. How?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Enable the OIDC issuer and <strong>Workload Identity</strong> on AKS;</p>\n<ul class=\"q-points\"><li>create a user-assigned managed identity with Key Vault access (RBAC role &quot;Key Vault Secrets User&quot;);</li><li>create a federated credential linking the identity to the Kubernetes ServiceAccount;</li><li>annotate the ServiceAccount and label pods to use it.</li><li>Then either use the <strong>Secrets Store CSI Driver</strong> (mount secrets as files/sync to K8s Secrets) or call Key Vault from code with <code>DefaultAzureCredential</code>.</li><li>No passwords stored anywhere.</li></ul>\n"},{"id":703,"course_slug":"kubernetes","course_title":"Kubernetes (K8s) & AKS","ord":21,"level":"Scenario","priority":"Medium","question":"Should you run SQL Server inside Kubernetes for production?","question_html":"Should you run SQL Server inside Kubernetes for production?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Usually no.</p>\n<ul class=\"q-points\"><li>Stateful databases need careful handling of storage, backups, HA, failover and upgrades;</li><li>a managed service (Azure SQL Database/Managed Instance) gives backups, HA, patching and SLAs out of the box.</li><li>Running databases in Kubernetes (StatefulSets, operators) is viable for teams with strong expertise or specific needs (portability, edge, dev/test).</li><li>Keep the cluster for stateless services and connect to managed data stores.</li></ul>\n"},{"id":704,"course_slug":"azure-devops","course_title":"Azure DevOps & CI/CD","ord":1,"level":"Beginner","priority":"High","question":"What is DevOps? What are CI and CD?","question_html":"What is DevOps? What are CI and CD?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> DevOps combines development and operations culture, practices and tools to deliver value faster and more reliably: automation, collaboration, small batches, fast feedback and monitoring.</p>\n<ul class=\"q-points\"><li>CI (Continuous Integration): developers merge frequently, and every change is automatically built and tested.</li><li>CD: Continuous Delivery keeps every build releasable and deploys to production with a manual approval;</li><li>Continuous Deployment deploys every passing change to production automatically.</li></ul>\n"},{"id":705,"course_slug":"azure-devops","course_title":"Azure DevOps & CI/CD","ord":2,"level":"Beginner","priority":"High","question":"What services does Azure DevOps provide?","question_html":"What services does Azure DevOps provide?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Azure Boards (work tracking, Kanban, sprints), Azure Repos (Git repos, PRs, branch policies), Azure Pipelines (CI/CD for any platform/cloud), Azure Test Plans (manual/exploratory testing), Azure Artifacts (package feeds).</p>\n<ul class=\"q-points\"><li>Available as Azure DevOps Services (cloud) and Azure DevOps Server (on-prem, formerly TFS).</li></ul>\n"},{"id":706,"course_slug":"azure-devops","course_title":"Azure DevOps & CI/CD","ord":3,"level":"Beginner","priority":"High","question":"Explain the structure of a YAML pipeline.","question_html":"Explain the structure of a YAML pipeline.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A pipeline has triggers, optional variables/parameters/resources, and <strong>stages</strong> (e.g. Build, DeployDev, DeployProd);</p>\n<ul class=\"q-points\"><li>each stage contains <strong>jobs</strong> that run on an agent;</li><li>each job has <strong>steps</strong> — tasks (prebuilt, like <code>DotNetCoreCLI@2</code>, <code>AzureWebApp@1</code>) or scripts.</li><li>Deployment jobs target environments with approvals.</li><li>Artifacts pass outputs between stages.</li></ul>\n"},{"id":707,"course_slug":"azure-devops","course_title":"Azure DevOps & CI/CD","ord":4,"level":"Beginner","priority":"High","question":"YAML pipelines vs classic pipelines?","question_html":"YAML pipelines vs classic pipelines?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Classic build and release pipelines are configured in the web UI (release pipelines with stages, artifacts and gates).</p>\n<ul class=\"q-points\"><li>YAML pipelines are pipelines-as-code stored in the repo: versioned, reviewed in PRs, branchable, reusable via templates, and support multi-stage CI/CD with environments and checks.</li><li>Microsoft recommends YAML; some classic features are being retired or disabled for new organisations.</li></ul>\n"},{"id":709,"course_slug":"azure-devops","course_title":"Azure DevOps & CI/CD","ord":6,"level":"Intermediate","priority":"High","question":"What are branch policies and why use them?","question_html":"What are branch policies and why use them?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Rules on protected branches (e.g. <code>main</code>) enforced on pull requests: require PRs, minimum reviewers, linked work items, resolved comments, successful build validation pipeline, required reviewers by path, allowed merge types, external status checks.</p>\n<ul class=\"q-points\"><li>They keep <code>main</code> always buildable and reviewed, enforce quality gates, and create traceability.</li></ul>\n"},{"id":710,"course_slug":"azure-devops","course_title":"Azure DevOps & CI/CD","ord":7,"level":"Intermediate","priority":"High","question":"How do you manage secrets in Azure Pipelines?","question_html":"How do you manage secrets in Azure Pipelines?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Store them as secret variables or in variable groups linked to <strong>Azure Key Vault</strong> (or fetch with the <code>AzureKeyVault@2</code> task).</p>\n<ul class=\"q-points\"><li>Secrets are masked in logs and must be mapped explicitly into scripts via <code>env</code>.</li><li>Use service connections with <strong>workload identity federation</strong> (no stored client secrets), restrict pipeline permissions on variable groups/service connections, add approvals, and never commit secrets to the repo (enable secret scanning).</li></ul>\n"},{"id":711,"course_slug":"azure-devops","course_title":"Azure DevOps & CI/CD","ord":8,"level":"Intermediate","priority":"High","question":"What are environments, approvals and checks?","question_html":"What are environments, approvals and checks?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> An environment represents a deployment target (dev, test, prod — or Kubernetes namespaces/VMs) with deployment history and traceability.</p>\n<ul class=\"q-points\"><li>Approvals and checks configured on the environment gate deployment jobs: manual approvers, branch control (only from main), business hours, Azure Monitor alert queries, REST/Function checks, exclusive lock (one deployment at a time), required templates.</li><li>They replace classic release gates.</li></ul>\n"},{"id":712,"course_slug":"azure-devops","course_title":"Azure DevOps & CI/CD","ord":9,"level":"Intermediate","priority":"High","question":"What is the difference between ${{ }}, $[ ] and $( )?","question_html":"What is the difference between <code>${{ }}</code>, <code>$[ ]</code> and <code>$( )</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>${{ }}</code> are template (compile-time) expressions, evaluated when the YAML is parsed — used for parameters, conditional insertion and template logic.</p>\n<ul class=\"q-points\"><li><code>$[ ]</code> are runtime expressions evaluated before a job/stage runs — used in conditions and variables depending on other jobs&#39; outputs.</li><li><code>$( )</code> is macro syntax replaced just before a task executes — used in task inputs and scripts.</li></ul>\n"},{"id":716,"course_slug":"azure-devops","course_title":"Azure DevOps & CI/CD","ord":13,"level":"Advanced","priority":"High","question":"How would you design a CI/CD pipeline for a .NET microservice deployed to AKS?","question_html":"How would you design a CI/CD pipeline for a .NET microservice deployed to AKS?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> PR pipeline: restore, build, unit tests, coverage, SonarQube, dependency and secret scanning, Docker build (no push), Bicep/Helm lint.</p>\n<ul class=\"q-points\"><li>Main pipeline: build and test → build image tagged with commit SHA → scan with Trivy/Defender → push to ACR → deploy to dev via Helm (or update a GitOps repo) → integration/smoke tests → staging with approval → canary or blue-green to production with automated health checks (App Insights/Prometheus) and automatic rollback.</li><li>Use templates, workload-identity service connections, Key Vault secrets, environments with approvals, and track DORA metrics.</li></ul>\n"},{"id":718,"course_slug":"azure-devops","course_title":"Azure DevOps & CI/CD","ord":15,"level":"Scenario","priority":"High","question":"The build is green but production broke after deployment. How do you prevent this next time?","question_html":"The build is green but production broke after deployment. How do you prevent this next time?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Find the gap: missing tests (add integration/contract tests for the failure), environment differences (config, data, secrets — use the same artifact and IaC everywhere), no smoke tests (add post-deploy health checks that fail the stage), big-bang releases (use canary/blue-green or slot swaps with warm-up, feature flags), and no automatic rollback (monitor key metrics and roll back on alerts).</p>\n<ul class=\"q-points\"><li>Run a blameless post-mortem and add the fix to the pipeline.</li></ul>\n"},{"id":719,"course_slug":"azure-devops","course_title":"Azure DevOps & CI/CD","ord":16,"level":"Scenario","priority":"High","question":"Pipelines take 40 minutes and developers are frustrated. How do you speed them up?","question_html":"Pipelines take 40 minutes and developers are frustrated. How do you speed them up?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Measure each step.</p>\n<ul class=\"q-points\"><li>Then: cache NuGet/npm packages (<code>Cache@2</code>), run independent jobs in parallel (split test projects), use incremental builds and only build changed services (path filters), use faster/self-hosted or Managed DevOps Pool agents with warm caches, avoid rebuilding — build once and promote the same artifact, move slow end-to-end tests to a nightly or post-merge stage, use Docker layer caching, and remove redundant steps.</li></ul>\n"},{"id":708,"course_slug":"azure-devops","course_title":"Azure DevOps & CI/CD","ord":5,"level":"Beginner","priority":"Medium","question":"What is an agent? Microsoft-hosted vs self-hosted?","question_html":"What is an agent? Microsoft-hosted vs self-hosted?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> An agent is software on a machine that runs pipeline jobs.</p>\n<ul class=\"q-points\"><li>Microsoft-hosted agents are fresh VMs provided per job, preconfigured with common tools, no maintenance, but no private network access and cache isn&#39;t kept.</li><li>Self-hosted agents run on your machines/containers: custom tools, persistent caches, access to on-prem/private resources, but you maintain and secure them.</li><li>Managed DevOps Pools offer Microsoft-managed agents with private networking.</li></ul>\n"},{"id":713,"course_slug":"azure-devops","course_title":"Azure DevOps & CI/CD","ord":10,"level":"Intermediate","priority":"Medium","question":"How do you reuse pipeline logic across projects?","question_html":"How do you reuse pipeline logic across projects?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> YAML templates (step, job, stage, variable templates) with typed parameters, stored in a shared repository referenced via <code>resources.repositories</code>;</p>\n<ul class=\"q-points\"><li><code>extends</code> templates to enforce a standard pipeline skeleton (with the required-template check on environments);</li><li>variable groups for shared settings;</li><li>task groups in classic pipelines.</li></ul>\n"},{"id":714,"course_slug":"azure-devops","course_title":"Azure DevOps & CI/CD","ord":11,"level":"Intermediate","priority":"Medium","question":"What branching strategy would you recommend and why?","question_html":"What branching strategy would you recommend and why?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> For most web/cloud teams: trunk-based development or GitHub flow — short-lived branches, PRs with build validation, frequent merges to main, feature flags for incomplete work, automated deployment through environments with approvals.</p>\n<ul class=\"q-points\"><li>It reduces merge conflicts and supports CI/CD.</li><li>GitFlow suits products with scheduled releases and multiple supported versions but adds overhead.</li></ul>\n"},{"id":715,"course_slug":"azure-devops","course_title":"Azure DevOps & CI/CD","ord":12,"level":"Intermediate","priority":"Medium","question":"How do you deploy database changes in a pipeline?","question_html":"How do you deploy database changes in a pipeline?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Generate idempotent migration scripts in CI (<code>dotnet ef migrations script --idempotent</code>, SSDT DACPAC, or DbUp/Flyway scripts), publish them as artifacts, review them, apply in each environment&#39;s deployment stage before the app (<code>SqlAzureDacpacDeployment@1</code>, <code>sqlcmd</code>, EF migration bundle), using backward-compatible (expand/contract) changes so old and new app versions work during rollout.</p>\n<ul class=\"q-points\"><li>Back up / use point-in-time restore for rollback.</li></ul>\n"},{"id":717,"course_slug":"azure-devops","course_title":"Azure DevOps & CI/CD","ord":14,"level":"Advanced","priority":"Medium","question":"What are DORA metrics?","question_html":"What are DORA metrics?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Four key metrics from the DevOps Research and Assessment program: <strong>Deployment frequency</strong>, <strong>Lead time for changes</strong> (commit to production), <strong>Change failure rate</strong> (% of deployments causing failures), and <strong>Time to restore service</strong> (now often &quot;failed deployment recovery time&quot;).</p>\n<ul class=\"q-points\"><li>They measure delivery performance; elite teams deploy on demand with low failure rates and fast recovery.</li></ul>\n"},{"id":720,"course_slug":"azure-devops","course_title":"Azure DevOps & CI/CD","ord":17,"level":"Scenario","priority":"Medium","question":"A teammate committed a production connection string to the repo. What do you do?","question_html":"A teammate committed a production connection string to the repo. What do you do?","answer_html":"<p>Treat it as compromised: rotate the credential immediately (change password/key, or switch to managed identity), check access logs, remove it from the code and move it to Key Vault/variable groups, rewrite history only if required by policy (history may already be cloned), enable secret scanning/push protection (GitHub Advanced Security for Azure DevOps) and pre-commit hooks, and run a short blameless review on the process.</p>\n"},{"id":721,"course_slug":"azure-devops","course_title":"Azure DevOps & CI/CD","ord":18,"level":"Scenario","priority":"Medium","question":"How do you achieve zero-downtime deployments to Azure App Service from a pipeline?","question_html":"How do you achieve zero-downtime deployments to Azure App Service from a pipeline?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Deploy to a <strong>staging slot</strong>, warm it up (application initialization / health check path), run smoke tests against the slot URL, then <strong>swap</strong> slots (the swap is instantaneous and warmed);</p>\n<ul class=\"q-points\"><li>keep slot-specific settings sticky;</li><li>if issues appear, swap back.</li><li>Combine with backward-compatible DB migrations and feature flags.</li></ul>\n"},{"id":722,"course_slug":"azure","course_title":"Microsoft Azure for .NET Developers","ord":1,"level":"Beginner","priority":"High","question":"What are IaaS, PaaS and SaaS? Give Azure examples.","question_html":"What are IaaS, PaaS and SaaS? Give Azure examples.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> IaaS provides virtualised infrastructure — you manage OS and above (Azure VMs, VM Scale Sets).</p>\n<ul class=\"q-points\"><li>PaaS provides a managed platform — you deploy code and data, Azure handles OS, patching and scaling (App Service, Azure SQL Database, Functions, Container Apps).</li><li>SaaS is complete software you just use (Microsoft 365).</li><li>Serverless (Functions, Logic Apps) is PaaS that scales to zero and bills per use.</li></ul>\n"},{"id":723,"course_slug":"azure","course_title":"Microsoft Azure for .NET Developers","ord":2,"level":"Beginner","priority":"High","question":"Explain the Azure resource hierarchy.","question_html":"Explain the Azure resource hierarchy.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Entra ID tenant → management groups (policy and RBAC across subscriptions) → subscriptions (billing and access boundary, quotas) → resource groups (containers for resources sharing a lifecycle) → resources (web apps, databases).</p>\n<ul class=\"q-points\"><li>RBAC and Azure Policy inherit downward.</li><li>A resource belongs to exactly one resource group; resources in a group can be in different regions.</li></ul>\n"},{"id":724,"course_slug":"azure","course_title":"Microsoft Azure for .NET Developers","ord":3,"level":"Beginner","priority":"High","question":"What is a managed identity and why use it?","question_html":"What is a managed identity and why use it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> An automatically managed identity in Entra ID for an Azure resource (App Service, Functions, VM, AKS pod via workload identity) that lets code authenticate to other Azure services (Key Vault, Storage, SQL, Service Bus) without storing any credentials.</p>\n<ul class=\"q-points\"><li>Azure handles the credentials and rotation.</li><li>System-assigned is tied to one resource&#39;s lifecycle; user-assigned is a standalone identity shared by several resources.</li><li>In code, use <code>DefaultAzureCredential</code>.</li></ul>\n"},{"id":725,"course_slug":"azure","course_title":"Microsoft Azure for .NET Developers","ord":4,"level":"Beginner","priority":"High","question":"What are deployment slots in App Service?","question_html":"What are deployment slots in App Service?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Live apps with their own hostnames (e.g. <code>app-staging.azurewebsites.net</code>) within the same App Service plan (Standard tier and above).</p>\n<ul class=\"q-points\"><li>You deploy to staging, warm it up and test, then <strong>swap</strong> with production — near-zero downtime and instant rollback by swapping back.</li><li>Slot-specific (sticky) settings stay with the slot (e.g. connection strings for staging).</li></ul>\n"},{"id":727,"course_slug":"azure","course_title":"Microsoft Azure for .NET Developers","ord":6,"level":"Intermediate","priority":"High","question":"Service Bus vs Event Grid vs Event Hubs — when do you use each?","question_html":"Service Bus vs Event Grid vs Event Hubs — when do you use each?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Service Bus is for high-value business <strong>messages</strong> between services where every message must be processed: queues/topics, FIFO with sessions, transactions, duplicate detection, dead-lettering (orders, payments).</p>\n<ul class=\"q-points\"><li>Event Grid routes discrete <strong>events</strong> (something happened) to subscribers via push with filtering — reacting to blob uploads, resource changes or custom app events.</li><li>Event Hubs ingests high-volume <strong>event streams</strong> (telemetry, logs, IoT) with partitions, retention and replay for stream processing.</li></ul>\n"},{"id":728,"course_slug":"azure","course_title":"Microsoft Azure for .NET Developers","ord":7,"level":"Intermediate","priority":"High","question":"What are Azure Functions triggers and bindings? Which hosting plan would you choose?","question_html":"What are Azure Functions triggers and bindings? Which hosting plan would you choose?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A trigger starts the function (HTTP, Timer, Service Bus, Blob, Queue, Event Grid, Event Hubs, Cosmos DB change feed); exactly one per function.</p>\n<ul class=\"q-points\"><li>Bindings declaratively connect to data as inputs/outputs (read a blob, write to a queue) without SDK code.</li><li>Plans: Flex Consumption (serverless, scale to zero, VNet — the default choice for new apps), Premium (pre-warmed, no cold start, long runs), Dedicated/App Service plan (predictable cost), Container Apps.</li><li>For .NET, use the isolated worker model.</li></ul>\n"},{"id":729,"course_slug":"azure","course_title":"Microsoft Azure for .NET Developers","ord":8,"level":"Intermediate","priority":"High","question":"What are Durable Functions?","question_html":"What are Durable Functions?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> An extension of Azure Functions for stateful workflows in code.</p>\n<ul class=\"q-points\"><li>An orchestrator function coordinates activity functions, and state is checkpointed automatically (event sourcing in storage), so workflows can run for days and survive restarts.</li><li>Patterns: function chaining, fan-out/fan-in, async HTTP APIs (status endpoint), monitoring loops, human interaction (wait for an external event with timeout), durable entities.</li><li>Orchestrator code must be deterministic (no <code>DateTime.Now</code>, no direct I/O).</li></ul>\n"},{"id":730,"course_slug":"azure","course_title":"Microsoft Azure for .NET Developers","ord":9,"level":"Intermediate","priority":"High","question":"How do you choose between Azure SQL Database and Cosmos DB?","question_html":"How do you choose between Azure SQL Database and Cosmos DB?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Azure SQL: relational data, complex joins and transactions, strong consistency, reporting, existing SQL skills — most line-of-business apps.</p>\n<ul class=\"q-points\"><li>Cosmos DB: globally distributed apps needing low latency at any scale, flexible schema JSON documents, massive throughput with predictable performance, multi-region writes, tunable consistency — e.g. catalogues, IoT, user profiles, gaming.</li><li>Cosmos requires careful partition key design and RU cost planning.</li></ul>\n"},{"id":731,"course_slug":"azure","course_title":"Microsoft Azure for .NET Developers","ord":10,"level":"Intermediate","priority":"High","question":"What are Cosmos DB consistency levels?","question_html":"What are Cosmos DB consistency levels?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> From strongest to weakest: Strong (linearizable reads — always latest), Bounded Staleness (reads lag by at most K versions or T time), Session (default — read-your-own-writes within a session), Consistent Prefix (never see out-of-order writes), Eventual (no ordering guarantee, lowest latency/cost).</p>\n<ul class=\"q-points\"><li>Stronger consistency means higher latency and RU cost, and Strong limits multi-region writes.</li></ul>\n"},{"id":735,"course_slug":"azure","course_title":"Microsoft Azure for .NET Developers","ord":14,"level":"Advanced","priority":"High","question":"How would you design a highly available, globally distributed web app on Azure?","question_html":"How would you design a highly available, globally distributed web app on Azure?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Deploy the stateless app tier to two or more regions (App Service/Container Apps/AKS), each zone-redundant;</p>\n<ul class=\"q-points\"><li>put Azure Front Door in front for global load balancing, failover, WAF and CDN;</li><li>data: Azure SQL with auto-failover groups (or Cosmos DB with multi-region writes);</li><li>geo-redundant storage;</li><li>Service Bus geo-disaster recovery/replication;</li><li>Key Vault per region;</li><li>health probes and automated failover;</li><li>IaC for identical environments;</li><li>test failover regularly;</li><li>monitor with Application Insights;</li><li>define RTO/RPO targets and back up accordingly.</li></ul>\n"},{"id":737,"course_slug":"azure","course_title":"Microsoft Azure for .NET Developers","ord":16,"level":"Scenario","priority":"High","question":"Your App Service API slows down every day at 9 AM and CPU hits 100%. What do you do?","question_html":"Your App Service API slows down every day at 9 AM and CPU hits 100%. What do you do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Short term: configure <strong>autoscale</strong> rules (scale out on CPU &gt; 70% and schedule-based scale-out before 9 AM).</p>\n<ul class=\"q-points\"><li>Investigate root cause with Application Insights (slow requests, dependencies, profiler): expensive queries (add indexes, caching), sync-over-async, chatty calls, large payloads.</li><li>Consider caching hot data in Redis, moving heavy work to queues and background workers, and scaling up the plan if a single instance is undersized.</li><li>Verify with load tests.</li></ul>\n"},{"id":738,"course_slug":"azure","course_title":"Microsoft Azure for .NET Developers","ord":17,"level":"Scenario","priority":"High","question":"An order API must notify inventory, billing and email services reliably when an order is placed. Design it on Azure.","question_html":"An order API must notify inventory, billing and email services reliably when an order is placed. Design it on Azure.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The API saves the order and writes an outbox record in the same transaction; a background publisher sends an <code>OrderPlaced</code> message to a <strong>Service Bus topic</strong>.</p>\n<ul class=\"q-points\"><li>Inventory, billing and email each have their own <strong>subscription</strong> (with filters if needed), processed by Functions/Container Apps workers with peek-lock, retries, dead-letter queue monitoring and idempotent handlers (dedupe by MessageId).</li><li>Managed identities for access, Application Insights distributed tracing across services, alerts on DLQ count.</li></ul>\n"},{"id":739,"course_slug":"azure","course_title":"Microsoft Azure for .NET Developers","ord":18,"level":"Scenario","priority":"High","question":"A developer's connection string with the SQL admin password was found in appsettings.json in the repo. How do you fix the design?","question_html":"A developer&#39;s connection string with the SQL admin password was found in appsettings.json in the repo. How do you fix the design?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Rotate the password immediately.</p>\n<ul class=\"q-points\"><li>Switch the app to <strong>Entra ID authentication</strong> for Azure SQL with a managed identity (<code>Authentication=Active Directory Default</code> in the connection string, create a contained user <code>FROM EXTERNAL PROVIDER</code> with minimal roles) — no password at all.</li><li>Put any remaining secrets in Key Vault with Key Vault references.</li><li>Enable secret scanning in the repo and remove SQL admin usage from apps.</li></ul>\n"},{"id":726,"course_slug":"azure","course_title":"Microsoft Azure for .NET Developers","ord":5,"level":"Beginner","priority":"Medium","question":"What are availability zones and region pairs?","question_html":"What are availability zones and region pairs?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Availability zones are physically separate datacenters within a region with independent power, cooling and networking;</p>\n<ul class=\"q-points\"><li>deploying across zones (zone-redundant services) protects against a datacenter failure (99.99% SLA for VMs across zones).</li><li>Region pairs are two regions in the same geography used for disaster recovery (geo-redundant storage replication, sequential platform updates, prioritised recovery).</li></ul>\n"},{"id":732,"course_slug":"azure","course_title":"Microsoft Azure for .NET Developers","ord":11,"level":"Intermediate","priority":"Medium","question":"What is the difference between blob access tiers?","question_html":"What is the difference between blob access tiers?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Hot (frequent access, highest storage cost, lowest access cost), Cool (infrequent, 30-day minimum), Cold (rare, 90-day minimum), Archive (offline, cheapest storage, 180-day minimum, rehydration takes hours).</p>\n<ul class=\"q-points\"><li>Lifecycle management rules can automatically move blobs between tiers or delete them based on age.</li></ul>\n"},{"id":733,"course_slug":"azure","course_title":"Microsoft Azure for .NET Developers","ord":12,"level":"Intermediate","priority":"Medium","question":"How do you secure secrets for an app hosted in Azure?","question_html":"How do you secure secrets for an app hosted in Azure?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Store them in Azure Key Vault;</p>\n<ul class=\"q-points\"><li>give the app a managed identity with the &quot;Key Vault Secrets User&quot; RBAC role;</li><li>read them via the Key Vault configuration provider or App Service Key Vault references;</li><li>enable soft delete and purge protection;</li><li>use private endpoints;</li><li>rotate secrets (or eliminate them by using managed identity auth to SQL, Storage and Service Bus directly);</li><li>never store secrets in appsettings.json or source control.</li></ul>\n"},{"id":734,"course_slug":"azure","course_title":"Microsoft Azure for .NET Developers","ord":13,"level":"Intermediate","priority":"Medium","question":"What is Azure API Management used for?","question_html":"What is Azure API Management used for?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A managed API gateway in front of backend APIs (App Service, Functions, AKS, on-prem): central entry point, JWT/OAuth validation, subscription keys, rate limiting and quotas, request/response transformation, caching, versioning and revisions, mock responses, analytics, and a developer portal for consumers.</p>\n<ul class=\"q-points\"><li>Policies are XML snippets applied at global, product, API or operation scope.</li></ul>\n"},{"id":736,"course_slug":"azure","course_title":"Microsoft Azure for .NET Developers","ord":15,"level":"Advanced","priority":"Medium","question":"How do you reduce Azure costs for an application?","question_html":"How do you reduce Azure costs for an application?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Right-size SKUs using metrics and Advisor;</p>\n<ul class=\"q-points\"><li>autoscale with sensible minimums;</li><li>use reserved instances/savings plans for steady workloads;</li><li>serverless/scale-to-zero (Flex Consumption, Container Apps) for spiky ones;</li><li>spot VMs for interruptible batch;</li><li>storage lifecycle tiers;</li><li>shut down dev/test outside hours;</li><li>delete orphaned resources;</li><li>use caching to reduce database tier needs;</li><li>set budgets and alerts;</li><li>tag resources for cost allocation;</li><li>consider Azure Hybrid Benefit for Windows/SQL licences.</li></ul>\n"},{"id":740,"course_slug":"azure","course_title":"Microsoft Azure for .NET Developers","ord":19,"level":"Scenario","priority":"Medium","question":"Users in Europe complain the India-hosted site is slow. What can you do?","question_html":"Users in Europe complain the India-hosted site is slow. What can you do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Put Azure Front Door (CDN + global edge, TLS termination, caching static content and cacheable API responses) in front;</p>\n<ul class=\"q-points\"><li>serve static assets from the CDN;</li><li>compress and optimise payloads;</li><li>deploy a read-only or full secondary region in Europe with Front Door latency-based routing;</li><li>replicate data (Cosmos DB multi-region or Azure SQL geo-replica for reads);</li><li>check data residency requirements first.</li></ul>\n"},{"id":741,"course_slug":"azure","course_title":"Microsoft Azure for .NET Developers","ord":20,"level":"Scenario","priority":"Medium","question":"Blob uploads must trigger thumbnail generation automatically. Which services?","question_html":"Blob uploads must trigger thumbnail generation automatically. Which services?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Blob Storage (uploads via SAS or managed identity) → <strong>Event Grid</strong> <code>BlobCreated</code> event (filtered by container/suffix) → <strong>Azure Function</strong> (Event Grid trigger, Flex Consumption) that generates the thumbnail and writes it to a <code>thumbnails</code> container with an output binding.</p>\n<ul class=\"q-points\"><li>Add retries/dead-lettering on the Event Grid subscription, and Application Insights for monitoring.</li><li>For high volume, put a Service Bus/Storage queue between them.</li></ul>\n"},{"id":742,"course_slug":"azure-databases","course_title":"Azure Databases — Azure SQL, Managed Instance, Cosmos DB, PostgreSQL and Migration","ord":1,"level":"Beginner","priority":"High","question":"Azure SQL Database vs Managed Instance vs SQL Server on a VM?","question_html":"Azure SQL Database vs Managed Instance vs SQL Server on a VM?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Azure SQL Database is a fully managed single database (or elastic pool) — best for new cloud apps, with database-scoped features.</p>\n<ul class=\"q-points\"><li>Managed Instance is a fully managed SQL Server instance in your VNet with near-complete compatibility (SQL Agent, cross-database queries, CLR, linked servers) — best for lift-and-shift migrations.</li><li>SQL Server on an Azure VM is IaaS with full control and 100 % compatibility but you manage patching, backups and HA.</li></ul>\n"},{"id":743,"course_slug":"azure-databases","course_title":"Azure Databases — Azure SQL, Managed Instance, Cosmos DB, PostgreSQL and Migration","ord":2,"level":"Beginner","priority":"High","question":"What is the difference between DTU and vCore models?","question_html":"What is the difference between DTU and vCore models?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> DTU bundles CPU, memory and I/O into one measure with fixed tiers (Basic, Standard, Premium) — simple but less flexible. vCore lets you choose cores, memory and storage independently, pick hardware generations and tiers (General Purpose, Business Critical, Hyperscale), use serverless compute, and save with Azure Hybrid Benefit and reserved capacity.</p>\n<ul class=\"q-points\"><li>Most new deployments use vCore.</li></ul>\n"},{"id":744,"course_slug":"azure-databases","course_title":"Azure Databases — Azure SQL, Managed Instance, Cosmos DB, PostgreSQL and Migration","ord":3,"level":"Beginner","priority":"High","question":"How do you connect an App Service to Azure SQL without storing a password?","question_html":"How do you connect an App Service to Azure SQL without storing a password?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Enable a managed identity on the App Service, set an Entra admin on the SQL server, create a contained database user <code>FROM EXTERNAL PROVIDER</code> for the identity and grant roles, and use a connection string with <code>Authentication=Active Directory Default</code> (or Managed Identity).</p>\n<ul class=\"q-points\"><li>Locally the same code uses your developer login through DefaultAzureCredential.</li></ul>\n"},{"id":745,"course_slug":"azure-databases","course_title":"Azure Databases — Azure SQL, Managed Instance, Cosmos DB, PostgreSQL and Migration","ord":4,"level":"Intermediate","priority":"High","question":"What are failover groups and how are they different from active geo-replication?","question_html":"What are failover groups and how are they different from active geo-replication?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Active geo-replication replicates a single database to up to four readable secondaries in other regions, and failover is per database with connection strings pointing to specific servers.</p>\n<ul class=\"q-points\"><li>Failover groups manage a group of databases (or a whole managed instance) together and provide stable listener endpoints for read-write and read-only traffic that follow the primary after failover, so applications don&#39;t need connection-string changes.</li><li>Failover can be automatic or manual.</li></ul>\n"},{"id":746,"course_slug":"azure-databases","course_title":"Azure Databases — Azure SQL, Managed Instance, Cosmos DB, PostgreSQL and Migration","ord":5,"level":"Intermediate","priority":"High","question":"How does backup and restore work in Azure SQL Database?","question_html":"How does backup and restore work in Azure SQL Database?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Backups are automatic: weekly full, differential every 12–24 hours and log backups every 5–10 minutes, stored in geo-redundant (or zone/locally redundant) storage.</p>\n<ul class=\"q-points\"><li>You can restore to any point in time within the retention period (1–35 days) as a new database, keep long-term retention backups up to 10 years, and geo-restore to another region if the primary region is unavailable.</li></ul>\n"},{"id":747,"course_slug":"azure-databases","course_title":"Azure Databases — Azure SQL, Managed Instance, Cosmos DB, PostgreSQL and Migration","ord":6,"level":"Intermediate","priority":"High","question":"What is a partition key in Cosmos DB and how do you choose it?","question_html":"What is a partition key in Cosmos DB and how do you choose it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The property used to distribute items across logical and physical partitions; all items with the same value form a logical partition (max 20 GB).</p>\n<ul class=\"q-points\"><li>Choose a key with high cardinality and evenly spread reads/writes that is present in most queries (e.g. customerId, tenantId, deviceId) — so queries hit one partition and throughput isn&#39;t limited by a hot partition.</li><li>It can&#39;t be changed later without migrating data.</li></ul>\n"},{"id":748,"course_slug":"azure-databases","course_title":"Azure Databases — Azure SQL, Managed Instance, Cosmos DB, PostgreSQL and Migration","ord":7,"level":"Intermediate","priority":"High","question":"What are Request Units (RU/s) and consistency levels in Cosmos DB?","question_html":"What are Request Units (RU/s) and consistency levels in Cosmos DB?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> RUs are the normalised cost of operations (CPU, IO, memory): a 1 KB point read ≈ 1 RU, writes and queries cost more;</p>\n<ul class=\"q-points\"><li>you provision RU/s (manual/autoscale) or pay per RU in serverless.</li><li>Consistency levels trade latency/availability for freshness: Strong, Bounded staleness, Session (default, read-your-writes), Consistent prefix and Eventual.</li></ul>\n"},{"id":754,"course_slug":"azure-databases","course_title":"Azure Databases — Azure SQL, Managed Instance, Cosmos DB, PostgreSQL and Migration","ord":13,"level":"Scenario","priority":"High","question":"You need to migrate a 500 GB on-prem SQL Server database with SQL Agent jobs and cross-database queries to Azure with minimal downtime. What do you choose?","question_html":"You need to migrate a 500 GB on-prem SQL Server database with SQL Agent jobs and cross-database queries to Azure with minimal downtime. What do you choose?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Azure SQL Managed Instance, because it supports SQL Agent and cross-database queries.</p>\n<ul class=\"q-points\"><li>Assess with the migration tools, provision MI in a VNet connected by VPN/ExpressRoute, use the online migration (Database Migration Service or the MI link/log replay) to keep the target in sync, test the application against MI, then cut over during a short window by stopping writes, completing the sync and switching connection strings.</li></ul>\n"},{"id":755,"course_slug":"azure-databases","course_title":"Azure Databases — Azure SQL, Managed Instance, Cosmos DB, PostgreSQL and Migration","ord":14,"level":"Scenario","priority":"High","question":"An Azure SQL database is at 100 % CPU after a release. What do you do?","question_html":"An Azure SQL database is at 100 % CPU after a release. What do you do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Check Query Store/Query Performance Insight for the top CPU queries and regressed plans;</p>\n<ul class=\"q-points\"><li>force the last good plan (or rely on automatic tuning) as an immediate fix;</li><li>fix the query/indexes (missing index, non-SARGable predicate, parameter sniffing);</li><li>temporarily scale up the tier if users are impacted;</li><li>add caching or read replicas for heavy reads;</li><li>set alerts on CPU and log IO for early warning.</li></ul>\n"},{"id":749,"course_slug":"azure-databases","course_title":"Azure Databases — Azure SQL, Managed Instance, Cosmos DB, PostgreSQL and Migration","ord":8,"level":"Intermediate","priority":"Medium","question":"What is serverless compute in Azure SQL Database?","question_html":"What is serverless compute in Azure SQL Database?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A compute tier that automatically scales vCores between a minimum and maximum based on load and bills per second of compute used;</p>\n<ul class=\"q-points\"><li>in General Purpose it can auto-pause after an idle period, charging only for storage, and resumes on the next connection (with a short delay).</li><li>Ideal for dev/test and intermittent workloads, not for latency-sensitive always-on production.</li></ul>\n"},{"id":750,"course_slug":"azure-databases","course_title":"Azure Databases — Azure SQL, Managed Instance, Cosmos DB, PostgreSQL and Migration","ord":9,"level":"Intermediate","priority":"Medium","question":"How do you secure Azure SQL Database?","question_html":"How do you secure Azure SQL Database?","answer_html":"<p>Private endpoints and disabled public access (or tight firewall rules), Entra-only authentication with managed identities, least-privilege database roles, TDE (on by default) and TLS, Always Encrypted for highly sensitive columns, Row-Level Security for tenant isolation, Dynamic Data Masking for non-privileged users, auditing to Log Analytics, Microsoft Defender for SQL, and secrets (if any) in Key Vault.</p>\n"},{"id":751,"course_slug":"azure-databases","course_title":"Azure Databases — Azure SQL, Managed Instance, Cosmos DB, PostgreSQL and Migration","ord":10,"level":"Advanced","priority":"Medium","question":"What is Hyperscale and when would you use it?","question_html":"What is Hyperscale and when would you use it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A vCore service tier with a distributed architecture separating compute, page servers and log service, supporting databases up to 128 TB with near-constant-time backups and fast restores, rapid scale up/down, and up to four HA replicas plus named read replicas.</p>\n<ul class=\"q-points\"><li>Use it for large or fast-growing OLTP databases and mixed workloads needing read scale-out.</li></ul>\n"},{"id":752,"course_slug":"azure-databases","course_title":"Azure Databases — Azure SQL, Managed Instance, Cosmos DB, PostgreSQL and Migration","ord":11,"level":"Advanced","priority":"Medium","question":"Why must applications use retry logic with Azure SQL?","question_html":"Why must applications use retry logic with Azure SQL?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Cloud databases have transient faults: failovers during maintenance or hardware failure, load balancing, throttling when resource limits are hit (errors such as 40613, 40501, 40197, 10928).</p>\n<ul class=\"q-points\"><li>A short retry with exponential backoff (EF Core <code>EnableRetryOnFailure</code>, Polly, SqlClient configurable retry logic) makes these invisible to users;</li><li>make operations idempotent so retries are safe.</li></ul>\n"},{"id":753,"course_slug":"azure-databases","course_title":"Azure Databases — Azure SQL, Managed Instance, Cosmos DB, PostgreSQL and Migration","ord":12,"level":"Intermediate","priority":"Medium","question":"What is an elastic pool and when should you not use it?","question_html":"What is an elastic pool and when should you not use it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A shared pool of compute (vCores or eDTUs) and storage used by many Azure SQL databases, each scaling within per-database min/max limits — cost-effective when databases have low average and uneven peak usage (SaaS database-per-tenant).</p>\n<ul class=\"q-points\"><li>Avoid it when databases peak at the same time or one database needs consistently high resources — that database belongs in its own single database or a separate pool.</li></ul>\n"},{"id":756,"course_slug":"azure-databases","course_title":"Azure Databases — Azure SQL, Managed Instance, Cosmos DB, PostgreSQL and Migration","ord":15,"level":"Scenario","priority":"Medium","question":"A multi-tenant SaaS has 300 small customer databases with different peak times. How do you host them cost-effectively?","question_html":"A multi-tenant SaaS has 300 small customer databases with different peak times. How do you host them cost-effectively?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Put them in one or more elastic pools so they share a pool of vCores/eDTUs sized for combined peak, not each database&#39;s peak;</p>\n<ul class=\"q-points\"><li>monitor per-database usage and move noisy tenants to their own database or pool;</li><li>use Elastic Jobs for schema updates across all databases and a catalog database to map tenants to databases.</li></ul>\n"},{"id":757,"course_slug":"aws","course_title":"Amazon Web Services (AWS) for .NET and Full Stack Developers","ord":1,"level":"Beginner","priority":"High","question":"What are regions and availability zones?","question_html":"What are regions and availability zones?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A region is a geographic area (Mumbai, Singapore, Tokyo…) containing multiple isolated availability zones — separate data centres with independent power, cooling and networking connected by low-latency links.</p>\n<ul class=\"q-points\"><li>Deploying across at least two AZs protects against a data-centre failure; multiple regions protect against regional outages and serve global users.</li></ul>\n"},{"id":758,"course_slug":"aws","course_title":"Amazon Web Services (AWS) for .NET and Full Stack Developers","ord":2,"level":"Beginner","priority":"High","question":"Explain the shared responsibility model.","question_html":"Explain the shared responsibility model.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> AWS is responsible for security <em>of</em> the cloud — physical data centres, hardware, networking, virtualisation and the internals of managed services.</p>\n<ul class=\"q-points\"><li>The customer is responsible for security <em>in</em> the cloud — IAM users and policies, data and its encryption, network configuration (security groups), OS patching on EC2, application code and secrets.</li><li>The split shifts with the service: more customer responsibility on EC2, less on Lambda/S3.</li></ul>\n"},{"id":759,"course_slug":"aws","course_title":"Amazon Web Services (AWS) for .NET and Full Stack Developers","ord":3,"level":"Beginner","priority":"High","question":"What is IAM and what is the difference between a user and a role?","question_html":"What is IAM and what is the difference between a user and a role?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> IAM controls who can do what on which AWS resources using JSON policies.</p>\n<ul class=\"q-points\"><li>A user is a long-term identity (person or legacy app) with credentials;</li><li>a role is an identity without permanent credentials that is assumed to obtain temporary credentials — used by EC2 instances, ECS tasks, Lambda functions, other accounts and federated users.</li><li>Applications should use roles, not access keys.</li></ul>\n"},{"id":760,"course_slug":"aws","course_title":"Amazon Web Services (AWS) for .NET and Full Stack Developers","ord":4,"level":"Beginner","priority":"High","question":"EC2 vs Elastic Beanstalk vs ECS/Fargate vs Lambda for hosting a .NET API?","question_html":"EC2 vs Elastic Beanstalk vs ECS/Fargate vs Lambda for hosting a .NET API?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> EC2: full VMs you manage (good for legacy IIS apps).</p>\n<ul class=\"q-points\"><li>Elastic Beanstalk: PaaS that provisions EC2, load balancing and scaling for you — quick hosting.</li><li>ECS on Fargate: run containers without managing servers — the common choice for containerised ASP.NET Core microservices.</li><li>Lambda: functions billed per request that scale to zero — great for event-driven or spiky APIs, with cold starts and time limits (15 min).</li></ul>\n"},{"id":761,"course_slug":"aws","course_title":"Amazon Web Services (AWS) for .NET and Full Stack Developers","ord":5,"level":"Beginner","priority":"High","question":"What is S3 and what are storage classes?","question_html":"What is S3 and what are storage classes?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Simple Storage Service: object storage for files of any size in buckets, highly durable (11 nines), accessed over HTTPS/SDK.</p>\n<ul class=\"q-points\"><li>Storage classes trade price vs access speed: Standard (frequent), Intelligent-Tiering (automatic), Standard-IA/One Zone-IA (infrequent), Glacier Instant/Flexible/Deep Archive (archives).</li><li>Lifecycle rules move objects between classes automatically.</li></ul>\n"},{"id":762,"course_slug":"aws","course_title":"Amazon Web Services (AWS) for .NET and Full Stack Developers","ord":6,"level":"Intermediate","priority":"High","question":"How do you host SQL Server on AWS?","question_html":"How do you host SQL Server on AWS?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Amazon RDS for SQL Server (managed: backups, patching, Multi-AZ failover, read replicas on Enterprise;</p>\n<ul class=\"q-points\"><li>licence included), RDS Custom for SQL Server (OS access, BYOL), or SQL Server on EC2 (full control, Always On, SSIS/SSRS on the box).</li><li>Place databases in private subnets, restrict security groups to the app tier, encrypt with KMS and store credentials in Secrets Manager.</li></ul>\n"},{"id":763,"course_slug":"aws","course_title":"Amazon Web Services (AWS) for .NET and Full Stack Developers","ord":7,"level":"Intermediate","priority":"High","question":"Security group vs network ACL?","question_html":"Security group vs network ACL?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Security groups are stateful firewalls attached to instances/network interfaces with allow rules only — return traffic is automatically allowed.</p>\n<ul class=\"q-points\"><li>Network ACLs are stateless rules on subnets with both allow and deny, evaluated in order, requiring explicit rules for return traffic.</li><li>Security groups are the primary control; NACLs add coarse subnet-level protection.</li></ul>\n"},{"id":764,"course_slug":"aws","course_title":"Amazon Web Services (AWS) for .NET and Full Stack Developers","ord":8,"level":"Intermediate","priority":"High","question":"SQS vs SNS vs EventBridge?","question_html":"SQS vs SNS vs EventBridge?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> SQS is a message queue — consumers pull messages, each processed by one consumer, with retries and DLQs (decoupling and buffering).</p>\n<ul class=\"q-points\"><li>SNS is pub/sub — a message published to a topic is pushed to all subscribers (fan-out, notifications).</li><li>EventBridge is an event bus with content-based routing rules from AWS services, SaaS and apps, plus a scheduler — for event-driven architectures.</li><li>Common combination: SNS/EventBridge fan-out to several SQS queues.</li></ul>\n"},{"id":765,"course_slug":"aws","course_title":"Amazon Web Services (AWS) for .NET and Full Stack Developers","ord":9,"level":"Intermediate","priority":"High","question":"What is DynamoDB and how do you design keys?","question_html":"What is DynamoDB and how do you design keys?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A fully managed NoSQL key-value/document database with consistent single-digit-ms latency at any scale.</p>\n<ul class=\"q-points\"><li>Items are stored by partition key (and optional sort key);</li><li>design starts from access patterns — choose a high-cardinality partition key to spread load, a sort key for ranges/ordering, and GSIs for other access patterns (often single-table design).</li><li>Use on-demand or provisioned capacity with auto scaling.</li></ul>\n"},{"id":770,"course_slug":"aws","course_title":"Amazon Web Services (AWS) for .NET and Full Stack Developers","ord":14,"level":"Scenario","priority":"High","question":"Your ASP.NET Core API on ECS must read files from S3 and connect to RDS SQL Server. How do you set up access securely?","question_html":"Your ASP.NET Core API on ECS must read files from S3 and connect to RDS SQL Server. How do you set up access securely?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Give the ECS task a task IAM role with a least-privilege policy for the specific S3 bucket/prefix; the AWS SDK picks up temporary credentials automatically.</p>\n<ul class=\"q-points\"><li>Put RDS in private subnets with a security group allowing port 1433 only from the ECS service&#39;s security group;</li><li>store the DB credentials in Secrets Manager (readable by the task role) and load them at startup;</li><li>enforce TLS (<code>Encrypt=True</code>) and KMS encryption at rest.</li></ul>\n"},{"id":766,"course_slug":"aws","course_title":"Amazon Web Services (AWS) for .NET and Full Stack Developers","ord":10,"level":"Intermediate","priority":"Medium","question":"ALB vs NLB vs API Gateway?","question_html":"ALB vs NLB vs API Gateway?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> ALB is a layer-7 HTTP/HTTPS load balancer with host/path routing, WebSockets and TLS termination — for web apps and containers.</p>\n<ul class=\"q-points\"><li>NLB is layer 4 (TCP/UDP), extremely fast with static IPs — for non-HTTP protocols or extreme throughput.</li><li>API Gateway is a managed API front door with authentication, throttling, API keys, request validation and direct Lambda integration — for public/serverless APIs.</li></ul>\n"},{"id":767,"course_slug":"aws","course_title":"Amazon Web Services (AWS) for .NET and Full Stack Developers","ord":11,"level":"Intermediate","priority":"Medium","question":"How do you manage secrets for a .NET app on AWS?","question_html":"How do you manage secrets for a .NET app on AWS?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Store them in Secrets Manager (with rotation for database credentials) or SSM Parameter Store (SecureString), grant the app&#39;s IAM role permission to read only those secrets, and load them into <code>IConfiguration</code> at startup with the AWS configuration provider or SDK.</p>\n<ul class=\"q-points\"><li>No secrets in appsettings, environment files in source control or container images.</li></ul>\n"},{"id":768,"course_slug":"aws","course_title":"Amazon Web Services (AWS) for .NET and Full Stack Developers","ord":12,"level":"Advanced","priority":"Medium","question":"How do you make an application highly available on AWS?","question_html":"How do you make an application highly available on AWS?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Run stateless app instances/tasks in at least two AZs behind an ALB with health checks and auto scaling;</p>\n<ul class=\"q-points\"><li>use Multi-AZ databases (RDS/Aurora) and replicated storage (S3);</li><li>externalise sessions (ElastiCache/DynamoDB);</li><li>use queues to absorb spikes;</li><li>Route 53 health checks and failover routing to a second region for disaster recovery;</li><li>automate infrastructure with IaC and test failures.</li></ul>\n"},{"id":769,"course_slug":"aws","course_title":"Amazon Web Services (AWS) for .NET and Full Stack Developers","ord":13,"level":"Advanced","priority":"Medium","question":"What are the pillars of the AWS Well-Architected Framework?","question_html":"What are the pillars of the AWS Well-Architected Framework?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Operational excellence (automation, observability, runbooks), Security (identity, protection, detection), Reliability (recover from failure, scale), Performance efficiency (right resources, experiment), Cost optimisation (pay for what you need) and Sustainability (minimise environmental impact).</p>\n<ul class=\"q-points\"><li>AWS offers a Well-Architected Tool to review workloads against them.</li></ul>\n"},{"id":771,"course_slug":"aws","course_title":"Amazon Web Services (AWS) for .NET and Full Stack Developers","ord":15,"level":"Scenario","priority":"Medium","question":"A company is moving from Azure to AWS. How would you map their stack (App Service, Azure SQL, Blob, Service Bus, Key Vault, App Insights)?","question_html":"A company is moving from Azure to AWS. How would you map their stack (App Service, Azure SQL, Blob, Service Bus, Key Vault, App Insights)?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> App Service → Elastic Beanstalk, App Runner or ECS Fargate;</p>\n<ul class=\"q-points\"><li>Azure SQL → RDS for SQL Server (or Aurora PostgreSQL if re-platforming);</li><li>Blob Storage → S3;</li><li>Service Bus queues/topics → SQS/SNS (or Amazon MQ for AMQP compatibility);</li><li>Key Vault → Secrets Manager + KMS;</li><li>Application Insights → CloudWatch + X-Ray/OpenTelemetry;</li><li>Azure DevOps pipelines can deploy to AWS or move to GitHub Actions/CodePipeline.</li><li>Migrate data with AWS DMS and test performance and IAM thoroughly.</li></ul>\n"},{"id":772,"course_slug":"aws","course_title":"Amazon Web Services (AWS) for .NET and Full Stack Developers","ord":16,"level":"Scenario","priority":"Medium","question":"Your AWS bill doubled this month. How do you investigate and reduce it?","question_html":"Your AWS bill doubled this month. How do you investigate and reduce it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use Cost Explorer grouped by service, account and tags to find the jump (often data transfer, NAT gateway traffic, oversized RDS/EC2, forgotten resources or logging volume).</p>\n<ul class=\"q-points\"><li>Fix: right-size or stop idle resources, Savings Plans for steady compute, S3 lifecycle policies, VPC endpoints to avoid NAT charges for S3/DynamoDB traffic, reduce CloudWatch log retention, set Budgets alerts and tagging policies to prevent recurrence.</li></ul>\n"},{"id":773,"course_slug":"gcp","course_title":"Google Cloud Platform (GCP) for .NET and Full Stack Developers","ord":1,"level":"Beginner","priority":"High","question":"What is the GCP resource hierarchy?","question_html":"What is the GCP resource hierarchy?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Organisation (your domain) → folders (departments/environments) → projects → resources.</p>\n<ul class=\"q-points\"><li>Projects are the core unit: they hold resources, enabled APIs, quotas and are linked to a billing account.</li><li>IAM policies and organisation policies set at higher levels are inherited by everything below.</li></ul>\n"},{"id":774,"course_slug":"gcp","course_title":"Google Cloud Platform (GCP) for .NET and Full Stack Developers","ord":2,"level":"Beginner","priority":"High","question":"What is Cloud Run and why is it popular for .NET APIs?","question_html":"What is Cloud Run and why is it popular for .NET APIs?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A fully managed platform that runs any stateless HTTP container: you deploy an image (or source), get an HTTPS endpoint, automatic scaling from zero to many instances, per-request billing, revisions with traffic splitting, and integration with Secret Manager, Cloud SQL and Pub/Sub.</p>\n<ul class=\"q-points\"><li>ASP.NET Core containers run unchanged — just listen on the <code>PORT</code> environment variable.</li></ul>\n"},{"id":775,"course_slug":"gcp","course_title":"Google Cloud Platform (GCP) for .NET and Full Stack Developers","ord":3,"level":"Beginner","priority":"High","question":"What are service accounts?","question_html":"What are service accounts?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Identities for workloads rather than people.</p>\n<ul class=\"q-points\"><li>A Cloud Run service, VM or GKE workload runs as a service account, and IAM roles granted to that account decide what Google APIs it can call (e.g. <code>roles/cloudsql.client</code>, <code>roles/secretmanager.secretAccessor</code>).</li><li>Client libraries pick up its credentials automatically; avoid downloading service account keys — use Workload Identity (Federation) instead.</li></ul>\n"},{"id":777,"course_slug":"gcp","course_title":"Google Cloud Platform (GCP) for .NET and Full Stack Developers","ord":5,"level":"Intermediate","priority":"High","question":"How do you connect a Cloud Run service to Cloud SQL for SQL Server securely?","question_html":"How do you connect a Cloud Run service to Cloud SQL for SQL Server securely?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use a private IP Cloud SQL instance and connect from Cloud Run through VPC egress (Direct VPC egress or a Serverless VPC Access connector), or use the Cloud SQL Auth Proxy/connector which authorises with IAM and encrypts the connection.</p>\n<ul class=\"q-points\"><li>Run Cloud Run as a dedicated service account with <code>roles/cloudsql.client</code>, keep the password/connection string in Secret Manager mounted as an environment variable, and enable HA and backups on the instance.</li></ul>\n"},{"id":778,"course_slug":"gcp","course_title":"Google Cloud Platform (GCP) for .NET and Full Stack Developers","ord":6,"level":"Intermediate","priority":"High","question":"Pub/Sub vs Cloud Tasks?","question_html":"Pub/Sub vs Cloud Tasks?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Pub/Sub is many-to-many event messaging: publishers send to topics and every subscription receives each message (fan-out, decoupling, streaming).</p>\n<ul class=\"q-points\"><li>Cloud Tasks is a queue of individual HTTP tasks targeted at one handler with explicit rate limits, scheduling and retries — like a background job queue.</li><li>Use Pub/Sub for events, Cloud Tasks for controlled work dispatch.</li></ul>\n"},{"id":779,"course_slug":"gcp","course_title":"Google Cloud Platform (GCP) for .NET and Full Stack Developers","ord":7,"level":"Intermediate","priority":"High","question":"What is BigQuery and when would you use it?","question_html":"What is BigQuery and when would you use it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A serverless, columnar data warehouse that runs SQL over terabytes–petabytes without managing servers, billed by storage and bytes scanned (or reserved slots).</p>\n<ul class=\"q-points\"><li>Use it for analytics, reporting, log analysis and ML (BigQuery ML) — not for OLTP.</li><li>Partition and cluster tables and avoid <code>SELECT *</code> to control cost.</li></ul>\n"},{"id":783,"course_slug":"gcp","course_title":"Google Cloud Platform (GCP) for .NET and Full Stack Developers","ord":11,"level":"Scenario","priority":"High","question":"You need to deploy an ASP.NET Core API with a SQL Server database on GCP with minimal operations work. What do you build?","question_html":"You need to deploy an ASP.NET Core API with a SQL Server database on GCP with minimal operations work. What do you build?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Containerise the API (Dockerfile listening on PORT), push to Artifact Registry with Cloud Build, deploy to Cloud Run with a dedicated service account, min instances 1 for low latency, secrets from Secret Manager;</p>\n<ul class=\"q-points\"><li>Cloud SQL for SQL Server (HA, backups, PITR, private IP) reached via VPC egress;</li><li>Cloud Logging/Monitoring alerts on errors and latency;</li><li>a global HTTPS load balancer with Cloud Armor if a custom domain and WAF are needed;</li><li>budgets for cost control.</li></ul>\n"},{"id":776,"course_slug":"gcp","course_title":"Google Cloud Platform (GCP) for .NET and Full Stack Developers","ord":4,"level":"Beginner","priority":"Medium","question":"Compute Engine vs Cloud Run vs GKE vs App Engine?","question_html":"Compute Engine vs Cloud Run vs GKE vs App Engine?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Compute Engine: VMs with full control (legacy/IIS apps).</p>\n<ul class=\"q-points\"><li>Cloud Run: serverless containers — simplest for HTTP services and jobs.</li><li>GKE: managed Kubernetes for complex microservice platforms (Autopilot reduces node management).</li><li>App Engine: the original PaaS, now mostly replaced by Cloud Run for new work.</li></ul>\n"},{"id":780,"course_slug":"gcp","course_title":"Google Cloud Platform (GCP) for .NET and Full Stack Developers","ord":8,"level":"Intermediate","priority":"Medium","question":"Cloud SQL vs Spanner vs Firestore vs Bigtable?","question_html":"Cloud SQL vs Spanner vs Firestore vs Bigtable?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Cloud SQL: managed SQL Server/PostgreSQL/MySQL for typical regional relational apps.</p>\n<ul class=\"q-points\"><li>Spanner: horizontally scalable, globally consistent relational database for very large or global systems.</li><li>Firestore: serverless document database with real-time sync for web/mobile.</li><li>Bigtable: wide-column NoSQL for massive throughput time-series/analytical workloads.</li></ul>\n"},{"id":781,"course_slug":"gcp","course_title":"Google Cloud Platform (GCP) for .NET and Full Stack Developers","ord":9,"level":"Intermediate","priority":"Medium","question":"How is a GCP VPC different from AWS/Azure networks?","question_html":"How is a GCP VPC different from AWS/Azure networks?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> GCP VPC networks are global resources — one VPC spans all regions with regional subnets, and instances in different regions communicate over Google&#39;s private network without peering.</p>\n<ul class=\"q-points\"><li>AWS VPCs and Azure VNets are regional and need peering or transit gateways to connect regions.</li><li>Firewall rules in GCP apply at the VPC level and can target network tags or service accounts.</li></ul>\n"},{"id":782,"course_slug":"gcp","course_title":"Google Cloud Platform (GCP) for .NET and Full Stack Developers","ord":10,"level":"Advanced","priority":"Medium","question":"How do you avoid service account keys in CI/CD?","question_html":"How do you avoid service account keys in CI/CD?","answer_html":"<p>Use Workload Identity Federation: configure a workload identity pool and provider trusting GitHub Actions&#39; (or Azure DevOps&#39;) OIDC tokens, allow it to impersonate a deploy service account with minimal roles, and authenticate in the pipeline with <code>google-github-actions/auth</code> — short-lived tokens, nothing secret stored in the CI system.</p>\n"},{"id":784,"course_slug":"gcp","course_title":"Google Cloud Platform (GCP) for .NET and Full Stack Developers","ord":12,"level":"Scenario","priority":"Medium","question":"Logs from your .NET app on Cloud Run show up as plain text without severity. How do you fix it?","question_html":"Logs from your .NET app on Cloud Run show up as plain text without severity. How do you fix it?","answer_html":"<p>Write structured JSON logs to stdout with a <code>severity</code> field (and <code>message</code>, trace fields) — e.g. use a JSON console formatter or Google.Cloud.Diagnostics.AspNetCore3 — so Cloud Logging parses levels and fields, and include the <code>logging.googleapis.com/trace</code> field to correlate logs with Cloud Trace requests.</p>\n"},{"id":785,"course_slug":"gcp","course_title":"Google Cloud Platform (GCP) for .NET and Full Stack Developers","ord":13,"level":"Scenario","priority":"Medium","question":"BigQuery costs are high because analysts run large queries. How do you reduce them?","question_html":"BigQuery costs are high because analysts run large queries. How do you reduce them?","answer_html":"<p>Partition tables by date and cluster by common filters, require partition filters, avoid <code>SELECT *</code>, use materialised views and BI Engine for dashboards, set per-user/per-project custom quotas and <code>maximum_bytes_billed</code>, consider slot reservations (editions) for predictable spend, and review the most expensive queries in INFORMATION_SCHEMA jobs views.</p>\n"},{"id":786,"course_slug":"gcp","course_title":"Google Cloud Platform (GCP) for .NET and Full Stack Developers","ord":14,"level":"Beginner","priority":"Medium","question":"What are regions, zones and multi-regions in GCP?","question_html":"What are regions, zones and multi-regions in GCP?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A region is a geographic location (asia-south1 Mumbai) with three or more zones — isolated deployment areas within the region.</p>\n<ul class=\"q-points\"><li>Zonal resources (VMs, disks) live in one zone;</li><li>regional resources replicate across zones (regional Cloud SQL HA, Cloud Run);</li><li>multi-regional resources (Cloud Storage multi-region, BigQuery US/EU) replicate across regions for availability and proximity.</li></ul>\n"},{"id":787,"course_slug":"gcp","course_title":"Google Cloud Platform (GCP) for .NET and Full Stack Developers","ord":15,"level":"Intermediate","priority":"Medium","question":"How do you control access to a Cloud Run service?","question_html":"How do you control access to a Cloud Run service?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Public services allow <code>allUsers</code> the <code>roles/run.invoker</code> role;</p>\n<ul class=\"q-points\"><li>private services require callers with run.invoker (service accounts for service-to-service with ID tokens), Identity-Aware Proxy for employees, or ingress settings restricting traffic to internal/load balancer only.</li><li>Combine with application-level auth (JWT from Identity Platform/Entra) for end users.</li></ul>\n"},{"id":788,"course_slug":"html-css","course_title":"HTML5 & CSS3 — Semantic Markup to Responsive Layouts","ord":1,"level":"Beginner","priority":"High","question":"What is semantic HTML and why is it important?","question_html":"What is semantic HTML and why is it important?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Using elements that describe meaning — <code>header</code>, <code>nav</code>, <code>main</code>, <code>article</code>, <code>section</code>, <code>aside</code>, <code>footer</code>, <code>button</code>, headings — instead of generic <code>div</code>/<code>span</code>.</p>\n<ul class=\"q-points\"><li>Benefits: accessibility (screen readers use landmarks and roles), SEO (search engines understand structure), built-in behaviour (buttons are focusable and keyboard-operable), and readable code.</li></ul>\n"},{"id":789,"course_slug":"html-css","course_title":"HTML5 & CSS3 — Semantic Markup to Responsive Layouts","ord":2,"level":"Beginner","priority":"High","question":"Explain the CSS box model. What does box-sizing: border-box do?","question_html":"Explain the CSS box model. What does box-sizing: border-box do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Each element is content + padding + border + margin.</p>\n<ul class=\"q-points\"><li>With the default <code>content-box</code>, <code>width</code> sets only the content, so padding and border are added on top.</li><li>With <code>border-box</code>, <code>width</code> includes content, padding and border, which makes sizing predictable — most projects set it globally.</li></ul>\n"},{"id":790,"course_slug":"html-css","course_title":"HTML5 & CSS3 — Semantic Markup to Responsive Layouts","ord":3,"level":"Beginner","priority":"High","question":"What is CSS specificity? Which rule wins?","question_html":"What is CSS specificity? Which rule wins?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Specificity scores selectors as (ids, classes/attributes/pseudo-classes, elements);</p>\n<ul class=\"q-points\"><li>higher wins, inline styles beat selectors, <code>!important</code> beats normal declarations, and with equal specificity the later rule wins.</li><li>Example: <code>#nav a</code> (1,0,1) beats <code>.menu a.active</code> (0,2,1).</li><li>Keep specificity low with classes to avoid override wars.</li></ul>\n"},{"id":791,"course_slug":"html-css","course_title":"HTML5 & CSS3 — Semantic Markup to Responsive Layouts","ord":4,"level":"Beginner","priority":"High","question":"Flexbox vs Grid — when do you use each?","question_html":"Flexbox vs Grid — when do you use each?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Flexbox is one-dimensional (a row or a column), content-driven — nav bars, toolbars, centring, distributing items.</p>\n<ul class=\"q-points\"><li>Grid is two-dimensional (rows and columns together), container-driven — page layouts, card galleries, forms.</li><li>Often Grid for the overall layout and Flexbox inside components.</li></ul>\n"},{"id":792,"course_slug":"html-css","course_title":"HTML5 & CSS3 — Semantic Markup to Responsive Layouts","ord":5,"level":"Beginner","priority":"High","question":"How do you centre a div horizontally and vertically?","question_html":"How do you centre a div horizontally and vertically?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Flexbox: parent <code>display:flex; justify-content:center; align-items:center;</code>.</p>\n<ul class=\"q-points\"><li>Grid: parent <code>display:grid; place-items:center;</code>.</li><li>Horizontal only for a block with a width: <code>margin: 0 auto</code>.</li><li>Absolute: <code>position:absolute; inset:0; margin:auto;</code> with a set size, or <code>top:50%; left:50%; transform:translate(-50%,-50%)</code>.</li></ul>\n"},{"id":795,"course_slug":"html-css","course_title":"HTML5 & CSS3 — Semantic Markup to Responsive Layouts","ord":8,"level":"Intermediate","priority":"High","question":"How do you make a website responsive?","question_html":"How do you make a website responsive?","answer_html":"<p>Viewport meta tag, mobile-first CSS with <code>min-width</code> media queries, fluid layouts (Flexbox/Grid, <code>%</code>, <code>fr</code>, <code>minmax</code>, <code>clamp</code>), responsive images (<code>max-width:100%</code>, <code>srcset</code>, <code>&lt;picture&gt;</code>), relative units (<code>rem</code>), container queries for reusable components, testing on real devices and DevTools device mode, and avoiding fixed widths and horizontal scroll.</p>\n"},{"id":796,"course_slug":"html-css","course_title":"HTML5 & CSS3 — Semantic Markup to Responsive Layouts","ord":9,"level":"Intermediate","priority":"High","question":"What are media queries and container queries?","question_html":"What are media queries and container queries?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Media queries apply styles based on the viewport/device (<code>@media (min-width: 768px)</code>, <code>prefers-color-scheme</code>, <code>prefers-reduced-motion</code>, print).</p>\n<ul class=\"q-points\"><li>Container queries apply styles based on the size of a parent container (`container-type: inline-size;</li><li>@container (min-width: 400px)`), so a component adapts wherever it is placed — e.g. a card in a narrow sidebar vs a wide main area.</li></ul>\n"},{"id":797,"course_slug":"html-css","course_title":"HTML5 & CSS3 — Semantic Markup to Responsive Layouts","ord":10,"level":"Intermediate","priority":"High","question":"How do you make a web page accessible?","question_html":"How do you make a web page accessible?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Semantic HTML, labels for inputs, <code>alt</code> text, real buttons/links, keyboard navigation with visible focus, colour contrast ≥ 4.5:1, logical heading order, <code>lang</code> attribute, ARIA only where native HTML can&#39;t (live regions, expanded states), respect reduced motion, and test with Lighthouse/axe and a screen reader.</p>\n<ul class=\"q-points\"><li>Target WCAG 2.1/2.2 AA.</li></ul>\n"},{"id":803,"course_slug":"html-css","course_title":"HTML5 & CSS3 — Semantic Markup to Responsive Layouts","ord":16,"level":"Scenario","priority":"High","question":"The layout looks fine on desktop but has a horizontal scrollbar on mobile. How do you find and fix it?","question_html":"The layout looks fine on desktop but has a horizontal scrollbar on mobile. How do you find and fix it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use DevTools device mode and find the element wider than the viewport (temporarily <code>* { outline: 1px solid red }</code>, or check elements whose right edge exceeds the width).</p>\n<ul class=\"q-points\"><li>Usual causes: fixed widths (<code>width: 500px</code>), long unbroken text/URLs (<code>overflow-wrap: anywhere</code>), images without <code>max-width:100%</code>, <code>100vw</code> with a scrollbar, negative margins, tables and code blocks (wrap them in an <code>overflow-x:auto</code> container), and grid/flex children that can&#39;t shrink (<code>min-width: 0</code> on grid/flex items, <code>minmax(0, 1fr)</code>).</li></ul>\n"},{"id":793,"course_slug":"html-css","course_title":"HTML5 & CSS3 — Semantic Markup to Responsive Layouts","ord":6,"level":"Beginner","priority":"Medium","question":"Difference between display: none, visibility: hidden and opacity: 0?","question_html":"Difference between display: none, visibility: hidden and opacity: 0?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>display:none</code> removes the element from layout and the accessibility tree.</p>\n<ul class=\"q-points\"><li><code>visibility:hidden</code> hides it but keeps its space and it can&#39;t be clicked.</li><li><code>opacity:0</code> makes it transparent but it keeps its space and still receives clicks and focus.</li></ul>\n"},{"id":794,"course_slug":"html-css","course_title":"HTML5 & CSS3 — Semantic Markup to Responsive Layouts","ord":7,"level":"Beginner","priority":"Medium","question":"What are the different position values?","question_html":"What are the different position values?","answer_html":"<p><code>static</code> (default flow), <code>relative</code> (offset from its normal place, anchor for absolute children), <code>absolute</code> (out of flow, relative to nearest positioned ancestor), <code>fixed</code> (relative to the viewport), <code>sticky</code> (behaves relative until a scroll offset, then fixed within its container).</p>\n"},{"id":798,"course_slug":"html-css","course_title":"HTML5 & CSS3 — Semantic Markup to Responsive Layouts","ord":11,"level":"Intermediate","priority":"Medium","question":"What is the difference between em, rem, %, vw and px?","question_html":"What is the difference between em, rem, %, vw and px?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>px</code> is fixed;</p>\n<ul class=\"q-points\"><li><code>em</code> is relative to the element&#39;s/parent&#39;s font size (compounds when nested);</li><li><code>rem</code> is relative to the root font size (predictable, respects user font settings);</li><li><code>%</code> is relative to the parent dimension;</li><li><code>vw</code>/<code>vh</code> are 1% of the viewport width/height (<code>dvh</code> accounts for mobile browser bars).</li></ul>\n"},{"id":799,"course_slug":"html-css","course_title":"HTML5 & CSS3 — Semantic Markup to Responsive Layouts","ord":12,"level":"Intermediate","priority":"Medium","question":"CSS variables vs Sass variables?","question_html":"CSS variables vs Sass variables?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> CSS custom properties exist at runtime: they cascade and inherit, can be changed by media queries, classes or JavaScript — perfect for themes and dark mode.</p>\n<ul class=\"q-points\"><li>Sass variables are compile-time constants, replaced in the output CSS; useful for build-time logic (loops, mixins), but cannot change in the browser.</li></ul>\n"},{"id":800,"course_slug":"html-css","course_title":"HTML5 & CSS3 — Semantic Markup to Responsive Layouts","ord":13,"level":"Intermediate","priority":"Medium","question":"What is the critical rendering path and how do you optimise it?","question_html":"What is the critical rendering path and how do you optimise it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> HTML → DOM, CSS → CSSOM, combined into the render tree → layout → paint → composite.</p>\n<ul class=\"q-points\"><li>CSS blocks rendering and sync scripts block parsing.</li><li>Optimise: small/critical CSS first, <code>defer</code> scripts, preload key fonts/images, compress and size images, avoid layout shifts by setting dimensions, animate <code>transform</code>/<code>opacity</code>.</li></ul>\n"},{"id":801,"course_slug":"html-css","course_title":"HTML5 & CSS3 — Semantic Markup to Responsive Layouts","ord":14,"level":"Advanced","priority":"Medium","question":"What is a stacking context and why does z-index sometimes not work?","question_html":"What is a stacking context and why does z-index sometimes not work?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A stacking context is an isolated layering group; <code>z-index</code> only compares elements within the same context.</p>\n<ul class=\"q-points\"><li>New contexts are created by positioned elements with <code>z-index</code>, <code>opacity &lt; 1</code>, <code>transform</code>, <code>filter</code>, <code>isolation: isolate</code> and others.</li><li>A child with <code>z-index: 9999</code> can&#39;t escape a parent context that is below another element — fix the parent&#39;s stacking, not the child&#39;s number.</li></ul>\n"},{"id":802,"course_slug":"html-css","course_title":"HTML5 & CSS3 — Semantic Markup to Responsive Layouts","ord":15,"level":"Advanced","priority":"Medium","question":"What are Core Web Vitals?","question_html":"What are Core Web Vitals?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Google&#39;s user-experience metrics: LCP (Largest Contentful Paint — loading, good ≤ 2.5 s), INP (Interaction to Next Paint — responsiveness, good ≤ 200 ms;</p>\n<ul class=\"q-points\"><li>replaced FID in 2024) and CLS (Cumulative Layout Shift — visual stability, good ≤ 0.1).</li><li>Improve with optimised images and fonts, less JavaScript, and fixed dimensions for media and ads.</li></ul>\n"},{"id":804,"course_slug":"html-css","course_title":"HTML5 & CSS3 — Semantic Markup to Responsive Layouts","ord":17,"level":"Scenario","priority":"Medium","question":"A designer wants a card grid that shows 1 column on phones, 2 on tablets and 4 on desktop. Write the CSS.","question_html":"A designer wants a card grid that shows 1 column on phones, 2 on tablets and 4 on desktop. Write the CSS.","answer_html":"<div class=\"code-block\"><span class=\"code-lang\">css</span><button class=\"copy-btn\" type=\"button\" data-copy>Copy</button><pre><code class=\"hljs\"><span class=\"hljs-selector-class\">.cards</span> { <span class=\"hljs-attribute\">display</span>: grid; <span class=\"hljs-attribute\">gap</span>: <span class=\"hljs-number\">16px</span>; <span class=\"hljs-attribute\">grid-template-columns</span>: <span class=\"hljs-number\">1</span>fr; }\n<span class=\"hljs-keyword\">@media</span> (<span class=\"hljs-attribute\">min-width</span>: <span class=\"hljs-number\">640px</span>)  { <span class=\"hljs-selector-class\">.cards</span> { <span class=\"hljs-attribute\">grid-template-columns</span>: <span class=\"hljs-built_in\">repeat</span>(<span class=\"hljs-number\">2</span>, <span class=\"hljs-number\">1</span>fr); } }\n<span class=\"hljs-keyword\">@media</span> (<span class=\"hljs-attribute\">min-width</span>: <span class=\"hljs-number\">1100px</span>) { <span class=\"hljs-selector-class\">.cards</span> { <span class=\"hljs-attribute\">grid-template-columns</span>: <span class=\"hljs-built_in\">repeat</span>(<span class=\"hljs-number\">4</span>, <span class=\"hljs-number\">1</span>fr); } }</code></pre></div>\n<p>Or without breakpoints: <code>grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));</code> — columns appear as space allows.</p>\n"},{"id":805,"course_slug":"html-css","course_title":"HTML5 & CSS3 — Semantic Markup to Responsive Layouts","ord":18,"level":"Scenario","priority":"Medium","question":"Your page jumps around while loading (high CLS). What do you fix?","question_html":"Your page jumps around while loading (high CLS). What do you fix?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Set <code>width</code>/<code>height</code> (or <code>aspect-ratio</code>) on images, videos and iframes;</p>\n<ul class=\"q-points\"><li>reserve space for ads, banners and late-loading components (skeletons);</li><li>use <code>font-display: swap</code> with similar fallback fonts or <code>size-adjust</code>;</li><li>don&#39;t insert content above existing content after load;</li><li>animate with <code>transform</code> instead of changing layout properties.</li></ul>\n"},{"id":806,"course_slug":"javascript","course_title":"JavaScript (ES5 → ES2025) & TypeScript Basics","ord":1,"level":"Beginner","priority":"High","question":"What is the difference between == and ===?","question_html":"What is the difference between <code>==</code> and <code>===</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>===</code> (strict equality) compares type and value without conversion.</p>\n<ul class=\"q-points\"><li><code>==</code> (loose equality) converts operands to a common type first, which produces surprises (<code>&quot;&quot; == 0</code> is true, <code>null == undefined</code> is true, <code>[] == false</code> is true).</li><li>Always use <code>===</code> (except, by some style guides, <code>x == null</code> to check null or undefined).</li></ul>\n"},{"id":807,"course_slug":"javascript","course_title":"JavaScript (ES5 → ES2025) & TypeScript Basics","ord":2,"level":"Beginner","priority":"High","question":"What is the difference between var, let and const?","question_html":"What is the difference between <code>var</code>, <code>let</code> and <code>const</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>var</code> is function-scoped, hoisted and initialised as <code>undefined</code>, can be re-declared, and creates a property on the global object at top level.</p>\n<ul class=\"q-points\"><li><code>let</code> and <code>const</code> are block-scoped and hoisted but in the Temporal Dead Zone until their declaration (accessing them earlier throws).</li><li>Neither can be re-declared in the same scope.</li><li><code>const</code> can&#39;t be reassigned, but the object it references can still be mutated.</li><li>Default to <code>const</code>, use <code>let</code> when reassigning, avoid <code>var</code>.</li></ul>\n"},{"id":808,"course_slug":"javascript","course_title":"JavaScript (ES5 → ES2025) & TypeScript Basics","ord":3,"level":"Beginner","priority":"High","question":"What is hoisting?","question_html":"What is hoisting?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> During the creation phase of an execution context, declarations are registered before code runs.</p>\n<ul class=\"q-points\"><li><code>var</code> variables are hoisted and initialised to <code>undefined</code>.</li><li>Function declarations are hoisted with their body (callable before the line they appear on).</li><li><code>let</code>, <code>const</code> and <code>class</code> are hoisted but uninitialised (TDZ → ReferenceError if used early).</li><li>Function expressions and arrow functions follow the rules of the variable they&#39;re assigned to.</li></ul>\n"},{"id":809,"course_slug":"javascript","course_title":"JavaScript (ES5 → ES2025) & TypeScript Basics","ord":4,"level":"Beginner","priority":"High","question":"What are the primitive data types in JavaScript?","question_html":"What are the primitive data types in JavaScript?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>string</code>, <code>number</code>, <code>bigint</code>, <code>boolean</code>, <code>undefined</code>, <code>null</code> and <code>symbol</code>.</p>\n<ul class=\"q-points\"><li>They are immutable and compared by value.</li><li>Everything else (objects, arrays, functions, dates) is an object compared by reference.</li><li><code>typeof null</code> returns &quot;object&quot; due to a historical bug.</li></ul>\n"},{"id":810,"course_slug":"javascript","course_title":"JavaScript (ES5 → ES2025) & TypeScript Basics","ord":5,"level":"Beginner","priority":"High","question":"What is the difference between null and undefined?","question_html":"What is the difference between <code>null</code> and <code>undefined</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>undefined</code> means a variable has been declared but not assigned, a missing property, or a function with no return value — set by the engine.</p>\n<ul class=\"q-points\"><li><code>null</code> is an intentional &quot;no value&quot; assigned by the programmer.</li><li><code>typeof undefined</code> is &quot;undefined&quot;, <code>typeof null</code> is &quot;object&quot;; <code>null == undefined</code> is true but <code>null === undefined</code> is false.</li><li><code>??</code> and <code>?.</code> treat both as nullish.</li></ul>\n"},{"id":811,"course_slug":"javascript","course_title":"JavaScript (ES5 → ES2025) & TypeScript Basics","ord":6,"level":"Beginner","priority":"High","question":"What are arrow functions and how are they different from regular functions?","question_html":"What are arrow functions and how are they different from regular functions?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A concise function syntax (<code>x =&gt; x * 2</code>).</p>\n<ul class=\"q-points\"><li>Differences: no own <code>this</code> (lexically inherited — great for callbacks), no <code>arguments</code> object, can&#39;t be used as constructors with <code>new</code>, no <code>prototype</code>, and implicit return for single expressions.</li><li>Don&#39;t use them as object methods or prototype methods that need dynamic <code>this</code>.</li></ul>\n"},{"id":812,"course_slug":"javascript","course_title":"JavaScript (ES5 → ES2025) & TypeScript Basics","ord":7,"level":"Intermediate","priority":"High","question":"What is a closure? Give a practical example.","question_html":"What is a closure? Give a practical example.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A closure is a function that remembers the variables from the scope where it was created, even after that scope has finished executing.</p>\n<ul class=\"q-points\"><li>Example: <code>function counter() { let c = 0; return () =&gt; ++c; }</code> — each returned function has its own private <code>c</code>.</li><li>Practical uses: data privacy, function factories, memoisation caches, debounce/throttle timers, partial application, event handlers capturing loop values (with <code>let</code>).</li></ul>\n"},{"id":813,"course_slug":"javascript","course_title":"JavaScript (ES5 → ES2025) & TypeScript Basics","ord":8,"level":"Intermediate","priority":"High","question":"Explain the event loop.","question_html":"Explain the event loop.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> JavaScript executes on a single thread with a call stack.</p>\n<ul class=\"q-points\"><li>Asynchronous operations (timers, network, events) are handled by the browser/Node APIs, which queue callbacks when done.</li><li>When the call stack is empty, the event loop first runs <strong>all microtasks</strong> (promise reactions, <code>queueMicrotask</code>), then (in browsers) lets rendering happen, then picks the next <strong>macrotask</strong> (setTimeout, I/O, UI events).</li><li>That&#39;s why a resolved promise&#39;s <code>.then</code> runs before a <code>setTimeout(..., 0)</code> callback.</li></ul>\n"},{"id":814,"course_slug":"javascript","course_title":"JavaScript (ES5 → ES2025) & TypeScript Basics","ord":9,"level":"Intermediate","priority":"High","question":"What is a Promise? Explain Promise.all, allSettled, race and any.","question_html":"What is a Promise? Explain Promise.all, allSettled, race and any.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A Promise represents the eventual result of an asynchronous operation, in state pending, fulfilled or rejected; <code>.then/.catch/.finally</code> register reactions.</p>\n<ul class=\"q-points\"><li><code>Promise.all</code> waits for all and rejects on the first failure.</li><li><code>allSettled</code> waits for all and returns each outcome.</li><li><code>race</code> settles with the first settled promise (success or failure).</li><li><code>any</code> fulfils with the first success and rejects with AggregateError only if all fail.</li></ul>\n"},{"id":815,"course_slug":"javascript","course_title":"JavaScript (ES5 → ES2025) & TypeScript Basics","ord":10,"level":"Intermediate","priority":"High","question":"How does this work in JavaScript?","question_html":"How does <code>this</code> work in JavaScript?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> It depends on the call site: method call → the object before the dot;</p>\n<ul class=\"q-points\"><li>plain function call → <code>undefined</code> in strict mode (global object otherwise);</li><li>constructor with <code>new</code> → the new instance;</li><li><code>call/apply/bind</code> → explicitly set;</li><li>event listeners with regular functions → the element;</li><li>arrow functions → <code>this</code> of the enclosing lexical scope.</li><li>Losing <code>this</code> when passing methods as callbacks is fixed with <code>bind</code> or arrow functions.</li></ul>\n"},{"id":816,"course_slug":"javascript","course_title":"JavaScript (ES5 → ES2025) & TypeScript Basics","ord":11,"level":"Intermediate","priority":"High","question":"What is the difference between call, apply and bind?","question_html":"What is the difference between <code>call</code>, <code>apply</code> and <code>bind</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> All set <code>this</code> explicitly.</p>\n<ul class=\"q-points\"><li><code>call(thisArg, a, b)</code> invokes immediately with individual arguments.</li><li><code>apply(thisArg, [a, b])</code> invokes immediately with an array of arguments.</li><li><code>bind(thisArg, a)</code> doesn&#39;t invoke — it returns a new function with <code>this</code> (and optionally leading arguments) permanently bound, useful for callbacks and event handlers.</li></ul>\n"},{"id":817,"course_slug":"javascript","course_title":"JavaScript (ES5 → ES2025) & TypeScript Basics","ord":12,"level":"Intermediate","priority":"High","question":"What is prototypal inheritance?","question_html":"What is prototypal inheritance?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Objects inherit directly from other objects through the internal <code>[[Prototype]]</code> link.</p>\n<ul class=\"q-points\"><li>When a property isn&#39;t found on an object, the engine looks up its prototype chain.</li><li>Constructor functions share methods via <code>Constructor.prototype</code>;</li><li><code>Object.create(proto)</code> creates objects with a chosen prototype;</li><li>ES6 <code>class</code>/<code>extends</code> is syntax over the same mechanism (<code>Dog.prototype.__proto__ === Animal.prototype</code>).</li></ul>\n"},{"id":818,"course_slug":"javascript","course_title":"JavaScript (ES5 → ES2025) & TypeScript Basics","ord":13,"level":"Intermediate","priority":"High","question":"What is event delegation and why use it?","question_html":"What is event delegation and why use it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Attaching a single event listener to a common ancestor instead of each child, using event bubbling and <code>event.target</code> (often with <code>closest()</code>) to identify which child was interacted with.</p>\n<ul class=\"q-points\"><li>Benefits: fewer listeners (memory/performance), works for elements added later dynamically, simpler cleanup.</li><li>Note: some events don&#39;t bubble (<code>focus</code>, <code>blur</code> — use <code>focusin</code>/<code>focusout</code>).</li></ul>\n"},{"id":819,"course_slug":"javascript","course_title":"JavaScript (ES5 → ES2025) & TypeScript Basics","ord":14,"level":"Intermediate","priority":"High","question":"Debounce vs throttle — implement one.","question_html":"Debounce vs throttle — implement one.","answer_html":"<p>Debounce delays execution until calls stop for a given time (search-as-you-type, auto-save, resize end). Throttle guarantees execution at most once per interval (scroll position, mousemove, rate-limited API calls).</p>\n<div class=\"code-block\"><span class=\"code-lang\">js</span><button class=\"copy-btn\" type=\"button\" data-copy>Copy</button><pre><code class=\"hljs\"><span class=\"hljs-keyword\">const</span> <span class=\"hljs-title function_\">debounce</span> = (<span class=\"hljs-params\">fn, ms</span>) =&gt; { <span class=\"hljs-keyword\">let</span> t; <span class=\"hljs-keyword\">return</span> <span class=\"hljs-function\">(<span class=\"hljs-params\">...a</span>) =&gt;</span> { <span class=\"hljs-built_in\">clearTimeout</span>(t); t = <span class=\"hljs-built_in\">setTimeout</span>(<span class=\"hljs-function\">() =&gt;</span> <span class=\"hljs-title function_\">fn</span>(...a), ms); }; };\n<span class=\"hljs-keyword\">const</span> <span class=\"hljs-title function_\">throttle</span> = (<span class=\"hljs-params\">fn, ms</span>) =&gt; { <span class=\"hljs-keyword\">let</span> last = <span class=\"hljs-number\">0</span>; <span class=\"hljs-keyword\">return</span> <span class=\"hljs-function\">(<span class=\"hljs-params\">...a</span>) =&gt;</span> { <span class=\"hljs-keyword\">const</span> now = <span class=\"hljs-title class_\">Date</span>.<span class=\"hljs-title function_\">now</span>(); <span class=\"hljs-keyword\">if</span> (now - last &gt;= ms) { last = now; <span class=\"hljs-title function_\">fn</span>(...a); } }; };</code></pre></div>\n"},{"id":823,"course_slug":"javascript","course_title":"JavaScript (ES5 → ES2025) & TypeScript Basics","ord":18,"level":"Advanced","priority":"High","question":"What causes memory leaks in JavaScript and how do you find them?","question_html":"What causes memory leaks in JavaScript and how do you find them?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Unremoved event listeners and timers (<code>setInterval</code> never cleared), references to detached DOM nodes, accidental globals, closures capturing large objects, ever-growing caches/maps, and subscriptions not unsubscribed in SPA components.</p>\n<ul class=\"q-points\"><li>Find them with Chrome DevTools: Performance monitor (JS heap growing), Memory tab heap snapshots compared over time, &quot;Detached elements&quot; panel, and allocation timelines.</li><li>Fix with cleanup on unmount, <code>WeakMap</code>/<code>WeakRef</code> for metadata, and bounded caches.</li></ul>\n"},{"id":826,"course_slug":"javascript","course_title":"JavaScript (ES5 → ES2025) & TypeScript Basics","ord":21,"level":"Scenario","priority":"High","question":"A search box calls the API on every keystroke and floods the server. How do you fix it?","question_html":"A search box calls the API on every keystroke and floods the server. How do you fix it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Debounce the input (e.g. 300 ms) so the request fires only after typing pauses;</p>\n<ul class=\"q-points\"><li>ignore queries shorter than 2–3 characters;</li><li>cancel the previous in-flight request with <code>AbortController</code> so stale responses don&#39;t overwrite newer results (or track the latest request id);</li><li>cache recent results;</li><li>show a loading state.</li><li>On the server, add rate limiting and make the search endpoint efficient (indexes, paging).</li></ul>\n"},{"id":827,"course_slug":"javascript","course_title":"JavaScript (ES5 → ES2025) & TypeScript Basics","ord":22,"level":"Scenario","priority":"High","question":"A page becomes unresponsive while processing a 50 MB JSON file in the browser. What do you do?","question_html":"A page becomes unresponsive while processing a 50 MB JSON file in the browser. What do you do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The main thread is blocked by long synchronous work.</p>\n<ul class=\"q-points\"><li>Move parsing/processing into a <strong>Web Worker</strong> (postMessage the data or a File/Blob, return results);</li><li>stream the file with <code>ReadableStream</code> / process in chunks;</li><li>better, process it on the server and fetch paginated or aggregated results;</li><li>virtualise large lists when rendering;</li><li>show progress.</li><li>Measure with the DevTools Performance panel (long tasks).</li></ul>\n"},{"id":820,"course_slug":"javascript","course_title":"JavaScript (ES5 → ES2025) & TypeScript Basics","ord":15,"level":"Intermediate","priority":"Medium","question":"What is the difference between shallow copy and deep copy?","question_html":"What is the difference between shallow copy and deep copy?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A shallow copy duplicates top-level properties, but nested objects are still shared references (<code>{...obj}</code>, <code>Object.assign</code>, <code>arr.slice()</code>, <code>[...arr]</code>).</p>\n<ul class=\"q-points\"><li>A deep copy duplicates everything recursively: <code>structuredClone(obj)</code> (modern, handles Dates/Maps/cycles, not functions/DOM nodes), or <code>JSON.parse(JSON.stringify(obj))</code> (loses Dates, undefined, functions, Infinity), or lodash <code>cloneDeep</code>.</li></ul>\n"},{"id":821,"course_slug":"javascript","course_title":"JavaScript (ES5 → ES2025) & TypeScript Basics","ord":16,"level":"Intermediate","priority":"Medium","question":"What is the difference between map, forEach, filter and reduce?","question_html":"What is the difference between <code>map</code>, <code>forEach</code>, <code>filter</code> and <code>reduce</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>forEach</code> iterates for side effects and returns <code>undefined</code>.</p>\n<ul class=\"q-points\"><li><code>map</code> returns a new array of the same length with transformed items.</li><li><code>filter</code> returns a new array with items that pass a test.</li><li><code>reduce</code> accumulates the array into a single value (sum, object, grouped map).</li><li>None of them mutate the original array (unless your callback does).</li><li><code>forEach</code> can&#39;t be stopped early — use <code>for...of</code> with <code>break</code>, or <code>some</code>/<code>find</code>.</li></ul>\n"},{"id":822,"course_slug":"javascript","course_title":"JavaScript (ES5 → ES2025) & TypeScript Basics","ord":17,"level":"Intermediate","priority":"Medium","question":"What are async and defer on script tags?","question_html":"What are <code>async</code> and <code>defer</code> on script tags?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Both download the script without blocking HTML parsing.</p>\n<ul class=\"q-points\"><li><code>async</code> executes as soon as it&#39;s downloaded — order not guaranteed, may run before the DOM is complete (good for independent scripts like analytics).</li><li><code>defer</code> executes after parsing finishes, in document order, before DOMContentLoaded (good for app scripts).</li><li>Module scripts are deferred by default.</li></ul>\n"},{"id":824,"course_slug":"javascript","course_title":"JavaScript (ES5 → ES2025) & TypeScript Basics","ord":19,"level":"Advanced","priority":"Medium","question":"What is the output of this code and why? for (var i=0;i<3;i++){ setTimeout(()=>console.log(i),0) }","question_html":"What is the output of this code and why? <code>for (var i=0;i&lt;3;i++){ setTimeout(()=&gt;console.log(i),0) }</code>","answer_html":"<p class=\"q-short\"><strong>In short:</strong> It prints <code>3 3 3</code>.</p>\n<ul class=\"q-points\"><li><code>var</code> is function-scoped, so all three callbacks close over the same <code>i</code>, and by the time the timers run (after the loop completes), <code>i</code> is 3.</li><li>Fixes: use <code>let</code> (a new binding per iteration → <code>0 1 2</code>), or an IIFE/<code>bind</code> to capture the current value.</li></ul>\n"},{"id":825,"course_slug":"javascript","course_title":"JavaScript (ES5 → ES2025) & TypeScript Basics","ord":20,"level":"Advanced","priority":"Medium","question":"What is the difference between interface and type in TypeScript?","question_html":"What is the difference between <code>interface</code> and <code>type</code> in TypeScript?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Both can describe object shapes and can be extended (interfaces via <code>extends</code>, types via intersections <code>&amp;</code>).</p>\n<ul class=\"q-points\"><li>Interfaces support declaration merging (re-opening to add members, used to augment library types) and give clearer error messages for object shapes.</li><li>Type aliases can represent anything: unions, tuples, primitives, mapped and conditional types.</li><li>Common guidance: interfaces for public object contracts, types for unions and type-level programming.</li></ul>\n"},{"id":828,"course_slug":"javascript","course_title":"JavaScript (ES5 → ES2025) & TypeScript Basics","ord":23,"level":"Scenario","priority":"Medium","question":"Users report the app gets slower the longer it's open. How do you investigate?","question_html":"Users report the app gets slower the longer it&#39;s open. How do you investigate?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Suspect a memory leak.</p>\n<ul class=\"q-points\"><li>Reproduce the flow repeatedly while taking heap snapshots in DevTools and comparing them (look for growing arrays, detached DOM nodes, listeners).</li><li>Check for intervals not cleared, event listeners/subscriptions not removed when views are destroyed, global caches growing unbounded, and large closures.</li><li>Fix cleanup paths (component unmount/destroy hooks), use <code>AbortController</code> to remove listeners, bound caches, and verify the heap stabilises.</li></ul>\n"},{"id":829,"course_slug":"javascript","course_title":"JavaScript (ES5 → ES2025) & TypeScript Basics","ord":24,"level":"Scenario","priority":"Medium","question":"You need to call 3 independent APIs and show the page when all are done, but still show partial data if one fails. How?","question_html":"You need to call 3 independent APIs and show the page when all are done, but still show partial data if one fails. How?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Start all requests in parallel and use <code>Promise.allSettled</code>, then render the fulfilled results and show an error placeholder for rejected ones.</p>\n<ul class=\"q-points\"><li>Add timeouts with <code>AbortSignal.timeout(ms)</code> so a slow API doesn&#39;t hang the page, and retry idempotent failures with backoff.</li><li>If any single failure must fail the whole page, use <code>Promise.all</code> instead.</li></ul>\n"},{"id":830,"course_slug":"typescript","course_title":"TypeScript — Types, Generics and Real-World Patterns","ord":1,"level":"Beginner","priority":"High","question":"What is TypeScript and why use it over JavaScript?","question_html":"What is TypeScript and why use it over JavaScript?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A typed superset of JavaScript that compiles to plain JavaScript.</p>\n<ul class=\"q-points\"><li>Static types catch errors at compile time, give IntelliSense and safe refactoring, document APIs and scale better for large teams.</li><li>Types are erased at runtime, so there is no runtime cost — and no runtime checking.</li></ul>\n"},{"id":831,"course_slug":"typescript","course_title":"TypeScript — Types, Generics and Real-World Patterns","ord":2,"level":"Beginner","priority":"High","question":"What is the difference between interface and type?","question_html":"What is the difference between interface and type?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Both describe object shapes.</p>\n<ul class=\"q-points\"><li><code>type</code> can also name unions, intersections, tuples, primitives and mapped/conditional types;</li><li><code>interface</code> supports declaration merging and <code>extends</code>, and is often preferred for public object contracts.</li><li>Interfaces can&#39;t express unions; types can&#39;t be reopened.</li></ul>\n"},{"id":832,"course_slug":"typescript","course_title":"TypeScript — Types, Generics and Real-World Patterns","ord":3,"level":"Beginner","priority":"High","question":"any vs unknown vs never?","question_html":"any vs unknown vs never?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>any</code> disables type checking for that value (errors pass silently).</p>\n<ul class=\"q-points\"><li><code>unknown</code> accepts any value but must be narrowed (typeof/guards/schema) before use — the safe choice for external data and <code>catch</code> errors.</li><li><code>never</code> represents values that never occur — functions that always throw, or the impossible branch in an exhaustive switch.</li></ul>\n"},{"id":833,"course_slug":"typescript","course_title":"TypeScript — Types, Generics and Real-World Patterns","ord":4,"level":"Beginner","priority":"High","question":"What are union types and how do you narrow them?","question_html":"What are union types and how do you narrow them?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A union <code>A | B</code> means the value is one of several types.</p>\n<ul class=\"q-points\"><li>Narrow with <code>typeof</code>, <code>instanceof</code>, <code>in</code>, equality on a discriminant property (<code>kind</code>), truthiness, or custom type guards (<code>x is T</code>) so TypeScript knows which member you have in each branch.</li></ul>\n"},{"id":835,"course_slug":"typescript","course_title":"TypeScript — Types, Generics and Real-World Patterns","ord":6,"level":"Intermediate","priority":"High","question":"What are generics? Give an example.","question_html":"What are generics? Give an example.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Type parameters that make code reusable while keeping types: <code>function first&lt;T&gt;(xs: T[]): T | undefined</code>.</p>\n<ul class=\"q-points\"><li>With constraints (<code>T extends { id: number }</code>) and <code>keyof</code> (<code>K extends keyof T</code>) you get type-safe helpers such as <code>pluck(items, &quot;name&quot;)</code>.</li><li>Common built-ins: <code>Array&lt;T&gt;</code>, <code>Promise&lt;T&gt;</code>, <code>Record&lt;K,V&gt;</code>.</li></ul>\n"},{"id":836,"course_slug":"typescript","course_title":"TypeScript — Types, Generics and Real-World Patterns","ord":7,"level":"Intermediate","priority":"High","question":"Explain Partial, Pick, Omit and Record with use cases.","question_html":"Explain Partial, Pick, Omit and Record with use cases.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>Partial&lt;T&gt;</code> makes all props optional (update/PATCH payloads).</p>\n<ul class=\"q-points\"><li><code>Pick&lt;T,K&gt;</code> keeps chosen keys (summary DTO).</li><li><code>Omit&lt;T,K&gt;</code> removes keys (create payload without <code>id</code>).</li><li><code>Record&lt;K,V&gt;</code> builds an object type with keys K (lookup tables like <code>Record&lt;Status, string&gt;</code>).</li></ul>\n"},{"id":837,"course_slug":"typescript","course_title":"TypeScript — Types, Generics and Real-World Patterns","ord":8,"level":"Intermediate","priority":"High","question":"What does strict mode enable and why should it be on?","question_html":"What does strict mode enable and why should it be on?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>strict: true</code> enables <code>noImplicitAny</code>, <code>strictNullChecks</code>, <code>strictFunctionTypes</code>, <code>strictBindCallApply</code>, <code>strictPropertyInitialization</code>, <code>alwaysStrict</code>, <code>useUnknownInCatchVariables</code> and others.</p>\n<ul class=\"q-points\"><li>It catches the most common bugs — especially null/undefined access.</li><li>New projects should always use it; legacy projects can turn flags on gradually.</li></ul>\n"},{"id":838,"course_slug":"typescript","course_title":"TypeScript — Types, Generics and Real-World Patterns","ord":9,"level":"Intermediate","priority":"High","question":"What is a discriminated union?","question_html":"What is a discriminated union?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A union of object types that share a literal &quot;tag&quot; property (<code>kind</code>, <code>type</code>, <code>status</code>).</p>\n<ul class=\"q-points\"><li>Switching on the tag narrows to the exact member, and a <code>never</code> check in <code>default</code> makes the switch exhaustive — adding a new member produces compile errors wherever it isn&#39;t handled.</li><li>Ideal for state (<code>{ status: &quot;loading&quot; } | { status: &quot;error&quot;; error: string } | { status: &quot;ok&quot;; data: T }</code>) and Redux/NgRx actions.</li></ul>\n"},{"id":843,"course_slug":"typescript","course_title":"TypeScript — Types, Generics and Real-World Patterns","ord":14,"level":"Scenario","priority":"High","question":"The API returned a different JSON shape and the app crashed even though it compiled. Why, and how do you prevent it?","question_html":"The API returned a different JSON shape and the app crashed even though it compiled. Why, and how do you prevent it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Types are erased at runtime; <code>http.get&lt;Order[]&gt;()</code> or <code>as Order[]</code> only told the compiler what to expect.</p>\n<ul class=\"q-points\"><li>Prevent: generate client types from the backend OpenAPI document in the build (so contract changes show up as compile errors), validate responses at the boundary with Zod/Valibot, version the API, and add contract/end-to-end tests.</li></ul>\n"},{"id":834,"course_slug":"typescript","course_title":"TypeScript — Types, Generics and Real-World Patterns","ord":5,"level":"Beginner","priority":"Medium","question":"What is type inference?","question_html":"What is type inference?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The compiler works out types without annotations: <code>let n = 5</code> is <code>number</code>, a function&#39;s return type comes from its <code>return</code> statements, generic arguments come from the values passed.</p>\n<ul class=\"q-points\"><li>Annotate function parameters and public APIs; let inference handle locals.</li></ul>\n"},{"id":839,"course_slug":"typescript","course_title":"TypeScript — Types, Generics and Real-World Patterns","ord":10,"level":"Intermediate","priority":"Medium","question":"What is the difference between as (type assertion) and satisfies?","question_html":"What is the difference between <code>as</code> (type assertion) and <code>satisfies</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>as T</code> tells the compiler &quot;trust me, it&#39;s T&quot; — no runtime check and it can hide mistakes.</p>\n<ul class=\"q-points\"><li><code>satisfies T</code> checks that a value matches T but keeps the more precise inferred type, so you get validation without losing literal types.</li><li>Prefer <code>satisfies</code> for config objects and avoid <code>as</code> except at well-validated boundaries.</li></ul>\n"},{"id":840,"course_slug":"typescript","course_title":"TypeScript — Types, Generics and Real-World Patterns","ord":11,"level":"Intermediate","priority":"Medium","question":"What are declaration files (.d.ts)?","question_html":"What are declaration files (.d.ts)?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Files containing only type declarations that describe JavaScript code — they let TypeScript type-check calls into JS libraries.</p>\n<ul class=\"q-points\"><li>Libraries ship their own (<code>&quot;types&quot;</code> in package.json) or come from DefinitelyTyped (<code>npm i -D @types/lodash</code>).</li><li>You can write <code>declare module &quot;x&quot;</code> or augment globals (e.g. <code>Window</code>) in your own <code>.d.ts</code>.</li></ul>\n"},{"id":841,"course_slug":"typescript","course_title":"TypeScript — Types, Generics and Real-World Patterns","ord":12,"level":"Advanced","priority":"Medium","question":"What are mapped and conditional types?","question_html":"What are mapped and conditional types?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Mapped types transform each property of another type: <code>{ [K in keyof T]: Readonly&lt;T[K]&gt; }</code> (with <code>as</code> to rename keys).</p>\n<ul class=\"q-points\"><li>Conditional types choose a type by condition: `T extends U ?</li><li>X : Y<code>, with </code>infer<code> to extract parts (</code>T extends Promise<infer R> ?</li><li>R : T`).</li><li>Built-in utilities like <code>Partial</code>, <code>ReturnType</code> and <code>Awaited</code> are implemented with them.</li></ul>\n"},{"id":842,"course_slug":"typescript","course_title":"TypeScript — Types, Generics and Real-World Patterns","ord":13,"level":"Advanced","priority":"Medium","question":"Structural vs nominal typing — what does TypeScript use?","question_html":"Structural vs nominal typing — what does TypeScript use?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Structural: types are compatible if their shapes match, regardless of names, so <code>{ id: 1, name: &quot;x&quot; }</code> is assignable to any interface with those members.</p>\n<ul class=\"q-points\"><li>C# and Java are nominal.</li><li>To simulate nominal types (e.g. <code>UserId</code> vs <code>OrderId</code> both numbers), use branded types: <code>type UserId = number &amp; { readonly __brand: &quot;UserId&quot; }</code>.</li></ul>\n"},{"id":844,"course_slug":"typescript","course_title":"TypeScript — Types, Generics and Real-World Patterns","ord":15,"level":"Scenario","priority":"Medium","question":"You are migrating a large JavaScript project to TypeScript. How do you do it?","question_html":"You are migrating a large JavaScript project to TypeScript. How do you do it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Incrementally: add <code>tsconfig</code> with <code>allowJs</code> and <code>checkJs</code> off, rename files to <code>.ts</code> module by module starting from leaves (utilities, models), add <code>@types</code> packages, use <code>any</code>/<code>unknown</code> temporarily with TODOs, then turn on <code>strict</code> flags one by one (<code>noImplicitAny</code>, then <code>strictNullChecks</code>).</p>\n<ul class=\"q-points\"><li>Add type-checking (<code>tsc --noEmit</code>) to CI so coverage only grows.</li></ul>\n"},{"id":845,"course_slug":"typescript","course_title":"TypeScript — Types, Generics and Real-World Patterns","ord":16,"level":"Scenario","priority":"Medium","question":"Write a type-safe function that groups an array by a key.","question_html":"Write a type-safe function that groups an array by a key.","answer_html":"<div class=\"code-block\"><span class=\"code-lang\">typescript</span><button class=\"copy-btn\" type=\"button\" data-copy>Copy</button><pre><code class=\"hljs\"><span class=\"hljs-keyword\">function</span> groupBy&lt;T, K <span class=\"hljs-keyword\">extends</span> <span class=\"hljs-title class_\">PropertyKey</span>&gt;(<span class=\"hljs-attr\">items</span>: T[], <span class=\"hljs-attr\">key</span>: <span class=\"hljs-function\">(<span class=\"hljs-params\"><span class=\"hljs-attr\">item</span>: T</span>) =&gt;</span> K): <span class=\"hljs-title class_\">Record</span>&lt;K, T[]&gt; {\n  <span class=\"hljs-keyword\">return</span> items.<span class=\"hljs-title function_\">reduce</span>(<span class=\"hljs-function\">(<span class=\"hljs-params\">acc, item</span>) =&gt;</span> {\n    <span class=\"hljs-keyword\">const</span> k = <span class=\"hljs-title function_\">key</span>(item);\n    (acc[k] ??= []).<span class=\"hljs-title function_\">push</span>(item);\n    <span class=\"hljs-keyword\">return</span> acc;\n  }, {} <span class=\"hljs-keyword\">as</span> <span class=\"hljs-title class_\">Record</span>&lt;K, T[]&gt;);\n}\n<span class=\"hljs-keyword\">const</span> byStatus = <span class=\"hljs-title function_\">groupBy</span>(orders, <span class=\"hljs-function\"><span class=\"hljs-params\">o</span> =&gt;</span> o.<span class=\"hljs-property\">status</span>);   <span class=\"hljs-comment\">// Record&lt;OrderStatus, Order[]&gt;</span></code></pre></div>\n<p>(Modern runtimes also have <code>Object.groupBy(items, fn)</code> from ES2024.)</p>\n"},{"id":846,"course_slug":"nodejs","course_title":"Node.js — Runtime Internals, Express, APIs and SQL Server","ord":1,"level":"Beginner","priority":"High","question":"What is Node.js and why is it fast for I/O-heavy apps?","question_html":"What is Node.js and why is it fast for I/O-heavy apps?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A JavaScript runtime built on Chrome&#39;s V8 engine and libuv.</p>\n<ul class=\"q-points\"><li>It runs your JavaScript on a single main thread with an event loop and performs I/O (network, disk) asynchronously, so while one request waits for the database the thread serves other requests.</li><li>Without thread-per-request overhead it handles many concurrent connections efficiently — ideal for APIs, proxies and real-time apps.</li></ul>\n"},{"id":847,"course_slug":"nodejs","course_title":"Node.js — Runtime Internals, Express, APIs and SQL Server","ord":2,"level":"Beginner","priority":"High","question":"Explain the event loop in Node.js.","question_html":"Explain the event loop in Node.js.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The event loop is libuv&#39;s loop that repeatedly checks for completed work and runs callbacks on the main thread in phases: timers (setTimeout/setInterval), pending callbacks, poll (I/O events), check (setImmediate), close callbacks.</p>\n<ul class=\"q-points\"><li>Between callbacks Node drains the <code>process.nextTick</code> queue and then the promise microtask queue.</li><li>Blocking the loop with long synchronous code delays every other request.</li></ul>\n"},{"id":848,"course_slug":"nodejs","course_title":"Node.js — Runtime Internals, Express, APIs and SQL Server","ord":3,"level":"Beginner","priority":"High","question":"Is Node.js single-threaded?","question_html":"Is Node.js single-threaded?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Your JavaScript runs on one main thread, but Node itself is not: libuv uses a thread pool (default 4) for file system, DNS lookup, crypto and compression, and the OS handles network I/O asynchronously.</p>\n<ul class=\"q-points\"><li>You can also use worker threads for CPU-heavy JavaScript and the cluster module or multiple containers to use all CPU cores.</li></ul>\n"},{"id":849,"course_slug":"nodejs","course_title":"Node.js — Runtime Internals, Express, APIs and SQL Server","ord":4,"level":"Beginner","priority":"High","question":"What is the difference between CommonJS and ES modules?","question_html":"What is the difference between CommonJS and ES modules?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> CommonJS uses <code>require()</code>/<code>module.exports</code>, loads synchronously at runtime and was Node&#39;s original system.</p>\n<ul class=\"q-points\"><li>ES modules use <code>import</code>/<code>export</code>, are statically analysable (tree-shaking), support top-level await and are the JavaScript standard — enabled with <code>.mjs</code> or <code>&quot;type&quot;: &quot;module&quot;</code>.</li><li>Modern Node supports both and recent versions can <code>require()</code> ES modules.</li></ul>\n"},{"id":850,"course_slug":"nodejs","course_title":"Node.js — Runtime Internals, Express, APIs and SQL Server","ord":5,"level":"Beginner","priority":"High","question":"What is middleware in Express?","question_html":"What is middleware in Express?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A function <code>(req, res, next)</code> in the request pipeline that can read/modify the request and response, end the response, or call <code>next()</code> to pass control on.</p>\n<ul class=\"q-points\"><li>Used for logging, parsing bodies, authentication, CORS, validation and error handling (error middleware has four parameters <code>(err, req, res, next)</code>).</li><li>Middleware runs in the order it&#39;s registered.</li></ul>\n"},{"id":852,"course_slug":"nodejs","course_title":"Node.js — Runtime Internals, Express, APIs and SQL Server","ord":7,"level":"Intermediate","priority":"High","question":"process.nextTick vs setImmediate vs setTimeout(fn, 0)?","question_html":"process.nextTick vs setImmediate vs setTimeout(fn, 0)?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>process.nextTick</code> callbacks run immediately after the current operation, before promise microtasks and before the event loop continues.</p>\n<ul class=\"q-points\"><li><code>setTimeout(fn, 0)</code> runs in the timers phase of a later loop iteration (minimum ~1 ms).</li><li><code>setImmediate</code> runs in the check phase right after the poll phase.</li><li>Inside an I/O callback, setImmediate always fires before a zero timeout.</li><li>Overusing nextTick can starve I/O.</li></ul>\n"},{"id":853,"course_slug":"nodejs","course_title":"Node.js — Runtime Internals, Express, APIs and SQL Server","ord":8,"level":"Intermediate","priority":"High","question":"How do you handle errors in async Node.js code?","question_html":"How do you handle errors in async Node.js code?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use <code>try/catch</code> around <code>await</code>, <code>.catch()</code> on promises, and error-first callbacks for callback APIs.</p>\n<ul class=\"q-points\"><li>In Express 5 rejected async handlers reach the error middleware automatically (Express 4: wrap or use express-async-errors).</li><li>Add a central error middleware, log <code>unhandledRejection</code> and <code>uncaughtException</code> (then exit and let the process manager restart), validate input to avoid predictable errors, and never swallow errors silently.</li></ul>\n"},{"id":854,"course_slug":"nodejs","course_title":"Node.js — Runtime Internals, Express, APIs and SQL Server","ord":9,"level":"Intermediate","priority":"High","question":"How do you connect Node.js to SQL Server?","question_html":"How do you connect Node.js to SQL Server?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use the <code>mssql</code> package (tedious driver): create one <code>ConnectionPool</code> at startup with server, database, credentials and <code>encrypt: true</code>, then run parameterised queries with <code>request().input(...).query(...)</code>, stored procedures with <code>.execute()</code>, and transactions with <code>sql.Transaction</code>.</p>\n<ul class=\"q-points\"><li>Alternatives: Prisma (<code>provider = &quot;sqlserver&quot;</code>) or Sequelize/TypeORM.</li><li>Keep credentials in environment variables or use Entra ID authentication for Azure SQL.</li></ul>\n"},{"id":855,"course_slug":"nodejs","course_title":"Node.js — Runtime Internals, Express, APIs and SQL Server","ord":10,"level":"Intermediate","priority":"High","question":"What are streams and why are they useful?","question_html":"What are streams and why are they useful?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Objects for reading or writing data in chunks (Readable, Writable, Duplex, Transform).</p>\n<ul class=\"q-points\"><li>They keep memory constant for large files or responses, start delivering data before everything is loaded, and handle backpressure.</li><li>Use <code>stream.pipeline</code> to connect streams with proper error handling — e.g. read a CSV, gzip it, write it to the HTTP response.</li></ul>\n"},{"id":858,"course_slug":"nodejs","course_title":"Node.js — Runtime Internals, Express, APIs and SQL Server","ord":13,"level":"Advanced","priority":"High","question":"What causes event-loop blocking and how do you detect and fix it?","question_html":"What causes event-loop blocking and how do you detect and fix it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Long synchronous operations: big loops, synchronous fs/crypto (<code>readFileSync</code>, <code>pbkdf2Sync</code>), huge <code>JSON.parse/stringify</code>, regex catastrophes, sorting large arrays per request.</p>\n<ul class=\"q-points\"><li>Detect with event-loop lag metrics (<code>perf_hooks.monitorEventLoopDelay</code>), clinic.js, profiling with <code>--inspect</code>/<code>--prof</code>.</li><li>Fix by using async APIs, streaming, chunking work with <code>setImmediate</code>, moving CPU work to worker threads or another service, and caching results.</li></ul>\n"},{"id":861,"course_slug":"nodejs","course_title":"Node.js — Runtime Internals, Express, APIs and SQL Server","ord":16,"level":"Scenario","priority":"High","question":"Your Node API becomes very slow when a user uploads a large CSV for import. What's wrong and how do you fix it?","question_html":"Your Node API becomes very slow when a user uploads a large CSV for import. What&#39;s wrong and how do you fix it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The upload is probably read and parsed synchronously in memory (<code>readFileSync</code>, <code>JSON/CSV parse</code> of the whole file) on the main thread, blocking the event loop for all users.</p>\n<ul class=\"q-points\"><li>Stream the upload (multer/busboy to disk or Blob storage), parse it with a streaming CSV parser, insert in batches (bulk insert/TVP), and ideally move the import to a background job/queue with a worker, returning <code>202 Accepted</code> and a status endpoint.</li></ul>\n"},{"id":851,"course_slug":"nodejs","course_title":"Node.js — Runtime Internals, Express, APIs and SQL Server","ord":6,"level":"Beginner","priority":"Medium","question":"What are package.json, package-lock.json, dependencies and devDependencies?","question_html":"What are package.json, package-lock.json, dependencies and devDependencies?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>package.json</code> describes the project: name, scripts, engines, dependency ranges.</p>\n<ul class=\"q-points\"><li><code>package-lock.json</code> records the exact resolved versions of the whole dependency tree so installs are reproducible (<code>npm ci</code>).</li><li><code>dependencies</code> are needed at runtime in production; <code>devDependencies</code> only for development, testing and building.</li></ul>\n"},{"id":856,"course_slug":"nodejs","course_title":"Node.js — Runtime Internals, Express, APIs and SQL Server","ord":11,"level":"Intermediate","priority":"Medium","question":"What is the cluster module and how is it different from worker threads?","question_html":"What is the cluster module and how is it different from worker threads?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Cluster forks multiple Node processes (one per core) that share the same server port, each with its own event loop and memory — scaling a stateless HTTP server on one machine (PM2 does this).</p>\n<ul class=\"q-points\"><li>Worker threads run JavaScript in parallel threads inside one process (separate V8 isolates, can share memory via SharedArrayBuffer) — for CPU-heavy tasks without blocking the main event loop.</li></ul>\n"},{"id":857,"course_slug":"nodejs","course_title":"Node.js — Runtime Internals, Express, APIs and SQL Server","ord":12,"level":"Intermediate","priority":"Medium","question":"How do you secure an Express API?","question_html":"How do you secure an Express API?","answer_html":"<p>Helmet for security headers, strict CORS, HTTPS, input validation (zod/Joi), parameterised queries/ORM against injection, authentication (JWT/OAuth with libraries like passport or jose) and role checks, rate limiting, body size limits, password hashing (bcrypt/argon2), secrets in env/Key Vault, dependency scanning (<code>npm audit</code>, Dependabot), no stack traces in responses, and keeping Node and packages updated.</p>\n"},{"id":859,"course_slug":"nodejs","course_title":"Node.js — Runtime Internals, Express, APIs and SQL Server","ord":14,"level":"Advanced","priority":"Medium","question":"How do memory leaks happen in Node and how do you find them?","question_html":"How do memory leaks happen in Node and how do you find them?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Objects kept reachable: growing global arrays/maps used as caches without limits, event listeners added per request and never removed, closures capturing large data, timers not cleared, unclosed DB connections.</p>\n<ul class=\"q-points\"><li>Find them by watching heap usage over time, taking heap snapshots (<code>--inspect</code> + Chrome DevTools, <code>heapdump</code>) and comparing retained objects;</li><li>fix by bounding caches (LRU), removing listeners and cleaning up timers.</li></ul>\n"},{"id":860,"course_slug":"nodejs","course_title":"Node.js — Runtime Internals, Express, APIs and SQL Server","ord":15,"level":"Advanced","priority":"Medium","question":"Node.js vs ASP.NET Core — when would you choose each?","question_html":"Node.js vs ASP.NET Core — when would you choose each?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Node.js: JavaScript/TypeScript across front and back end, huge npm ecosystem, great for I/O-heavy APIs, real-time apps, BFFs and serverless functions, fast prototyping.</p>\n<ul class=\"q-points\"><li>ASP.NET Core: strong typing and tooling by default, true multithreading for CPU-heavy work, rich built-in framework (DI, auth, EF Core), excellent performance and long-term support — common in enterprises with SQL Server/Azure.</li><li>Choose based on team skills, workload and ecosystem.</li></ul>\n"},{"id":862,"course_slug":"nodejs","course_title":"Node.js — Runtime Internals, Express, APIs and SQL Server","ord":17,"level":"Scenario","priority":"Medium","question":"The production Node process crashes occasionally with \"UnhandledPromiseRejection\". What do you do?","question_html":"The production Node process crashes occasionally with &quot;UnhandledPromiseRejection&quot;. What do you do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Find the promise without <code>await</code>/<code>.catch</code> from the stack trace and logs;</p>\n<ul class=\"q-points\"><li>fix it by awaiting or handling the error;</li><li>add a global <code>process.on(&#39;unhandledRejection&#39;)</code> handler that logs (then exits for safety), run under a process manager (PM2/containers) that restarts the app, and add lint rules (<code>@typescript-eslint/no-floating-promises</code>) to prevent new ones.</li></ul>\n"},{"id":863,"course_slug":"jquery","course_title":"jQuery","ord":1,"level":"Beginner","priority":"High","question":"What is jQuery and why was it popular?","question_html":"What is jQuery and why was it popular?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A fast, small JavaScript library that simplifies HTML DOM traversal and manipulation, event handling, animation and AJAX with a concise, chainable API that worked consistently across browsers (especially old IE).</p>\n<ul class=\"q-points\"><li>It also had a large plugin ecosystem.</li><li>Modern browsers now offer standard APIs (<code>querySelector</code>, <code>fetch</code>, <code>classList</code>), so new projects often don&#39;t need it, but many existing apps still do.</li></ul>\n"},{"id":864,"course_slug":"jquery","course_title":"jQuery","ord":2,"level":"Beginner","priority":"High","question":"What is the difference between $(document).ready() and window.onload?","question_html":"What is the difference between <code>$(document).ready()</code> and <code>window.onload</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>$(document).ready()</code> (or <code>$(fn)</code>) runs as soon as the DOM is parsed and ready to manipulate, before images and stylesheets finish loading;</p>\n<ul class=\"q-points\"><li>you can have many ready handlers.</li><li><code>window.onload</code> (or <code>$(window).on(&quot;load&quot;)</code>) waits until all resources, including images and iframes, have loaded — later.</li><li>Use ready for DOM setup, load for things needing image dimensions.</li></ul>\n"},{"id":865,"course_slug":"jquery","course_title":"jQuery","ord":3,"level":"Beginner","priority":"High","question":"What is the $ sign in jQuery? What does noConflict do?","question_html":"What is the <code>$</code> sign in jQuery? What does <code>noConflict</code> do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>$</code> is an alias for the <code>jQuery</code> function, used to select elements, create elements and run code on DOM ready.</p>\n<ul class=\"q-points\"><li>Other libraries (old Prototype.js) also use <code>$</code>;</li><li><code>jQuery.noConflict()</code> releases <code>$</code> back to them, and you can use <code>jQuery(...)</code> or wrap your code in <code>(function ($) { ... })(jQuery)</code> to keep using <code>$</code> locally.</li></ul>\n"},{"id":866,"course_slug":"jquery","course_title":"jQuery","ord":4,"level":"Beginner","priority":"High","question":"What is the difference between .text(), .html() and .val()?","question_html":"What is the difference between <code>.text()</code>, <code>.html()</code> and <code>.val()</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>.text()</code> gets/sets the text content (HTML-escaped, safe for user input).</p>\n<ul class=\"q-points\"><li><code>.html()</code> gets/sets inner HTML (parses markup — XSS risk with untrusted data).</li><li><code>.val()</code> gets/sets the value of form elements (input, select, textarea).</li></ul>\n"},{"id":868,"course_slug":"jquery","course_title":"jQuery","ord":6,"level":"Intermediate","priority":"High","question":"What is the difference between .on(), .bind(), .live() and .delegate()?","question_html":"What is the difference between <code>.on()</code>, <code>.bind()</code>, <code>.live()</code> and <code>.delegate()</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>.bind()</code> attached handlers directly to existing elements;</p>\n<ul class=\"q-points\"><li><code>.live()</code> attached to the document for current and future elements (removed in 1.9, slow);</li><li><code>.delegate()</code> attached to a chosen ancestor for matching descendants.</li><li><code>.on()</code> (1.7+) unified all of them: <code>.on(&quot;click&quot;, handler)</code> for direct binding and <code>.on(&quot;click&quot;, &quot;.child&quot;, handler)</code> for delegation.</li><li>Use <code>.on()</code>/<code>.off()</code> only.</li></ul>\n"},{"id":869,"course_slug":"jquery","course_title":"jQuery","ord":7,"level":"Intermediate","priority":"High","question":"What is event delegation in jQuery and why use it?","question_html":"What is event delegation in jQuery and why use it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Binding a handler to a static ancestor with a selector argument — <code>$(&quot;#table&quot;).on(&quot;click&quot;, &quot;.delete&quot;, fn)</code> — so events bubbling from matching descendants are handled.</p>\n<ul class=\"q-points\"><li>It works for elements added dynamically after binding (e.g. rows inserted via AJAX) and uses one handler instead of hundreds.</li></ul>\n"},{"id":870,"course_slug":"jquery","course_title":"jQuery","ord":8,"level":"Intermediate","priority":"High","question":"What is the difference between .attr() and .prop()?","question_html":"What is the difference between <code>.attr()</code> and <code>.prop()</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>.attr()</code> works with HTML attributes as written in markup (initial values, strings).</p>\n<ul class=\"q-points\"><li><code>.prop()</code> works with DOM properties reflecting the current state (booleans like <code>checked</code>, <code>disabled</code>, <code>selected</code>).</li><li>E.g. after a user ticks a checkbox, <code>.prop(&quot;checked&quot;)</code> is <code>true</code> but <code>.attr(&quot;checked&quot;)</code> may still be undefined.</li><li>Use <code>.prop</code> for boolean state since jQuery 1.6.</li></ul>\n"},{"id":871,"course_slug":"jquery","course_title":"jQuery","ord":9,"level":"Intermediate","priority":"High","question":"How do you make AJAX calls with jQuery? What are deferreds?","question_html":"How do you make AJAX calls with jQuery? What are deferreds?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>$.ajax({ url, method, data, contentType, dataType })</code> or shortcuts <code>$.get</code>, <code>$.post</code>, <code>$.getJSON</code>, <code>.load()</code>.</p>\n<ul class=\"q-points\"><li>They return jqXHR objects implementing the Deferred/Promise interface: chain <code>.done()</code>, <code>.fail()</code>, <code>.always()</code>, <code>.then()</code>, and combine with <code>$.when()</code> for parallel calls.</li><li>Since 3.0 deferreds are Promises/A+ compatible, so they can be awaited.</li><li>For ASP.NET Core POSTs, send the antiforgery token in a header.</li></ul>\n"},{"id":876,"course_slug":"jquery","course_title":"jQuery","ord":14,"level":"Scenario","priority":"High","question":"Click handlers don't work for table rows added after an AJAX refresh. Why and how to fix?","question_html":"Click handlers don&#39;t work for table rows added after an AJAX refresh. Why and how to fix?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The handlers were bound directly (<code>$(&quot;.delete&quot;).on(&quot;click&quot;, ...)</code>) to rows existing at bind time; new rows don&#39;t have them.</p>\n<ul class=\"q-points\"><li>Use delegation on a static container: <code>$(&quot;#ordersTable&quot;).on(&quot;click&quot;, &quot;.delete&quot;, handler)</code> — or rebind after each refresh (worse).</li><li>Make sure the container itself isn&#39;t replaced by the AJAX refresh.</li></ul>\n"},{"id":877,"course_slug":"jquery","course_title":"jQuery","ord":15,"level":"Scenario","priority":"High","question":"An old site uses jQuery 1.11 and a security scan flags XSS vulnerabilities. What do you do?","question_html":"An old site uses jQuery 1.11 and a security scan flags XSS vulnerabilities. What do you do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Upgrade to the latest jQuery 3.x/4.x (3.5+ fixed the <code>htmlPrefilter</code> XSS issues), using jQuery Migrate in development to find deprecated API usage and fix it (e.g. <code>.size()</code>, <code>.bind()</code>, <code>.success()</code> callbacks);</p>\n<ul class=\"q-points\"><li>update plugins to compatible versions;</li><li>review code that passes user data into <code>.html()</code>, <code>.append()</code> with strings or <code>$(userInput)</code> and switch to <code>.text()</code>/element creation;</li><li>add a Content-Security-Policy;</li><li>retest the UI.</li></ul>\n"},{"id":867,"course_slug":"jquery","course_title":"jQuery","ord":5,"level":"Beginner","priority":"Medium","question":"What is method chaining?","question_html":"What is method chaining?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Most jQuery methods return the same jQuery object, so you can call multiple methods in sequence on one selection: <code>$(&quot;#box&quot;).addClass(&quot;active&quot;).fadeIn(200).text(&quot;Hello&quot;)</code>.</p>\n<ul class=\"q-points\"><li>It avoids repeated DOM queries and keeps code concise.</li><li>Getter methods (like <code>.text()</code> with no args) return values and end the chain.</li></ul>\n"},{"id":872,"course_slug":"jquery","course_title":"jQuery","ord":10,"level":"Intermediate","priority":"Medium","question":"What is the difference between .remove(), .detach() and .empty()?","question_html":"What is the difference between <code>.remove()</code>, <code>.detach()</code> and <code>.empty()</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>.remove()</code> removes the elements and their jQuery data and event handlers.</p>\n<ul class=\"q-points\"><li><code>.detach()</code> removes elements but keeps data and handlers so they can be re-inserted later.</li><li><code>.empty()</code> removes only the child nodes of the selected elements, keeping the elements themselves.</li></ul>\n"},{"id":873,"course_slug":"jquery","course_title":"jQuery","ord":11,"level":"Intermediate","priority":"Medium","question":"How do you write a jQuery plugin?","question_html":"How do you write a jQuery plugin?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Add a function to <code>$.fn</code> (jQuery.prototype), merge default options with <code>$.extend</code>, iterate with <code>this.each()</code> and return <code>this</code> so it&#39;s chainable, and wrap it in an IIFE receiving <code>jQuery</code> as <code>$</code> to avoid conflicts: `(function($){ $.fn.myPlugin = function(opts){ const s = $.extend({}, defaults, opts);</p>\n<ul class=\"q-points\"><li>return this.each(function(){ /* ...</li><li>*/ }); }; })(jQuery);`.</li></ul>\n"},{"id":874,"course_slug":"jquery","course_title":"jQuery","ord":12,"level":"Advanced","priority":"Medium","question":"How do you re-enable unobtrusive validation for a form loaded via AJAX?","question_html":"How do you re-enable unobtrusive validation for a form loaded via AJAX?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The unobtrusive adapter parses forms only on page load.</p>\n<ul class=\"q-points\"><li>After inserting new HTML, remove the cached validator data and re-parse: `$form.removeData(&quot;validator&quot;).removeData(&quot;unobtrusiveValidation&quot;);</li><li>$.validator.unobtrusive.parse($form);`.</li><li>Then call <code>$form.valid()</code> before submitting.</li></ul>\n"},{"id":875,"course_slug":"jquery","course_title":"jQuery","ord":13,"level":"Advanced","priority":"Medium","question":"Should a new project use jQuery? How would you migrate away from it?","question_html":"Should a new project use jQuery? How would you migrate away from it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Usually not: modern browsers have standard equivalents (querySelector, classList, fetch, closest, dataset, CSS transitions), and frameworks provide components and state management. jQuery is still reasonable for small enhancements on server-rendered pages or when a needed plugin depends on it.</p>\n<ul class=\"q-points\"><li>To migrate: upgrade with jQuery Migrate, freeze new jQuery usage via lint rules, replace utilities with native APIs, swap plugins, migrate UI screens to components incrementally, then remove the library.</li></ul>\n"},{"id":878,"course_slug":"jquery","course_title":"jQuery","ord":16,"level":"Scenario","priority":"Medium","question":"A page with 5,000 rows is slow when appending rows in a loop with $(\"#tbody\").append(...). How do you speed it up?","question_html":"A page with 5,000 rows is slow when appending rows in a loop with <code>$(&quot;#tbody&quot;).append(...)</code>. How do you speed it up?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Each <code>.append()</code> triggers DOM work and possibly layout.</p>\n<ul class=\"q-points\"><li>Build all rows as one HTML string (with escaped values) or a DocumentFragment and append once;</li><li>cache <code>$(&quot;#tbody&quot;)</code>;</li><li>detach the table during the build;</li><li>use event delegation instead of per-row handlers;</li><li>better yet, paginate or virtualise the table (DataTables with server-side processing) instead of rendering 5,000 rows.</li></ul>\n"},{"id":879,"course_slug":"angularjs","course_title":"AngularJS (1.x) — Legacy","ord":1,"level":"Beginner","priority":"High","question":"What is AngularJS and how is it different from Angular?","question_html":"What is AngularJS and how is it different from Angular?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> AngularJS (1.x, 2010) is a JavaScript MVC/MVVM framework using controllers, <code>$scope</code>, two-way binding through dirty-checking digest cycles and directives;</p>\n<ul class=\"q-points\"><li>it reached end of life on 31 Dec 2021.</li><li>Angular (2+, 2016) is a complete rewrite in TypeScript with components, a hierarchical DI system, RxJS, a CLI, AOT compilation, zone.js/signals-based change detection, mobile-friendly performance and regular releases.</li><li>There&#39;s no direct upgrade path; migration is a rewrite (often incremental with ngUpgrade).</li></ul>\n"},{"id":880,"course_slug":"angularjs","course_title":"AngularJS (1.x) — Legacy","ord":2,"level":"Beginner","priority":"High","question":"What is two-way data binding in AngularJS?","question_html":"What is two-way data binding in AngularJS?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Synchronisation between the model and the view in both directions: <code>ng-model</code> updates the scope when the user changes input, and any change to the scope model updates the view during the next digest cycle.</p>\n<ul class=\"q-points\"><li>It&#39;s implemented with watchers and dirty checking.</li><li>Convenient, but many two-way bindings slow down large apps.</li></ul>\n"},{"id":881,"course_slug":"angularjs","course_title":"AngularJS (1.x) — Legacy","ord":3,"level":"Beginner","priority":"High","question":"What are directives? Name some built-in ones.","question_html":"What are directives? Name some built-in ones.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Directives are markers on DOM elements (attributes, elements, classes, comments) that tell the AngularJS compiler to attach behaviour or transform the DOM.</p>\n<ul class=\"q-points\"><li>Built-in: <code>ng-app</code>, <code>ng-controller</code>, <code>ng-model</code>, <code>ng-bind</code>, <code>ng-repeat</code>, <code>ng-if</code>, <code>ng-show/ng-hide</code>, <code>ng-click</code>, <code>ng-class</code>, <code>ng-include</code>, <code>ng-switch</code>, <code>ng-options</code>, <code>ng-submit</code>.</li><li>You can write custom directives and components.</li></ul>\n"},{"id":882,"course_slug":"angularjs","course_title":"AngularJS (1.x) — Legacy","ord":4,"level":"Beginner","priority":"High","question":"What is $scope? What is $rootScope?","question_html":"What is $scope? What is $rootScope?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>$scope</code> is the object that glues a controller to its view — properties and functions on it are available in the template.</p>\n<ul class=\"q-points\"><li>Scopes form a hierarchy mirroring the DOM, with prototypal inheritance (child scopes from <code>ng-repeat</code>, <code>ng-if</code>, <code>ng-include</code>).</li><li><code>$rootScope</code> is the top-level scope of the app; every other scope descends from it.</li><li>Avoid storing state on <code>$rootScope</code> — use services.</li></ul>\n"},{"id":884,"course_slug":"angularjs","course_title":"AngularJS (1.x) — Legacy","ord":6,"level":"Intermediate","priority":"High","question":"What is the difference between service, factory and provider?","question_html":"What is the difference between service, factory and provider?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> All produce injectable singletons.</p>\n<ul class=\"q-points\"><li>A <strong>factory</strong> is a function whose returned value is the service.</li><li>A <strong>service</strong> is a constructor function instantiated with <code>new</code> (methods on <code>this</code>).</li><li>A <strong>provider</strong> is the most configurable: an object with a <code>$get</code> method, plus configuration methods available in <code>config()</code> blocks before the app runs (factory and service are shorthands built on providers).</li><li>Constants are injectable in config; values are not.</li></ul>\n"},{"id":885,"course_slug":"angularjs","course_title":"AngularJS (1.x) — Legacy","ord":7,"level":"Intermediate","priority":"High","question":"Explain the digest cycle. When do you need $apply?","question_html":"Explain the digest cycle. When do you need $apply?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> When something inside AngularJS&#39;s context happens (ng-click, $http, $timeout), AngularJS calls <code>$apply</code> → <code>$digest</code>, which dirty-checks all watchers, runs listeners for changed values, and repeats until nothing changes (max 10 loops), then the view reflects the model.</p>\n<ul class=\"q-points\"><li>If you change the model outside AngularJS (native <code>setTimeout</code>, jQuery plugin callbacks, WebSocket events), AngularJS doesn&#39;t know, so wrap the change in <code>$scope.$apply()</code> (or use <code>$timeout</code>/<code>$applyAsync</code>).</li></ul>\n"},{"id":886,"course_slug":"angularjs","course_title":"AngularJS (1.x) — Legacy","ord":8,"level":"Intermediate","priority":"High","question":"How does dependency injection work in AngularJS? What breaks it during minification?","question_html":"How does dependency injection work in AngularJS? What breaks it during minification?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The <code>$injector</code> looks at a function&#39;s parameter names (or explicit annotations) and supplies registered services.</p>\n<ul class=\"q-points\"><li>Minification renames parameters (<code>$http</code> → <code>a</code>), so implicit DI breaks.</li><li>Fix with inline array annotation <code>[&quot;$http&quot;, function ($http) {}]</code>, the <code>$inject</code> property, build tools like ng-annotate, and enable <code>ng-strict-di</code> to catch missing annotations.</li></ul>\n"},{"id":890,"course_slug":"angularjs","course_title":"AngularJS (1.x) — Legacy","ord":12,"level":"Advanced","priority":"High","question":"How do you improve the performance of a slow AngularJS app?","question_html":"How do you improve the performance of a slow AngularJS app?","answer_html":"<p>Reduce the number of watchers (one-time bindings <code>::</code>, fewer two-way bindings, avoid deep <code>$watch</code>), use <code>track by</code> in <code>ng-repeat</code>, paginate or virtualise large lists, prefer <code>ng-if</code> for hidden heavy sections, move filters out of templates, debounce <code>ng-model</code> (<code>ng-model-options=&quot;{ debounce: 300 }&quot;</code>), use <code>$applyAsync</code> and <code>$httpProvider.useApplyAsync</code>, disable debug info in production, and profile digest time with DevTools.</p>\n"},{"id":891,"course_slug":"angularjs","course_title":"AngularJS (1.x) — Legacy","ord":13,"level":"Advanced","priority":"High","question":"How would you migrate a large AngularJS app to Angular?","question_html":"How would you migrate a large AngularJS app to Angular?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Prepare the codebase (latest 1.8, components with one-way bindings, controller-as, services instead of <code>$rootScope</code>, TypeScript, module bundler).</p>\n<ul class=\"q-points\"><li>Then create a hybrid app with <code>@angular/upgrade</code> (UpgradeModule): Angular bootstraps and boots AngularJS;</li><li>migrate leaf components and services first, downgrading Angular components for use in AngularJS templates and upgrading AngularJS services for Angular.</li><li>Move routes one by one (or split by routes behind a proxy), test continuously, and finally remove AngularJS.</li><li>Budget for the fact that AngularJS is EOL and has no security patches.</li></ul>\n"},{"id":892,"course_slug":"angularjs","course_title":"AngularJS (1.x) — Legacy","ord":14,"level":"Scenario","priority":"High","question":"You change a model value inside a jQuery datepicker callback but the view doesn't update. Why?","question_html":"You change a model value inside a jQuery datepicker callback but the view doesn&#39;t update. Why?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The callback runs outside AngularJS&#39;s digest, so no dirty check happens.</p>\n<ul class=\"q-points\"><li>Wrap the update in <code>$scope.$apply(() =&gt; vm.date = value)</code> (or <code>$scope.$applyAsync</code>), or better, wrap the datepicker in a custom directive that uses <code>ngModel.$setViewValue</code> inside <code>$apply</code>.</li><li>Avoid calling <code>$apply</code> when a digest is already in progress (<code>$digest already in progress</code> error) — <code>$applyAsync</code> or <code>$timeout</code> avoids that.</li></ul>\n"},{"id":893,"course_slug":"angularjs","course_title":"AngularJS (1.x) — Legacy","ord":15,"level":"Scenario","priority":"High","question":"An ng-repeat over 3,000 rows makes the page freeze on every keystroke in a search box. Fix it.","question_html":"An ng-repeat over 3,000 rows makes the page freeze on every keystroke in a search box. Fix it.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Each keystroke triggers a digest over thousands of watchers plus filter re-evaluation.</p>\n<ul class=\"q-points\"><li>Fixes: debounce the input with <code>ng-model-options=&quot;{ debounce: 300 }&quot;</code>;</li><li>filter in the controller once per change instead of a template filter;</li><li>add <code>track by row.id</code>;</li><li>use one-time bindings (<code>::</code>) for row fields that don&#39;t change;</li><li>paginate or virtualise (e.g. <code>ui-grid</code> or a virtual-repeat directive);</li><li>reduce per-row bindings and directives.</li></ul>\n"},{"id":883,"course_slug":"angularjs","course_title":"AngularJS (1.x) — Legacy","ord":5,"level":"Beginner","priority":"Medium","question":"What is the difference between ng-if and ng-show?","question_html":"What is the difference between ng-if and ng-show?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>ng-if</code> adds or removes the element (and creates/destroys its child scope and watchers) based on the condition.</p>\n<ul class=\"q-points\"><li><code>ng-show</code>/<code>ng-hide</code> keep the element in the DOM and toggle <code>display: none</code> via a CSS class, so its watchers remain active.</li><li>Use <code>ng-if</code> for heavy content that&#39;s rarely shown, <code>ng-show</code> for frequent toggling of light content.</li></ul>\n"},{"id":887,"course_slug":"angularjs","course_title":"AngularJS (1.x) — Legacy","ord":9,"level":"Intermediate","priority":"Medium","question":"What are the scope binding types in a component/directive (@, =, <, &)?","question_html":"What are the scope binding types in a component/directive (@, =, &lt;, &amp;)?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>@</code> — one-way string/interpolated attribute value.</p>\n<ul class=\"q-points\"><li><code>=</code> — two-way binding (expensive, avoid in components).</li><li><code>&lt;</code> — one-way binding of an expression (1.5+, preferred for inputs).</li><li><code>&amp;</code> — callback expression bound to the parent&#39;s function, used for outputs (<code>on-select=&quot;vm.open(id)&quot;</code> invoked as <code>$ctrl.onSelect({ id: 5 })</code>).</li></ul>\n"},{"id":888,"course_slug":"angularjs","course_title":"AngularJS (1.x) — Legacy","ord":10,"level":"Intermediate","priority":"Medium","question":"What is the difference between $emit and $broadcast?","question_html":"What is the difference between $emit and $broadcast?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Both dispatch scope events.</p>\n<ul class=\"q-points\"><li><code>$emit</code> sends an event <strong>upwards</strong> from the current scope through its parents to <code>$rootScope</code>.</li><li><code>$broadcast</code> sends it <strong>downwards</strong> to all child scopes.</li><li>Listen with <code>$on</code>.</li><li>Overusing events makes data flow hard to follow — prefer services or component bindings; always deregister <code>$rootScope.$on</code> listeners on <code>$destroy</code>.</li></ul>\n"},{"id":889,"course_slug":"angularjs","course_title":"AngularJS (1.x) — Legacy","ord":11,"level":"Intermediate","priority":"Medium","question":"What are filters? How do you create a custom filter?","question_html":"What are filters? How do you create a custom filter?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Filters format data in templates (<code>currency</code>, <code>date</code>, <code>uppercase</code>, <code>limitTo</code>, <code>orderBy</code>, <code>filter</code>, <code>json</code>, <code>number</code>) and can be chained with <code>|</code>.</p>\n<ul class=\"q-points\"><li>Create one with <code>module.filter(&quot;name&quot;, () =&gt; input =&gt; transformed)</code>.</li><li>Filters in templates execute on every digest, so keep them cheap.</li></ul>\n"},{"id":894,"course_slug":"angularjs","course_title":"AngularJS (1.x) — Legacy","ord":16,"level":"Scenario","priority":"Medium","question":"Your company still runs a business-critical AngularJS app. What risks do you raise and what plan do you propose?","question_html":"Your company still runs a business-critical AngularJS app. What risks do you raise and what plan do you propose?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Risks: no security patches since Dec 2021 (compliance/pen-test findings), dwindling developer pool, incompatible modern libraries, browser changes.</p>\n<ul class=\"q-points\"><li>Plan: short-term — upgrade to 1.8.3, add a strict Content-Security-Policy, review <code>$sce</code>/<code>ng-bind-html</code> usage, consider commercial extended support;</li><li>medium-term — incremental migration (Angular via ngUpgrade, or React/Vue via micro-frontends/route-by-route strangler), starting with the most-changed or riskiest screens;</li><li>keep feature parity tests (Playwright) as a safety net.</li></ul>\n"},{"id":895,"course_slug":"angular","course_title":"Angular (2 → 21)","ord":1,"level":"Beginner","priority":"High","question":"What is Angular and how is it different from AngularJS?","question_html":"What is Angular and how is it different from AngularJS?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Angular is a TypeScript-based, component-driven framework (2016+, by Google) with a CLI, hierarchical DI, RxJS, signals, a router, forms and HTTP modules, AOT compilation and SSR.</p>\n<ul class=\"q-points\"><li>AngularJS (1.x) used JavaScript, controllers and <code>$scope</code>, two-way binding with dirty-checking digest cycles, and reached EOL in Dec 2021.</li><li>Angular is faster, more modular, mobile-friendly, and has semver releases every six months.</li></ul>\n"},{"id":896,"course_slug":"angular","course_title":"Angular (2 → 21)","ord":2,"level":"Beginner","priority":"High","question":"What are components and what is a standalone component?","question_html":"What are components and what is a standalone component?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A component is a TypeScript class decorated with <code>@Component</code> that controls a piece of UI through its template and styles, with a selector used in other templates.</p>\n<ul class=\"q-points\"><li>A standalone component (v14+, default since v19) declares its own dependencies via <code>imports</code> without belonging to an NgModule, making apps simpler, enabling lazy loading per component, and reducing boilerplate.</li></ul>\n"},{"id":897,"course_slug":"angular","course_title":"Angular (2 → 21)","ord":3,"level":"Beginner","priority":"High","question":"Explain the types of data binding in Angular.","question_html":"Explain the types of data binding in Angular.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Interpolation <code>{{ }}</code> and property binding <code>[prop]=&quot;expr&quot;</code> (component → view), event binding <code>(event)=&quot;handler()&quot;</code> (view → component), and two-way binding <code>[(ngModel)]=&quot;value&quot;</code> (banana-in-a-box: property + event).</p>\n<ul class=\"q-points\"><li>Also attribute <code>[attr.x]</code>, class <code>[class.x]</code> and style <code>[style.x]</code> bindings.</li></ul>\n"},{"id":898,"course_slug":"angular","course_title":"Angular (2 → 21)","ord":4,"level":"Beginner","priority":"High","question":"What are directives? Types of directives?","question_html":"What are directives? Types of directives?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Classes that add behaviour to elements.</p>\n<ul class=\"q-points\"><li><strong>Components</strong> are directives with templates.</li><li><strong>Attribute directives</strong> change appearance/behaviour (<code>ngClass</code>, <code>ngStyle</code>, custom <code>appHighlight</code>).</li><li><strong>Structural directives</strong> change DOM layout by adding/removing elements (<code>*ngIf</code>, <code>*ngFor</code>, <code>*ngSwitch</code> — now largely replaced by built-in control flow <code>@if</code>, <code>@for</code>, <code>@switch</code>).</li></ul>\n"},{"id":899,"course_slug":"angular","course_title":"Angular (2 → 21)","ord":5,"level":"Beginner","priority":"High","question":"What are pipes? Pure vs impure?","question_html":"What are pipes? Pure vs impure?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Pipes transform values in templates (<code>date</code>, <code>currency</code>, <code>async</code>, custom).</p>\n<ul class=\"q-points\"><li>Pure pipes (default) run only when the input value/reference changes — efficient.</li><li>Impure pipes (<code>pure: false</code>) run on every change detection cycle — needed for detecting changes inside mutable objects/arrays, but expensive.</li><li><code>async</code> is impure because it tracks emissions.</li></ul>\n"},{"id":901,"course_slug":"angular","course_title":"Angular (2 → 21)","ord":7,"level":"Intermediate","priority":"High","question":"Explain the component lifecycle hooks.","question_html":"Explain the component lifecycle hooks.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>ngOnChanges</code> (input changes, before init), <code>ngOnInit</code> (once, initialise/fetch data), <code>ngDoCheck</code> (each CD cycle), <code>ngAfterContentInit</code>/<code>ngAfterContentChecked</code> (projected content), <code>ngAfterViewInit</code>/<code>ngAfterViewChecked</code> (view and child views, <code>@ViewChild</code> ready), <code>ngOnDestroy</code> (cleanup).</p>\n<ul class=\"q-points\"><li>The constructor is for DI only.</li><li>Modern code often uses signal inputs/<code>computed</code> instead of <code>ngOnChanges</code>, <code>afterNextRender</code> for DOM work and <code>DestroyRef</code>/<code>takeUntilDestroyed</code> for cleanup.</li></ul>\n"},{"id":902,"course_slug":"angular","course_title":"Angular (2 → 21)","ord":8,"level":"Intermediate","priority":"High","question":"What is dependency injection in Angular? What does providedIn: 'root' mean?","question_html":"What is dependency injection in Angular? What does <code>providedIn: &#39;root&#39;</code> mean?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> DI supplies a class&#39;s dependencies from injectors instead of the class creating them.</p>\n<ul class=\"q-points\"><li>Services are registered with providers; consumers use <code>inject(Service)</code> or constructor parameters.</li><li><code>@Injectable({ providedIn: &#39;root&#39; })</code> registers a tree-shakable application-wide singleton.</li><li>Providers can also be scoped to routes or components (new instance per component).</li><li>Injectors are hierarchical: lookup goes from the element injector up to the root/environment injector.</li></ul>\n"},{"id":903,"course_slug":"angular","course_title":"Angular (2 → 21)","ord":9,"level":"Intermediate","priority":"High","question":"Observable vs Promise?","question_html":"Observable vs Promise?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A Promise handles a single future value, is eager (starts immediately), and isn&#39;t cancellable.</p>\n<ul class=\"q-points\"><li>An Observable can emit many values over time, is lazy (runs on subscribe), cancellable (unsubscribe), and composable with operators (map, switchMap, debounceTime, retry).</li><li>Angular uses Observables for HttpClient, router events, forms valueChanges; convert with <code>firstValueFrom</code>/<code>toSignal</code> when convenient.</li></ul>\n"},{"id":904,"course_slug":"angular","course_title":"Angular (2 → 21)","ord":10,"level":"Intermediate","priority":"High","question":"switchMap vs mergeMap vs concatMap vs exhaustMap?","question_html":"switchMap vs mergeMap vs concatMap vs exhaustMap?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> All map each source value to an inner observable and flatten.</p>\n<ul class=\"q-points\"><li><code>switchMap</code> cancels the previous inner observable when a new value arrives (typeahead search, route param changes).</li><li><code>mergeMap</code> runs all concurrently (parallel independent requests).</li><li><code>concatMap</code> queues them and runs one after another in order (sequential saves).</li><li><code>exhaustMap</code> ignores new values while the current inner observable is active (prevent duplicate login submissions).</li></ul>\n"},{"id":905,"course_slug":"angular","course_title":"Angular (2 → 21)","ord":11,"level":"Intermediate","priority":"High","question":"What are signals and why were they introduced?","question_html":"What are signals and why were they introduced?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Signals (v16+) are reactive primitives holding a value: <code>signal()</code> (writable), <code>computed()</code> (derived, memoised), <code>effect()</code> (side effects).</p>\n<ul class=\"q-points\"><li>Angular tracks which templates/computeds read which signals, so it knows exactly what changed and can update only affected components — enabling fine-grained, zoneless change detection, simpler state than RxJS for synchronous state, and better performance.</li><li>RxJS remains useful for async event streams; <code>toSignal</code>/<code>toObservable</code> bridge them.</li></ul>\n"},{"id":906,"course_slug":"angular","course_title":"Angular (2 → 21)","ord":12,"level":"Intermediate","priority":"High","question":"Template-driven vs reactive forms — which do you use?","question_html":"Template-driven vs reactive forms — which do you use?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Template-driven forms define the model in the template with <code>ngModel</code> and directive validators — quick for simple forms.</p>\n<ul class=\"q-points\"><li>Reactive forms define <code>FormGroup</code>/<code>FormControl</code>/<code>FormArray</code> in the component, are synchronous, strongly typed (v14+), easy to unit test, and ideal for complex, dynamic forms with custom/async validators.</li><li>Most enterprise apps use reactive forms; v21 previews signal-based forms.</li></ul>\n"},{"id":907,"course_slug":"angular","course_title":"Angular (2 → 21)","ord":13,"level":"Intermediate","priority":"High","question":"How do you implement route guards and lazy loading?","question_html":"How do you implement route guards and lazy loading?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Guards are functions (<code>CanActivateFn</code>, <code>CanMatchFn</code>, <code>CanDeactivateFn</code>, <code>ResolveFn</code>) listed on routes;</p>\n<ul class=\"q-points\"><li>they return boolean, UrlTree (redirect), or an observable/promise of those — e.g. <code>authGuard</code> redirects to /login.</li><li>Lazy loading uses <code>loadComponent: () =&gt; import(...)</code> or <code>loadChildren</code> so feature code is downloaded only when the route is visited, reducing the initial bundle;</li><li>preloading strategies can fetch them in the background.</li></ul>\n"},{"id":910,"course_slug":"angular","course_title":"Angular (2 → 21)","ord":16,"level":"Advanced","priority":"High","question":"Explain change detection. What does OnPush do? What is zoneless?","question_html":"Explain change detection. What does OnPush do? What is zoneless?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Change detection syncs component state to the DOM.</p>\n<ul class=\"q-points\"><li>With zone.js, Angular runs a check over the tree after any async event.</li><li><code>OnPush</code> limits checks of a component to when its input references change, an event happens inside it, an async pipe emits, a signal it reads changes, or <code>markForCheck()</code> is called — fewer checks, better performance, but requires immutable updates.</li><li>Zoneless mode (default for new apps in v21) removes zone.js entirely;</li><li>change detection is scheduled by signals, events and explicit notifications, which gives smaller bundles and more predictable updates.</li></ul>\n"},{"id":911,"course_slug":"angular","course_title":"Angular (2 → 21)","ord":17,"level":"Advanced","priority":"High","question":"How do you prevent memory leaks in Angular?","question_html":"How do you prevent memory leaks in Angular?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Unsubscribe from long-lived observables: prefer the <code>async</code> pipe or <code>toSignal</code>, use <code>takeUntilDestroyed()</code> (or <code>takeUntil</code> with a destroy subject), remove manual DOM listeners and timers in <code>ngOnDestroy</code>/<code>DestroyRef.onDestroy</code>, avoid storing component references in singleton services, and be careful with <code>effect()</code>s that create subscriptions.</p>\n<ul class=\"q-points\"><li>HttpClient requests complete on their own but still should be cancelled if the component is destroyed mid-request (switchMap/takeUntilDestroyed).</li></ul>\n"},{"id":914,"course_slug":"angular","course_title":"Angular (2 → 21)","ord":20,"level":"Scenario","priority":"High","question":"A list of 10,000 rows renders slowly and scrolling lags. How do you optimise?","question_html":"A list of 10,000 rows renders slowly and scrolling lags. How do you optimise?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use CDK virtual scrolling (<code>cdk-virtual-scroll-viewport</code>) so only visible rows are in the DOM;</p>\n<ul class=\"q-points\"><li><code>track item.id</code> in <code>@for</code>;</li><li><code>OnPush</code> row components with immutable inputs;</li><li>avoid function calls and impure pipes in row templates (use computed/pure pipes);</li><li>paginate or load incrementally from the API;</li><li>move heavy computations to a Web Worker;</li><li>and measure with Angular DevTools profiler.</li></ul>\n"},{"id":915,"course_slug":"angular","course_title":"Angular (2 → 21)","ord":21,"level":"Scenario","priority":"High","question":"Your search box sends a request on every keystroke and results sometimes appear out of order. Fix it.","question_html":"Your search box sends a request on every keystroke and results sometimes appear out of order. Fix it.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use a reactive control and RxJS: <code>valueChanges.pipe(debounceTime(300), distinctUntilChanged(), filter(t =&gt; t.length &gt;= 2), switchMap(t =&gt; this.api.search(t)))</code>.</p>\n<ul class=\"q-points\"><li><code>switchMap</code> cancels the previous HTTP request, so stale responses can&#39;t overwrite newer ones.</li><li>Show results with the <code>async</code> pipe or <code>toSignal</code>, and handle errors with <code>catchError</code> returning an empty list.</li></ul>\n"},{"id":916,"course_slug":"angular","course_title":"Angular (2 → 21)","ord":22,"level":"Scenario","priority":"High","question":"After login, some API calls still go out without the token, and expired tokens cause random 401s. How do you design auth handling?","question_html":"After login, some API calls still go out without the token, and expired tokens cause random 401s. How do you design auth handling?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Centralise it: an auth service storing the token (in memory/signal;</p>\n<ul class=\"q-points\"><li>refresh token in an HttpOnly cookie via the backend), a functional interceptor that adds the <code>Authorization</code> header to API requests, and on 401 attempts a single shared refresh (queue concurrent requests while refreshing using a shared observable), then retries;</li><li>if refresh fails, log out and redirect via a guard.</li><li>Protect routes with <code>canActivate</code>/<code>canMatch</code> guards; never rely on the frontend for real authorisation — the API must enforce it.</li></ul>\n"},{"id":900,"course_slug":"angular","course_title":"Angular (2 → 21)","ord":6,"level":"Beginner","priority":"Medium","question":"What is the Angular CLI? Name common commands.","question_html":"What is the Angular CLI? Name common commands.","answer_html":"<p>The official command-line tool to scaffold, develop, build, test and update Angular apps: <code>ng new</code>, <code>ng serve</code>, <code>ng generate component|service|pipe|guard|directive</code>, <code>ng build</code>, <code>ng test</code>, <code>ng e2e</code>, <code>ng add</code> (add libraries with schematics), <code>ng update</code> (automated migrations between versions), <code>ng lint</code> (with angular-eslint).</p>\n"},{"id":908,"course_slug":"angular","course_title":"Angular (2 → 21)","ord":14,"level":"Intermediate","priority":"Medium","question":"How do components communicate?","question_html":"How do components communicate?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Parent to child with inputs;</p>\n<ul class=\"q-points\"><li>child to parent with outputs (events);</li><li>two-way with <code>model()</code>;</li><li>parent to child methods via <code>viewChild</code>;</li><li>siblings/unrelated components through a shared injectable service holding signals or a BehaviorSubject;</li><li>app-wide via a store (NgRx);</li><li>and through the router (params, query params, state).</li></ul>\n"},{"id":909,"course_slug":"angular","course_title":"Angular (2 → 21)","ord":15,"level":"Intermediate","priority":"Medium","question":"What is an HTTP interceptor?","question_html":"What is an HTTP interceptor?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A function (<code>HttpInterceptorFn</code>) or class registered with <code>provideHttpClient(withInterceptors([...]))</code> that sees every outgoing request and incoming response.</p>\n<ul class=\"q-points\"><li>Uses: attaching auth tokens, adding headers, global error handling (401 redirect, toast), logging, loading spinners, caching, retrying.</li><li>Requests are immutable — use <code>req.clone()</code> to modify.</li></ul>\n"},{"id":912,"course_slug":"angular","course_title":"Angular (2 → 21)","ord":18,"level":"Advanced","priority":"Medium","question":"What is SSR and hydration in Angular?","question_html":"What is SSR and hydration in Angular?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Server-side rendering (<code>@angular/ssr</code>) renders pages on the server (or prerenders at build time) so users and search engines get HTML immediately.</p>\n<ul class=\"q-points\"><li>Hydration then reuses that DOM in the browser instead of re-rendering it (non-destructive hydration v16+), with event replay so early clicks aren&#39;t lost and incremental hydration (v19) to hydrate parts lazily with <code>@defer</code> triggers.</li><li>Watch for browser-only APIs (<code>window</code>, <code>localStorage</code>) — guard them with <code>isPlatformBrowser</code> or <code>afterNextRender</code>.</li></ul>\n"},{"id":913,"course_slug":"angular","course_title":"Angular (2 → 21)","ord":19,"level":"Advanced","priority":"Medium","question":"What is NgRx and when should you use it?","question_html":"What is NgRx and when should you use it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A Redux-style state management library: actions describe events, reducers produce new immutable state, the store holds a single state tree, selectors read memoised slices, effects handle side effects like HTTP.</p>\n<ul class=\"q-points\"><li>Use it for large apps with complex shared state, many teams, and a need for predictability, debugging (DevTools time travel) and strict patterns.</li><li>For small/medium apps, signal-based services or NgRx Signal Store are simpler.</li></ul>\n"},{"id":917,"course_slug":"angular","course_title":"Angular (2 → 21)","ord":23,"level":"Scenario","priority":"Medium","question":"You get \"ExpressionChangedAfterItHasBeenCheckedError\". What does it mean and how do you fix it?","question_html":"You get &quot;ExpressionChangedAfterItHasBeenCheckedError&quot;. What does it mean and how do you fix it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> In development mode Angular runs a second check after change detection;</p>\n<ul class=\"q-points\"><li>the error means a bound value changed between the first and second check — usually state modified in <code>ngAfterViewInit</code>/<code>ngAfterContentInit</code>, in a child that updates the parent during the same cycle, or a getter returning a new value each time.</li><li>Fix the data flow: initialise values earlier (<code>ngOnInit</code>), derive with <code>computed</code>, move updates into an event or the next tick only as a last resort, or restructure so children don&#39;t mutate parent state during rendering.</li></ul>\n"},{"id":918,"course_slug":"angular","course_title":"Angular (2 → 21)","ord":24,"level":"Scenario","priority":"Medium","question":"How would you upgrade an Angular 12 app to the latest version?","question_html":"How would you upgrade an Angular 12 app to the latest version?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Upgrade one major version at a time with <code>ng update @angular/core@13 @angular/cli@13</code> (and so on), following angular.dev/update-guide for each step;</p>\n<ul class=\"q-points\"><li>update Angular Material and third-party libraries alongside;</li><li>fix breaking changes and run tests after each hop;</li><li>along the way migrate to standalone components (<code>ng generate @angular/core:standalone</code>), built-in control flow (<code>ng generate @angular/core:control-flow</code>), signal inputs, the esbuild application builder, and functional guards/interceptors;</li><li>check Node and TypeScript version requirements.</li></ul>\n"},{"id":919,"course_slug":"react","course_title":"React (with Hooks, React 19 & Next.js basics)","ord":1,"level":"Beginner","priority":"High","question":"What is React and what are its main features?","question_html":"What is React and what are its main features?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> React is a JavaScript library (by Meta, 2013) for building user interfaces with reusable components.</p>\n<ul class=\"q-points\"><li>Features: declarative UI, component-based architecture, JSX, one-way data flow via props, state with hooks, efficient updates via reconciliation (virtual DOM diffing), a huge ecosystem, and React Native for mobile.</li><li>It focuses on the view layer; routing, data fetching and SSR come from libraries or frameworks like Next.js.</li></ul>\n"},{"id":920,"course_slug":"react","course_title":"React (with Hooks, React 19 & Next.js basics)","ord":2,"level":"Beginner","priority":"High","question":"What is JSX?","question_html":"What is JSX?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> JSX is a syntax extension that looks like HTML inside JavaScript.</p>\n<ul class=\"q-points\"><li>A compiler (Babel, SWC, esbuild) turns it into function calls (<code>jsx(&quot;div&quot;, props)</code> / <code>React.createElement</code>) that create React elements.</li><li>It supports embedding expressions in <code>{}</code>, uses <code>className</code>/camelCase attributes, and escapes values by default to prevent XSS.</li><li>It&#39;s optional but universal.</li></ul>\n"},{"id":921,"course_slug":"react","course_title":"React (with Hooks, React 19 & Next.js basics)","ord":3,"level":"Beginner","priority":"High","question":"What is the virtual DOM and reconciliation?","question_html":"What is the virtual DOM and reconciliation?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The virtual DOM is a lightweight in-memory tree of React elements describing the UI.</p>\n<ul class=\"q-points\"><li>On each render React creates a new tree, <strong>diffs</strong> it against the previous one (reconciliation) using heuristics — elements of a different type are replaced, same-type elements are updated, keys identify list items — and applies only the minimal changes to the real DOM in the commit phase.</li><li>Fiber (React 16+) made this work interruptible and prioritised.</li></ul>\n"},{"id":922,"course_slug":"react","course_title":"React (with Hooks, React 19 & Next.js basics)","ord":4,"level":"Beginner","priority":"High","question":"What is the difference between props and state?","question_html":"What is the difference between props and state?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Props are inputs passed from parent to child; they&#39;re read-only for the child.</p>\n<ul class=\"q-points\"><li>State is data owned and managed by a component (<code>useState</code>/<code>useReducer</code>) that changes over time and triggers re-renders when updated.</li><li>A parent&#39;s state often becomes a child&#39;s props.</li><li>Data flows down via props; children request changes via callback props.</li></ul>\n"},{"id":923,"course_slug":"react","course_title":"React (with Hooks, React 19 & Next.js basics)","ord":5,"level":"Beginner","priority":"High","question":"Why are keys important in lists?","question_html":"Why are keys important in lists?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Keys give each list item a stable identity so React can match elements between renders and update, move or remove the right DOM nodes and preserve component state.</p>\n<ul class=\"q-points\"><li>Without good keys (or with array indexes when the list changes order), React may reuse the wrong component instance, causing bugs like inputs showing the wrong values and unnecessary re-renders.</li><li>Use unique IDs from data; keys need to be unique only among siblings.</li></ul>\n"},{"id":925,"course_slug":"react","course_title":"React (with Hooks, React 19 & Next.js basics)","ord":7,"level":"Intermediate","priority":"High","question":"Explain useEffect and its dependency array. How do you clean up?","question_html":"Explain useEffect and its dependency array. How do you clean up?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>useEffect(fn, deps)</code> runs side effects (data fetching, subscriptions, timers, DOM APIs) after the component commits.</p>\n<ul class=\"q-points\"><li>With no deps it runs after every render; with <code>[]</code> once after mount; with <code>[a, b]</code> when those values change.</li><li>Return a cleanup function from the effect to unsubscribe, clear timers or abort fetches — React runs it before re-running the effect and on unmount.</li><li>Missing dependencies cause stale values; the ESLint hooks rule helps.</li></ul>\n"},{"id":926,"course_slug":"react","course_title":"React (with Hooks, React 19 & Next.js basics)","ord":8,"level":"Intermediate","priority":"High","question":"What are the Rules of Hooks and why do they exist?","question_html":"What are the Rules of Hooks and why do they exist?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Only call hooks at the top level of React function components or custom hooks — never inside loops, conditions, nested functions or after early returns — and only from React functions.</p>\n<ul class=\"q-points\"><li>React stores hook state in an ordered list per component and relies on the call order being identical on every render to match each <code>useState</code>/<code>useEffect</code> with its stored data.</li></ul>\n"},{"id":927,"course_slug":"react","course_title":"React (with Hooks, React 19 & Next.js basics)","ord":9,"level":"Intermediate","priority":"High","question":"useMemo vs useCallback vs React.memo?","question_html":"useMemo vs useCallback vs React.memo?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>useMemo(() =&gt; compute(a, b), [a, b])</code> caches the result of an expensive calculation.</p>\n<ul class=\"q-points\"><li><code>useCallback(fn, deps)</code> caches a function&#39;s identity so it doesn&#39;t change every render.</li><li><code>React.memo(Component)</code> skips re-rendering a component when its props are shallowly equal.</li><li>They work together: memoised child + stable callback/object props.</li><li>Use them where profiling shows a benefit; the React Compiler now automates most of this.</li></ul>\n"},{"id":928,"course_slug":"react","course_title":"React (with Hooks, React 19 & Next.js basics)","ord":10,"level":"Intermediate","priority":"High","question":"What is the Context API? When would you not use it?","question_html":"What is the Context API? When would you not use it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Context passes data through the component tree without prop drilling: <code>createContext</code>, a provider with a value, and <code>useContext</code> in consumers.</p>\n<ul class=\"q-points\"><li>It suits low-frequency global values (theme, auth user, locale, feature flags).</li><li>Avoid it for frequently changing, large global state, because every consumer re-renders on any change of the value — use a state library (Zustand, Redux Toolkit) or split contexts and memoise values.</li><li>It&#39;s not a replacement for server-state caching.</li></ul>\n"},{"id":929,"course_slug":"react","course_title":"React (with Hooks, React 19 & Next.js basics)","ord":11,"level":"Intermediate","priority":"High","question":"useState vs useReducer?","question_html":"useState vs useReducer?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>useState</code> is ideal for simple, independent values.</p>\n<ul class=\"q-points\"><li><code>useReducer</code> centralises complex state logic where the next state depends on the previous one and on multiple action types (forms with many fields, carts, wizards).</li><li>Its reducer is pure and easily testable, and <code>dispatch</code> is stable, which helps memoisation.</li><li>It often pairs with Context for small app-wide stores.</li></ul>\n"},{"id":930,"course_slug":"react","course_title":"React (with Hooks, React 19 & Next.js basics)","ord":12,"level":"Intermediate","priority":"High","question":"What is lifting state up?","question_html":"What is lifting state up?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> When two components need the same changing data, move the state to their closest common parent and pass it down as props, with callbacks for updates.</p>\n<ul class=\"q-points\"><li>This keeps a single source of truth.</li><li>If many layers are involved, consider composition (passing components as children), Context, or a store.</li></ul>\n"},{"id":933,"course_slug":"react","course_title":"React (with Hooks, React 19 & Next.js basics)","ord":15,"level":"Advanced","priority":"High","question":"How do you optimise the performance of a React application?","question_html":"How do you optimise the performance of a React application?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Profile with React DevTools;</p>\n<ul class=\"q-points\"><li>avoid unnecessary re-renders (state colocation, splitting components, <code>memo</code> with stable props or the React Compiler, splitting contexts);</li><li>virtualise long lists;</li><li>correct keys;</li><li>code-split routes and heavy components with <code>lazy</code>/Suspense;</li><li><code>useTransition</code>/<code>useDeferredValue</code> for heavy updates during typing;</li><li>cache server data with TanStack Query;</li><li>debounce inputs;</li><li>use SSR/Server Components to reduce client JS;</li><li>optimise images;</li><li>always ship production builds.</li></ul>\n"},{"id":934,"course_slug":"react","course_title":"React (with Hooks, React 19 & Next.js basics)","ord":16,"level":"Advanced","priority":"High","question":"What are React Server Components and how do they differ from SSR?","question_html":"What are React Server Components and how do they differ from SSR?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> SSR renders the whole component tree to HTML on the server per request, then ships all the component JS to hydrate it in the browser.</p>\n<ul class=\"q-points\"><li>Server Components are components that run only on the server (or at build time): they can access databases and secrets directly, and their code is never sent to the browser — only their rendered output (RSC payload).</li><li>Client Components (<code>&quot;use client&quot;</code>) are still hydrated for interactivity.</li><li>RSC and SSR are complementary — frameworks like Next.js use both.</li></ul>\n"},{"id":937,"course_slug":"react","course_title":"React (with Hooks, React 19 & Next.js basics)","ord":19,"level":"Scenario","priority":"High","question":"A dashboard with many widgets re-renders entirely when the user types in a search box. How do you fix it?","question_html":"A dashboard with many widgets re-renders entirely when the user types in a search box. How do you fix it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Find what re-renders with the Profiler.</p>\n<ul class=\"q-points\"><li>Usually the search state lives too high (in the page) so every widget re-renders.</li><li>Move the search state down into the search component or the part that uses it;</li><li>wrap expensive widgets in <code>memo</code> and pass stable props (or enable the React Compiler);</li><li>use <code>useDeferredValue</code> for the filtered results so typing stays responsive;</li><li>debounce the search before triggering data fetching;</li><li>split a big context into smaller ones.</li></ul>\n"},{"id":938,"course_slug":"react","course_title":"React (with Hooks, React 19 & Next.js basics)","ord":20,"level":"Scenario","priority":"High","question":"Fetching data in useEffect sometimes shows results for the previous user ID after switching quickly. Why and how to fix?","question_html":"Fetching data in useEffect sometimes shows results for the previous user ID after switching quickly. Why and how to fix?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Race condition: an older request resolves after a newer one and overwrites state.</p>\n<ul class=\"q-points\"><li>Fix by aborting the previous request in the effect cleanup (<code>AbortController</code>), or ignoring stale responses with a flag (`let ignore = false;</li><li>return () =&gt; { ignore = true }`).</li><li>Better: use TanStack Query/SWR or framework loaders, which key requests by parameters and handle caching, deduplication and races automatically.</li></ul>\n"},{"id":924,"course_slug":"react","course_title":"React (with Hooks, React 19 & Next.js basics)","ord":6,"level":"Beginner","priority":"Medium","question":"Controlled vs uncontrolled components?","question_html":"Controlled vs uncontrolled components?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> In a controlled component, form input values are driven by React state (<code>value</code> + <code>onChange</code>), giving React full control — instant validation, conditional disabling, formatting.</p>\n<ul class=\"q-points\"><li>In an uncontrolled component, the DOM keeps the value and you read it when needed via refs or <code>FormData</code> (<code>defaultValue</code>), which means less code and fewer re-renders (React Hook Form uses this approach).</li><li>File inputs are always uncontrolled.</li></ul>\n"},{"id":931,"course_slug":"react","course_title":"React (with Hooks, React 19 & Next.js basics)","ord":13,"level":"Intermediate","priority":"Medium","question":"What are custom hooks? Give an example.","question_html":"What are custom hooks? Give an example.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Functions starting with <code>use</code> that call other hooks to encapsulate reusable stateful logic — <code>useFetch(url)</code>, <code>useDebounce(value)</code>, <code>useLocalStorage(key)</code>, <code>useOnlineStatus()</code>.</p>\n<ul class=\"q-points\"><li>Each component that calls a custom hook gets its own independent state.</li><li>They replace older patterns like HOCs and render props for logic reuse.</li></ul>\n"},{"id":932,"course_slug":"react","course_title":"React (with Hooks, React 19 & Next.js basics)","ord":14,"level":"Intermediate","priority":"Medium","question":"What are error boundaries?","question_html":"What are error boundaries?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Components (currently class components implementing <code>getDerivedStateFromError</code>/<code>componentDidCatch</code>, or the <code>react-error-boundary</code> package) that catch JavaScript errors in their child component tree during rendering, lifecycle methods and constructors, show a fallback UI and log the error, instead of unmounting the whole app.</p>\n<ul class=\"q-points\"><li>They don&#39;t catch errors in event handlers, async code (setTimeout, promises outside rendering), SSR or themselves.</li></ul>\n"},{"id":935,"course_slug":"react","course_title":"React (with Hooks, React 19 & Next.js basics)","ord":17,"level":"Advanced","priority":"Medium","question":"What's new in React 18 and 19?","question_html":"What&#39;s new in React 18 and 19?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> React 18: concurrent rendering (interruptible rendering), <code>createRoot</code>, automatic batching of all state updates, transitions (<code>useTransition</code>, <code>startTransition</code>), <code>useDeferredValue</code>, <code>useId</code>, streaming SSR with Suspense.</p>\n<ul class=\"q-points\"><li>React 19: Actions (async functions in transitions and <code>&lt;form action&gt;</code>), <code>useActionState</code>, <code>useFormStatus</code>, <code>useOptimistic</code>, the <code>use()</code> API, <code>ref</code> as a prop (no <code>forwardRef</code>), <code>&lt;Context&gt;</code> as provider, document metadata tags, stable Server Components and Server Actions, and better hydration error messages.</li><li>19.2 added <code>&lt;Activity&gt;</code> and <code>useEffectEvent</code>.</li></ul>\n"},{"id":936,"course_slug":"react","course_title":"React (with Hooks, React 19 & Next.js basics)","ord":18,"level":"Advanced","priority":"Medium","question":"What causes infinite re-render loops and how do you fix them?","question_html":"What causes infinite re-render loops and how do you fix them?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Setting state during render unconditionally (<code>setCount(count + 1)</code> in the body), calling a handler instead of passing it (<code>onClick={handle()}</code>), or an effect that sets state which changes its own dependencies (objects/arrays/functions recreated each render in the dependency array).</p>\n<ul class=\"q-points\"><li>Fix by moving updates into event handlers, passing function references, computing derived values during render instead of in effects, memoising dependency objects or depending on primitive fields, and guarding effect updates with conditions.</li></ul>\n"},{"id":939,"course_slug":"react","course_title":"React (with Hooks, React 19 & Next.js basics)","ord":21,"level":"Scenario","priority":"Medium","question":"How would you structure a large React application?","question_html":"How would you structure a large React application?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Feature-based folders (<code>features/orders/{components,hooks,api,types}</code>) plus shared <code>components/ui</code>, <code>lib</code>, <code>hooks</code>;</p>\n<ul class=\"q-points\"><li>a framework (Next.js) or Vite + React Router;</li><li>TypeScript everywhere;</li><li>server state in TanStack Query (or framework loaders), minimal global client state in Zustand/Redux Toolkit;</li><li>a design system (Tailwind/shadcn or MUI);</li><li>forms with React Hook Form + Zod;</li><li>route-based code splitting;</li><li>testing with Vitest + RTL + MSW and Playwright;</li><li>ESLint (hooks rules) and Prettier;</li><li>Storybook for shared components;</li><li>CI with type checks, tests and bundle-size budgets.</li></ul>\n"},{"id":940,"course_slug":"react","course_title":"React (with Hooks, React 19 & Next.js basics)","ord":22,"level":"Scenario","priority":"Medium","question":"A modal rendered inside a card is cut off by overflow: hidden on the card. How do you fix it in React?","question_html":"A modal rendered inside a card is cut off by <code>overflow: hidden</code> on the card. How do you fix it in React?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Render the modal with a <strong>portal</strong> (<code>createPortal(&lt;Modal /&gt;, document.body)</code> or a dedicated <code>#modal-root</code>) so it&#39;s attached outside the card&#39;s DOM hierarchy while still part of the React tree (events and context still work).</p>\n<ul class=\"q-points\"><li>Manage focus trapping, Escape to close and <code>aria-modal</code> for accessibility — or use the native <code>&lt;dialog&gt;</code> element or an accessible library (Radix UI).</li></ul>\n"},{"id":941,"course_slug":"nextjs","course_title":"Next.js — App Router, Folder Structure, Rendering and Full Stack with SQL Server","ord":1,"level":"Beginner","priority":"High","question":"What is Next.js and how is it different from React?","question_html":"What is Next.js and how is it different from React?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> React is a library for building UI components.</p>\n<ul class=\"q-points\"><li>Next.js is a React framework that adds file-based routing, server-side and static rendering, Server Components, data fetching and caching, API endpoints (route handlers, Server Actions), image/font optimisation, SEO metadata and production build/deployment tooling.</li><li>It produces full HTML from the server, improving SEO and first load.</li></ul>\n"},{"id":942,"course_slug":"nextjs","course_title":"Next.js — App Router, Folder Structure, Rendering and Full Stack with SQL Server","ord":2,"level":"Beginner","priority":"High","question":"Explain the App Router folder structure and special files.","question_html":"Explain the App Router folder structure and special files.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Folders inside <code>app/</code> map to URL segments; a segment becomes routable with <code>page.tsx</code> (UI) or <code>route.ts</code> (API).</p>\n<ul class=\"q-points\"><li><code>layout.tsx</code> wraps child pages and persists across navigation; <code>loading.tsx</code> is the Suspense fallback; <code>error.tsx</code> is the error boundary; <code>not-found.tsx</code> shows 404s.</li><li><code>[id]</code> is a dynamic segment, <code>[...slug]</code> catch-all, <code>(group)</code> organises without affecting URLs, <code>_folder</code> is private.</li></ul>\n"},{"id":943,"course_slug":"nextjs","course_title":"Next.js — App Router, Folder Structure, Rendering and Full Stack with SQL Server","ord":3,"level":"Beginner","priority":"High","question":"What are Server Components and Client Components?","question_html":"What are Server Components and Client Components?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Server Components (default in the App Router) render on the server, can be async and access databases/secrets directly, and send no JavaScript to the browser.</p>\n<ul class=\"q-points\"><li>Client Components (<code>&quot;use client&quot;</code>) are hydrated in the browser and can use state, effects and event handlers.</li><li>Use server by default and client only for interactive parts.</li></ul>\n"},{"id":944,"course_slug":"nextjs","course_title":"Next.js — App Router, Folder Structure, Rendering and Full Stack with SQL Server","ord":4,"level":"Intermediate","priority":"High","question":"What rendering strategies does Next.js support?","question_html":"What rendering strategies does Next.js support?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Static generation at build time (with <code>generateStaticParams</code>), Incremental Static Regeneration (time-based <code>revalidate</code> or on-demand <code>revalidatePath/Tag</code>), dynamic server rendering per request, streaming with Suspense, Partial Prerendering/Cache Components (static shell + dynamic holes), and client-side rendering inside Client Components.</p>\n<ul class=\"q-points\"><li>Choose per page/component based on how fresh and personalised the data must be.</li></ul>\n"},{"id":945,"course_slug":"nextjs","course_title":"Next.js — App Router, Folder Structure, Rendering and Full Stack with SQL Server","ord":5,"level":"Intermediate","priority":"High","question":"What are Server Actions and what must you be careful about?","question_html":"What are Server Actions and what must you be careful about?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Async functions marked <code>&quot;use server&quot;</code> that run on the server and can be called from forms (<code>&lt;form action={fn}&gt;</code>) or client code, used for mutations without writing API routes;</p>\n<ul class=\"q-points\"><li>they integrate with revalidation and redirects and work without JavaScript.</li><li>Careful: each action is effectively a public HTTP endpoint — always authenticate, authorise and validate input inside it, and don&#39;t return sensitive data.</li></ul>\n"},{"id":946,"course_slug":"nextjs","course_title":"Next.js — App Router, Folder Structure, Rendering and Full Stack with SQL Server","ord":6,"level":"Intermediate","priority":"High","question":"How do you connect Next.js to SQL Server safely?","question_html":"How do you connect Next.js to SQL Server safely?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Only from server code — Server Components, Server Actions and route handlers on the Node.js runtime — using <code>mssql</code> (one shared connection pool kept on <code>globalThis</code> in development) or Prisma with the <code>sqlserver</code> provider;</p>\n<ul class=\"q-points\"><li>mark modules <code>import &quot;server-only&quot;</code>, keep credentials in environment variables, use parameterised queries, and keep the database close to the hosting region.</li><li>Alternatively call an ASP.NET Core API that owns the database.</li></ul>\n"},{"id":951,"course_slug":"nextjs","course_title":"Next.js — App Router, Folder Structure, Rendering and Full Stack with SQL Server","ord":11,"level":"Scenario","priority":"High","question":"A product listing page is slow because it queries SQL Server on every request, but prices change only once a day. What do you do?","question_html":"A product listing page is slow because it queries SQL Server on every request, but prices change only once a day. What do you do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Make it static or cached: use <code>generateStaticParams</code> + <code>revalidate = 86400</code> (ISR) or cache the query function (<code>&quot;use cache&quot;</code> with a cache life / <code>unstable_cache</code> in older versions), and call <code>revalidatePath(&quot;/products&quot;)</code> or <code>revalidateTag</code> from the admin update action so changes appear immediately.</p>\n<ul class=\"q-points\"><li>Add proper indexes for the query, and keep only truly personalised parts (cart badge) dynamic.</li></ul>\n"},{"id":947,"course_slug":"nextjs","course_title":"Next.js — App Router, Folder Structure, Rendering and Full Stack with SQL Server","ord":7,"level":"Intermediate","priority":"Medium","question":"What is middleware (proxy in Next 16) used for?","question_html":"What is middleware (proxy in Next 16) used for?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Code that runs before a request is routed — redirects, rewrites, authentication gates, A/B testing, adding headers, localisation — configured with a <code>matcher</code>.</p>\n<ul class=\"q-points\"><li>It should be fast and must not be the only security check; validate access again in pages, actions and route handlers.</li></ul>\n"},{"id":948,"course_slug":"nextjs","course_title":"Next.js — App Router, Folder Structure, Rendering and Full Stack with SQL Server","ord":8,"level":"Intermediate","priority":"Medium","question":"How does Next.js help SEO?","question_html":"How does Next.js help SEO?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Pages render to full HTML on the server (static or dynamic), so crawlers see content immediately;</p>\n<ul class=\"q-points\"><li>the Metadata API and <code>generateMetadata</code> set titles, descriptions, canonical URLs and Open Graph tags;</li><li>file conventions generate <code>sitemap.xml</code>, <code>robots.txt</code> and OG images;</li><li><code>next/image</code> and <code>next/font</code> improve Core Web Vitals;</li><li>clean URLs from file routing.</li></ul>\n"},{"id":949,"course_slug":"nextjs","course_title":"Next.js — App Router, Folder Structure, Rendering and Full Stack with SQL Server","ord":9,"level":"Advanced","priority":"Medium","question":"Pages Router vs App Router?","question_html":"Pages Router vs App Router?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Pages Router uses <code>pages/</code>, <code>getServerSideProps/getStaticProps</code>, <code>_app/_document</code> and API routes; every component is a client component.</p>\n<ul class=\"q-points\"><li>App Router uses <code>app/</code>, nested layouts, React Server Components, streaming, Server Actions, route handlers and the Metadata API, with fetch/caching integrated.</li><li>New projects use the App Router; both can coexist for incremental migration.</li></ul>\n"},{"id":950,"course_slug":"nextjs","course_title":"Next.js — App Router, Folder Structure, Rendering and Full Stack with SQL Server","ord":10,"level":"Advanced","priority":"Medium","question":"What is hydration and what causes hydration errors?","question_html":"What is hydration and what causes hydration errors?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Hydration attaches React&#39;s event handlers and state to server-rendered HTML in the browser.</p>\n<ul class=\"q-points\"><li>Errors happen when the client&#39;s first render differs from the server HTML — using <code>Date.now()</code>/random values, <code>window</code>/<code>localStorage</code> during render, locale-dependent formatting, invalid HTML nesting, or browser extensions modifying the DOM.</li><li>Fix by rendering client-only values in <code>useEffect</code>, consistent formatting, or <code>suppressHydrationWarning</code> for intentional differences.</li></ul>\n"},{"id":952,"course_slug":"nextjs","course_title":"Next.js — App Router, Folder Structure, Rendering and Full Stack with SQL Server","ord":12,"level":"Scenario","priority":"Medium","question":"After deployment, a page shows stale data even after the database changed. Why?","question_html":"After deployment, a page shows stale data even after the database changed. Why?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The route or fetch is statically generated or cached (build-time rendering, <code>revalidate</code>, <code>&quot;use cache&quot;</code>, cached fetch).</p>\n<ul class=\"q-points\"><li>Trigger on-demand revalidation (<code>revalidatePath</code>/<code>revalidateTag</code>/<code>updateTag</code>) after mutations, lower the revalidate interval, or make the route dynamic if it must always be fresh (reading cookies/headers or <code>connection()</code>).</li></ul>\n"},{"id":953,"course_slug":"nextjs","course_title":"Next.js — App Router, Folder Structure, Rendering and Full Stack with SQL Server","ord":13,"level":"Scenario","priority":"Medium","question":"Your Next.js app works locally but database calls fail on Vercel. What do you check?","question_html":"Your Next.js app works locally but database calls fail on Vercel. What do you check?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Environment variables set in the Vercel project for the right environment;</p>\n<ul class=\"q-points\"><li>the database firewall allows Vercel&#39;s outbound IPs (or use Azure SQL with public access rules / private networking);</li><li><code>encrypt: true</code> and valid certificates (no <code>trustServerCertificate</code> against a misconfigured server);</li><li>the route runs on the Node.js runtime (not Edge);</li><li>connection limits from many serverless instances (small pools);</li><li>region latency.</li></ul>\n"},{"id":954,"course_slug":"nextjs","course_title":"Next.js — App Router, Folder Structure, Rendering and Full Stack with SQL Server","ord":14,"level":"Beginner","priority":"Medium","question":"What is the difference between next/link and <a>?","question_html":"What is the difference between <code>next/link</code> and <code>&lt;a&gt;</code>?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>&lt;Link&gt;</code> performs client-side navigation — it fetches only the new route&#39;s payload, keeps layouts mounted and prefetches linked routes in the viewport — so navigation is fast without full page reloads.</p>\n<ul class=\"q-points\"><li>A plain <code>&lt;a&gt;</code> causes a full browser navigation.</li><li>Use <code>&lt;Link&gt;</code> for internal links and <code>&lt;a&gt;</code> for external ones.</li></ul>\n"},{"id":955,"course_slug":"nextjs","course_title":"Next.js — App Router, Folder Structure, Rendering and Full Stack with SQL Server","ord":15,"level":"Intermediate","priority":"Medium","question":"How do you handle environment variables in Next.js?","question_html":"How do you handle environment variables in Next.js?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Server-only variables in <code>.env.local</code>/hosting settings are read via <code>process.env.X</code> on the server.</p>\n<ul class=\"q-points\"><li>Variables prefixed <code>NEXT_PUBLIC_</code> are inlined into client bundles at build time — never put secrets there.</li><li>Different files per environment (<code>.env.development</code>, <code>.env.production</code>); validate them at startup (zod).</li></ul>\n"},{"id":956,"course_slug":"vue","course_title":"Vue.js 3 (with Pinia, Vue Router & Nuxt basics)","ord":1,"level":"Beginner","priority":"High","question":"What is Vue.js and why is it called progressive?","question_html":"What is Vue.js and why is it called progressive?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Vue is an open-source JavaScript framework for building UIs and SPAs (Evan You, 2014).</p>\n<ul class=\"q-points\"><li>It&#39;s &quot;progressive&quot; because you can adopt it incrementally: start by adding it to part of a page via a script tag, then grow into a full SPA with SFCs, Vue Router, Pinia, a build tool and SSR (Nuxt).</li><li>It offers declarative templates, a reactive data system, components and a small, fast core.</li></ul>\n"},{"id":957,"course_slug":"vue","course_title":"Vue.js 3 (with Pinia, Vue Router & Nuxt basics)","ord":2,"level":"Beginner","priority":"High","question":"What are the most commonly used Vue directives?","question_html":"What are the most commonly used Vue directives?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>v-bind</code> (<code>:</code>) for attributes/props, <code>v-on</code> (<code>@</code>) for events (with modifiers like <code>.prevent</code>), <code>v-model</code> for two-way form binding, <code>v-if/v-else-if/v-else</code> for conditional rendering, <code>v-show</code> for CSS visibility toggling, <code>v-for</code> for lists with <code>:key</code>, <code>v-html</code>/<code>v-text</code>, <code>v-slot</code> (<code>#</code>) for slots, plus <code>v-once</code>, <code>v-memo</code>, <code>v-pre</code>, <code>v-cloak</code>.</p>\n<ul class=\"q-points\"><li>Custom directives are possible for low-level DOM access.</li></ul>\n"},{"id":958,"course_slug":"vue","course_title":"Vue.js 3 (with Pinia, Vue Router & Nuxt basics)","ord":3,"level":"Beginner","priority":"High","question":"What is the difference between v-if and v-show?","question_html":"What is the difference between v-if and v-show?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>v-if</code> conditionally renders: when false the element and its child components aren&#39;t created (or are destroyed), so toggling is expensive but the initial render is cheap.</p>\n<ul class=\"q-points\"><li><code>v-show</code> always renders the element and toggles <code>display: none</code>, so toggling is cheap but the initial render always pays the cost.</li><li>Use <code>v-show</code> for frequent toggles, <code>v-if</code> for rarely changing conditions.</li><li><code>v-show</code> doesn&#39;t work on <code>&lt;template&gt;</code>.</li></ul>\n"},{"id":959,"course_slug":"vue","course_title":"Vue.js 3 (with Pinia, Vue Router & Nuxt basics)","ord":4,"level":"Beginner","priority":"High","question":"What are computed properties and how are they different from methods and watchers?","question_html":"What are computed properties and how are they different from methods and watchers?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Computed properties derive values from reactive state and are <strong>cached</strong> until their dependencies change — ideal for filtered lists or totals used in templates.</p>\n<ul class=\"q-points\"><li>Methods run every time they&#39;re called (re-render) — use for event handlers.</li><li>Watchers run side effects when a specific value changes (API calls, saving to localStorage); <code>watchEffect</code> auto-tracks dependencies.</li></ul>\n"},{"id":960,"course_slug":"vue","course_title":"Vue.js 3 (with Pinia, Vue Router & Nuxt basics)","ord":5,"level":"Beginner","priority":"High","question":"What is the purpose of the key attribute in v-for?","question_html":"What is the purpose of the <code>key</code> attribute in v-for?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>key</code> gives each item a unique, stable identity so Vue&#39;s virtual DOM can track, reorder and reuse elements correctly and preserve component state and DOM state (focus, input values).</p>\n<ul class=\"q-points\"><li>Without keys, Vue uses an in-place patch strategy that can show stale state when items are reordered or removed.</li><li>Use unique IDs, not array indexes, for dynamic lists.</li></ul>\n"},{"id":962,"course_slug":"vue","course_title":"Vue.js 3 (with Pinia, Vue Router & Nuxt basics)","ord":7,"level":"Intermediate","priority":"High","question":"Explain ref vs reactive.","question_html":"Explain ref vs reactive.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>ref()</code> wraps any value (including primitives) in an object with a reactive <code>.value</code> property; templates unwrap it automatically.</p>\n<ul class=\"q-points\"><li><code>reactive()</code> makes an object/array/Map deeply reactive via a Proxy, accessed directly without <code>.value</code>, but you can&#39;t reassign the whole object and destructuring loses reactivity (use <code>toRefs</code>).</li><li>The Vue docs recommend <code>ref</code> as the default because it works with all types and is explicit.</li></ul>\n"},{"id":963,"course_slug":"vue","course_title":"Vue.js 3 (with Pinia, Vue Router & Nuxt basics)","ord":8,"level":"Intermediate","priority":"High","question":"How does reactivity work in Vue 3? How is it different from Vue 2?","question_html":"How does reactivity work in Vue 3? How is it different from Vue 2?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Vue 3 wraps state in JavaScript Proxies: getters track which effect (render, computed, watcher) accessed a property;</p>\n<ul class=\"q-points\"><li>setters trigger those effects, which re-run in a batched, asynchronous update queue.</li><li>Vue 2 used <code>Object.defineProperty</code> on existing properties, so it couldn&#39;t detect new or deleted properties or direct array index/length changes, requiring <code>Vue.set</code>/<code>Vue.delete</code>.</li><li>Proxies remove those caveats and improve performance and memory usage.</li></ul>\n"},{"id":964,"course_slug":"vue","course_title":"Vue.js 3 (with Pinia, Vue Router & Nuxt basics)","ord":9,"level":"Intermediate","priority":"High","question":"Options API vs Composition API — which and why?","question_html":"Options API vs Composition API — which and why?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The Options API organises code by option type (data, methods, computed, lifecycle) and is easy for small components and beginners.</p>\n<ul class=\"q-points\"><li>The Composition API (<code>setup</code>/<code>&lt;script setup&gt;</code>) organises code by logical concern, enables clean reuse via composables (replacing mixins and their naming conflicts), and gives far better TypeScript inference.</li><li>For large or long-lived apps, the Composition API with <code>&lt;script setup&gt;</code> is generally preferred; both are supported in Vue 3.</li></ul>\n"},{"id":965,"course_slug":"vue","course_title":"Vue.js 3 (with Pinia, Vue Router & Nuxt basics)","ord":10,"level":"Intermediate","priority":"High","question":"What are the lifecycle hooks in Vue 3?","question_html":"What are the lifecycle hooks in Vue 3?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>setup</code> (replacing beforeCreate/created), <code>onBeforeMount</code>, <code>onMounted</code> (DOM ready — fetch data, init libraries), <code>onBeforeUpdate</code>, <code>onUpdated</code>, <code>onBeforeUnmount</code>, <code>onUnmounted</code> (cleanup), plus <code>onErrorCaptured</code>, <code>onActivated</code>/<code>onDeactivated</code> (KeepAlive), <code>onServerPrefetch</code> (SSR), and debug hooks <code>onRenderTracked</code>/<code>onRenderTriggered</code>.</p>\n<ul class=\"q-points\"><li>Options API equivalents use <code>beforeUnmount</code>/<code>unmounted</code> instead of Vue 2&#39;s <code>beforeDestroy</code>/<code>destroyed</code>.</li></ul>\n"},{"id":966,"course_slug":"vue","course_title":"Vue.js 3 (with Pinia, Vue Router & Nuxt basics)","ord":11,"level":"Intermediate","priority":"High","question":"What are slots and scoped slots?","question_html":"What are slots and scoped slots?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Slots let a parent pass template content into a child component&#39;s placeholders: the default slot, named slots (<code>&lt;slot name=&quot;footer&quot;&gt;</code> filled with <code>&lt;template #footer&gt;</code>), and fallback content.</p>\n<ul class=\"q-points\"><li>Scoped slots let the child pass data back to the slot content (<code>&lt;slot :item=&quot;item&quot;&gt;</code> used as <code>&lt;template #default=&quot;{ item }&quot;&gt;</code>) — e.g. a generic table component where the parent customises how each row renders.</li></ul>\n"},{"id":967,"course_slug":"vue","course_title":"Vue.js 3 (with Pinia, Vue Router & Nuxt basics)","ord":12,"level":"Intermediate","priority":"High","question":"What is Pinia and how does it compare to Vuex?","question_html":"What is Pinia and how does it compare to Vuex?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Pinia is Vue&#39;s official state management library.</p>\n<ul class=\"q-points\"><li>Stores are defined with <code>defineStore</code> (state, getters, actions, or setup syntax with refs/computeds/functions).</li><li>Compared with Vuex: no mutations (actions modify state directly, sync or async), no nested modules — just multiple independent stores, full TypeScript support without boilerplate, smaller size, DevTools integration and SSR support.</li><li>Vuex is in maintenance mode.</li></ul>\n"},{"id":970,"course_slug":"vue","course_title":"Vue.js 3 (with Pinia, Vue Router & Nuxt basics)","ord":15,"level":"Advanced","priority":"High","question":"What are composables and how do they differ from mixins?","question_html":"What are composables and how do they differ from mixins?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Composables are functions (<code>useXxx</code>) that use Composition API primitives to encapsulate and reuse stateful logic, returning refs and functions.</p>\n<ul class=\"q-points\"><li>Unlike mixins, they make the source of each property explicit (via destructuring), avoid naming collisions, can accept arguments, can be composed together, and are fully typed.</li><li>Mixins merged options implicitly, causing unclear origins and conflicts.</li></ul>\n"},{"id":973,"course_slug":"vue","course_title":"Vue.js 3 (with Pinia, Vue Router & Nuxt basics)","ord":18,"level":"Scenario","priority":"High","question":"A page with a list of 20,000 items is slow to render and scroll. How do you fix it?","question_html":"A page with a list of 20,000 items is slow to render and scroll. How do you fix it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Render only what&#39;s visible with virtual scrolling (vue-virtual-scroller/TanStack Virtual);</p>\n<ul class=\"q-points\"><li>paginate or load incrementally from the API;</li><li>use stable <code>:key</code>s;</li><li>store the large list with <code>shallowRef</code> (or <code>markRaw</code> items) so Vue doesn&#39;t make every nested property reactive;</li><li>move filtering/sorting into computed properties;</li><li>avoid heavy components per row;</li><li>use <code>v-memo</code> for rows that rarely change.</li></ul>\n"},{"id":974,"course_slug":"vue","course_title":"Vue.js 3 (with Pinia, Vue Router & Nuxt basics)","ord":19,"level":"Scenario","priority":"High","question":"You destructure props or a reactive store and the UI stops updating. Why?","question_html":"You destructure props or a reactive store and the UI stops updating. Why?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Destructuring copies the current values out of the reactive Proxy, breaking the connection.</p>\n<ul class=\"q-points\"><li>Fix: use <code>toRefs(reactiveObj)</code> or <code>storeToRefs(store)</code> for Pinia state/getters (actions can be destructured directly), access via <code>props.x</code>, or rely on Vue 3.5&#39;s compiler-supported reactive props destructure inside <code>&lt;script setup&gt;</code>, which keeps destructured props reactive in templates and computeds.</li></ul>\n"},{"id":961,"course_slug":"vue","course_title":"Vue.js 3 (with Pinia, Vue Router & Nuxt basics)","ord":6,"level":"Beginner","priority":"Medium","question":"How do you pass data between parent and child components?","question_html":"How do you pass data between parent and child components?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Parent to child with <strong>props</strong> (read-only in the child).</p>\n<ul class=\"q-points\"><li>Child to parent by <strong>emitting events</strong> (<code>defineEmits</code>, <code>emit(&#39;save&#39;, data)</code>), and two-way via <code>v-model</code> on components (<code>defineModel</code>).</li><li>For deeper trees use provide/inject; for global or sibling state use Pinia; parent can call child methods via template refs and <code>defineExpose</code>.</li></ul>\n"},{"id":968,"course_slug":"vue","course_title":"Vue.js 3 (with Pinia, Vue Router & Nuxt basics)","ord":13,"level":"Intermediate","priority":"Medium","question":"What is provide/inject?","question_html":"What is provide/inject?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A dependency-injection mechanism: an ancestor <code>provide</code>s a value under a key and any descendant, at any depth, can <code>inject</code> it — avoiding prop drilling for things like theme, configuration or a form context.</p>\n<ul class=\"q-points\"><li>Provide refs (often <code>readonly</code>) to keep it reactive.</li><li>It&#39;s not a replacement for global state management (Pinia).</li></ul>\n"},{"id":969,"course_slug":"vue","course_title":"Vue.js 3 (with Pinia, Vue Router & Nuxt basics)","ord":14,"level":"Intermediate","priority":"Medium","question":"How do navigation guards work in Vue Router?","question_html":"How do navigation guards work in Vue Router?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Guards run during navigation and can allow, cancel (<code>return false</code>) or redirect (return a route location).</p>\n<ul class=\"q-points\"><li>Global guards: <code>router.beforeEach</code> (auth checks), <code>beforeResolve</code>, <code>afterEach</code> (analytics).</li><li>Per-route: <code>beforeEnter</code>.</li><li>In-component: <code>onBeforeRouteLeave</code> (unsaved changes) and <code>onBeforeRouteUpdate</code> (same component, new params).</li><li>Route <code>meta</code> fields (e.g. <code>requiresAuth</code>) drive guard logic.</li></ul>\n"},{"id":971,"course_slug":"vue","course_title":"Vue.js 3 (with Pinia, Vue Router & Nuxt basics)","ord":16,"level":"Advanced","priority":"Medium","question":"What is nextTick and when do you need it?","question_html":"What is nextTick and when do you need it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Vue batches DOM updates asynchronously: after changing state, the DOM isn&#39;t updated immediately but in the next &quot;tick&quot; (microtask).</p>\n<ul class=\"q-points\"><li><code>await nextTick()</code> waits until the DOM reflects the latest state — e.g. to measure an element&#39;s size or focus an input that was just rendered with <code>v-if</code>.</li></ul>\n"},{"id":972,"course_slug":"vue","course_title":"Vue.js 3 (with Pinia, Vue Router & Nuxt basics)","ord":17,"level":"Advanced","priority":"Medium","question":"How does Vue's compiler optimise rendering?","question_html":"How does Vue&#39;s compiler optimise rendering?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The template compiler analyses templates at build time: it hoists static nodes (created once), adds patch flags to dynamic nodes (so diffing only checks what can change, like text or class), and builds a block tree that tracks dynamic descendants, avoiding a full virtual DOM tree walk.</p>\n<ul class=\"q-points\"><li>Vapor Mode (in development for 3.6) goes further, compiling templates to direct DOM operations without a virtual DOM.</li></ul>\n"},{"id":975,"course_slug":"vue","course_title":"Vue.js 3 (with Pinia, Vue Router & Nuxt basics)","ord":20,"level":"Scenario","priority":"Medium","question":"Your company has a large Vue 2 app. Vue 2 reached EOL in December 2023. What's your plan?","question_html":"Your company has a large Vue 2 app. Vue 2 reached EOL in December 2023. What&#39;s your plan?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Assess dependencies (Vuex, Vue Router 3, UI libraries like Vuetify 2/Element UI, plugins) and test coverage.</p>\n<ul class=\"q-points\"><li>Short term: upgrade to Vue 2.7 (Composition API) and consider extended commercial support for security.</li><li>Then use the <code>@vue/compat</code> migration build on Vue 3 to fix deprecations incrementally;</li><li>migrate Vue Router 3 → 4, Vuex → Pinia (store by store), Vue CLI → Vite, and UI libraries to Vue 3 versions (often the biggest effort);</li><li>remove filters, the event bus and <code>$listeners</code>;</li><li>add Playwright tests for critical flows before and during the migration;</li><li>ship in stages.</li></ul>\n"},{"id":976,"course_slug":"vue","course_title":"Vue.js 3 (with Pinia, Vue Router & Nuxt basics)","ord":21,"level":"Scenario","priority":"Medium","question":"A watcher calling an API fires too often while the user types. How do you control it?","question_html":"A watcher calling an API fires too often while the user types. How do you control it?","answer_html":"<p>Debounce the watcher&#39;s work (<code>useDebounceFn</code> from VueUse or a debounce wrapper), add <code>v-model.lazy</code> if updating on change is enough, ignore short queries, cancel the previous request with <code>AbortController</code> via <code>onWatcherCleanup</code> (Vue 3.5) or the <code>onCleanup</code> argument so stale responses can&#39;t overwrite newer ones, and cache results.</p>\n"},{"id":977,"course_slug":"test-automation","course_title":"Test Automation — Selenium, Playwright, API and BDD with C#","ord":1,"level":"Beginner","priority":"High","question":"What is the test pyramid and why does it matter?","question_html":"What is the test pyramid and why does it matter?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Many fast unit tests at the bottom, fewer API/integration tests in the middle, and a small number of slow UI/E2E tests at the top.</p>\n<ul class=\"q-points\"><li>It gives fast feedback and stable suites: most logic is tested cheaply below the UI, while a few E2E tests confirm critical user journeys.</li><li>The anti-pattern is the &quot;ice-cream cone&quot; (mostly UI tests) — slow and flaky.</li></ul>\n"},{"id":978,"course_slug":"test-automation","course_title":"Test Automation — Selenium, Playwright, API and BDD with C#","ord":2,"level":"Beginner","priority":"High","question":"What should and shouldn't be automated?","question_html":"What should and shouldn&#39;t be automated?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Automate stable, repetitive, high-value checks: regression, smoke, data-driven cases, API contracts, cross-browser critical paths.</p>\n<ul class=\"q-points\"><li>Don&#39;t automate exploratory and usability testing, one-off checks, features that change daily, or anything where the maintenance costs more than running it manually.</li></ul>\n"},{"id":979,"course_slug":"test-automation","course_title":"Test Automation — Selenium, Playwright, API and BDD with C#","ord":3,"level":"Beginner","priority":"High","question":"Which Selenium locators do you use and in what order?","question_html":"Which Selenium locators do you use and in what order?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Prefer stable, unique attributes: <code>data-testid</code>/<code>data-qa</code> → <code>id</code> → <code>name</code> → CSS selectors → relative XPath (text, attributes, axes) → link text.</p>\n<ul class=\"q-points\"><li>Avoid absolute XPath and generated class names.</li><li>If the app lacks good attributes, ask developers to add test ids — it&#39;s the most effective fix for brittle tests.</li></ul>\n"},{"id":980,"course_slug":"test-automation","course_title":"Test Automation — Selenium, Playwright, API and BDD with C#","ord":4,"level":"Beginner","priority":"High","question":"Implicit vs explicit vs fluent wait?","question_html":"Implicit vs explicit vs fluent wait?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Implicit: a global timeout applied to every element lookup.</p>\n<ul class=\"q-points\"><li>Explicit: <code>WebDriverWait</code> waiting for a specific condition (visible, clickable, text present) up to a timeout — recommended.</li><li>Fluent: an explicit wait with configurable polling and ignored exceptions.</li><li>Never use <code>Thread.Sleep</code>, and don&#39;t mix implicit and explicit waits (timeouts combine unpredictably).</li></ul>\n"},{"id":981,"course_slug":"test-automation","course_title":"Test Automation — Selenium, Playwright, API and BDD with C#","ord":5,"level":"Beginner","priority":"High","question":"What is the Page Object Model?","question_html":"What is the Page Object Model?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A design pattern where each page or component is a class that owns its locators and exposes user actions (<code>LoginAs</code>, <code>AddToCart</code>).</p>\n<ul class=\"q-points\"><li>Tests read like user steps, locators live in one place (one fix when the UI changes), and code is reused.</li><li>Variants: Page Factory (Java), component objects, Screenplay pattern.</li></ul>\n"},{"id":982,"course_slug":"test-automation","course_title":"Test Automation — Selenium, Playwright, API and BDD with C#","ord":6,"level":"Intermediate","priority":"High","question":"Selenium vs Playwright — which would you choose?","question_html":"Selenium vs Playwright — which would you choose?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Playwright for new web projects: auto-waiting and retrying assertions (less flakiness), fast isolated browser contexts, built-in tracing, network mocking, API testing, parallel runs and codegen.</p>\n<ul class=\"q-points\"><li>Selenium when you need the W3C standard, the widest language/browser support (including real Safari and legacy browsers), Appium for mobile, an existing large Selenium framework, or vendor grids.</li><li>Both work well with C#.</li></ul>\n"},{"id":983,"course_slug":"test-automation","course_title":"Test Automation — Selenium, Playwright, API and BDD with C#","ord":7,"level":"Intermediate","priority":"High","question":"How do you handle StaleElementReferenceException?","question_html":"How do you handle StaleElementReferenceException?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> It means the element you hold was removed or re-rendered in the DOM.</p>\n<ul class=\"q-points\"><li>Re-locate the element right before using it (page-object properties that find each time, not cached fields), wait for the page update to finish (explicit wait on a condition), and include it in ignored exceptions of a fluent wait for dynamic grids.</li></ul>\n"},{"id":984,"course_slug":"test-automation","course_title":"Test Automation — Selenium, Playwright, API and BDD with C#","ord":8,"level":"Intermediate","priority":"High","question":"How do you design an automation framework from scratch?","question_html":"How do you design an automation framework from scratch?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Language and runner matching the team (C# + NUnit/xUnit), Selenium or Playwright for UI and HttpClient/RestSharp for API, layered structure (tests → pages/components → core: driver factory, config, waits, logging → data builders → API helpers), configuration per environment, test data created via API, parallel execution, screenshots/traces and reports on failure, CI integration with categories (smoke/regression), and coding standards with code review.</p>\n<ul class=\"q-points\"><li>Optionally Reqnroll for BDD.</li></ul>\n"},{"id":985,"course_slug":"test-automation","course_title":"Test Automation — Selenium, Playwright, API and BDD with C#","ord":9,"level":"Intermediate","priority":"High","question":"How do you test REST APIs? What do you validate?","question_html":"How do you test REST APIs? What do you validate?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Using HttpClient/RestSharp/Postman: send requests with correct and incorrect data, check status codes (200/201/204/400/401/403/404/409), response body and JSON schema, headers, error format, authentication and authorisation per role, boundary values, pagination and sorting, idempotency of PUT/DELETE, and response time.</p>\n<ul class=\"q-points\"><li>Chain requests (create → get → update → delete) and clean up data.</li></ul>\n"},{"id":989,"course_slug":"test-automation","course_title":"Test Automation — Selenium, Playwright, API and BDD with C#","ord":13,"level":"Advanced","priority":"High","question":"How do you run UI tests in parallel safely?","question_html":"How do you run UI tests in parallel safely?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> One driver/browser context per test (thread-local or per-test instance), no static shared state, unique test data per test (GUIDs, separate users), tests independent of order, config for worker count, and infrastructure that can handle the load (Selenium Grid, cloud grid, Playwright workers).</p>\n<ul class=\"q-points\"><li>NUnit: <code>[Parallelizable]</code> with instance-per-test-case; xUnit: collections control parallelism.</li></ul>\n"},{"id":990,"course_slug":"test-automation","course_title":"Test Automation — Selenium, Playwright, API and BDD with C#","ord":14,"level":"Advanced","priority":"High","question":"How do you integrate automated tests into CI/CD?","question_html":"How do you integrate automated tests into CI/CD?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Tests live in the same repo or a sibling repo, run via <code>dotnet test</code> in Azure DevOps/GitHub Actions/Jenkins: unit and API smoke on every PR (quality gate), deployment smoke tests after each environment deploy, full regression nightly.</p>\n<ul class=\"q-points\"><li>Headless browsers or a grid, results published (TRX/JUnit), artefacts on failure (screenshots, videos, traces), notifications, and failing tests block the pipeline.</li></ul>\n"},{"id":992,"course_slug":"test-automation","course_title":"Test Automation — Selenium, Playwright, API and BDD with C#","ord":16,"level":"Scenario","priority":"High","question":"Your regression suite of 800 UI tests takes 6 hours and 10% fail randomly. What do you do?","question_html":"Your regression suite of 800 UI tests takes 6 hours and 10% fail randomly. What do you do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Measure first: list slowest and flakiest tests.</p>\n<ul class=\"q-points\"><li>Move logic checks down the pyramid (API/unit tests); keep UI tests for critical journeys.</li><li>Replace sleeps with condition waits or Playwright auto-wait; use stable locators; create test data via API instead of UI steps; reuse login state.</li><li>Run in parallel on a grid with independent data.</li><li>Quarantine flaky tests and fix root causes.</li><li>Target: smoke &lt; 10 min per PR, full regression &lt; 1 hour, flake rate &lt; 1–2%.</li></ul>\n"},{"id":993,"course_slug":"test-automation","course_title":"Test Automation — Selenium, Playwright, API and BDD with C#","ord":17,"level":"Scenario","priority":"High","question":"A test passes locally but fails in the CI pipeline. How do you investigate?","question_html":"A test passes locally but fails in the CI pipeline. How do you investigate?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Compare environments: headless vs headed (viewport/screen size differs), browser/driver versions, timing on slower agents, environment URLs and config, test data present/missing, parallel runs colliding, time zone/culture, network/proxy.</p>\n<ul class=\"q-points\"><li>Collect evidence: screenshots, video, Playwright trace, browser console and network logs, CI logs.</li><li>Reproduce with the same settings locally (headless, same browser version, same data).</li></ul>\n"},{"id":986,"course_slug":"test-automation","course_title":"Test Automation — Selenium, Playwright, API and BDD with C#","ord":10,"level":"Intermediate","priority":"Medium","question":"What is data-driven testing?","question_html":"What is data-driven testing?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Running the same test logic with multiple data sets: NUnit <code>[TestCase]</code>/<code>[TestCaseSource]</code>, xUnit <code>[Theory]</code> + <code>[InlineData]</code>/<code>[MemberData]</code>, Reqnroll <code>Scenario Outline</code> + <code>Examples</code>, or data from JSON/CSV/Excel/DB.</p>\n<ul class=\"q-points\"><li>It increases coverage (boundaries, partitions) without duplicating code.</li></ul>\n"},{"id":987,"course_slug":"test-automation","course_title":"Test Automation — Selenium, Playwright, API and BDD with C#","ord":11,"level":"Intermediate","priority":"Medium","question":"How do you handle iframes, multiple windows, alerts and dropdowns in Selenium?","question_html":"How do you handle iframes, multiple windows, alerts and dropdowns in Selenium?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Frames: <code>driver.SwitchTo().Frame(idOrElement)</code> then <code>SwitchTo().DefaultContent()</code>.</p>\n<ul class=\"q-points\"><li>Windows/tabs: store <code>CurrentWindowHandle</code>, loop <code>WindowHandles</code>, <code>SwitchTo().Window(handle)</code>.</li><li>Alerts: <code>SwitchTo().Alert().Accept()/Dismiss()/Text</code>.</li><li>Dropdowns: <code>new SelectElement(element).SelectByText(&quot;India&quot;)</code> for <code>&lt;select&gt;</code>; custom dropdowns are clicked like normal elements.</li></ul>\n"},{"id":988,"course_slug":"test-automation","course_title":"Test Automation — Selenium, Playwright, API and BDD with C#","ord":12,"level":"Intermediate","priority":"Medium","question":"What is BDD and when is it worth it?","question_html":"What is BDD and when is it worth it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Behaviour-Driven Development describes behaviour in Gherkin (Given/When/Then) agreed with business and QA, then automates those scenarios with step definitions (Reqnroll in .NET).</p>\n<ul class=\"q-points\"><li>Worth it when business stakeholders read and help write scenarios — it becomes living documentation.</li><li>If only engineers read them, the Gherkin layer is overhead; plain readable tests are enough.</li></ul>\n"},{"id":991,"course_slug":"test-automation","course_title":"Test Automation — Selenium, Playwright, API and BDD with C#","ord":15,"level":"Advanced","priority":"Medium","question":"What metrics do you track for test automation?","question_html":"What metrics do you track for test automation?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Pass rate and flaky rate, execution time, coverage of critical flows/requirements (not just code coverage), defects found by automation vs escaped defects, time to fix broken tests, and automation ROI (manual hours saved).</p>\n<ul class=\"q-points\"><li>Use them to decide what to fix, speed up or delete.</li></ul>\n"},{"id":994,"course_slug":"test-automation","course_title":"Test Automation — Selenium, Playwright, API and BDD with C#","ord":18,"level":"Scenario","priority":"Medium","question":"The developers change the UI often and your locators break every sprint. How do you fix this?","question_html":"The developers change the UI often and your locators break every sprint. How do you fix this?","answer_html":"<p>Agree with developers to add stable <code>data-testid</code> attributes (part of the definition of done), use role/text-based locators (Playwright <code>GetByRole</code>, <code>GetByLabel</code>) that follow user-visible behaviour, centralise locators in page/component objects, review UI changes with QA early, and add a quick smoke run on every PR so breaks are found immediately — not at the end of the sprint.</p>\n"},{"id":995,"course_slug":"test-automation","course_title":"Test Automation — Selenium, Playwright, API and BDD with C#","ord":19,"level":"Scenario","priority":"Medium","question":"How would you test a login page? List the cases.","question_html":"How would you test a login page? List the cases.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Valid login;</p>\n<ul class=\"q-points\"><li>invalid password;</li><li>unknown user;</li><li>empty fields;</li><li>field validation (email format, length);</li><li>password masked;</li><li>case sensitivity;</li><li>account lockout after N attempts;</li><li>&quot;remember me&quot;;</li><li>forgot password flow;</li><li>SQL injection/XSS strings;</li><li>session timeout and logout;</li><li>back button after logout;</li><li>HTTPS;</li><li>multiple browsers/devices;</li><li>accessibility (labels, keyboard);</li><li>performance under load;</li><li>error messages don&#39;t reveal whether the user exists.</li></ul>\n"},{"id":996,"course_slug":"industrial-automation","course_title":"Industrial Automation — PLC, SCADA, Modbus and OPC UA","ord":1,"level":"Beginner","priority":"High","question":"What is a PLC and how is it different from a microcontroller or PC?","question_html":"What is a PLC and how is it different from a microcontroller or PC?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A PLC is a rugged industrial controller that reads inputs, runs a control program in a deterministic scan cycle and drives outputs.</p>\n<ul class=\"q-points\"><li>Compared to a PC it is built for harsh environments, real-time deterministic timing, direct industrial I/O and decades of 24/7 operation, programmed in IEC 61131-3 languages.</li><li>A microcontroller is a chip that needs custom boards, protection and certification to do the same job.</li></ul>\n"},{"id":997,"course_slug":"industrial-automation","course_title":"Industrial Automation — PLC, SCADA, Modbus and OPC UA","ord":2,"level":"Beginner","priority":"High","question":"Explain the PLC scan cycle.","question_html":"Explain the PLC scan cycle.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Read all inputs into the input image table → execute the program top to bottom using that image → write the output image to the physical outputs → do communication and diagnostics → repeat.</p>\n<ul class=\"q-points\"><li>Scan time is usually milliseconds.</li><li>Because inputs are sampled once per scan, very short pulses need high-speed inputs or interrupts.</li></ul>\n"},{"id":998,"course_slug":"industrial-automation","course_title":"Industrial Automation — PLC, SCADA, Modbus and OPC UA","ord":3,"level":"Beginner","priority":"High","question":"What are the IEC 61131-3 programming languages?","question_html":"What are the IEC 61131-3 programming languages?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Ladder Diagram (relay-style graphics), Function Block Diagram (blocks connected by signals), Structured Text (high-level text like Pascal), Sequential Function Chart (steps and transitions for sequences), and Instruction List (assembly-like, deprecated since the 2013 edition).</p>\n<ul class=\"q-points\"><li>Ladder for discrete logic, ST for maths and data, SFC for sequences, FBD for process control.</li></ul>\n"},{"id":999,"course_slug":"industrial-automation","course_title":"Industrial Automation — PLC, SCADA, Modbus and OPC UA","ord":4,"level":"Beginner","priority":"High","question":"What is the difference between SCADA, HMI and DCS?","question_html":"What is the difference between SCADA, HMI and DCS?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> HMI is the operator interface for a machine or line.</p>\n<ul class=\"q-points\"><li>SCADA supervises many controllers over a plant or wide area — data acquisition, control, alarms, trends and reporting.</li><li>A DCS is an integrated control system (controllers + HMI + engineering) for continuous processes like refineries and power plants, where control is distributed across controllers on a common platform.</li></ul>\n"},{"id":1000,"course_slug":"industrial-automation","course_title":"Industrial Automation — PLC, SCADA, Modbus and OPC UA","ord":5,"level":"Beginner","priority":"High","question":"Why is 4–20 mA used instead of 0–20 mA or 0–10 V?","question_html":"Why is 4–20 mA used instead of 0–20 mA or 0–10 V?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Current signals are not affected by voltage drop over long cables and are less sensitive to electrical noise.</p>\n<ul class=\"q-points\"><li>The &quot;live zero&quot; at 4 mA lets you detect a broken wire (current near 0 mA) as a fault rather than reading it as 0 %, and the 4 mA can power two-wire loop-powered transmitters.</li></ul>\n"},{"id":1002,"course_slug":"industrial-automation","course_title":"Industrial Automation — PLC, SCADA, Modbus and OPC UA","ord":7,"level":"Intermediate","priority":"High","question":"Explain the start/stop seal-in (latching) circuit.","question_html":"Explain the start/stop seal-in (latching) circuit.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Start (NO) in parallel with a contact of the motor output, in series with Stop (NC in the field) and overload.</p>\n<ul class=\"q-points\"><li>Pressing Start energises the motor coil; the motor&#39;s own contact keeps the rung true after Start is released (seal-in); pressing Stop or an overload breaks the rung.</li><li>In ST: <code>Motor := (Start OR Motor) AND NOT Stop AND NOT Overload;</code>.</li></ul>\n"},{"id":1003,"course_slug":"industrial-automation","course_title":"Industrial Automation — PLC, SCADA, Modbus and OPC UA","ord":8,"level":"Intermediate","priority":"High","question":"Explain TON, TOF and counters with an example.","question_html":"Explain TON, TOF and counters with an example.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> TON (on-delay): output becomes true when the input has stayed true for the preset — e.g. start a conveyor 5 s after a horn.</p>\n<ul class=\"q-points\"><li>TOF (off-delay): output stays true for the preset after the input turns false — e.g. keep a cooling fan running 2 minutes after the motor stops.</li><li>CTU counts rising edges to a preset — e.g. 100 parts fill a box, then reset.</li></ul>\n"},{"id":1004,"course_slug":"industrial-automation","course_title":"Industrial Automation — PLC, SCADA, Modbus and OPC UA","ord":9,"level":"Intermediate","priority":"High","question":"What is Modbus? Explain its data model and function codes.","question_html":"What is Modbus? Explain its data model and function codes.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A simple open request/response protocol (RTU over RS-485 serial, TCP over Ethernet on port 502).</p>\n<ul class=\"q-points\"><li>Data tables: coils (read/write bits — FC01/05/15), discrete inputs (read-only bits — FC02), input registers (read-only 16-bit — FC04) and holding registers (read/write 16-bit — FC03/06/16).</li><li>32-bit values span two registers with device-specific word order.</li><li>It has no security, so it belongs on segmented networks.</li></ul>\n"},{"id":1005,"course_slug":"industrial-automation","course_title":"Industrial Automation — PLC, SCADA, Modbus and OPC UA","ord":10,"level":"Intermediate","priority":"High","question":"What is OPC UA and why is it important for Industry 4.0?","question_html":"What is OPC UA and why is it important for Industry 4.0?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A vendor- and platform-independent standard (IEC 62541) for secure industrial data exchange.</p>\n<ul class=\"q-points\"><li>It provides a rich information model (typed objects, not just addresses), services for read/write/subscribe/methods/history/alarms, built-in security with certificates and encryption, and transports from client/server to PubSub over MQTT.</li><li>It lets MES, cloud and analytics systems read machine data the same way from any vendor.</li></ul>\n"},{"id":1008,"course_slug":"industrial-automation","course_title":"Industrial Automation — PLC, SCADA, Modbus and OPC UA","ord":13,"level":"Advanced","priority":"High","question":"How would you collect data from 50 PLCs of different brands into a .NET application?","question_html":"How would you collect data from 50 PLCs of different brands into a .NET application?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use a gateway/OPC UA layer to normalise protocols (built-in OPC UA servers, or Kepware/Ignition for S7, EtherNet/IP, Modbus), then a .NET edge service (Worker Service) that subscribes to OPC UA monitored items or polls Modbus, adds source timestamps and quality, buffers locally (store-and-forward) and publishes to MQTT/Azure IoT Hub or writes to a time-series/SQL database.</p>\n<ul class=\"q-points\"><li>Use a tag configuration table, a consistent naming model (ISA-95 hierarchy), and keep OT and IT networks separated by a DMZ.</li></ul>\n"},{"id":1009,"course_slug":"industrial-automation","course_title":"Industrial Automation — PLC, SCADA, Modbus and OPC UA","ord":14,"level":"Advanced","priority":"High","question":"How do you secure an OT network?","question_html":"How do you secure an OT network?","answer_html":"<p>Defence in depth per IEC 62443: asset inventory, segmentation into zones and conduits with firewalls and an industrial DMZ, no direct internet access to controllers, secure protocols (OPC UA with signing/encryption), strict remote access (jump host, MFA, recording), least-privilege accounts, change control and backups of PLC programs, patching in maintenance windows, OT-aware monitoring, and incident response plans that consider safety.</p>\n"},{"id":1011,"course_slug":"industrial-automation","course_title":"Industrial Automation — PLC, SCADA, Modbus and OPC UA","ord":16,"level":"Scenario","priority":"High","question":"A motor sometimes doesn't start when the operator presses Start on the HMI. How do you troubleshoot?","question_html":"A motor sometimes doesn&#39;t start when the operator presses Start on the HMI. How do you troubleshoot?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Check the PLC online: is the HMI command bit reaching the PLC (HMI write and tag address), is the command a momentary pulse shorter than the scan or overwritten elsewhere (duplicate coil, another rung/routine), are permissives/interlocks true (stop, overload, guard, upstream conditions), any faults on the drive/VFD, the output module and contactor (output LED, fuse, wiring).</p>\n<ul class=\"q-points\"><li>Use cross-references and a trend of the involved bits; check the alarm log for the time of failure.</li></ul>\n"},{"id":1012,"course_slug":"industrial-automation","course_title":"Industrial Automation — PLC, SCADA, Modbus and OPC UA","ord":17,"level":"Scenario","priority":"High","question":"The MES shows wrong temperature values from a Modbus device. What could be wrong?","question_html":"The MES shows wrong temperature values from a Modbus device. What could be wrong?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Wrong register address (0- vs 1-based offset: 40001 is register 0), wrong function code (holding vs input registers), wrong data type or word/byte order for 32-bit floats, missing scaling factor (value ×10), wrong slave/unit id, or reading stale data after a communication error without checking quality.</p>\n<ul class=\"q-points\"><li>Compare with a tool like Modbus Poll and the device manual.</li></ul>\n"},{"id":1001,"course_slug":"industrial-automation","course_title":"Industrial Automation — PLC, SCADA, Modbus and OPC UA","ord":6,"level":"Beginner","priority":"Medium","question":"What is the difference between NO and NC contacts, and why is a stop button wired NC?","question_html":"What is the difference between NO and NC contacts, and why is a stop button wired NC?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Normally open contacts close when actuated; normally closed contacts open when actuated.</p>\n<ul class=\"q-points\"><li>Stop and emergency-stop buttons are wired NC so a broken wire or loose terminal has the same effect as pressing Stop — the machine fails safe instead of becoming impossible to stop.</li></ul>\n"},{"id":1006,"course_slug":"industrial-automation","course_title":"Industrial Automation — PLC, SCADA, Modbus and OPC UA","ord":11,"level":"Intermediate","priority":"Medium","question":"What is PID control? What do P, I and D do?","question_html":"What is PID control? What do P, I and D do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A feedback algorithm that adjusts an output to keep a process variable at its setpoint.</p>\n<ul class=\"q-points\"><li>P reacts to the current error (bigger error → bigger correction), I accumulates past error to remove steady-state offset, D reacts to how fast the error changes to reduce overshoot.</li><li>Tuning balances speed, overshoot and stability; add anti-windup and output limits.</li></ul>\n"},{"id":1007,"course_slug":"industrial-automation","course_title":"Industrial Automation — PLC, SCADA, Modbus and OPC UA","ord":12,"level":"Intermediate","priority":"Medium","question":"What is the difference between FAT and SAT?","question_html":"What is the difference between FAT and SAT?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Factory Acceptance Test: the system (panels, PLC/HMI programs) is tested at the integrator&#39;s site, often with simulated I/O, before shipping.</p>\n<ul class=\"q-points\"><li>Site Acceptance Test: after installation at the plant, with real field devices and process, before handover to production.</li><li>Both are witnessed and documented against the functional specification.</li></ul>\n"},{"id":1010,"course_slug":"industrial-automation","course_title":"Industrial Automation — PLC, SCADA, Modbus and OPC UA","ord":15,"level":"Advanced","priority":"Medium","question":"What is the difference between a standard PLC and a safety PLC?","question_html":"What is the difference between a standard PLC and a safety PLC?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A safety PLC is certified for functional safety (e.g. SIL 3 / PL e): redundant processors and I/O, self-diagnostics, safe communication (PROFIsafe, CIP Safety), and a protected safety program that goes to a safe state on any detected fault.</p>\n<ul class=\"q-points\"><li>Safety functions (e-stop, light curtains, guard doors, burner management) belong in the safety PLC or hard-wired circuits, never only in standard logic.</li></ul>\n"},{"id":1013,"course_slug":"industrial-automation","course_title":"Industrial Automation — PLC, SCADA, Modbus and OPC UA","ord":18,"level":"Scenario","priority":"Medium","question":"Management wants to let a cloud dashboard write setpoints directly to PLCs. What do you advise?","question_html":"Management wants to let a cloud dashboard write setpoints directly to PLCs. What do you advise?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Treat it as a safety and security risk.</p>\n<ul class=\"q-points\"><li>Keep control and interlocks in the PLC;</li><li>allow only bounded, validated setpoint changes through a controlled path (MES/SCADA with role-based access, approval, audit trail, limits enforced again in the PLC);</li><li>no inbound connections from the internet into OT — use outbound-only edge connections through the DMZ;</li><li>follow change-management and safety review (MOC).</li><li>Often a read-only cloud dashboard is the right first step.</li></ul>\n"},{"id":1014,"course_slug":"industry-40","course_title":"Industry 4.0 & IIoT — Smart Manufacturing Software","ord":1,"level":"Beginner","priority":"High","question":"What is Industry 4.0?","question_html":"What is Industry 4.0?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The fourth industrial revolution: connecting machines, products, people and IT systems through IIoT, cloud/edge computing, data analytics and AI so factories become transparent, flexible and self-optimising.</p>\n<ul class=\"q-points\"><li>It builds on the automation of Industry 3.0 (PLCs, IT) by adding connectivity and data-driven decisions — e.g. real-time OEE, predictive maintenance, full traceability and digital twins.</li></ul>\n"},{"id":1015,"course_slug":"industry-40","course_title":"Industry 4.0 & IIoT — Smart Manufacturing Software","ord":2,"level":"Beginner","priority":"High","question":"What is IIoT and how is it different from consumer IoT?","question_html":"What is IIoT and how is it different from consumer IoT?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Industrial IoT connects industrial equipment — sensors, PLCs, machines — to collect and use data.</p>\n<ul class=\"q-points\"><li>Compared with consumer IoT it demands higher reliability, determinism and safety, works with industrial protocols (OPC UA, Modbus, PROFINET), runs in harsh environments with long equipment lifetimes (20+ years, brownfield machines), and has stricter security and uptime requirements.</li></ul>\n"},{"id":1016,"course_slug":"industry-40","course_title":"Industry 4.0 & IIoT — Smart Manufacturing Software","ord":3,"level":"Beginner","priority":"High","question":"What is OEE and how is it calculated?","question_html":"What is OEE and how is it calculated?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Overall Equipment Effectiveness = Availability × Performance × Quality.</p>\n<ul class=\"q-points\"><li>Availability = run time ÷ planned time; Performance = (ideal cycle time × total count) ÷ run time; Quality = good count ÷ total count.</li><li>Example: 87.5 % × 90.5 % × 95 % ≈ 75 %.</li><li>It shows how much of planned time is truly productive and which loss to attack first.</li></ul>\n"},{"id":1017,"course_slug":"industry-40","course_title":"Industry 4.0 & IIoT — Smart Manufacturing Software","ord":4,"level":"Beginner","priority":"High","question":"What is an MES and how does it differ from ERP?","question_html":"What is an MES and how does it differ from ERP?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> MES executes and tracks production on the shop floor in real time — orders dispatched to lines, data collection, quality, traceability, OEE, work instructions.</p>\n<ul class=\"q-points\"><li>ERP manages the business — finance, purchasing, inventory, sales, planning over days/weeks.</li><li>ISA-95 defines the integration: ERP sends orders and receives production confirmations and consumption from MES.</li></ul>\n"},{"id":1019,"course_slug":"industry-40","course_title":"Industry 4.0 & IIoT — Smart Manufacturing Software","ord":6,"level":"Intermediate","priority":"High","question":"What is MQTT and why is it popular in IIoT?","question_html":"What is MQTT and why is it popular in IIoT?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A lightweight publish/subscribe protocol over TCP with a broker.</p>\n<ul class=\"q-points\"><li>Small overhead, works on unreliable networks, decouples producers from consumers, supports QoS levels, retained messages, last will (detect offline devices) and persistent sessions;</li><li>easy to secure with TLS and certificates;</li><li>all clouds support it.</li><li>Sparkplug B adds a standard namespace, payload format and state management for industrial use.</li></ul>\n"},{"id":1020,"course_slug":"industry-40","course_title":"Industry 4.0 & IIoT — Smart Manufacturing Software","ord":7,"level":"Intermediate","priority":"High","question":"Explain MQTT QoS levels.","question_html":"Explain MQTT QoS levels.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> QoS 0 — at most once, fire-and-forget, may be lost.</p>\n<ul class=\"q-points\"><li>QoS 1 — at least once, acknowledged, may be duplicated (consumers must be idempotent).</li><li>QoS 2 — exactly once via a four-step handshake, slower.</li><li>Telemetry usually uses 0 or 1; commands and important events use 1 with idempotency or 2.</li></ul>\n"},{"id":1021,"course_slug":"industry-40","course_title":"Industry 4.0 & IIoT — Smart Manufacturing Software","ord":8,"level":"Intermediate","priority":"High","question":"What is the difference between OPC UA and MQTT? When do you use which?","question_html":"What is the difference between OPC UA and MQTT? When do you use which?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> OPC UA is a full industrial interoperability standard — rich information models, browse/read/write/subscribe/methods, built-in security — ideal for connecting to machines and controllers.</p>\n<ul class=\"q-points\"><li>MQTT is a lightweight transport for pub/sub distribution of data to many consumers and to the cloud.</li><li>Common pattern: OPC UA at the machine/edge, MQTT (or OPC UA PubSub over MQTT) from the edge to the enterprise/cloud.</li></ul>\n"},{"id":1022,"course_slug":"industry-40","course_title":"Industry 4.0 & IIoT — Smart Manufacturing Software","ord":9,"level":"Intermediate","priority":"High","question":"What is edge computing and why is it needed in factories?","question_html":"What is edge computing and why is it needed in factories?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Processing data close to the machines on gateways or industrial PCs.</p>\n<ul class=\"q-points\"><li>Needed for low-latency decisions, operation when the network or cloud is down (store-and-forward), reducing bandwidth by filtering/aggregating high-frequency data, protocol translation, and keeping sensitive OT networks closed while sending only outbound data.</li></ul>\n"},{"id":1025,"course_slug":"industry-40","course_title":"Industry 4.0 & IIoT — Smart Manufacturing Software","ord":12,"level":"Advanced","priority":"High","question":"How does predictive maintenance work? What data do you need?","question_html":"How does predictive maintenance work? What data do you need?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Collect condition data (vibration, temperature, current, pressure, cycles) plus maintenance and failure history, engineer features (RMS, spectral peaks, trends), train anomaly-detection or remaining-useful-life models, deploy them at the edge or cloud, and turn predictions into alerts and CMMS work orders.</p>\n<ul class=\"q-points\"><li>Success needs domain experts, enough failure examples (or anomaly detection when rare), and a feedback loop measuring avoided downtime and false alarms.</li></ul>\n"},{"id":1026,"course_slug":"industry-40","course_title":"Industry 4.0 & IIoT — Smart Manufacturing Software","ord":13,"level":"Advanced","priority":"High","question":"Design a real-time OEE dashboard for 20 production lines.","question_html":"Design a real-time OEE dashboard for 20 production lines.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Edge per line reads machine state, counts and reject signals via OPC UA/Modbus, timestamps in UTC and publishes state changes to MQTT/IoT Hub.</p>\n<ul class=\"q-points\"><li>A stream processor or .NET consumer maintains current state per line, accumulates run/down time by reason and counts, stores events in a time-series/SQL store and shift summaries in SQL.</li><li>An ASP.NET Core API + SignalR pushes live updates to an Angular/React dashboard (andon view, OEE gauges, downtime Pareto).</li><li>Operators enter downtime reasons on a tablet.</li><li>Handle shift calendars, planned stops, ideal cycle times per product, and offline buffering.</li></ul>\n"},{"id":1029,"course_slug":"industry-40","course_title":"Industry 4.0 & IIoT — Smart Manufacturing Software","ord":16,"level":"Scenario","priority":"High","question":"A plant has 30-year-old machines without network connectivity. How do you bring them into an Industry 4.0 project?","question_html":"A plant has 30-year-old machines without network connectivity. How do you bring them into an Industry 4.0 project?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Retrofit: add sensors (current clamps for run/stop, vibration sensors, photo-eyes or counters for parts), read existing PLC I/O through gateways or protocol converters (serial Modbus → TCP), or use IO-Link and small edge devices.</p>\n<ul class=\"q-points\"><li>Start with simple, high-value signals (running/stopped, count, reject) to get OEE and downtime, then add condition monitoring.</li><li>Keep the machine&#39;s safety and control untouched; document and secure the new connections.</li></ul>\n"},{"id":1030,"course_slug":"industry-40","course_title":"Industry 4.0 & IIoT — Smart Manufacturing Software","ord":17,"level":"Scenario","priority":"High","question":"OEE dashboards show 110 % performance on some lines. What is wrong?","question_html":"OEE dashboards show 110 % performance on some lines. What is wrong?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Performance above 100 % means the ideal cycle time is wrong (too slow) or counts are inflated — wrong ideal cycle time for the running product, product not switched in the system at changeover, double counting from sensor bounce (needs debounce/edge detection), counting rejects twice, or run time understated (downtime recorded incorrectly).</p>\n<ul class=\"q-points\"><li>Validate the master data per product and the signal logic at the edge.</li></ul>\n"},{"id":1018,"course_slug":"industry-40","course_title":"Industry 4.0 & IIoT — Smart Manufacturing Software","ord":5,"level":"Beginner","priority":"Medium","question":"What is ISA-95?","question_html":"What is ISA-95?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> An international standard (IEC 62264) for integrating enterprise and control systems.</p>\n<ul class=\"q-points\"><li>It defines the levels (0–4), the functions of manufacturing operations management (production, quality, maintenance, inventory) and object models for data exchanged between ERP and MES, plus the equipment hierarchy enterprise → site → area → line → unit — used to structure data models and topic namespaces.</li></ul>\n"},{"id":1023,"course_slug":"industry-40","course_title":"Industry 4.0 & IIoT — Smart Manufacturing Software","ord":10,"level":"Intermediate","priority":"Medium","question":"What is the Unified Namespace?","question_html":"What is the Unified Namespace?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> An architecture where an event broker (typically MQTT) holds the current state of the whole business in one ISA-95-structured topic hierarchy.</p>\n<ul class=\"q-points\"><li>Machines, MES, ERP and analytics publish and subscribe there instead of building point-to-point integrations, making data discoverable and new consumers easy to add.</li><li>It needs governance of topic structure and payload contracts.</li></ul>\n"},{"id":1024,"course_slug":"industry-40","course_title":"Industry 4.0 & IIoT — Smart Manufacturing Software","ord":11,"level":"Intermediate","priority":"Medium","question":"What are MTBF and MTTR?","question_html":"What are MTBF and MTTR?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> MTBF (mean time between failures) = operating time ÷ number of failures — reliability.</p>\n<ul class=\"q-points\"><li>MTTR (mean time to repair) = total repair time ÷ number of repairs — maintainability.</li><li>Availability ≈ MTBF ÷ (MTBF + MTTR).</li><li>Improving maintenance, spare-part availability and diagnostics reduces MTTR; root-cause analysis and predictive maintenance increase MTBF.</li></ul>\n"},{"id":1027,"course_slug":"industry-40","course_title":"Industry 4.0 & IIoT — Smart Manufacturing Software","ord":14,"level":"Advanced","priority":"Medium","question":"What is a digital twin? Give a practical example.","question_html":"What is a digital twin? Give a practical example.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A live virtual model of a physical asset or process, synchronised with real data and used to monitor, predict and simulate.</p>\n<ul class=\"q-points\"><li>Example: a twin of a packaging line combining live machine states, a throughput model and maintenance data, used to test a new product changeover sequence virtually and to predict the effect of a slower filler on output.</li><li>Tools: Azure Digital Twins (DTDL), Asset Administration Shell, simulation software, virtual commissioning.</li></ul>\n"},{"id":1028,"course_slug":"industry-40","course_title":"Industry 4.0 & IIoT — Smart Manufacturing Software","ord":15,"level":"Advanced","priority":"Medium","question":"How do you handle millions of telemetry rows per day in SQL Server?","question_html":"How do you handle millions of telemetry rows per day in SQL Server?","answer_html":"<p>Batch inserts (SqlBulkCopy, table-valued parameters), narrow tables with tag ids, clustered columnstore indexes for history, partitioning by date with sliding-window archiving, report-by-exception/deadband to cut volume, aggregates (1-min/1-h) for dashboards, <code>DATE_BUCKET</code> and window functions for queries, separate hot recent data from cold history — or use a dedicated time-series store (ADX/InfluxDB) and keep SQL for transactional MES data.</p>\n"},{"id":1031,"course_slug":"industry-40","course_title":"Industry 4.0 & IIoT — Smart Manufacturing Software","ord":18,"level":"Scenario","priority":"Medium","question":"Telemetry arrives late and out of order after network outages. How do you keep reports correct?","question_html":"Telemetry arrives late and out of order after network outages. How do you keep reports correct?","answer_html":"<p>Use the device&#39;s source timestamp (UTC) rather than ingestion time, buffer and replay at the edge with sequence numbers, make ingestion idempotent (dedupe by device + sequence/timestamp), let aggregations handle late data (recompute affected windows, or watermarks in stream processing), and show data-quality flags on dashboards when data is incomplete.</p>\n"},{"id":1032,"course_slug":"industry-40","course_title":"Industry 4.0 & IIoT — Smart Manufacturing Software","ord":19,"level":"Scenario","priority":"Medium","question":"Management asks: \"How do we start Industry 4.0 with a small budget?\"","question_html":"Management asks: &quot;How do we start Industry 4.0 with a small budget?&quot;","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Start with a clear business problem and one KPI — usually OEE/downtime on a bottleneck line.</p>\n<ul class=\"q-points\"><li>Connect a few signals with low-cost edge hardware, build a simple dashboard and digital downtime-reason entry, run daily review meetings on the data, and quantify savings (more output, less scrap, less overtime).</li><li>Use the result to fund scaling with a standard architecture (ISA-95 naming, MQTT/OPC UA, central data store), then move to predictive maintenance and quality analytics.</li></ul>\n"},{"id":1033,"course_slug":"blockchain-web3","course_title":"Blockchain & Web3 Fundamentals","ord":1,"level":"Beginner","priority":"High","question":"What is blockchain? Explain it simply.","question_html":"What is blockchain? Explain it simply.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A blockchain is a shared digital ledger copied across many computers.</p>\n<ul class=\"q-points\"><li>Transactions are grouped into blocks; each block stores the hash of the previous block, forming a chain, so changing an old record would break every later link.</li><li>A consensus mechanism lets the computers agree on the next block without a central authority.</li><li>Result: a tamper-evident, transparent, append-only record that participants don&#39;t have to trust a single party to maintain.</li></ul>\n"},{"id":1034,"course_slug":"blockchain-web3","course_title":"Blockchain & Web3 Fundamentals","ord":2,"level":"Beginner","priority":"High","question":"What is Web3 and how is it different from Web2?","question_html":"What is Web3 and how is it different from Web2?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Web2 is today&#39;s platform-centric internet: users create content but companies own the data, accounts and payment rails.</p>\n<ul class=\"q-points\"><li>Web3 adds native ownership via blockchains: users hold assets and identity in wallets (private keys), applications are built on open smart contracts, and value can move peer to peer without intermediaries.</li><li>Trade-offs: user responsibility for keys, scalability limits, UX friction and regulatory uncertainty.</li></ul>\n"},{"id":1035,"course_slug":"blockchain-web3","course_title":"Blockchain & Web3 Fundamentals","ord":3,"level":"Beginner","priority":"High","question":"What is a hash and why is it important in blockchain?","question_html":"What is a hash and why is it important in blockchain?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A hash function maps any input to a fixed-size output (SHA-256 → 256 bits) that is deterministic, one-way, collision-resistant and changes completely with any tiny input change.</p>\n<ul class=\"q-points\"><li>Blockchains use hashes to link blocks (each header contains the previous block&#39;s hash), summarise transactions (Merkle root), derive addresses, and in Proof of Work mining (finding a hash below a target).</li></ul>\n"},{"id":1036,"course_slug":"blockchain-web3","course_title":"Blockchain & Web3 Fundamentals","ord":4,"level":"Beginner","priority":"High","question":"What is the difference between a public and a private blockchain?","question_html":"What is the difference between a public and a private blockchain?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A public (permissionless) blockchain lets anyone read, transact and participate in consensus (Bitcoin, Ethereum) — maximally decentralised and censorship-resistant, but slower and fully transparent.</p>\n<ul class=\"q-points\"><li>A private/permissioned blockchain restricts participants to known organisations (Hyperledger Fabric, Corda) — faster, private data channels, governance by a consortium, but less decentralised;</li><li>often used for supply chains and inter-bank settlement.</li></ul>\n"},{"id":1037,"course_slug":"blockchain-web3","course_title":"Blockchain & Web3 Fundamentals","ord":5,"level":"Beginner","priority":"High","question":"What is a smart contract?","question_html":"What is a smart contract?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A program stored on a blockchain that runs automatically and deterministically when called by a transaction, enforcing rules without intermediaries — e.g. an escrow releasing funds when conditions are met, a token contract tracking balances, a DEX swapping tokens.</p>\n<ul class=\"q-points\"><li>On Ethereum, contracts are written in Solidity, compiled to EVM bytecode, are immutable once deployed (unless proxies are used), and every execution costs gas.</li></ul>\n"},{"id":1039,"course_slug":"blockchain-web3","course_title":"Blockchain & Web3 Fundamentals","ord":7,"level":"Intermediate","priority":"High","question":"Proof of Work vs Proof of Stake?","question_html":"Proof of Work vs Proof of Stake?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> In PoW, miners spend computing power to find a valid block hash;</p>\n<ul class=\"q-points\"><li>the chain with the most cumulative work is canonical — very secure and battle-tested (Bitcoin) but energy-intensive.</li><li>In PoS, validators lock up (stake) coins to earn the right to propose and attest blocks;</li><li>dishonest behaviour is punished by slashing — far more energy-efficient (Ethereum cut energy use by ~99.95% after The Merge in Sep 2022) and gives economic finality, but is more complex and can concentrate stake.</li></ul>\n"},{"id":1040,"course_slug":"blockchain-web3","course_title":"Blockchain & Web3 Fundamentals","ord":8,"level":"Intermediate","priority":"High","question":"Explain gas and EIP-1559.","question_html":"Explain gas and EIP-1559.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Gas measures the computational work of an EVM operation; every transaction sets a gas limit and pays <code>gasUsed × gas price</code>.</p>\n<ul class=\"q-points\"><li>EIP-1559 (London, 2021) introduced a protocol-set <strong>base fee</strong> per block (adjusts with congestion and is burned) plus an optional <strong>priority tip</strong> to the validator;</li><li>users specify <code>maxFeePerGas</code> and <code>maxPriorityFeePerGas</code>.</li><li>Failed transactions still consume gas.</li><li>Gas prevents infinite loops and spam and pays for network resources.</li></ul>\n"},{"id":1041,"course_slug":"blockchain-web3","course_title":"Blockchain & Web3 Fundamentals","ord":9,"level":"Intermediate","priority":"High","question":"What are ERC-20 and ERC-721?","question_html":"What are ERC-20 and ERC-721?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Ethereum token standards (interfaces).</p>\n<ul class=\"q-points\"><li>ERC-20 defines fungible tokens with <code>balanceOf</code>, <code>transfer</code>, <code>approve</code>, <code>allowance</code>, <code>transferFrom</code> and Transfer/Approval events — every unit is identical (stablecoins, governance tokens).</li><li>ERC-721 defines non-fungible tokens where each <code>tokenId</code> is unique with an <code>ownerOf</code> and <code>tokenURI</code> for metadata (NFTs).</li><li>ERC-1155 supports many fungible and non-fungible token types in one contract with batch transfers.</li></ul>\n"},{"id":1042,"course_slug":"blockchain-web3","course_title":"Blockchain & Web3 Fundamentals","ord":10,"level":"Intermediate","priority":"High","question":"What are layer 2 solutions? Optimistic vs ZK rollups?","question_html":"What are layer 2 solutions? Optimistic vs ZK rollups?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Layer 2s execute transactions off the main chain and post compressed data and proofs to layer 1, inheriting its security while increasing throughput and cutting fees.</p>\n<ul class=\"q-points\"><li>Optimistic rollups (Arbitrum, Optimism, Base) assume batches are valid and allow fraud proofs during a challenge period (~7 days for L1 withdrawals).</li><li>ZK rollups (zkSync, Starknet, Scroll, Linea) post validity proofs, giving faster finality without a challenge window but with more complex proving.</li><li>EIP-4844 blobs (2024) made L2 data much cheaper.</li></ul>\n"},{"id":1046,"course_slug":"blockchain-web3","course_title":"Blockchain & Web3 Fundamentals","ord":14,"level":"Advanced","priority":"High","question":"How would you build a backend in .NET that confirms crypto payments?","question_html":"How would you build a backend in .NET that confirms crypto payments?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Generate a unique deposit address or payment reference per order (HD wallet derivation, or a payment contract with order IDs), subscribe to new blocks/Transfer events via an RPC provider (Nethereum with WebSockets or a provider&#39;s webhooks), match incoming transfers to orders (exact token contract, amount, decimals), wait for N confirmations or finality before marking paid (re-org safety), make processing idempotent (by tx hash + log index), persist state in SQL Server, handle under/over-payments and expirations, keep signing keys in an HSM (Azure Key Vault Managed HSM) if you send refunds, and monitor RPC failures with fallbacks.</p>\n<ul class=\"q-points\"><li>Also account for KYC/AML and tax rules.</li></ul>\n"},{"id":1049,"course_slug":"blockchain-web3","course_title":"Blockchain & Web3 Fundamentals","ord":17,"level":"Scenario","priority":"High","question":"A user says their tokens were stolen even though they never shared their seed phrase. What likely happened, and how could the dApp have protected them?","question_html":"A user says their tokens were stolen even though they never shared their seed phrase. What likely happened, and how could the dApp have protected them?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Likely causes: they signed a malicious <strong>approval</strong> or <strong>permit</strong> (gasless signature) giving a drainer contract the right to spend their tokens, signed a phishing transaction disguised as a mint/claim, interacted with a compromised frontend, or had malware.</p>\n<ul class=\"q-points\"><li>Protections: show clear human-readable signing (EIP-712), request exact (not unlimited) approvals, warn on known-malicious addresses, use transaction simulation (wallets like Rabby/Blockaid), domain verification, and encourage revoking old approvals (revoke.cash) and using hardware wallets.</li></ul>\n"},{"id":1050,"course_slug":"blockchain-web3","course_title":"Blockchain & Web3 Fundamentals","ord":18,"level":"Scenario","priority":"High","question":"Your company wants to \"put the supply chain on the blockchain\". How do you evaluate it?","question_html":"Your company wants to &quot;put the supply chain on the blockchain&quot;. How do you evaluate it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Ask: who are the participants and do they distrust each other?</p>\n<ul class=\"q-points\"><li>Who writes data, and who verifies it?</li><li>Blockchain only guarantees that recorded data hasn&#39;t been altered — not that it was true when entered (garbage in, garbage out), so you need trusted inputs (IoT sensors, signed attestations).</li><li>Evaluate a permissioned ledger (Hyperledger Fabric) vs a public chain with hashes/anchoring vs a shared database with signed audit logs;</li><li>consider privacy of commercial data, throughput, cost, governance, integration with ERP, and regulation.</li><li>Often the best design anchors document hashes on-chain and keeps data off-chain.</li></ul>\n"},{"id":1038,"course_slug":"blockchain-web3","course_title":"Blockchain & Web3 Fundamentals","ord":6,"level":"Beginner","priority":"Medium","question":"What is a wallet? What happens if you lose your seed phrase?","question_html":"What is a wallet? What happens if you lose your seed phrase?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A wallet manages private keys and signs transactions; the blockchain holds the balances.</p>\n<ul class=\"q-points\"><li>A seed phrase (12–24 words, BIP-39) is a human-readable backup from which all the wallet&#39;s keys are derived.</li><li>If you lose it and the device, the funds are permanently inaccessible — there&#39;s no reset.</li><li>If someone else gets it, they can take everything.</li><li>Store it offline; never share it or type it into websites.</li></ul>\n"},{"id":1043,"course_slug":"blockchain-web3","course_title":"Blockchain & Web3 Fundamentals","ord":11,"level":"Intermediate","priority":"Medium","question":"What is the difference between the UTXO model and the account model?","question_html":"What is the difference between the UTXO model and the account model?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> UTXO (Bitcoin): a transaction consumes previous unspent outputs and creates new ones; a balance is the sum of UTXOs you can unlock.</p>\n<ul class=\"q-points\"><li>It&#39;s parallelisable and privacy-friendlier (new addresses), but less convenient for complex logic.</li><li>Account model (Ethereum): global state stores balances and contract storage per address, and transactions update them directly — simpler for smart contracts, needs nonces for replay protection.</li></ul>\n"},{"id":1044,"course_slug":"blockchain-web3","course_title":"Blockchain & Web3 Fundamentals","ord":12,"level":"Intermediate","priority":"Medium","question":"What is an oracle and why is it needed?","question_html":"What is an oracle and why is it needed?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Smart contracts can only see on-chain data; they can&#39;t call web APIs, because every node must produce the same result.</p>\n<ul class=\"q-points\"><li>An oracle is a service that brings external data (prices, sports results, randomness) on-chain, ideally decentralised and tamper-resistant (Chainlink aggregates many data providers).</li><li>Poor oracle design — e.g. using a single DEX pool&#39;s spot price — enables price manipulation and flash-loan exploits.</li></ul>\n"},{"id":1045,"course_slug":"blockchain-web3","course_title":"Blockchain & Web3 Fundamentals","ord":13,"level":"Intermediate","priority":"Medium","question":"What is the blockchain trilemma?","question_html":"What is the blockchain trilemma?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The observation that a blockchain finds it hard to be simultaneously decentralised, secure and scalable — optimising two tends to sacrifice the third.</p>\n<ul class=\"q-points\"><li>Bitcoin and Ethereum L1 prioritise decentralisation and security; high-throughput chains often use fewer, more powerful validators.</li><li>Layer 2 rollups, sharding of data (danksharding/blobs) and better clients try to improve scalability without giving up the other two.</li></ul>\n"},{"id":1047,"course_slug":"blockchain-web3","course_title":"Blockchain & Web3 Fundamentals","ord":15,"level":"Advanced","priority":"Medium","question":"What are MEV and front-running?","question_html":"What are MEV and front-running?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Maximal Extractable Value is profit that block builders/searchers make by including, excluding or reordering transactions in a block — e.g. front-running a large DEX swap (buy before it, sell after: a &quot;sandwich attack&quot;), arbitrage and liquidations.</p>\n<ul class=\"q-points\"><li>Users are protected by slippage limits, private transaction relays (Flashbots Protect, MEV-blocker RPCs), batch auctions (CoW Swap) and commit-reveal schemes in contract design.</li></ul>\n"},{"id":1048,"course_slug":"blockchain-web3","course_title":"Blockchain & Web3 Fundamentals","ord":16,"level":"Advanced","priority":"Medium","question":"When should you NOT use a blockchain?","question_html":"When should you NOT use a blockchain?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> When a single trusted party (or a small set that already trusts each other) controls the data;</p>\n<ul class=\"q-points\"><li>when you need high throughput, low latency and cheap writes;</li><li>when data must be deleted or kept private (GDPR right to erasure conflicts with immutability);</li><li>when there&#39;s no need for censorship resistance or a shared ledger among mistrusting parties.</li><li>A regular database with audit logs, digital signatures or a ledger database (SQL Server ledger tables, Azure Confidential Ledger) is usually simpler, cheaper and faster.</li></ul>\n"},{"id":1051,"course_slug":"blockchain-web3","course_title":"Blockchain & Web3 Fundamentals","ord":19,"level":"Scenario","priority":"Medium","question":"Transactions from your backend keep failing with \"nonce too low\" or get stuck pending. How do you fix it?","question_html":"Transactions from your backend keep failing with &quot;nonce too low&quot; or get stuck pending. How do you fix it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Nonces must be sequential per sending account.</p>\n<ul class=\"q-points\"><li>Concurrent workers sending from the same account race for nonces, and a stuck low-fee transaction blocks later ones.</li><li>Fixes: one nonce manager per account (serialise sends, track the pending nonce in DB/Redis), set EIP-1559 fees from current base fee + a reasonable tip, replace stuck transactions by resending the same nonce with a higher fee (speed-up/cancel), use multiple sender accounts for throughput, and monitor the mempool and receipts with retries.</li></ul>\n"},{"id":1052,"course_slug":"solidity","course_title":"Solidity & Smart Contract Development","ord":1,"level":"Beginner","priority":"High","question":"What is Solidity and what is the EVM?","question_html":"What is Solidity and what is the EVM?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Solidity is a statically typed, contract-oriented programming language for writing smart contracts that run on the Ethereum Virtual Machine.</p>\n<ul class=\"q-points\"><li>The EVM is the sandboxed, deterministic, stack-based virtual machine that every Ethereum node runs to execute contract bytecode identically, metering each operation in gas.</li><li>Solidity compiles to EVM bytecode plus an ABI used by clients to call contract functions.</li></ul>\n"},{"id":1053,"course_slug":"solidity","course_title":"Solidity & Smart Contract Development","ord":2,"level":"Beginner","priority":"High","question":"Explain function visibility in Solidity.","question_html":"Explain function visibility in Solidity.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>public</code> — callable internally and externally (state variables get automatic getters).</p>\n<ul class=\"q-points\"><li><code>external</code> — callable only from outside the contract (or via <code>this.</code>).</li><li><code>internal</code> — this contract and contracts that inherit from it (default for state variables).</li><li><code>private</code> — only this contract.</li><li>Note: <code>private</code> doesn&#39;t hide data — all on-chain storage is publicly readable.</li></ul>\n"},{"id":1054,"course_slug":"solidity","course_title":"Solidity & Smart Contract Development","ord":3,"level":"Beginner","priority":"High","question":"What is the difference between view and pure functions?","question_html":"What is the difference between view and pure functions?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>view</code> functions can read state but not modify it; <code>pure</code> functions neither read nor modify state (only use their inputs and local variables).</p>\n<ul class=\"q-points\"><li>Both are free when called off-chain via <code>eth_call</code>, but cost gas when called from within a transaction.</li><li>The compiler enforces these restrictions.</li></ul>\n"},{"id":1055,"course_slug":"solidity","course_title":"Solidity & Smart Contract Development","ord":4,"level":"Beginner","priority":"High","question":"What are storage, memory and calldata?","question_html":"What are storage, memory and calldata?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> They&#39;re data locations.</p>\n<ul class=\"q-points\"><li><code>storage</code> is persistent contract state on the blockchain (expensive to write).</li><li><code>memory</code> is temporary, modifiable data that exists for the duration of a function call.</li><li><code>calldata</code> is a read-only, non-persistent area holding the arguments of external calls — the cheapest choice for external function array/string/struct parameters.</li><li>Assigning storage to a local <code>storage</code> variable creates a reference; to <code>memory</code> creates a copy.</li></ul>\n"},{"id":1056,"course_slug":"solidity","course_title":"Solidity & Smart Contract Development","ord":5,"level":"Beginner","priority":"High","question":"What is msg.sender vs tx.origin?","question_html":"What is msg.sender vs tx.origin?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>msg.sender</code> is the immediate caller of the current function — an EOA or another contract.</p>\n<ul class=\"q-points\"><li><code>tx.origin</code> is always the EOA that originally signed the transaction.</li><li>Using <code>tx.origin</code> for authorisation is a vulnerability: a malicious contract the user interacts with can call your contract and pass a <code>tx.origin == owner</code> check.</li><li>Always use <code>msg.sender</code>.</li></ul>\n"},{"id":1058,"course_slug":"solidity","course_title":"Solidity & Smart Contract Development","ord":7,"level":"Intermediate","priority":"High","question":"What is a reentrancy attack and how do you prevent it?","question_html":"What is a reentrancy attack and how do you prevent it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> When a contract makes an external call (e.g. sending Ether) before updating its own state, the recipient&#39;s code (fallback/receive or a token hook) can call back into the contract and repeat the action — for example withdrawing again before the balance is reduced (The DAO hack, 2016, ~3.6M ETH).</p>\n<ul class=\"q-points\"><li>Prevent it with the Checks-Effects-Interactions pattern (validate, update state, then call out), OpenZeppelin <code>ReentrancyGuard</code> (<code>nonReentrant</code>), pull-payment designs, and care with token callbacks (ERC-777/721/1155 hooks).</li></ul>\n"},{"id":1059,"course_slug":"solidity","course_title":"Solidity & Smart Contract Development","ord":8,"level":"Intermediate","priority":"High","question":"require vs revert vs assert vs custom errors?","question_html":"require vs revert vs assert vs custom errors?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>require(cond, &quot;msg&quot;)</code> validates inputs/conditions and reverts with an Error(string).</p>\n<ul class=\"q-points\"><li><code>revert CustomError(args)</code> (or <code>revert(&quot;msg&quot;)</code>) aborts explicitly, often after an <code>if</code>.</li><li>Custom errors (0.8.4+) are cheaper (4-byte selector + args instead of strings) and carry structured data.</li><li><code>assert(cond)</code> checks internal invariants that should never be false; failure raises a Panic error and indicates a bug.</li><li>All revert all state changes in the call.</li></ul>\n"},{"id":1060,"course_slug":"solidity","course_title":"Solidity & Smart Contract Development","ord":9,"level":"Intermediate","priority":"High","question":"How do you send Ether from a contract? transfer vs send vs call?","question_html":"How do you send Ether from a contract? transfer vs send vs call?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>transfer</code> forwards 2,300 gas and reverts on failure;</p>\n<ul class=\"q-points\"><li><code>send</code> forwards 2,300 gas and returns false on failure;</li><li><code>call{value: x}(&quot;&quot;)</code> forwards all available gas (configurable) and returns (success, data).</li><li>Since gas costs changed (EIP-1884) and smart-contract wallets need more gas, <code>call</code> with a checked return value is recommended — combined with reentrancy protection and the pull-payment pattern.</li></ul>\n"},{"id":1061,"course_slug":"solidity","course_title":"Solidity & Smart Contract Development","ord":10,"level":"Intermediate","priority":"High","question":"What changed in Solidity 0.8?","question_html":"What changed in Solidity 0.8?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Arithmetic is checked by default: overflow/underflow reverts (Panic 0x11) instead of silently wrapping, making SafeMath unnecessary;</p>\n<ul class=\"q-points\"><li><code>unchecked { }</code> blocks opt out for gas savings where safe.</li><li>ABI coder v2 became the default.</li><li>Later 0.8.x versions added custom errors (0.8.4), user-defined value types, <code>bytes.concat</code>/<code>string.concat</code>, named mapping parameters, user-defined operators and transient storage (0.8.28).</li></ul>\n"},{"id":1064,"course_slug":"solidity","course_title":"Solidity & Smart Contract Development","ord":13,"level":"Advanced","priority":"High","question":"How do upgradeable contracts work? What are the risks?","question_html":"How do upgradeable contracts work? What are the risks?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A proxy contract holds the state and forwards calls using <code>delegatecall</code> to an implementation contract, which runs in the proxy&#39;s storage context;</p>\n<ul class=\"q-points\"><li>upgrading means pointing the proxy to a new implementation (Transparent, UUPS, Beacon patterns).</li><li>Risks: storage layout collisions if variables are reordered, uninitialised implementations being taken over (use <code>_disableInitializers</code>), forgetting to protect the upgrade function, a malicious or compromised admin (mitigate with multisig + timelock), and loss of the &quot;code is law&quot; guarantee for users.</li></ul>\n"},{"id":1065,"course_slug":"solidity","course_title":"Solidity & Smart Contract Development","ord":14,"level":"Advanced","priority":"High","question":"How do you reduce gas costs in a contract?","question_html":"How do you reduce gas costs in a contract?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Reduce storage writes and reads (cache in memory/stack), pack variables into 32-byte slots, use <code>constant</code>/<code>immutable</code>, <code>calldata</code> for external inputs, custom errors, mappings instead of array searches, avoid unbounded loops, use <code>unchecked</code> where overflow can&#39;t happen, emit events instead of storing off-chain-only data, batch operations, transient storage for per-transaction flags, and tune the optimizer.</p>\n<ul class=\"q-points\"><li>Measure with gas reports/snapshots and never trade away safety.</li></ul>\n"},{"id":1068,"course_slug":"solidity","course_title":"Solidity & Smart Contract Development","ord":17,"level":"Scenario","priority":"High","question":"You must build a token sale contract that accepts USDC and gives buyers your token. What would you check for security?","question_html":"You must build a token sale contract that accepts USDC and gives buyers your token. What would you check for security?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use OpenZeppelin ERC-20 and <code>SafeERC20</code> (<code>safeTransferFrom</code> for USDC);</p>\n<ul class=\"q-points\"><li>handle decimals correctly (USDC has 6, your token 18);</li><li>checks-effects-interactions plus <code>nonReentrant</code>;</li><li>caps per wallet and a total cap;</li><li>start/end times;</li><li>pausable by a multisig;</li><li>no reliance on spot prices;</li><li>no unbounded loops (let users claim — pull, not push);</li><li>withdrawal of raised funds only by the treasury multisig;</li><li>events for every purchase;</li><li>comprehensive unit/fuzz tests including edge cases (zero amounts, rounding);</li><li>an external audit;</li><li>and legal/compliance review (securities rules, KYC).</li></ul>\n"},{"id":1069,"course_slug":"solidity","course_title":"Solidity & Smart Contract Development","ord":18,"level":"Scenario","priority":"High","question":"A deployed contract has a bug that can drain funds, and it's not upgradeable. What do you do?","question_html":"A deployed contract has a bug that can drain funds, and it&#39;s not upgradeable. What do you do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Act immediately: if it has a pause or emergency-withdraw function controlled by a multisig, use it;</p>\n<ul class=\"q-points\"><li>otherwise consider a white-hat rescue (exploit it yourself first to move funds to safety, coordinated with security firms such as SEAL 911), notify users and integrators to stop interacting, revoke approvals guidance, coordinate with exchanges/bridges to freeze stolen funds where possible, then deploy a fixed contract, migrate state from a snapshot, compensate users if possible, and publish a post-mortem.</li><li>Prevention: audits, bug bounties, pausability, rate limits and monitoring.</li></ul>\n"},{"id":1057,"course_slug":"solidity","course_title":"Solidity & Smart Contract Development","ord":6,"level":"Beginner","priority":"Medium","question":"What are events and why use them?","question_html":"What are events and why use them?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Events (<code>event Transfer(address indexed from, address indexed to, uint256 value)</code>) emitted with <code>emit</code> are stored in transaction logs, not contract storage — much cheaper.</p>\n<ul class=\"q-points\"><li>Off-chain apps (frontends, indexers, The Graph, .NET backends) subscribe to and filter them (up to 3 <code>indexed</code> topics).</li><li>Contracts can&#39;t read logs.</li><li>Use them for activity history, notifications and indexing.</li></ul>\n"},{"id":1062,"course_slug":"solidity","course_title":"Solidity & Smart Contract Development","ord":11,"level":"Intermediate","priority":"Medium","question":"What is the difference between an interface, an abstract contract and a library?","question_html":"What is the difference between an interface, an abstract contract and a library?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> An interface declares only external function signatures (no state, no implementation, no constructor) — used to interact with other contracts and define standards (IERC20).</p>\n<ul class=\"q-points\"><li>An abstract contract can contain state and implemented functions but has at least one unimplemented function or is marked abstract — it can&#39;t be deployed, only inherited.</li><li>A library holds reusable functions without state (internal functions are inlined;</li><li>public ones are deployed and called via delegatecall), attached to types with <code>using X for Y</code>.</li></ul>\n"},{"id":1063,"course_slug":"solidity","course_title":"Solidity & Smart Contract Development","ord":12,"level":"Intermediate","priority":"Medium","question":"What are modifiers? Give an example.","question_html":"What are modifiers? Give an example.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Reusable code that runs before and/or after a function body, where <code>_</code> marks where the body executes.</p>\n<ul class=\"q-points\"><li>Typical uses: access control (<code>onlyOwner</code>, <code>onlyRole</code>), state checks (<code>whenNotPaused</code>), reentrancy guards, input validation.</li><li>Example: <code>modifier onlyOwner() { if (msg.sender != owner) revert NotOwner(); _; }</code>.</li></ul>\n"},{"id":1066,"course_slug":"solidity","course_title":"Solidity & Smart Contract Development","ord":15,"level":"Advanced","priority":"Medium","question":"Why is on-chain randomness hard, and how do you get it?","question_html":"Why is on-chain randomness hard, and how do you get it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Everything on-chain is deterministic and visible: <code>block.timestamp</code>, <code>blockhash</code> and <code>block.prevrandao</code> can be predicted or influenced by validators/attackers, and users can revert transactions with unfavourable outcomes.</p>\n<ul class=\"q-points\"><li>Use a verifiable random function oracle (Chainlink VRF) that provides randomness with a cryptographic proof, or commit-reveal schemes among multiple parties.</li></ul>\n"},{"id":1067,"course_slug":"solidity","course_title":"Solidity & Smart Contract Development","ord":16,"level":"Advanced","priority":"Medium","question":"What is the difference between call, delegatecall and staticcall?","question_html":"What is the difference between call, delegatecall and staticcall?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>call</code> executes code in the target contract&#39;s context (its storage; <code>msg.sender</code> becomes the caller contract) and can send Ether.</p>\n<ul class=\"q-points\"><li><code>delegatecall</code> executes the target&#39;s code in the <strong>caller&#39;s</strong> context (caller&#39;s storage, <code>msg.sender</code> and <code>msg.value</code> preserved) — used by proxies and libraries;</li><li>dangerous with untrusted targets.</li><li><code>staticcall</code> is like call but reverts on any state modification — used for view calls.</li></ul>\n"},{"id":1070,"course_slug":"solidity","course_title":"Solidity & Smart Contract Development","ord":19,"level":"Scenario","priority":"Medium","question":"Your NFT mint is expensive and fails for some buyers because of gas. How do you improve it?","question_html":"Your NFT mint is expensive and fails for some buyers because of gas. How do you improve it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Optimise the mint: avoid storing per-token data that can be computed or kept off-chain (use a base URI + token ID), use ERC721A or similar batch-mint-optimised implementations for multi-mints, pack storage, use custom errors, and remove loops over all holders;</p>\n<ul class=\"q-points\"><li>use a Merkle-proof allowlist instead of storing whitelists on-chain;</li><li>deploy on a layer 2 (Base, Arbitrum) for much lower fees;</li><li>and test gas usage with Foundry gas reports before launch.</li></ul>\n"},{"id":1071,"course_slug":"dotnet-fullstack-interview","course_title":".NET Full Stack Developer Interview — End to End","ord":1,"level":"Beginner","priority":"High","question":"Explain the architecture of your current project end to end.","question_html":"Explain the architecture of your current project end to end.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use the skeleton: business context → frontend (framework, state, auth) → API (layers, validation, errors, logging) → data (EF/Dapper, SQL Server, stored procedures) → security (identity provider, JWT, roles) → delivery (Git, CI/CD, hosting) → <strong>your</strong> part and one measurable result.</p>\n<ul class=\"q-points\"><li>Draw the boxes while you speak and keep it to about two minutes; the interviewer will drill into what interests them.</li></ul>\n"},{"id":1072,"course_slug":"dotnet-fullstack-interview","course_title":".NET Full Stack Developer Interview — End to End","ord":2,"level":"Beginner","priority":"High","question":"What happens when a user clicks \"Save\" in your Angular/React app until the data is in SQL Server?","question_html":"What happens when a user clicks &quot;Save&quot; in your Angular/React app until the data is in SQL Server?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Form validation → service calls <code>POST /api/...</code> with JSON → interceptor adds the JWT → browser sends CORS preflight if cross-origin → Kestrel → middleware (exception handling, routing, CORS, authentication, authorization) → controller/endpoint → model binding and validation (400 if invalid) → service applies business rules → EF Core tracks the new entity → <code>SaveChangesAsync</code> opens a transaction and runs <code>INSERT</code> → SQL Server checks constraints and commits → API returns <code>201 Created</code> with the new resource → UI updates the list and shows a message.</p>\n<ul class=\"q-points\"><li>Errors flow back as ProblemDetails and are shown by the interceptor.</li></ul>\n"},{"id":1073,"course_slug":"dotnet-fullstack-interview","course_title":".NET Full Stack Developer Interview — End to End","ord":3,"level":"Beginner","priority":"High","question":"What is the difference between authentication and authorization? Which status codes do they return?","question_html":"What is the difference between authentication and authorization? Which status codes do they return?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Authentication proves <strong>who</strong> the caller is (token, cookie); failure → <strong>401 Unauthorized</strong>.</p>\n<ul class=\"q-points\"><li>Authorization decides <strong>what</strong> an authenticated caller may do (roles, policies, claims); failure → <strong>403 Forbidden</strong>.</li><li>In ASP.NET Core: <code>UseAuthentication()</code> then <code>UseAuthorization()</code>, <code>[Authorize(Roles = &quot;Admin&quot;)]</code> or policies.</li></ul>\n"},{"id":1074,"course_slug":"dotnet-fullstack-interview","course_title":".NET Full Stack Developer Interview — End to End","ord":4,"level":"Beginner","priority":"High","question":"What is CORS and why do you get a CORS error only in the browser?","question_html":"What is CORS and why do you get a CORS error only in the browser?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> CORS (Cross-Origin Resource Sharing) is a browser protection: JavaScript from origin A (e.g. <code>http://localhost:4200</code>) may read a response from origin B (<code>https://api.example.com</code>) only if B sends <code>Access-Control-Allow-Origin</code> allowing A.</p>\n<ul class=\"q-points\"><li>Non-simple requests trigger an <code>OPTIONS</code> preflight.</li><li>Postman and server-to-server calls don&#39;t enforce it.</li><li>Fix: <code>builder.Services.AddCors(...)</code> with the exact SPA origins and <code>app.UseCors(...)</code> before auth — never <code>AllowAnyOrigin</code> together with credentials.</li></ul>\n"},{"id":1075,"course_slug":"dotnet-fullstack-interview","course_title":".NET Full Stack Developer Interview — End to End","ord":5,"level":"Beginner","priority":"High","question":"Why do you return DTOs instead of EF entities from an API?","question_html":"Why do you return DTOs instead of EF entities from an API?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Entities expose internal fields (passwords, audit columns), create circular references for JSON, couple the API contract to the database schema, and with lazy loading can trigger extra queries during serialisation.</p>\n<ul class=\"q-points\"><li>DTOs give a stable contract, only the needed fields, and let you project in SQL (<code>Select(o =&gt; new OrderDto(...))</code>) so less data is read.</li></ul>\n"},{"id":1076,"course_slug":"dotnet-fullstack-interview","course_title":".NET Full Stack Developer Interview — End to End","ord":6,"level":"Intermediate","priority":"High","question":"How do you implement paging, sorting and searching in a full stack app?","question_html":"How do you implement paging, sorting and searching in a full stack app?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Server-side: the API takes <code>page</code>, <code>size</code> (clamped to a maximum, e.g. 100), <code>sort</code> and <code>q</code>;</p>\n<ul class=\"q-points\"><li>EF Core builds <code>Where</code> → <code>OrderBy</code> → <code>Skip/Take</code>, returns <code>{ items, total }</code> (or a continuation token for keyset paging on very large tables).</li><li>SQL needs an index that supports the filter + order.</li><li>UI: debounce the search box (300 ms), cancel the previous request (<code>switchMap</code> in RxJS / <code>AbortController</code>), keep page/sort in the URL query string so links and Back work.</li></ul>\n"},{"id":1077,"course_slug":"dotnet-fullstack-interview","course_title":".NET Full Stack Developer Interview — End to End","ord":7,"level":"Intermediate","priority":"High","question":"Where do you store the JWT in an SPA, and how do you refresh it?","question_html":"Where do you store the JWT in an SPA, and how do you refresh it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Safest: don&#39;t expose tokens to JavaScript — use a <strong>Backend-for-Frontend</strong> that keeps tokens server-side and gives the browser an HttpOnly, Secure, SameSite cookie.</p>\n<ul class=\"q-points\"><li>If the SPA holds tokens, keep the short-lived access token <strong>in memory</strong> (not <code>localStorage</code>, which XSS can read) and use refresh-token rotation via the identity provider (MSAL / oidc-client handle this).</li><li>On a 401 the interceptor refreshes once and retries; if refresh fails, redirect to login.</li></ul>\n"},{"id":1078,"course_slug":"dotnet-fullstack-interview","course_title":".NET Full Stack Developer Interview — End to End","ord":8,"level":"Intermediate","priority":"High","question":"How do you handle errors globally in both the API and the UI?","question_html":"How do you handle errors globally in both the API and the UI?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> API: <code>AddProblemDetails()</code> + an <code>IExceptionHandler</code> (or exception middleware) maps known exceptions to 400/404/409 and logs unknown ones as 500 with a correlation id;</p>\n<ul class=\"q-points\"><li><code>[ApiController]</code> returns validation errors automatically.</li><li>UI: one HTTP interceptor (Angular) or fetch wrapper (React) maps status codes to field errors, a login redirect, a &quot;no permission&quot; page, or a toast showing the correlation id;</li><li>React error boundaries / Angular <code>ErrorHandler</code> catch rendering errors.</li></ul>\n"},{"id":1079,"course_slug":"dotnet-fullstack-interview","course_title":".NET Full Stack Developer Interview — End to End","ord":9,"level":"Intermediate","priority":"High","question":"Explain the N+1 problem and how you detect and fix it.","question_html":"Explain the N+1 problem and how you detect and fix it.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> One query loads N parents, then one more query runs per parent to load children (often through lazy loading or a query inside a loop) — 1 + N round trips.</p>\n<ul class=\"q-points\"><li>Detect it with EF Core logging / Application Insights dependency telemetry / SQL Profiler showing many identical queries.</li><li>Fix: eager load with <code>Include</code>, or better project only what you need in one query (<code>Select</code>), use <code>AsSplitQuery</code> for large graphs, and never query inside a loop.</li></ul>\n"},{"id":1080,"course_slug":"dotnet-fullstack-interview","course_title":".NET Full Stack Developer Interview — End to End","ord":10,"level":"Intermediate","priority":"High","question":"How do you make an API call from Angular and show loading and error states?","question_html":"How do you make an API call from Angular and show loading and error states?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Inject <code>HttpClient</code> into a service that returns an <code>Observable&lt;T&gt;</code>; in the component either subscribe with <code>takeUntilDestroyed()</code> or use the <code>async</code> pipe / <code>toSignal</code>.</p>\n<ul class=\"q-points\"><li>Keep <code>loading</code>, <code>error</code> and <code>data</code> state (signals or a store), set loading before the call, clear it in <code>finalize</code>, catch errors with <code>catchError</code>.</li><li>For search, use <code>debounceTime</code> + <code>distinctUntilChanged</code> + <code>switchMap</code> so older requests are cancelled.</li></ul>\n"},{"id":1081,"course_slug":"dotnet-fullstack-interview","course_title":".NET Full Stack Developer Interview — End to End","ord":11,"level":"Intermediate","priority":"High","question":"How do you secure an ASP.NET Core Web API?","question_html":"How do you secure an ASP.NET Core Web API?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> HTTPS only (HSTS);</p>\n<ul class=\"q-points\"><li>authentication with JWT bearer from a trusted identity provider;</li><li>authorization with policies and resource checks (user may only see their own orders — prevents IDOR);</li><li>input validation;</li><li>parameterised queries (EF/Dapper do this — never concatenate SQL);</li><li>rate limiting (<code>AddRateLimiter</code>);</li><li>CORS restricted to known origins;</li><li>secrets in Key Vault;</li><li>security headers;</li><li>no stack traces to clients;</li><li>dependency scanning in CI;</li><li>logging without sensitive data.</li></ul>\n"},{"id":1085,"course_slug":"dotnet-fullstack-interview","course_title":".NET Full Stack Developer Interview — End to End","ord":15,"level":"Advanced","priority":"High","question":"How would you structure a new .NET full stack solution from scratch?","question_html":"How would you structure a new .NET full stack solution from scratch?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Domain, Application, Infrastructure and Api projects (clean architecture), tests projects alongside, and the SPA in its own folder.</p>\n<ul class=\"q-points\"><li>Dependency rule inwards; DI registers Infrastructure implementations of Application interfaces.</li><li>Cross-cutting: global error handling with ProblemDetails, validation (FluentValidation), structured logging with correlation ids, health checks, OpenAPI.</li><li>Start as a modular monolith, one database with schemas per module.</li><li>Add CI from day one.</li></ul>\n"},{"id":1086,"course_slug":"dotnet-fullstack-interview","course_title":".NET Full Stack Developer Interview — End to End","ord":16,"level":"Advanced","priority":"High","question":"Your list page takes 8 seconds to load. How do you find and fix the problem?","question_html":"Your list page takes 8 seconds to load. How do you find and fix the problem?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Measure layer by layer: browser DevTools Network (is it the API call or rendering?), API timing / Application Insights (controller vs SQL time), EF Core logs or SQL Profiler for the generated SQL, actual execution plan in SSMS.</p>\n<ul class=\"q-points\"><li>Typical fixes: server-side paging and projection, a covering index for the filter/sort columns, removing N+1 queries, <code>AsNoTracking</code>, caching reference data, removing <code>.Result</code> blocking, virtualising long lists and lazy-loading the route in the UI.</li><li>Re-measure after each change and report the before/after numbers.</li></ul>\n"},{"id":1087,"course_slug":"dotnet-fullstack-interview","course_title":".NET Full Stack Developer Interview — End to End","ord":17,"level":"Advanced","priority":"High","question":"Monolith or microservices for a new product? Justify.","question_html":"Monolith or microservices for a new product? Justify.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Usually a <strong>modular monolith</strong> first: one deployable, clear module boundaries, one database with separate schemas, in-process calls — simpler to build, test, deploy and debug.</p>\n<ul class=\"q-points\"><li>Move a module to a microservice when it needs independent scaling, release cadence, technology or team ownership.</li><li>Microservices add network failures, distributed data and transactions (sagas/outbox), observability and DevOps cost — accept that only for a concrete benefit.</li></ul>\n"},{"id":1090,"course_slug":"dotnet-fullstack-interview","course_title":".NET Full Stack Developer Interview — End to End","ord":20,"level":"Scenario","priority":"High","question":"The UI shows \"CORS error\" after you deployed the API to Azure, but it worked locally. What do you check?","question_html":"The UI shows &quot;CORS error&quot; after you deployed the API to Azure, but it worked locally. What do you check?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> The CORS policy must include the <strong>production SPA origin</strong> exactly (scheme + host + port, no trailing slash);</p>\n<ul class=\"q-points\"><li><code>UseCors</code> must run before <code>UseAuthentication</code>/<code>UseAuthorization</code> and before the endpoints;</li><li>Azure App Service&#39;s own CORS setting can override the app — use one or the other;</li><li>the &quot;CORS error&quot; can also hide a 500 or 404 (a failed preflight or an error page without CORS headers) — check the API logs and the Network tab for the actual status.</li></ul>\n"},{"id":1091,"course_slug":"dotnet-fullstack-interview","course_title":".NET Full Stack Developer Interview — End to End","ord":21,"level":"Scenario","priority":"High","question":"A user can see another customer's orders by changing the id in the URL. What is wrong and how do you fix it?","question_html":"A user can see another customer&#39;s orders by changing the id in the URL. What is wrong and how do you fix it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> That is an <strong>IDOR</strong> (Insecure Direct Object Reference) — broken object-level authorization, the #1 item in the OWASP API Security Top 10.</p>\n<ul class=\"q-points\"><li>Authentication alone is not enough: the API must check ownership on every request, e.g. filter by the current user&#39;s customer id from the token (<code>Where(o =&gt; o.CustomerId == currentUser.CustomerId)</code>) or use resource-based authorization (<code>IAuthorizationService.AuthorizeAsync(User, order, &quot;OwnsOrder&quot;)</code>).</li><li>Return 404 (not 403) to avoid revealing that the id exists, and add tests for it.</li></ul>\n"},{"id":1092,"course_slug":"dotnet-fullstack-interview","course_title":".NET Full Stack Developer Interview — End to End","ord":22,"level":"Scenario","priority":"High","question":"After a release the API is slow and SQL CPU is at 100%. What do you do?","question_html":"After a release the API is slow and SQL CPU is at 100%. What do you do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Stabilise first: roll back or scale up if users are blocked.</p>\n<ul class=\"q-points\"><li>Then find the top queries by CPU (Query Store / <code>sys.dm_exec_query_stats</code>), compare plans before and after the release — usually a new query without an index, a changed LINQ query producing a bad plan, an N+1 loop, or parameter sniffing.</li><li>Fix with an index, a rewritten query, forcing the last good plan in Query Store as a stop-gap, and add a performance test or alert so it is caught earlier next time.</li></ul>\n"},{"id":1093,"course_slug":"dotnet-fullstack-interview","course_title":".NET Full Stack Developer Interview — End to End","ord":23,"level":"Scenario","priority":"High","question":"You are asked to add a \"bulk upload products from Excel\" feature. Walk through your design.","question_html":"You are asked to add a &quot;bulk upload products from Excel&quot; feature. Walk through your design.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> UI: upload control with file type/size checks, shows progress, then a result summary.</p>\n<ul class=\"q-points\"><li>API: <code>POST</code> multipart, validate size, store the file (Blob Storage), return <code>202</code> with an import id.</li><li>Worker: read with a streaming library (e.g. ClosedXML/ExcelDataReader), validate every row and collect errors, insert in batches (<code>SqlBulkCopy</code> or EF Core bulk/<code>ExecuteUpdate</code>) inside a transaction or into a staging table then <code>MERGE</code>.</li><li>Status endpoint/SignalR for progress; downloadable error report; idempotent so a retry doesn&#39;t duplicate rows; audit who uploaded what.</li></ul>\n"},{"id":1082,"course_slug":"dotnet-fullstack-interview","course_title":".NET Full Stack Developer Interview — End to End","ord":12,"level":"Intermediate","priority":"Medium","question":"How do you handle two users editing the same record at the same time?","question_html":"How do you handle two users editing the same record at the same time?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Optimistic concurrency: a <code>ROWVERSION</code> column mapped as a concurrency token (<code>[Timestamp]</code>).</p>\n<ul class=\"q-points\"><li>The UI sends back the version it loaded; EF Core adds <code>WHERE Id = @id AND RowVersion = @v</code> to the UPDATE.</li><li>If no row is updated, EF throws <code>DbUpdateConcurrencyException</code>; the API returns <strong>409 Conflict</strong> and the UI shows &quot;this record changed — reload&quot;.</li><li>Pessimistic locking (holding locks) is rarely right for web apps.</li></ul>\n"},{"id":1083,"course_slug":"dotnet-fullstack-interview","course_title":".NET Full Stack Developer Interview — End to End","ord":13,"level":"Intermediate","priority":"Medium","question":"How do you manage configuration and secrets across dev, QA and production?","question_html":"How do you manage configuration and secrets across dev, QA and production?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> <code>appsettings.json</code> + <code>appsettings.{Environment}.json</code> + environment variables, bound to strongly typed options (<code>IOptions&lt;T&gt;</code>, validated on start).</p>\n<ul class=\"q-points\"><li>Secrets: User Secrets locally, Azure Key Vault in the cloud, accessed with Managed Identity (no passwords in config).</li><li>The SPA gets environment settings at build time (Angular <code>environment.ts</code> / Vite env) or from a <code>/config.json</code> loaded at startup so the same build can go to every environment.</li></ul>\n"},{"id":1084,"course_slug":"dotnet-fullstack-interview","course_title":".NET Full Stack Developer Interview — End to End","ord":14,"level":"Intermediate","priority":"Medium","question":"What does your CI/CD pipeline do for a full stack app?","question_html":"What does your CI/CD pipeline do for a full stack app?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> On PR: restore, build API and UI, run unit tests, lint, code analysis, maybe SonarQube and dependency scanning.</p>\n<ul class=\"q-points\"><li>On merge to main: build artefacts or Docker images with a version tag, deploy to dev, run DB migration scripts, smoke/integration tests, deploy to QA/UAT with approvals, then production via deployment slots or rolling update;</li><li>rollback = redeploy the previous artefact.</li><li>Pipelines are YAML in the repo.</li></ul>\n"},{"id":1088,"course_slug":"dotnet-fullstack-interview","course_title":".NET Full Stack Developer Interview — End to End","ord":18,"level":"Advanced","priority":"Medium","question":"How do you keep the API and the frontend contract in sync?","question_html":"How do you keep the API and the frontend contract in sync?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Generate the contract from the API: ASP.NET Core produces an OpenAPI document (built-in <code>AddOpenApi</code> in .NET 9+, or Swashbuckle/NSwag);</p>\n<ul class=\"q-points\"><li>generate TypeScript clients/types with NSwag, openapi-typescript or Orval in the build.</li><li>Version breaking changes (<code>/api/v2</code> or header versioning with Asp.Versioning), keep changes additive, and run contract or end-to-end tests in CI.</li></ul>\n"},{"id":1089,"course_slug":"dotnet-fullstack-interview","course_title":".NET Full Stack Developer Interview — End to End","ord":19,"level":"Advanced","priority":"Medium","question":"How do you run long work (reports, emails, imports) without blocking the user?","question_html":"How do you run long work (reports, emails, imports) without blocking the user?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Don&#39;t do it inside the HTTP request.</p>\n<ul class=\"q-points\"><li>Return <code>202 Accepted</code> with a job id, push a message to a queue (Azure Service Bus / RabbitMQ / Hangfire / a <code>Channel&lt;T&gt;</code> + <code>BackgroundService</code> for simple cases), process it in a worker, store status, and let the UI poll or receive a push via SignalR.</li><li>Make the job idempotent and retryable.</li></ul>\n"},{"id":1094,"course_slug":"dotnet-fullstack-interview","course_title":".NET Full Stack Developer Interview — End to End","ord":24,"level":"Scenario","priority":"Medium","question":"Two services need the same customer data. One team proposes sharing one database table. What do you advise?","question_html":"Two services need the same customer data. One team proposes sharing one database table. What do you advise?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Sharing tables couples deployments and schema changes between teams.</p>\n<ul class=\"q-points\"><li>Prefer one owner of the data: other services call its API or keep a read-only copy updated through events (CustomerUpdated on a message bus).</li><li>If they truly must share, use a view or a stable read schema as the contract.</li><li>Inside a modular monolith, keep separate schemas and access other modules only through their public interfaces.</li></ul>\n"},{"id":1095,"course_slug":"dotnet-fullstack-interview","course_title":".NET Full Stack Developer Interview — End to End","ord":25,"level":"Scenario","priority":"Medium","question":"Your Angular/React app works locally but shows a blank page after deployment. How do you debug it?","question_html":"Your Angular/React app works locally but shows a blank page after deployment. How do you debug it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Open DevTools console and Network: typical causes are a wrong <code>base href</code> / <code>base</code> path, 404s for JS bundles, the server not rewriting deep links to <code>index.html</code> (SPA fallback), missing environment config (API URL points to localhost), mixed content (HTTPS page calling HTTP API) or a runtime error in production mode only.</p>\n<ul class=\"q-points\"><li>Fix the hosting rewrite rule, base path and environment config, and add a smoke test to the pipeline.</li></ul>\n"},{"id":1096,"course_slug":"dotnet-fullstack-interview","course_title":".NET Full Stack Developer Interview — End to End","ord":26,"level":"Scenario","priority":"Medium","question":"An order must be saved, stock reduced and an email sent. How do you keep these consistent?","question_html":"An order must be saved, stock reduced and an email sent. How do you keep these consistent?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Order and stock in the <strong>same database transaction</strong> (<code>SaveChangesAsync</code> on one DbContext, or an explicit transaction).</p>\n<ul class=\"q-points\"><li>The email is a side effect outside the database, so use the <strong>outbox pattern</strong>: in the same transaction insert an &quot;OrderPlaced&quot; row into an Outbox table;</li><li>a background worker reads it, publishes/sends the email and marks it done.</li><li>If the app crashes after commit, the worker still sends it; consumers are idempotent so a retry doesn&#39;t send twice.</li></ul>\n"},{"id":1097,"course_slug":"hr-behavioral","course_title":"HR & Behavioural Interview","ord":1,"level":"Beginner","priority":"High","question":"Tell me about yourself.","question_html":"Tell me about yourself.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use Present → Past → Future in 60–90 seconds.</p>\n<ul class=\"q-points\"><li>Example: &quot;I&#39;m a .NET developer with 5 years&#39; experience in C#, ASP.NET Core, SQL Server and Azure.</li><li>Currently I build payment reconciliation APIs at ABC, where I cut the nightly batch from 3 hours to 25 minutes by moving row-by-row processing to set-based T-SQL and parallel jobs.</li><li>Earlier at XYZ I built SSIS/SSRS reporting for a banking client and set up Azure DevOps CI/CD.</li><li>I&#39;m looking for a role building cloud-native, high-scale services — which is why this Azure platform role interests me.&quot; Tailor the achievements to the job description.</li></ul>\n"},{"id":1098,"course_slug":"hr-behavioral","course_title":"HR & Behavioural Interview","ord":2,"level":"Beginner","priority":"High","question":"Why should we hire you?","question_html":"Why should we hire you?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Connect three things: the role&#39;s needs, your proof, and your attitude.</p>\n<ul class=\"q-points\"><li>&quot;You need someone who can build and run .NET services on Azure and improve performance.</li><li>I&#39;ve done exactly that — for example, I reduced API p95 latency by 60% with caching and query tuning, and I set up the CI/CD pipeline my team uses today.</li><li>I also communicate well with business users, and I&#39;m keen to keep learning, as my recent AZ-204 certification shows.</li><li>I can contribute from the first month.&quot;</li></ul>\n"},{"id":1099,"course_slug":"hr-behavioral","course_title":"HR & Behavioural Interview","ord":3,"level":"Beginner","priority":"High","question":"What are your strengths?","question_html":"What are your strengths?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Pick two or three that matter for the role and prove each with a short example.</p>\n<ul class=\"q-points\"><li>&quot;First, problem-solving under pressure — I led the fix for a production payment outage within 40 minutes by isolating a failing dependency and switching to a fallback.</li><li>Second, ownership — I don&#39;t stop at &#39;code complete&#39;; I add monitoring and documentation.</li><li>Third, learning quickly — I picked up Angular in a month to help our frontend team meet a release.&quot;</li></ul>\n"},{"id":1100,"course_slug":"hr-behavioral","course_title":"HR & Behavioural Interview","ord":4,"level":"Beginner","priority":"High","question":"What is your greatest weakness?","question_html":"What is your greatest weakness?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Choose a real but manageable weakness and show improvement.</p>\n<ul class=\"q-points\"><li>&quot;I used to find it hard to say no to extra requests, which once put a sprint commitment at risk.</li><li>I&#39;ve learned to make trade-offs visible: when a new request comes in, I ask my lead or product owner what should move out, and I track everything in Jira.</li><li>Over the last three sprints we met all our commitments.&quot;</li></ul>\n"},{"id":1101,"course_slug":"hr-behavioral","course_title":"HR & Behavioural Interview","ord":5,"level":"Beginner","priority":"High","question":"Why do you want to work here?","question_html":"Why do you want to work here?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Show research and fit: company → role → you.</p>\n<ul class=\"q-points\"><li>Mention the product/domain, something specific (tech stack, engineering culture, growth, customers), and how your experience matches.</li><li>Avoid answers about salary only or &quot;it&#39;s a big brand&quot;.</li><li>Example: &quot;Your platform serves banks across Asia, and I&#39;ve spent three years on banking data systems.</li><li>This role combines .NET microservices with Azure, which is where I want to grow, and your focus on automated testing matches how I work.&quot;</li></ul>\n"},{"id":1102,"course_slug":"hr-behavioral","course_title":"HR & Behavioural Interview","ord":6,"level":"Beginner","priority":"High","question":"Why are you leaving your current company?","question_html":"Why are you leaving your current company?","answer_html":"<p>Stay positive and future-focused: &quot;I&#39;ve had a great learning experience and delivered X and Y, but the project has moved into maintenance, and I&#39;m looking for larger-scale, cloud-native work and more ownership, which this role offers.&quot; Never criticise your employer, manager or colleagues, and keep it consistent with what&#39;s on LinkedIn and your resume.</p>\n"},{"id":1103,"course_slug":"hr-behavioral","course_title":"HR & Behavioural Interview","ord":7,"level":"Beginner","priority":"High","question":"Where do you see yourself in five years?","question_html":"Where do you see yourself in five years?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Show realistic ambition aligned with the company&#39;s path: &quot;I see myself as a senior engineer or tech lead owning a product area&#39;s architecture, mentoring developers and working closely with business stakeholders, with deeper Azure architecture expertise.</p>\n<ul class=\"q-points\"><li>I&#39;d like to grow into that here.&quot; Avoid &quot;running my own startup&quot; or &quot;in your job&quot;.</li></ul>\n"},{"id":1107,"course_slug":"hr-behavioral","course_title":"HR & Behavioural Interview","ord":11,"level":"Intermediate","priority":"High","question":"Tell me about a time you had a conflict with a colleague.","question_html":"Tell me about a time you had a conflict with a colleague.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> STAR, showing empathy and resolution — not blame.</p>\n<ul class=\"q-points\"><li>&quot;S: A senior QA and I disagreed on releasing a hotfix — he wanted a full regression; I worried about the client&#39;s outage.</li><li>T: We needed a decision within the hour.</li><li>A: I spoke with him privately, understood his concern about a past incident, and proposed a targeted regression of affected modules plus a rollback plan, then we presented both options to the lead together.</li><li>R: We released in 90 minutes with no new defects; since then we keep a &#39;hotfix test checklist&#39; we built together, and we work well.&quot;</li></ul>\n"},{"id":1108,"course_slug":"hr-behavioral","course_title":"HR & Behavioural Interview","ord":12,"level":"Intermediate","priority":"High","question":"Tell me about a failure or mistake you made.","question_html":"Tell me about a failure or mistake you made.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Choose a genuine mistake with low-to-moderate impact, own it, and show learning.</p>\n<ul class=\"q-points\"><li>&quot;I once deployed a database migration that locked a large table during business hours, causing 10 minutes of slow responses.</li><li>I rolled back immediately, informed my manager and the client, and redid it off-hours in batches.</li><li>I then added a pre-deployment checklist for migrations — size checks, off-peak scheduling and a tested rollback script — and we haven&#39;t had a repeat.&quot;</li></ul>\n"},{"id":1109,"course_slug":"hr-behavioral","course_title":"HR & Behavioural Interview","ord":13,"level":"Intermediate","priority":"High","question":"Describe a situation where you worked under pressure or a tight deadline.","question_html":"Describe a situation where you worked under pressure or a tight deadline.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Use STAR with planning and communication.</p>\n<ul class=\"q-points\"><li>&quot;When a client moved a release forward by two weeks, I prioritised by risk, automated repetitive validation with scripts, split tasks with two teammates, and gave daily status updates highlighting risks early.</li><li>We delivered three days early with zero UAT defects.&quot; Emphasise calm prioritisation, not heroic overtime.</li></ul>\n"},{"id":1110,"course_slug":"hr-behavioral","course_title":"HR & Behavioural Interview","ord":14,"level":"Intermediate","priority":"High","question":"Tell me about your biggest achievement.","question_html":"Tell me about your biggest achievement.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Pick a professional achievement relevant to the role, with a measurable result and your personal contribution.</p>\n<ul class=\"q-points\"><li>&quot;Re-architecting our report generation: reports took up to 20 minutes and often timed out.</li><li>I profiled the queries, introduced pre-aggregated tables refreshed by SSIS, moved generation to a background queue with email delivery, and added caching.</li><li>Average time dropped to under 30 seconds, and support tickets on reports fell by 80%.&quot;</li></ul>\n"},{"id":1111,"course_slug":"hr-behavioral","course_title":"HR & Behavioural Interview","ord":15,"level":"Intermediate","priority":"High","question":"How do you handle criticism or negative feedback?","question_html":"How do you handle criticism or negative feedback?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> &quot;I treat feedback as information to improve.</p>\n<ul class=\"q-points\"><li>I listen without being defensive, ask for specific examples, and agree on what to change.</li><li>For example, my lead said my PRs were too large to review; I started splitting work into smaller PRs with clear descriptions.</li><li>Review time dropped from days to hours, and I now give feedback to others the same way.&quot;</li></ul>\n"},{"id":1112,"course_slug":"hr-behavioral","course_title":"HR & Behavioural Interview","ord":16,"level":"Intermediate","priority":"High","question":"How do you prioritise when you have multiple tasks?","question_html":"How do you prioritise when you have multiple tasks?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> &quot;I first clarify impact and deadlines with stakeholders, then sort by urgency and importance (production issues and blockers first, then committed sprint work, then improvements).</p>\n<ul class=\"q-points\"><li>I break tasks into smaller pieces, track them in Jira, communicate early if something will slip, and ask my lead to arbitrate real conflicts rather than silently missing a deadline.&quot;</li></ul>\n"},{"id":1118,"course_slug":"hr-behavioral","course_title":"HR & Behavioural Interview","ord":22,"level":"Scenario","priority":"High","question":"You are offered a role, but another company is also likely to make an offer next week. What do you do?","question_html":"You are offered a role, but another company is also likely to make an offer next week. What do you do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Be honest and professional: thank the first company, express genuine interest, and ask for a reasonable timeline to decide (&quot;Could I confirm by next Friday?&quot;).</p>\n<ul class=\"q-points\"><li>Inform the second company that you have an offer and a deadline to see if they can speed up.</li><li>Compare on role, learning, team, stability, compensation and location — not just salary.</li><li>Once you accept, honour it; reneging after accepting damages your reputation (and in India some companies share data on offer drop-outs).</li></ul>\n"},{"id":1119,"course_slug":"hr-behavioral","course_title":"HR & Behavioural Interview","ord":23,"level":"Scenario","priority":"High","question":"Your manager asks you to finish a task that you believe will cause a production problem. What do you do?","question_html":"Your manager asks you to finish a task that you believe will cause a production problem. What do you do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Raise the concern immediately with facts: explain the risk, likely impact and evidence, and propose alternatives (a safer approach, a feature flag, a staged rollout, more testing).</p>\n<ul class=\"q-points\"><li>Put it in writing (email/ticket) so the decision is documented.</li><li>If the manager still decides to proceed and it isn&#39;t unethical or illegal, execute it as safely as possible with monitoring and a rollback plan.</li><li>If it&#39;s unethical or illegal (e.g. data privacy violation), escalate through proper channels.</li></ul>\n"},{"id":1104,"course_slug":"hr-behavioral","course_title":"HR & Behavioural Interview","ord":8,"level":"Beginner","priority":"Medium","question":"What do you know about our company?","question_html":"What do you know about our company?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Summarise in four points: what they do (products/services and customers), scale or market position (from public sources), recent news (launch, expansion, acquisition, results), and the tech/culture aspects relevant to you.</p>\n<ul class=\"q-points\"><li>Then connect: &quot;That&#39;s why this role appeals to me…&quot;.</li><li>Only use facts you&#39;ve verified — don&#39;t guess numbers.</li></ul>\n"},{"id":1105,"course_slug":"hr-behavioral","course_title":"HR & Behavioural Interview","ord":9,"level":"Beginner","priority":"Medium","question":"Are you willing to relocate or work in shifts?","question_html":"Are you willing to relocate or work in shifts?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Answer honestly with any conditions: &quot;Yes, I&#39;m open to relocating to Hyderabad; I&#39;d need about a month after my notice period to move.</p>\n<ul class=\"q-points\"><li>Could you tell me if relocation support is provided?&quot; For shifts: &quot;I&#39;m fine with occasional on-call rotations and overlap with US hours a few days a week.</li><li>Could you share how often night shifts are needed?&quot;</li></ul>\n"},{"id":1106,"course_slug":"hr-behavioral","course_title":"HR & Behavioural Interview","ord":10,"level":"Beginner","priority":"Medium","question":"What is your notice period? Can you join earlier?","question_html":"What is your notice period? Can you join earlier?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> State it exactly and what flexibility exists: &quot;My notice period is 60 days.</p>\n<ul class=\"q-points\"><li>My company allows buyout of part of it, so I could join in about 30–45 days if needed, and I&#39;m finishing my handover documentation early to make that possible.&quot; Don&#39;t claim an immediate joining you can&#39;t deliver — background checks will confirm dates.</li></ul>\n"},{"id":1113,"course_slug":"hr-behavioral","course_title":"HR & Behavioural Interview","ord":17,"level":"Intermediate","priority":"Medium","question":"What motivates you?","question_html":"What motivates you?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Be specific and genuine: &quot;Solving real problems for users and seeing measurable impact — like a report that used to take 20 minutes running in 30 seconds.</p>\n<ul class=\"q-points\"><li>I&#39;m also motivated by learning new things, such as moving our services to containers, and by working with a team where people help each other.&quot;</li></ul>\n"},{"id":1114,"course_slug":"hr-behavioral","course_title":"HR & Behavioural Interview","ord":18,"level":"Intermediate","priority":"Medium","question":"Do you prefer working alone or in a team?","question_html":"Do you prefer working alone or in a team?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> &quot;Both have their place.</p>\n<ul class=\"q-points\"><li>I enjoy deep focused work on complex problems, but I deliver best in a team: design discussions, code reviews and pairing improve quality.</li><li>In my current team I own the reporting module end to end and also review two colleagues&#39; PRs daily.&quot;</li></ul>\n"},{"id":1115,"course_slug":"hr-behavioral","course_title":"HR & Behavioural Interview","ord":19,"level":"Intermediate","priority":"Medium","question":"Have you ever disagreed with your manager? What happened?","question_html":"Have you ever disagreed with your manager? What happened?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Show respectful disagreement backed by data, then commitment.</p>\n<ul class=\"q-points\"><li>&quot;My manager wanted to add a feature directly into the monolith to meet a date; I was concerned about coupling.</li><li>I wrote a one-page comparison of effort and risks and suggested a small separate module behind an interface.</li><li>He agreed to a middle path: we shipped on time inside the monolith but behind the interface, and we extracted it later in two days.</li><li>Once a decision is made, I fully support it.&quot;</li></ul>\n"},{"id":1116,"course_slug":"hr-behavioral","course_title":"HR & Behavioural Interview","ord":20,"level":"Intermediate","priority":"Medium","question":"How do you keep your skills up to date?","question_html":"How do you keep your skills up to date?","answer_html":"<p>Give concrete, recent examples: &quot;I follow the .NET and Azure blogs and release notes, did the AZ-204 certification last year, build small side projects to try new features — recently Minimal APIs with .NET 10 and Azure Container Apps — and share learnings in our team&#39;s monthly tech talk.&quot;</p>\n"},{"id":1117,"course_slug":"hr-behavioral","course_title":"HR & Behavioural Interview","ord":21,"level":"Advanced","priority":"Medium","question":"Tell me about a time you went beyond your job description.","question_html":"Tell me about a time you went beyond your job description.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> &quot;Our team kept losing time on manual deployments.</p>\n<ul class=\"q-points\"><li>Although DevOps wasn&#39;t my role, I wrote a YAML pipeline in Azure DevOps for build, test and deployment to dev and QA, documented it and ran a session for the team.</li><li>Deployment time went from 2 hours to 15 minutes and failed deployments dropped sharply.</li><li>It was later adopted by two other teams.&quot;</li></ul>\n"},{"id":1120,"course_slug":"hr-behavioral","course_title":"HR & Behavioural Interview","ord":24,"level":"Scenario","priority":"Medium","question":"A teammate isn't contributing and you're doing their work. How do you handle it?","question_html":"A teammate isn&#39;t contributing and you&#39;re doing their work. How do you handle it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> First talk to them privately and without blame — there may be a reason (overload, personal issues, unclear tasks).</p>\n<ul class=\"q-points\"><li>Offer help and agree on clear ownership and deadlines.</li><li>Make work visible on the board.</li><li>If nothing changes and delivery is at risk, raise it factually with the lead, focusing on the impact on the work rather than on the person.</li></ul>\n"},{"id":1121,"course_slug":"hr-behavioral","course_title":"HR & Behavioural Interview","ord":25,"level":"Scenario","priority":"Medium","question":"What would you do in your first 30–60–90 days here?","question_html":"What would you do in your first 30–60–90 days here?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> &quot;First 30 days: learn the product, architecture, codebase, deployment process and people; fix small bugs to learn the workflow.</p>\n<ul class=\"q-points\"><li>60 days: own a feature end to end, contribute to code reviews and on-call.</li><li>90 days: deliver a meaningful improvement — for example in performance, testing or tooling — and agree on goals with my manager.&quot; Adjust to the role and ask what they expect.</li></ul>\n"},{"id":1122,"course_slug":"leadership","course_title":"Team Lead, Managerial & Agile Interview","ord":1,"level":"Beginner","priority":"High","question":"What is the difference between a tech lead and an engineering manager?","question_html":"What is the difference between a tech lead and an engineering manager?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> A tech lead owns technical direction for a team: architecture and design decisions, code quality, breaking down work, unblocking developers and mentoring — and still writes significant code.</p>\n<ul class=\"q-points\"><li>An engineering manager owns people and delivery: hiring, career growth, performance reviews, team health, process and cross-team coordination, with less hands-on coding.</li><li>In smaller teams (and in many Indian IT services companies&#39; &quot;team lead&quot; roles) one person does parts of both.</li></ul>\n"},{"id":1123,"course_slug":"leadership","course_title":"Team Lead, Managerial & Agile Interview","ord":2,"level":"Beginner","priority":"High","question":"Explain Scrum roles, events and artifacts.","question_html":"Explain Scrum roles, events and artifacts.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Accountabilities: Product Owner (maximises value, owns and orders the Product Backlog), Scrum Master (coaches the team and organisation in Scrum, removes impediments), Developers (create the increment, own the Sprint Backlog).</p>\n<ul class=\"q-points\"><li>Events: the Sprint (container), Sprint Planning, Daily Scrum (15 min), Sprint Review, Sprint Retrospective.</li><li>Artifacts with commitments: Product Backlog → Product Goal, Sprint Backlog → Sprint Goal, Increment → Definition of Done (2020 Scrum Guide).</li></ul>\n"},{"id":1124,"course_slug":"leadership","course_title":"Team Lead, Managerial & Agile Interview","ord":3,"level":"Beginner","priority":"High","question":"What is the difference between Agile and Waterfall?","question_html":"What is the difference between Agile and Waterfall?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Waterfall is sequential — requirements, design, build, test, deploy — each phase completed before the next, with change being costly;</p>\n<ul class=\"q-points\"><li>it suits fixed, well-understood requirements and regulated contexts.</li><li>Agile delivers in short iterations with working software each cycle, continuous feedback, and embraces change; it suits evolving requirements.</li><li>Many enterprises use hybrids (fixed milestones with agile execution).</li></ul>\n"},{"id":1127,"course_slug":"leadership","course_title":"Team Lead, Managerial & Agile Interview","ord":6,"level":"Intermediate","priority":"High","question":"How do you estimate a project or a large feature?","question_html":"How do you estimate a project or a large feature?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Clarify scope and acceptance criteria;</p>\n<ul class=\"q-points\"><li>break it into small tasks (≤ 2–3 days) including testing, reviews, deployment and documentation;</li><li>estimate with the people doing the work (planning poker or three-point estimates);</li><li>add buffers for risks and unknowns (spikes for unclear areas);</li><li>account for real capacity (meetings, support, leaves);</li><li>state assumptions and dependencies explicitly;</li><li>give a range rather than a single date;</li><li>re-forecast as you learn and communicate changes early.</li></ul>\n"},{"id":1128,"course_slug":"leadership","course_title":"Team Lead, Managerial & Agile Interview","ord":7,"level":"Intermediate","priority":"High","question":"How do you delegate work in your team?","question_html":"How do you delegate work in your team?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> I delegate outcomes with context: why it matters, what done looks like, constraints, deadline and check-in points.</p>\n<ul class=\"q-points\"><li>I match tasks to skills and growth goals — a stretch task for a junior with a senior pairing, critical-path work for experienced people — and adjust my involvement to their experience (directing for new members, delegating to experts).</li><li>Work is tracked on the board, I stay available to unblock, and I avoid taking the hardest tasks myself all the time so the team grows and I don&#39;t become a bottleneck.</li></ul>\n"},{"id":1129,"course_slug":"leadership","course_title":"Team Lead, Managerial & Agile Interview","ord":8,"level":"Intermediate","priority":"High","question":"How do you mentor junior developers?","question_html":"How do you mentor junior developers?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Regular 1:1s and pairing sessions;</p>\n<ul class=\"q-points\"><li>clear coding standards and examples;</li><li>code reviews that explain the <em>why</em> rather than just fixing things;</li><li>gradually larger tasks with support (first a bug fix, then a small feature, then owning a module);</li><li>encouraging questions and making it safe to make mistakes;</li><li>sharing resources and certification paths;</li><li>and celebrating progress publicly.</li><li>I measure success by how independently they can deliver after a few months.</li></ul>\n"},{"id":1130,"course_slug":"leadership","course_title":"Team Lead, Managerial & Agile Interview","ord":9,"level":"Intermediate","priority":"High","question":"How do you handle a team member who is underperforming?","question_html":"How do you handle a team member who is underperforming?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Gather facts first, then talk privately and early with specific examples, and listen to understand the cause (unclear expectations, skill gap, personal issues, motivation, wrong role).</p>\n<ul class=\"q-points\"><li>Agree on a concrete improvement plan with support — training, pairing, smaller scoped tasks — and regular check-ins.</li><li>Recognise improvements.</li><li>If there&#39;s no progress after a fair period, involve my manager and HR for a formal plan, documenting everything and treating the person with respect throughout.</li></ul>\n"},{"id":1131,"course_slug":"leadership","course_title":"Team Lead, Managerial & Agile Interview","ord":10,"level":"Intermediate","priority":"High","question":"How do you resolve a conflict between two team members?","question_html":"How do you resolve a conflict between two team members?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Speak with each privately to understand their perspective and underlying concerns, then bring them together focused on facts and the shared goal.</p>\n<ul class=\"q-points\"><li>For technical disagreements, agree criteria and use data or a quick spike to decide;</li><li>if still split, I make the call, explain the reasoning, record it (ADR) and ask both to commit.</li><li>For personal friction, set expectations for respectful behaviour and follow up.</li><li>I address conflict early, before it affects the team.</li></ul>\n"},{"id":1132,"course_slug":"leadership","course_title":"Team Lead, Managerial & Agile Interview","ord":11,"level":"Intermediate","priority":"High","question":"How do you handle scope changes requested in the middle of a sprint?","question_html":"How do you handle scope changes requested in the middle of a sprint?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Protect the Sprint Goal.</p>\n<ul class=\"q-points\"><li>I acknowledge the request, assess urgency and impact with the Product Owner: if it&#39;s truly critical (production issue, regulatory), we swap out work of similar size and make the trade-off visible;</li><li>otherwise it goes into the backlog for the next sprint planning.</li><li>For client projects, significant changes go through impact analysis and a change request covering effort, timeline and cost.</li></ul>\n"},{"id":1133,"course_slug":"leadership","course_title":"Team Lead, Managerial & Agile Interview","ord":12,"level":"Intermediate","priority":"High","question":"How do you report project status to stakeholders?","question_html":"How do you report project status to stakeholders?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Regular, concise updates: progress vs plan (with a RAG status), key achievements, risks and issues with mitigation plans, decisions needed from them, and next steps.</p>\n<ul class=\"q-points\"><li>I share bad news early with options and a recommendation, back statements with data (burnup charts, defect counts), tailor the detail to the audience (executives vs product owners), and keep a written record.</li></ul>\n"},{"id":1136,"course_slug":"leadership","course_title":"Team Lead, Managerial & Agile Interview","ord":15,"level":"Advanced","priority":"High","question":"How do you make architecture or technology decisions in a team?","question_html":"How do you make architecture or technology decisions in a team?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Start from requirements (including non-functional ones and constraints like budget, skills and timelines), list options, evaluate them against agreed criteria, run a spike or proof of concept for risky unknowns, involve the team and relevant experts, decide (and own the decision), and document it in an Architecture Decision Record with context, alternatives and consequences.</p>\n<ul class=\"q-points\"><li>Revisit decisions when context changes.</li><li>I prefer reversible decisions made quickly and irreversible ones made carefully.</li></ul>\n"},{"id":1137,"course_slug":"leadership","course_title":"Team Lead, Managerial & Agile Interview","ord":16,"level":"Advanced","priority":"High","question":"How do you measure your team's performance?","question_html":"How do you measure your team&#39;s performance?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> At team level, never individuals by raw output: DORA metrics (deployment frequency, lead time, change failure rate, time to restore), flow metrics (cycle time, throughput, WIP), quality (escaped defects, incident trends), predictability (planned vs delivered), and team health (engagement, attrition, on-call load).</p>\n<ul class=\"q-points\"><li>Business outcomes — features adopted, customer issues resolved — matter most.</li><li>I use metrics to find improvement opportunities, not to rank people.</li></ul>\n"},{"id":1139,"course_slug":"leadership","course_title":"Team Lead, Managerial & Agile Interview","ord":18,"level":"Scenario","priority":"High","question":"Your project is two weeks from the deadline and you realise it will be late by one week. What do you do?","question_html":"Your project is two weeks from the deadline and you realise it will be late by one week. What do you do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Verify the estimate with the team and find the cause.</p>\n<ul class=\"q-points\"><li>Inform stakeholders immediately — no surprises — with options: reduce scope (ship must-haves first, defer nice-to-haves), add focused help where it actually speeds things up (not late-stage new joiners on complex code — Brooks&#39;s law), remove distractions from the team, parallelise testing, or move the date.</li><li>Give a recommendation, get a decision in writing, update the plan, and run a retrospective later on why the risk wasn&#39;t spotted earlier.</li></ul>\n"},{"id":1140,"course_slug":"leadership","course_title":"Team Lead, Managerial & Agile Interview","ord":19,"level":"Scenario","priority":"High","question":"A critical production issue occurs on Friday evening. Walk me through how you handle it.","question_html":"A critical production issue occurs on Friday evening. Walk me through how you handle it.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Acknowledge and assess severity;</p>\n<ul class=\"q-points\"><li>assemble the right people (on-call, owners) and appoint an incident lead;</li><li>open a communication channel and inform stakeholders with regular updates.</li><li>Prioritise restoring service — roll back the last deployment, toggle a feature flag, fail over, scale up — before deep root-cause analysis.</li><li>Once stable, monitor, then do a blameless post-mortem the next week with a timeline, root causes (5 Whys), and owned action items (tests, alerts, runbooks, safer deployments).</li><li>Make sure people who worked late get time off.</li></ul>\n"},{"id":1141,"course_slug":"leadership","course_title":"Team Lead, Managerial & Agile Interview","ord":20,"level":"Scenario","priority":"High","question":"The client keeps adding requirements without changing the deadline. How do you manage it?","question_html":"The client keeps adding requirements without changing the deadline. How do you manage it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Make the impact visible: maintain a prioritised backlog with estimates, show the client what each new request displaces, and agree priorities together (MoSCoW: Must/Should/Could/Won&#39;t).</p>\n<ul class=\"q-points\"><li>Use a change-request process for contractual scope, protect the current sprint, and propose phased delivery — an MVP by the date, the rest in later releases.</li><li>Document decisions and keep the relationship collaborative rather than confrontational.</li></ul>\n"},{"id":1142,"course_slug":"leadership","course_title":"Team Lead, Managerial & Agile Interview","ord":21,"level":"Scenario","priority":"High","question":"Your best developer resigns in the middle of a critical release. What do you do?","question_html":"Your best developer resigns in the middle of a critical release. What do you do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Have an honest conversation to understand the reasons — if it&#39;s fixable (role, growth, compensation) and appropriate, explore a counter-offer with my manager, but don&#39;t rely on it.</p>\n<ul class=\"q-points\"><li>Immediately plan the knowledge transfer: document their modules, pair them with others during the notice period, record walkthroughs, and review critical code together.</li><li>Re-plan the release with stakeholders based on reduced capacity.</li><li>Longer term, reduce single points of failure by rotating ownership, and look at retention across the team.</li></ul>\n"},{"id":1125,"course_slug":"leadership","course_title":"Team Lead, Managerial & Agile Interview","ord":4,"level":"Beginner","priority":"Medium","question":"What are story points and velocity?","question_html":"What are story points and velocity?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Story points are relative estimates of effort, complexity and uncertainty (often Fibonacci: 1, 2, 3, 5, 8, 13), agreed by the team with planning poker — not hours.</p>\n<ul class=\"q-points\"><li>Velocity is the average number of points a team completes per sprint, used to forecast how much to plan.</li><li>Velocity is team-specific: don&#39;t compare teams or use it as a performance target.</li></ul>\n"},{"id":1126,"course_slug":"leadership","course_title":"Team Lead, Managerial & Agile Interview","ord":5,"level":"Beginner","priority":"Medium","question":"Scrum vs Kanban — when would you use each?","question_html":"Scrum vs Kanban — when would you use each?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Scrum works well for product development where you can plan in fixed sprints with a stable team and regular reviews.</p>\n<ul class=\"q-points\"><li>Kanban suits continuous, unpredictable inflow like support, maintenance and operations: work is pulled through columns with WIP limits, measured by cycle time.</li><li>Teams often combine them (&quot;Scrumban&quot;) — e.g. sprints for features with a Kanban lane for production support.</li></ul>\n"},{"id":1134,"course_slug":"leadership","course_title":"Team Lead, Managerial & Agile Interview","ord":13,"level":"Intermediate","priority":"Medium","question":"What do you do in a sprint retrospective that has become boring and repetitive?","question_html":"What do you do in a sprint retrospective that has become boring and repetitive?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Change the format (Start/Stop/Continue, 4Ls, sailboat, timeline), focus on one or two impactful improvements rather than long lists, review whether previous action items were done (and why not), use data (cycle time, escaped defects, interruptions), rotate the facilitator, and make it safe to raise uncomfortable topics.</p>\n<ul class=\"q-points\"><li>If the same issues keep coming back, escalate the systemic blockers outside the team.</li></ul>\n"},{"id":1135,"course_slug":"leadership","course_title":"Team Lead, Managerial & Agile Interview","ord":14,"level":"Intermediate","priority":"Medium","question":"How do you handle technical debt?","question_html":"How do you handle technical debt?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Make it visible as backlog items describing the business impact (slower delivery, incidents, security risk);</p>\n<ul class=\"q-points\"><li>prioritise debt in areas that change often or cause incidents;</li><li>reserve regular capacity (e.g. 15–20% per sprint) or attach refactoring to related feature work (Boy Scout rule);</li><li>prevent new debt with Definition of Done, reviews and automated quality gates;</li><li>and avoid big-bang rewrites unless the case is very strong — prefer incremental Strangler Fig approaches.</li></ul>\n"},{"id":1138,"course_slug":"leadership","course_title":"Team Lead, Managerial & Agile Interview","ord":17,"level":"Advanced","priority":"Medium","question":"How would you build and scale a new team from 3 to 10 developers?","question_html":"How would you build and scale a new team from 3 to 10 developers?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Define the team&#39;s mission and the roles needed (mix of seniorities and skills);</p>\n<ul class=\"q-points\"><li>set up a structured hiring process with a scorecard;</li><li>create strong onboarding (docs, buddy, dev environment scripts, first-week deliverable);</li><li>establish working agreements, coding standards, CI/CD and review practices before scaling;</li><li>split into sub-teams or feature pods around 5–7 people with clear ownership as you grow;</li><li>grow leaders internally (tech leads per pod);</li><li>and keep communication channels clear (team rituals, ADRs, documentation).</li></ul>\n"},{"id":1143,"course_slug":"leadership","course_title":"Team Lead, Managerial & Agile Interview","ord":22,"level":"Scenario","priority":"Medium","question":"Two senior developers disagree strongly on using microservices versus a modular monolith for a new product. How do you decide?","question_html":"Two senior developers disagree strongly on using microservices versus a modular monolith for a new product. How do you decide?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Bring the discussion back to requirements: team size, expected scale, deployment independence needs, domain boundaries, operational maturity, timeline and cost.</p>\n<ul class=\"q-points\"><li>Have each present trade-offs against those criteria; if uncertain, run a short spike.</li><li>For most new products with one team, a well-structured modular monolith is simpler and can be split later along module boundaries.</li><li>Decide, document the reasoning and the triggers that would make us revisit it in an ADR, and ask both to commit.</li></ul>\n"},{"id":1144,"course_slug":"leadership","course_title":"Team Lead, Managerial & Agile Interview","ord":23,"level":"Scenario","priority":"Medium","question":"A team member is consistently working late and seems burned out. What do you do?","question_html":"A team member is consistently working late and seems burned out. What do you do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Talk privately and with care: ask how they&#39;re doing and what&#39;s driving the extra hours (workload, unclear priorities, perfectionism, personal stress, fear of failing).</p>\n<ul class=\"q-points\"><li>Reduce or redistribute their load, clarify priorities, remove blockers, encourage time off and normal hours, and check the team&#39;s overall planning so this isn&#39;t systemic.</li><li>Point them to company support (EAP) if appropriate, and follow up regularly.</li></ul>\n"},{"id":1145,"course_slug":"leadership","course_title":"Team Lead, Managerial & Agile Interview","ord":24,"level":"Scenario","priority":"Medium","question":"You are asked to lead a team working on a technology you don't know well. How do you approach it?","question_html":"You are asked to lead a team working on a technology you don&#39;t know well. How do you approach it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Be honest about the gap and learn fast: study the architecture and fundamentals, pair with the team&#39;s experts and rely on them for detailed technical decisions, while I contribute leadership strengths — planning, unblocking, stakeholder management, quality practices.</p>\n<ul class=\"q-points\"><li>I&#39;d get hands-on with small tasks to build credibility, use external help (docs, vendor support, other teams) and set myself a learning plan with milestones.</li></ul>\n"},{"id":1146,"course_slug":"career-gaps-salary","course_title":"Career Gaps, Job Changes & Salary Negotiation","ord":1,"level":"Beginner","priority":"High","question":"I see a gap of a year in your resume. Can you explain it?","question_html":"I see a gap of a year in your resume. Can you explain it?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Answer in three parts: reason, activity, readiness.</p>\n<ul class=\"q-points\"><li>Example: &quot;My role was affected by a restructuring in early 2025.</li><li>I used the time to deepen my skills — I completed the AZ-204 certification and built a full-stack project with ASP.NET Core, React and Azure that&#39;s on my GitHub — and I also did a three-month freelance contract building APIs for a logistics client.</li><li>I&#39;m now fully ready and looking for a long-term role where I can contribute from day one.&quot; Keep it calm, factual and short, then move on.</li></ul>\n"},{"id":1147,"course_slug":"career-gaps-salary","course_title":"Career Gaps, Job Changes & Salary Negotiation","ord":2,"level":"Beginner","priority":"High","question":"What is your expected salary?","question_html":"What is your expected salary?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Give a researched range tied to the role: &quot;For a senior .NET developer role with Azure responsibilities in Pune, market data and my experience put my expectation at ₹22–25 lakhs fixed.</p>\n<ul class=\"q-points\"><li>I&#39;m open to discussing the full package, including variable pay and growth.&quot; If it&#39;s very early, you can ask to learn more about the role first, but don&#39;t avoid answering entirely if they insist.</li></ul>\n"},{"id":1148,"course_slug":"career-gaps-salary","course_title":"Career Gaps, Job Changes & Salary Negotiation","ord":3,"level":"Beginner","priority":"High","question":"What is your current CTC and why do you expect a big hike?","question_html":"What is your current CTC and why do you expect a big hike?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> State your current CTC honestly with its breakup (fixed vs variable).</p>\n<ul class=\"q-points\"><li>Justify the expectation with market value, expanded responsibilities in the new role, skills you bring (e.g. cloud, leadership), and competing offers if real.</li><li>Example: &quot;My current CTC is ₹12 LPA, of which ₹10.5 is fixed.</li><li>My current salary is below the market median because I&#39;ve been with the company since joining as a fresher, while my responsibilities have grown to leading a module and owning CI/CD.</li><li>The market range for this role is ₹18–22 LPA, which is the basis for my expectation.&quot;</li></ul>\n"},{"id":1151,"course_slug":"career-gaps-salary","course_title":"Career Gaps, Job Changes & Salary Negotiation","ord":6,"level":"Intermediate","priority":"High","question":"You were laid off. Was it because of performance?","question_html":"You were laid off. Was it because of performance?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> &quot;No — it was part of a company-wide restructuring that affected about 20% of the engineering team after a client contract ended.</p>\n<ul class=\"q-points\"><li>My last review rated me &#39;exceeds expectations&#39;, and my manager is happy to give a reference.</li><li>I&#39;ve stayed active since — I completed a certification and built a project with the latest .NET.&quot; Only say this if it&#39;s true; offer references.</li></ul>\n"},{"id":1152,"course_slug":"career-gaps-salary","course_title":"Career Gaps, Job Changes & Salary Negotiation","ord":7,"level":"Intermediate","priority":"High","question":"How do you justify switching from support/testing to development?","question_html":"How do you justify switching from support/testing to development?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Show evidence, not just interest: &quot;In my support role I wrote C# tools and SQL scripts that automated incident triage, saving about 10 hours a week.</p>\n<ul class=\"q-points\"><li>Over the last year I built two applications with ASP.NET Core and React (on GitHub), completed a .NET certification, and contributed bug fixes to our internal product with my lead&#39;s approval.</li><li>My production-support background helps me write more reliable, debuggable code.&quot;</li></ul>\n"},{"id":1153,"course_slug":"career-gaps-salary","course_title":"Career Gaps, Job Changes & Salary Negotiation","ord":8,"level":"Intermediate","priority":"High","question":"We can offer only 15% above your current salary. Will you accept?","question_html":"We can offer only 15% above your current salary. Will you accept?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Respond politely and with data: &quot;Thank you.</p>\n<ul class=\"q-points\"><li>I&#39;m keen on this role.</li><li>However, a 15% increase puts the offer below the market range for this position, and below another offer I&#39;m considering.</li><li>Would there be flexibility to reach ₹X fixed, or to add a joining bonus and a salary review after six months?&quot; If they can&#39;t move and you still want the job, decide based on the whole picture;</li><li>if not, decline gracefully.</li></ul>\n"},{"id":1157,"course_slug":"career-gaps-salary","course_title":"Career Gaps, Job Changes & Salary Negotiation","ord":12,"level":"Scenario","priority":"High","question":"You receive a written offer below your expectation, but you really want the job. What do you do?","question_html":"You receive a written offer below your expectation, but you really want the job. What do you do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Express enthusiasm and ask for time to review.</p>\n<ul class=\"q-points\"><li>Calculate the in-hand amount and compare with market data and your walk-away number.</li><li>Then make one well-justified request covering the specific gap, and offer alternatives (joining bonus, earlier appraisal, a higher designation, a relocation allowance, remote days).</li><li>If they can&#39;t move, decide consciously: accept if the role&#39;s learning, brand or stability is worth it, or politely decline.</li><li>Either way, get the final terms in writing.</li></ul>\n"},{"id":1158,"course_slug":"career-gaps-salary","course_title":"Career Gaps, Job Changes & Salary Negotiation","ord":13,"level":"Scenario","priority":"High","question":"Background verification shows a mismatch in your previous employment dates. What should you do?","question_html":"Background verification shows a mismatch in your previous employment dates. What should you do?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Contact HR immediately and explain transparently — for example, the resume used the project start date while the official joining date was a month later, or a notice period was shortened.</p>\n<ul class=\"q-points\"><li>Provide documents (offer and relieving letters, payslips, PF/UAN service history).</li><li>Small honest discrepancies can usually be resolved; deliberate misrepresentation usually leads to offer withdrawal.</li><li>Prevent it by using official dates on your resume.</li></ul>\n"},{"id":1149,"course_slug":"career-gaps-salary","course_title":"Career Gaps, Job Changes & Salary Negotiation","ord":4,"level":"Beginner","priority":"Medium","question":"Why did you change jobs so frequently?","question_html":"Why did you change jobs so frequently?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Explain briefly and show a positive pattern: &quot;My first role was a 10-month contract;</p>\n<ul class=\"q-points\"><li>the second company shut down its India development centre;</li><li>since then I&#39;ve been at my current company for three years and grown from developer to module lead.</li><li>Now I&#39;m looking for a long-term role where I can grow into a technical lead.&quot; Emphasise what you learned and your intention to stay.</li></ul>\n"},{"id":1150,"course_slug":"career-gaps-salary","course_title":"Career Gaps, Job Changes & Salary Negotiation","ord":5,"level":"Beginner","priority":"Medium","question":"Are you open to negotiation on the salary you mentioned?","question_html":"Are you open to negotiation on the salary you mentioned?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> &quot;Yes, I&#39;m flexible within reason.</p>\n<ul class=\"q-points\"><li>The role and growth matter to me as much as the number.</li><li>If the fixed component needs to be lower, components like a joining bonus, a performance review after six months, or equity could balance it.&quot; This shows flexibility without abandoning your target.</li></ul>\n"},{"id":1154,"course_slug":"career-gaps-salary","course_title":"Career Gaps, Job Changes & Salary Negotiation","ord":9,"level":"Intermediate","priority":"Medium","question":"Do you have other offers?","question_html":"Do you have other offers?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Be honest.</p>\n<ul class=\"q-points\"><li>If yes: &quot;Yes, I have one offer from a product company and I&#39;m in final rounds with another.</li><li>This role is my preferred option because of the team and the Azure work, so I&#39;d like to see if we can align on the package.&quot; Don&#39;t invent offers — companies sometimes ask for proof, and it damages trust.</li><li>If no: &quot;I&#39;m in process with a couple of companies, but this role is a strong fit for me.&quot;</li></ul>\n"},{"id":1155,"course_slug":"career-gaps-salary","course_title":"Career Gaps, Job Changes & Salary Negotiation","ord":10,"level":"Intermediate","priority":"Medium","question":"What is your notice period, and will you be able to join early?","question_html":"What is your notice period, and will you be able to join early?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> &quot;My notice period is 90 days.</p>\n<ul class=\"q-points\"><li>My company allows a buyout of up to 45 days, so I could join in about 45–60 days.</li><li>If the buyout amount is a concern, would you be able to support it?&quot; Be accurate — commitments you can&#39;t keep damage trust.</li></ul>\n"},{"id":1156,"course_slug":"career-gaps-salary","course_title":"Career Gaps, Job Changes & Salary Negotiation","ord":11,"level":"Advanced","priority":"Medium","question":"How would you respond to a counter-offer from your current employer?","question_html":"How would you respond to a counter-offer from your current employer?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Thank them, and evaluate against the reasons you wanted to leave — growth, technology, team, location — not only the money.</p>\n<ul class=\"q-points\"><li>If those reasons remain, decline respectfully: &quot;I appreciate the offer and everything I&#39;ve learned here, but I&#39;ve decided to take this new role for the learning opportunity.</li><li>I&#39;ll make sure the handover is smooth.&quot; If you accept a counter-offer, inform the new employer immediately and courteously.</li></ul>\n"},{"id":1159,"course_slug":"career-gaps-salary","course_title":"Career Gaps, Job Changes & Salary Negotiation","ord":14,"level":"Scenario","priority":"Medium","question":"You were freelancing for two years. The interviewer worries you won't fit into a team. How do you answer?","question_html":"You were freelancing for two years. The interviewer worries you won&#39;t fit into a team. How do you answer?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> &quot;Freelancing taught me to own outcomes end to end — requirements, delivery, deployment and support — and to communicate directly with clients.</p>\n<ul class=\"q-points\"><li>I also worked in teams on most projects: for example, with a client&#39;s in-house developers using Git and pull requests, and with designers and QA.</li><li>I&#39;m moving to full-time because I want deeper long-term product ownership and to grow with a team.</li><li>I&#39;ve closed my freelance engagements, so there&#39;s no conflict of interest.&quot;</li></ul>\n"},{"id":1160,"course_slug":"career-gaps-salary","course_title":"Career Gaps, Job Changes & Salary Negotiation","ord":15,"level":"Scenario","priority":"Medium","question":"An HR person asks for your expected salary before the technical rounds, and the posting has no range. What do you say?","question_html":"An HR person asks for your expected salary before the technical rounds, and the posting has no range. What do you say?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Try to learn the band first: &quot;Could you share the budgeted range for this role?</p>\n<ul class=\"q-points\"><li>That will help me give a meaningful answer.&quot; If they insist, give a researched range with a qualifier: &quot;Based on what I understand about the role and the market for senior .NET engineers in this city, I&#39;m looking at ₹24–28 lakhs fixed, depending on the responsibilities and total package.&quot; Avoid a single low number that anchors the whole negotiation.</li></ul>\n"},{"id":1161,"course_slug":"company-wise","course_title":"Company-wise Interview Preparation","ord":1,"level":"Beginner","priority":"High","question":"(IT services) Explain your current project and your role in it.","question_html":"(IT services) Explain your current project and your role in it.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Structure: business context → architecture → your role → tech stack → one challenge with a measurable result → process.</p>\n<ul class=\"q-points\"><li>Example: &quot;I work on a loan-origination system for a European bank.</li><li>It&#39;s an Angular frontend calling ASP.NET Core Web APIs, with SQL Server and Azure Service Bus for integration with the credit-scoring service, hosted on Azure App Service.</li><li>I own the document-verification module and the reporting APIs.</li><li>A key challenge was slow PDF generation timing out under load;</li><li>I moved it to a background worker with Service Bus and blob storage, cutting API response time from 25 seconds to under 1 second.</li><li>We work in two-week sprints with Azure DevOps pipelines and mandatory code reviews.&quot;</li></ul>\n"},{"id":1162,"course_slug":"company-wise","course_title":"Company-wise Interview Preparation","ord":2,"level":"Beginner","priority":"High","question":"(IT services) Why do you want to join a services company like ours?","question_html":"(IT services) Why do you want to join a services company like ours?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Mention exposure to multiple clients, domains and technologies;</p>\n<ul class=\"q-points\"><li>structured training and certifications;</li><li>global delivery experience;</li><li>career paths (technical or managerial);</li><li>and the company&#39;s specific strengths (a major client in your domain, a cloud or AI practice, a location).</li><li>Example: &quot;Working with global clients across banking and retail would broaden my domain knowledge.</li><li>Your Microsoft cloud practice is strong, and your certification programmes would help me move towards solution architecture.&quot;</li></ul>\n"},{"id":1163,"course_slug":"company-wise","course_title":"Company-wise Interview Preparation","ord":3,"level":"Beginner","priority":"High","question":"(IT services) Are you comfortable working in different shifts, technologies or locations?","question_html":"(IT services) Are you comfortable working in different shifts, technologies or locations?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Answer honestly with any constraints: &quot;Yes, I&#39;m comfortable with overlap with UK or US hours and occasional on-call support.</p>\n<ul class=\"q-points\"><li>I&#39;m primarily a .NET developer but I&#39;ve also worked on Angular and SSIS, and I&#39;m open to learning what the project needs.</li><li>I&#39;d prefer Pune or Bengaluru, but I&#39;m open to discussing other locations.&quot; Ask how often shifts rotate.</li></ul>\n"},{"id":1164,"course_slug":"company-wise","course_title":"Company-wise Interview Preparation","ord":4,"level":"Beginner","priority":"High","question":"(Freshers) What happens in online assessments like TCS NQT or similar tests, and how do you prepare?","question_html":"(Freshers) What happens in online assessments like TCS NQT or similar tests, and how do you prepare?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> These tests typically cover quantitative aptitude, logical reasoning, verbal ability, programming fundamentals and one or two coding problems, all under time pressure, with proctoring.</p>\n<ul class=\"q-points\"><li>Prepare with timed practice (aptitude books/sites, previous-year style questions), master one language for coding (input/output handling, strings, arrays), revise OOP, DBMS/SQL and OS basics, and read the official registration page for the current pattern, since sections change between years.</li></ul>\n"},{"id":1165,"course_slug":"company-wise","course_title":"Company-wise Interview Preparation","ord":5,"level":"Intermediate","priority":"High","question":"(Amazon) Tell me about a time you disagreed with your manager or team. (Have Backbone; Disagree and Commit)","question_html":"(Amazon) Tell me about a time you disagreed with your manager or team. (Have Backbone; Disagree and Commit)","answer_html":"<p class=\"q-short\"><strong>In short:</strong> &quot;S: My manager wanted to ship a reporting feature by computing aggregates on every request.</p>\n<ul class=\"q-points\"><li>T: I believed it would overload the database at month-end.</li><li>A: I gathered data — query costs and expected month-end traffic — and proposed pre-aggregating nightly with a fallback for today&#39;s data.</li><li>He disagreed because of the timeline, so we agreed on a quick load test; the on-request version exceeded our latency target by 4×.</li><li>R: We implemented my approach in 2 extra days; month-end reports stayed under 2 seconds.</li><li>Had the test gone the other way, I&#39;d have committed fully to his design.&quot; Show data, respect and commitment.</li></ul>\n"},{"id":1166,"course_slug":"company-wise","course_title":"Company-wise Interview Preparation","ord":6,"level":"Intermediate","priority":"High","question":"(Amazon) Tell me about a time you obsessed over a customer. (Customer Obsession)","question_html":"(Amazon) Tell me about a time you obsessed over a customer. (Customer Obsession)","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Pick a story where you went beyond the ticket to understand the user&#39;s real problem: &quot;Customers kept calling support about failed payments.</p>\n<ul class=\"q-points\"><li>Instead of just fixing the error message, I analysed 3 months of logs and found 40% of failures came from one bank&#39;s timeout.</li><li>I added retries with idempotency keys and a clear status page for pending payments.</li><li>Support calls on payments dropped by 60%.&quot; Quantify customer impact.</li></ul>\n"},{"id":1167,"course_slug":"company-wise","course_title":"Company-wise Interview Preparation","ord":7,"level":"Intermediate","priority":"High","question":"(Amazon) Tell me about a time you had to dive deep to solve a problem. (Dive Deep)","question_html":"(Amazon) Tell me about a time you had to dive deep to solve a problem. (Dive Deep)","answer_html":"<p class=\"q-short\"><strong>In short:</strong> &quot;Our API had random 5-second spikes.</p>\n<ul class=\"q-points\"><li>Dashboards showed nothing obvious, so I collected traces and found the spikes coincided with Gen 2 garbage collections caused by large JSON payloads (over 85 KB) landing on the Large Object Heap.</li><li>I switched to streaming serialisation and paginated the responses.</li><li>P99 latency dropped from 5.2 s to 300 ms.&quot; Show detailed investigation and data.</li></ul>\n"},{"id":1168,"course_slug":"company-wise","course_title":"Company-wise Interview Preparation","ord":8,"level":"Intermediate","priority":"High","question":"(Microsoft/Google) How do you approach a coding interview problem?","question_html":"(Microsoft/Google) How do you approach a coding interview problem?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Clarify requirements and constraints (input size, edge cases), talk through examples, state a brute-force solution with its complexity, optimise (hash map, two pointers, sorting, BFS/DFS, DP), write clean code while explaining, test with examples and edge cases, and state time and space complexity.</p>\n<ul class=\"q-points\"><li>Communicate throughout — interviewers evaluate problem solving and communication, not just the final answer.</li></ul>\n"},{"id":1169,"course_slug":"company-wise","course_title":"Company-wise Interview Preparation","ord":9,"level":"Intermediate","priority":"High","question":"(Product companies) Design a URL shortener.","question_html":"(Product companies) Design a URL shortener.","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Requirements: shorten URLs, redirect fast, custom aliases, expiry, analytics; read-heavy (say 100:1).</p>\n<ul class=\"q-points\"><li>API: <code>POST /urls</code> → short code; <code>GET /{code}</code> → 301/302 redirect.</li><li>ID generation: base62 encoding of a unique ID (from a distributed ID generator or a pre-allocated range per server) to avoid collisions, or random codes with collision checks.</li><li>Storage: key-value or SQL table (code PK → long URL, created, expiry, owner); cache hot codes in Redis; CDN/edge for redirects.</li><li>Scale: stateless app servers behind a load balancer, DB replication/sharding by code, async analytics via a queue.</li><li>Discuss 301 vs 302 (caching vs analytics), abuse/malware checks and rate limiting.</li></ul>\n"},{"id":1174,"course_slug":"company-wise","course_title":"Company-wise Interview Preparation","ord":14,"level":"Scenario","priority":"High","question":"You have interviews with a services company and a product company in the same week. How do you prepare differently?","question_html":"You have interviews with a services company and a product company in the same week. How do you prepare differently?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Common base: strong project explanation, C#/.NET/SQL fundamentals, behavioural stories.</p>\n<ul class=\"q-points\"><li>Services company: emphasise breadth (C#, ASP.NET Core, EF, SQL, Azure basics), client communication, flexibility, and classic coding programs.</li><li>Product company: practise DSA problems by pattern (timed), system design for your level, and values-based behavioural stories (e.g. Amazon LPs), and write code without IDE help.</li><li>Schedule the harder one later if possible, and use one as practice for the other.</li></ul>\n"},{"id":1175,"course_slug":"company-wise","course_title":"Company-wise Interview Preparation","ord":15,"level":"Scenario","priority":"High","question":"You failed a round at a company you really wanted. What do you do next?","question_html":"You failed a round at a company you really wanted. What do you do next?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Ask the recruiter politely for feedback (not always shared).</p>\n<ul class=\"q-points\"><li>Write down every question you were asked the same day and identify gaps.</li><li>Create a focused plan (e.g. 4 weeks of DSA patterns or system design) and practise with mock interviews.</li><li>Many companies allow re-applying after a cooling-off period (commonly around 6–12 months, depending on the company) — check the policy and re-apply stronger.</li><li>Meanwhile, keep interviewing elsewhere for practice.</li></ul>\n"},{"id":1170,"course_slug":"company-wise","course_title":"Company-wise Interview Preparation","ord":10,"level":"Intermediate","priority":"Medium","question":"(Consulting) The client says your team's delivery quality is poor. How do you respond?","question_html":"(Consulting) The client says your team&#39;s delivery quality is poor. How do you respond?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Listen first and gather specifics (which defects, which releases, impact).</p>\n<ul class=\"q-points\"><li>Acknowledge and share a data-backed analysis (defect trends, root causes — requirements gaps, rushed testing, environment issues).</li><li>Propose a concrete improvement plan: stronger acceptance criteria, automated tests and code-quality gates, a UAT checklist, release readiness reviews, and weekly quality reporting.</li><li>Agree on measurable targets and follow up.</li><li>Keep it professional and collaborative, never defensive.</li></ul>\n"},{"id":1171,"course_slug":"company-wise","course_title":"Company-wise Interview Preparation","ord":11,"level":"Intermediate","priority":"Medium","question":"(Startups) You get a 4-hour take-home: build a small task-management API. What do you prioritise?","question_html":"(Startups) You get a 4-hour take-home: build a small task-management API. What do you prioritise?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Read the requirements carefully and clarify assumptions in a README.</p>\n<ul class=\"q-points\"><li>Deliver a working, clean core first: a well-structured ASP.NET Core API with validation, error handling (ProblemDetails), persistence (EF Core with SQLite for easy setup), and a few meaningful tests.</li><li>Then add polish: Docker/compose to run it, OpenAPI docs, seed data, and notes on trade-offs and what you&#39;d do with more time (auth, pagination, CI).</li><li>Commit in small, clear steps.</li><li>Quality and clarity beat feature count.</li></ul>\n"},{"id":1172,"course_slug":"company-wise","course_title":"Company-wise Interview Preparation","ord":12,"level":"Intermediate","priority":"Medium","question":"(Taiwan) Why do you want to work in Taiwan, and how do you handle the language?","question_html":"(Taiwan) Why do you want to work in Taiwan, and how do you handle the language?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Give genuine reasons: Taiwan&#39;s strong technology and semiconductor ecosystem, the specific company&#39;s products, career growth, and quality of life.</p>\n<ul class=\"q-points\"><li>Be honest about language: &quot;I work professionally in English and my team communication would be in English;</li><li>I&#39;m learning Mandarin (currently basic) and I&#39;m comfortable working with bilingual colleagues and tools.&quot; State your work-permit or Gold Card status clearly.</li><li>Only apply for roles whose language requirements you can meet.</li></ul>\n"},{"id":1173,"course_slug":"company-wise","course_title":"Company-wise Interview Preparation","ord":13,"level":"Advanced","priority":"Medium","question":"(GCC) How would you work effectively with a team spread across India, Europe and the US?","question_html":"(GCC) How would you work effectively with a team spread across India, Europe and the US?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Agree overlap hours for synchronous meetings and rotate inconvenient slots fairly;</p>\n<ul class=\"q-points\"><li>use asynchronous communication well (clear written updates, design docs, recorded demos, well-written tickets);</li><li>document decisions (ADRs, wiki);</li><li>use follow-the-sun handovers with checklists for support;</li><li>be explicit about time zones in deadlines;</li><li>build relationships with video calls and occasional visits;</li><li>and respect cultural differences in communication styles.</li></ul>\n"},{"id":1176,"course_slug":"company-wise","course_title":"Company-wise Interview Preparation","ord":16,"level":"Scenario","priority":"Medium","question":"A recruiter from a big brand offers a role with a lower title and similar pay. Should you accept?","question_html":"A recruiter from a big brand offers a role with a lower title and similar pay. Should you accept?","answer_html":"<p class=\"q-short\"><strong>In short:</strong> Compare beyond the title: the actual responsibilities and level mapping (titles differ between companies — a &quot;Senior Engineer&quot; in one may equal &quot;Engineer II&quot; in another), learning opportunities, brand value for your career, team and manager, tech stack, stability, and growth path to the next level.</p>\n<ul class=\"q-points\"><li>Ask how levels map and what promotion timelines look like.</li><li>Negotiate the level if your experience justifies it, with examples of scope you&#39;ve handled.</li></ul>\n"}]