Question 1: Why is indexing critical for MongoDB performance at scale?
- It reduces document size
- It avoids schema validation
- It speeds up query execution
- It enables sharding automatically
Explanation: Indexes significantly reduce query scan time.
This advanced MERN Stack quiz is designed for experienced full-stack developers and senior interview preparation. It covers real-world scenarios, performance optimization, security, scalability, and deep internals of MongoDB, Express, React, and Node.js.
Explanation: Indexes significantly reduce query scan time.
Explanation: $where executes JavaScript and is slow.
Explanation: Sharding distributes data across multiple servers.
Explanation: Replica sets provide redundancy and failover.
Explanation: Plain text passwords are a major security risk.
Explanation: Exposed secrets allow attackers to forge tokens.
Explanation: HttpOnly cookies block JavaScript access.
Explanation: CSRF tokens protect against cross-site request forgery.
Explanation: Server-side pagination limits data transfer.
Explanation: $group performs heavy computation.
Explanation: Keys help React optimize DOM updates.
Explanation: React.memo prevents re-rendering unchanged components.
Explanation: State updates during render cause infinite loops.
Explanation: Excessive lifting increases prop drilling.
Explanation: Context shares state globally.
Explanation: It runs on every render.
Explanation: Blocking code halts the event loop.
Explanation: Non-blocking I/O allows high concurrency.
Explanation: Clustering uses multiple CPU cores.
Explanation: CPU-heavy tasks block the event loop.
Explanation: Helmet adds secure HTTP headers.
Explanation: Secrets must remain private.
Explanation: 422 represents unprocessable entity.
Explanation: Monoliths scale poorly at large size.
Explanation: Microservices allow independent scaling.
Explanation: Redis is widely used for caching.
Explanation: Rate limiting prevents abuse.
Explanation: Validation prevents attacks and crashes.
Explanation: References reduce duplication.
Explanation: Over-normalization increases query complexity.
Explanation: Virtualization renders only visible items.
Explanation: Error boundaries catch rendering errors.
Explanation: useEffect manages side effects.
Explanation: Async/await improves readability.
Explanation: Unhandled rejections can crash apps.
Explanation: Consistency simplifies frontend handling.
Explanation: Structured logs improve observability.
Explanation: Smart/Dumb components improve structure.
Explanation: Validation maintains data integrity.
Explanation: Error middleware centralizes errors.
Explanation: Wrong dependencies cause bugs.
Explanation: Versioning avoids breaking clients.
Explanation: CORS issues are common in deployments.
Explanation: Monitoring detects issues proactively.
Explanation: Stateless APIs scale easily.
This advanced MERN Stack quiz is designed for experienced full-stack developers and senior interview preparation. It covers real-world scenarios, performance optimization, security, scalability, and deep internals of MongoDB, Express, React, and Node.js.