Web & Application Servers: Internal Architecture & Execution Models Quiz

Q1. You built a web server that spawns a new thread for each client connection. As traffic grows to thousands of concurrent connections, you observe high memory usage and many threads sitting idle waiting for I/O. Which concurrency model would handle this situation more efficiently?




Q2. In an application server, incoming requests need to be dispatched to the appropriate handler logic based on the URL and HTTP method. Which part of the server architecture is responsible for this mapping of requests to the correct handler?




Q3. Your web application server performs a database query on every incoming request. Opening a new database connection for each request is adding significant latency and overhead. What server-side strategy can help reduce this repeated connection overhead?




Q4. A web server is sending out a large static video file to a client. You want to minimize CPU usage during this file transfer. Which technique should the server use to efficiently send the file data to the client?




Q5. You need to update your running web server application to a new version without interrupting service or dropping active connections. Which deployment approach can achieve a graceful, zero-downtime upgrade?




Q6. On a Linux server, your application uses the `select()` system call to monitor thousands of client sockets for readiness. As concurrency grows, `select()` calls are consuming excessive CPU time scanning many file descriptors. What should you adopt to improve I/O scalability in this situation?




Q7. A server is designed such that when a socket is ready to read data, the main loop gets notified and then explicitly reads the data from that socket and processes it. Which I/O design pattern does this approach represent?




Q8. To utilize a machine with multiple CPU cores, a web server is configured to pre-launch several worker processes at startup. Each process accepts and handles a share of incoming requests independently. Which concurrency model does this describe?




Q9. Your web server runs on a single-threaded event loop using asynchronous I/O. When one particular request performs a computationally heavy operation (a long CPU-bound loop), all other requests handled by the server slow down dramatically. Why is this happening?




Q10. A web application currently uses CGI, spawning a new process for each request to run a script. You redesign it so that the scripting engine runs inside the server process itself (using a persistent interpreter or JIT-compiled VM). What is the primary performance benefit of this change?




Q11. A server initiates an asynchronous read on a socket and registers a callback. The operating system (or I/O library) reads the data in the background and invokes the callback only once the read is fully complete with the data ready to use. Which concurrency pattern does this describe?




Q12. You have a dedicated listener thread accepting connections and queuing them for worker threads. During traffic spikes, some clients occasionally receive connection refusals even though worker threads are available. What is a likely cause of these refused connections?




Q13. A web server needs to handle many simultaneous idle connections efficiently (mostly waiting on I/O) and also perform occasional CPU-intensive computations (like image resizing). Which architecture best accommodates both high I/O concurrency and CPU-bound tasks?




Q14. An application server written in a managed language needs to perform intensive image processing on each request. Rewriting the entire server in a low-level language isn't feasible. Which approach will boost performance for the image processing task while minimizing changes to the server?




Q15. In a Java-based web server, developers enabled hot class reloading to update code on the fly during development. If this technique is used frequently in a long-running production server, what is a potential downside to be aware of?




software-architecture