Scrivio Interview library

Embedded servers

20 questions in 7 subtopics.

Tomcat, Jetty, Undertow and Netty

CodingFoundations6 min read
How do you switch a Spring MVC application from Tomcat to Jetty in Maven, and which server does WebFlux use by default?
DesignAdvanced6 min read
Teams want to choose their own embedded servers: some Tomcat, some Jetty, some Netty. Should the platform allow this?
LeadershipPrincipal6 min read
Boot 4 drops support for an embedded server that some of your services use. What does this teach about choosing less common components, and how would you plan the change?

Server thread pools

ConceptFoundations6 min read
Explain server.tomcat.threads.max, server.tomcat.accept-count and server.tomcat.max-connections. What happens when all are reached?
DebuggingIntermediate7 min read
Under load a service's latency jumps to 30 seconds while CPU is at 20 percent. A thread dump shows all 200 Tomcat threads waiting in HikariPool.getConnection. What is happening, and what would you change?
LeadershipPrincipal7 min read
Java servers moved from thread-per-request to event loops and reactive stacks, and now back to blocking code with virtual threads. What does this history teach you about choosing a concurrency model for long-lived systems?

Graceful shutdown

ConceptFoundations5 min read
What does server.shutdown=graceful do and which properties control it?
ScenarioIntermediate5 min read
During every Kubernetes rolling deploy a few requests fail with connection reset, although graceful shutdown is enabled. What is wrong and how do you fix it?
LeadershipPrincipal5 min read
Graceful shutdown and connection draining problems appear in many incidents during deploys. What long-term standards would you set so that deploys are invisible to users?

HTTP/2 and compression

CodingFoundations7 min read
How do you enable HTTP/2 and response compression in a Spring Boot application, and what are the conditions?
ScenarioIntermediate6 min read
A team enables gzip compression on all responses, including those containing CSRF tokens and user data over HTTPS. A security reviewer raises a concern. What is it, and what would you decide?

SSL bundles

CodingFoundations6 min read
Configure HTTPS for a Spring Boot server using a PEM certificate and key with SSL bundles.
DesignIntermediate6 min read
Certificates in your services expire every 90 days and restarts for renewal cause incidents. How would you use SSL bundles to fix this, both for the server and for outgoing clients?
DesignAdvanced6 min read
TLS is terminated in different places across your services: at the load balancer, a service mesh and the application. How would you decide a standard and where SSL bundles fit?

Virtual threads on the server

ConceptFoundations6 min read
What does spring.threads.virtual.enabled=true change in a Spring Boot 3.2+ application on Java 21?
ScenarioIntermediate6 min read
After enabling virtual threads, a service handles more concurrent requests, but the database starts rejecting connections and a third-party client is overloaded. What happened and what do you do?
LeadershipAdvanced6 min read
Would you enable virtual threads by default for all MVC services in your organisation? How would you roll it out?

Server port and context path

ConceptFoundations6 min read
How do you set the server port and context path in Spring Boot, how do you start on a random port in tests, and how does the application find out which port it got?
DebuggingIntermediate7 min read
A Spring Boot service behind a load balancer is deployed with server.servlet.context-path=/orders. Redirects after login go to http://internal-host:8080/login instead of the public https URL, and links in HAL responses are wrong. Explain and fix.
DesignAdvanced6 min read
Teams use different context paths and ports for their services (some /, some /api, some /service-name), which complicates gateway routing, health checks and documentation. What standard would you set?