Scrivio Interview library

Service performance tuning

21 questions in 5 subtopics.

Finding bottlenecks

ConceptFoundations6 min read
Explain the USE and RED methods and how you would apply them to find a bottleneck in a Spring Boot service that has become slow.
DebuggingIntermediate7 min read
An endpoint in a Spring Boot service takes 2 seconds at p95, but the SQL statements it runs total about 100 ms according to the logs. How would you find where the rest of the time goes?
ScenarioIntermediate7 min read
A Spring Boot service handles 300 requests per second fine but falls over at 400: latency climbs sharply and errors appear, while CPU is only 50 percent. What does this pattern suggest and how do you confirm it?
ScenarioAdvanced7 min read
End-to-end latency through a chain of seven services has grown slowly over a year and no single team sees a problem in its own service. How would you lead the investigation across teams?

Thread pool and connection pool tuning

ConceptFoundations6 min read
What are the default Tomcat request thread limit and HikariCP pool size in Spring Boot, and what happens when all database connections are in use?
ScenarioIntermediate7 min read
A team raised HikariCP maximumPoolSize from 10 to 100 on each of 8 pods to fix timeouts. The database CPU went to 100 percent and latency got worse. Explain why and how you would size the pool.
DesignIntermediate7 min read
Your team plans to enable virtual threads with spring.threads.virtual.enabled=true on a Spring Boot 3.5 MVC service. How does that change how you tune thread pools and connection pools?
LeadershipAdvanced8 min read
Across your organisation, services set pool sizes by copying values from other services, and several incidents were caused by too many database connections. What standard would you introduce?
LeadershipPrincipal6 min read
Your largest shared database is near its connection and CPU limits because hundreds of service instances each open their own pools. As the senior technical leader, how do you decide between tuning, connection proxies, splitting the database, or changing architecture?

Latency budgets

ConceptFoundations6 min read
A Spring Boot service calls another service with RestClient and has no timeouts configured. Why is this dangerous, and how do timeouts relate to a latency budget?
DesignIntermediate6 min read
A checkout API must respond within 500 ms at p99 and calls inventory, pricing and payment services. How would you set latency budgets, timeouts and retries?
DesignAdvanced6 min read
Define how latency budgets should be set and governed on a platform where user requests pass through up to eight Java services.
LeadershipPrincipal6 min read
Product teams keep adding synchronous calls and features to the checkout path, and p99 latency has doubled in two years, which hurts conversion. As the senior technical leader, how do you introduce performance budgets that the organisation respects?

Load testing

ConceptFoundations6 min read
What is the difference between open and closed workload models in load testing, and why can a closed model hide latency problems?
ScenarioIntermediate6 min read
Plan a load test for a new Spring Boot order service before launch. What do you test, how, and what do you collect?
DesignAdvanced6 min read
Your organisation wants performance regressions caught before production across 80 services. Design a performance testing approach that teams will actually use.
LeadershipPrincipal6 min read
Capacity planning at your company is done by adding servers before each peak season, and costs grow faster than traffic. As the senior technical leader, how do you change capacity planning into a disciplined process?
LeadershipPrincipal6 min read
Your company is deciding whether to fund a permanent production-scale performance environment or rely on testing in production with synthetic traffic and canaries. As the senior technical leader, how do you decide?

Profiling a Spring application

ConceptFoundations6 min read
How would you profile CPU usage and allocations of a Spring Boot application running in production with low overhead?
DebuggingIntermediate7 min read
A Spring Boot application takes 45 seconds to start, which slows deployments and autoscaling. How would you find what is slow and what would you change?
DebuggingIntermediate7 min read
A flame graph of a slow Spring Data JPA endpoint shows most time inside Hibernate flush and dirty checking. What is likely happening and how would you fix it?