Module 1 · Foundations · Lesson 1 of 15
Common misconceptions, corrected
How to use this course
Work through the modules in order. The 222 interview questions are numbered continuously across the course, even when the original PDF starts a new question series. Each question includes its answer and a short example or interview tip. Code snippets illustrate a specific idea; application types, services and configuration must be supplied where shown.
Common misconceptions to correct first
- Value types are not synonymous with stack storage. A value can be a field inside a heap object; the JIT may also use registers or eliminate allocations.
asyncandawaitdo not automatically create a new thread. Awaiting incomplete I/O allows the caller to continue without blocking a thread for that wait.IQueryable<T>is an expression-tree query boundary. Whether an operation runs remotely depends on its provider and where execution or materialization occurs.List<T>(capacity)reserves capacity; it does not create that many elements or changeCount.- A hash code is not a unique identifier. Equal values must have equal hash codes, while unequal values may collide.
foreachdoes not make a collection immutable. Structural changes invalidate many enumerators; the collection's documented contract determines what is allowed.- Resource ownership and memory reachability are separate concerns. Dispose owned external resources promptly rather than relying on garbage collection.
Answering an interview question
Start with the contract, give one concrete example, then explain a trade-off or failure mode. For performance claims, describe what you would measure. For concurrency and distributed operations, state the invariant and the behavior after cancellation, retries or partial failure.
Try to answer aloud before reading the model answer. Afterward, change one assumption and explain whether your answer still holds. The final lessons include additional review checklists and references.