Question 1. What is TCP Slow Start?
- TCP doesn’t send data at full speed immediately.
- At first, congestion window (~14KB) is very small.
- With each ACK received, congestion window increases exponentially until a threshold, then grows linearly.
- Purpose: probe network capacity safely, avoid overwhelming routers.
- Implication: keep first HTML response <14KB (compressed) for best initial load speed.
Question 2. What are TypeScript Generics?
- Generics = types as variables.
- Accepting types as parameters like variables.
- Allow functions, classes, and interfaces to be type-agnostic while preserving type safety.
function identity<T>(value: T): T {
return value;
}
identity<number>(10); // Explicit
identity("hi"); // Type inferred
Benefits
- Reusability
- Type safety
- Works with complex data structures (arrays, promises, etc.)
Question 3. Difference between null and undefined
- undefined: variable declared but not assigned a value.
- null: explicitly assigned “no value”.