Question 1: Which MongoDB feature is essential for horizontal scalability in MEAN applications?
- Indexes
- Replica Sets
- Sharding
- Aggregation Pipelines
Explanation: Sharding distributes data across multiple servers for horizontal scaling.
This advanced MEAN Stack quiz is designed for experienced full-stack developers preparing for senior interviews and real-world production challenges. It covers Angular internals, MongoDB performance, Express security, Node.js scalability, and system-level design concepts.
Explanation: Sharding distributes data across multiple servers for horizontal scaling.
Explanation: Replica sets provide redundancy and automatic failover.
Explanation: $group performs aggregation calculations and is resource-intensive.
Explanation: Indexes improve reads but slow down writes due to maintenance cost.
Explanation: OnPush reduces unnecessary change detection cycles.
Explanation: Unsubscribed observables can cause memory leaks.
Explanation: RxJS Observables handle complex asynchronous data streams.
Explanation: It limits data transfer and database workload.
Explanation: Error-handling middleware centralizes error processing.
Explanation: Synchronous code blocks the Node.js event loop.
Explanation: Non-blocking I/O allows high concurrency.
Explanation: Clustering enables scaling across CPU cores.
Explanation: CPU-heavy tasks block the event loop.
Explanation: Pure pipes run only when input values change.
Explanation: Lazy loading reduces initial load time.
Explanation: References avoid excessive duplication.
Explanation: Over-normalization increases query complexity.
Explanation: Helmet sets secure HTTP headers.
Explanation: Frontend code is publicly accessible.
Explanation: Leaked secrets allow attackers to forge tokens.
Explanation: HttpOnly cookies cannot be accessed by JavaScript.
Explanation: CSRF tokens protect against forged requests.
Explanation: 422 indicates unprocessable entity.
Explanation: Versioning avoids breaking existing clients.
Explanation: Transactions require replica sets.
Explanation: Smart/dumb components separate logic and UI.
Explanation: Stateless APIs scale horizontally.
Explanation: Unhandled rejections can crash the process.
Explanation: Centralized logs help diagnose production issues.
Explanation: Zone.js triggers change detection on async tasks.
Explanation: Exposed databases can be attacked easily.
Explanation: Fewer indexes reduce write overhead.
Explanation: Rate limiting restricts repeated requests.
Explanation: AOT improves startup time and security.
Explanation: Indexes prevent full collection scans.
Explanation: Consistency simplifies frontend handling.
Explanation: Excessive change detection reduces performance.
Explanation: Monitoring detects issues before users do.
Explanation: Blue-green deployment avoids downtime.
Explanation: Services with Observables enable loose coupling.
Explanation: Validation prevents inconsistent data.
Explanation: Stateless APIs scale horizontally.
Explanation: Async pipe misuse can cause memory leaks.
Explanation: Direct DB access exposes sensitive credentials.
Explanation: Server-side aggregation reduces data transfer.
Explanation: PM2 restarts crashed processes automatically.
Explanation: Security testing prevents vulnerabilities.
This advanced MEAN Stack quiz is designed for experienced full-stack developers preparing for senior interviews and real-world production challenges. It covers Angular internals, MongoDB performance, Express security, Node.js scalability, and system-level design concepts.