HikeCatalystHikeCatalyst
← All roles

Java / Spring Boot Developer Interview Questions

200 scenario-based questions with detailed model answers, organized skill-wise and tool-wise. Filter by topic, level or keyword, reveal the answer — then pressure-test yourself in a real mock.

SKILL / TOOL
LEVEL
200 questions
Q001Spring Boot CoreMid

Your Spring Boot 3 application starts in 45 seconds on a containerized fintech platform, but the SLA demands sub-10-second cold starts. The team is asking you to investigate. Walk through your diagnostic approach and the optimizations you would apply.

Q002Spring Boot CoreSenior

A retail e-commerce company runs 12 Spring Boot microservices. After migrating from Spring Boot 2.7 to 3.x, several services silently swallow exceptions inside @Transactional methods and return HTTP 200 instead of rolling back. Diagnose and fix the root cause.

Q003Spring Data & JPA/HibernateMid

Your team is getting N+1 query alerts from Datadog on a Spring Data JPA repository. The entity is Order with a @OneToMany to OrderItem and a @ManyToOne to Customer. Response times have degraded from 40ms to 800ms under load. How do you resolve this?

Q004Spring Data & JPA/HibernateSenior

A logistics platform processes 500 shipment status updates per second. The team is hitting database deadlocks between two Spring services that both update the Shipment table. Explain how you would diagnose and redesign the write path.

Q005REST API DesignMid

You are building a Spring Boot REST API for a healthcare provider. A GET /patients/{id} endpoint currently returns the full patient record including PII. A frontend team is consuming it and complaining it is slow to render. How do you evolve the API without breaking existing clients?

Q006REST API DesignSenior

Your Spring Boot API is consumed by 30 partner integrations. The product team wants to add mandatory request signing (HMAC-SHA256) to all POST/PUT endpoints without breaking existing partners over a 90-day migration window. Design the backward-compatible rollout.

Q007Spring SecurityMid

A Spring Boot API returns HTTP 403 for authenticated users on certain endpoints. The security config looks correct. Users have the ROLE_MANAGER authority but the @PreAuthorize annotation uses hasRole('MANAGER'). Requests are authenticated via JWT. What is likely wrong and how do you fix it?

Q008Spring SecuritySenior

A banking application needs to enforce that a customer can only access their own accounts, even if they guess another account's UUID. You have 200 microservices and cannot enforce this in every controller. Design a scalable solution using Spring Security.

Q009Microservices & Spring CloudMid

A Spring Cloud-based insurance platform has a Gateway routing requests to a Claims service and a Policy service. After a deployment, requests to /claims intermittently return 404 from the Gateway even though the Claims service is healthy in Consul. What are the likely causes?

Q010Microservices & Spring CloudSenior

Your organization is migrating a monolithic Spring Boot application to microservices. The CTO wants all inter-service calls to use synchronous REST. You foresee problems at scale. Present the architecture trade-offs and your recommended approach for a high-throughput order processing system.

Q011Concurrency & JVMMid

A Spring Boot service processing insurance claims uses a shared @Component that maintains a HashMap of in-flight claim IDs to prevent duplicate processing. Under high concurrency you are seeing duplicate claims processed. What is wrong and how do you fix it?

Q012Concurrency & JVMSenior

A high-frequency trading firm runs a Spring Boot service on Java 21. They want to process 100,000 concurrent market data subscriptions without a proportional thread count increase. The current blocking I/O approach uses 100,000 threads and is causing GC pressure. Redesign the threading model.

Q013JVM Tuning & GCMid

Your Spring Boot payment service experiences 2-3 second GC pauses every few minutes under production load, causing SLA breaches. The heap is 8GB and you are running the default G1GC. What do you investigate and what changes do you make?

Q014JVM Tuning & GCSenior

After a production deployment your Spring Boot service's heap usage climbs steadily over 6 hours from 2GB to 7GB without a corresponding traffic increase, then OOMs. Heap dumps show accumulation of HttpSession objects and Caffeine cache entries. Walk through root-cause analysis and resolution.

Q015Kafka & MessagingMid

Your Spring Kafka consumer is processing order events but you are seeing duplicate order confirmations being sent to customers. The consumer is configured with enable.auto.commit=true. Explain what is happening and how to fix it.

Q016Kafka & MessagingSenior

A media streaming company uses Kafka to fan out video transcoding jobs. A single slow consumer is causing consumer group lag to grow to 2 million messages across 12 partitions. The transcoding job itself cannot be made faster. Design a scalable consumption strategy.

Q017SQL & TransactionsMid

A Spring Boot service deducts inventory when an order is placed. Two concurrent requests for the same product arrive simultaneously. Despite using @Transactional, you are seeing inventory go negative. What is the isolation-level issue and how do you fix it?

Q018SQL & TransactionsSenior

A fintech platform needs to transfer funds between accounts atomically across two microservices — the Debit service and the Credit service — each with their own PostgreSQL database. Design the distributed transaction approach.

Q019Caching (Redis/Caffeine)Mid

Your Spring Boot product catalog API is experiencing a cache stampede: after a Redis TTL expiry, thousands of requests simultaneously hit the database before the cache is repopulated. The database spikes to 100% CPU. How do you mitigate this?

Q020Caching (Redis/Caffeine)Senior

A Spring Boot service at an e-commerce company uses Redis for session and product caches. After a Redis primary failover, you observe a cascade of NullPointerExceptions in production. The Jedis connection pool is exhausted. Diagnose and harden the Redis integration.

Q021Testing (JUnit/Mockito)Mid

A junior developer on your team writes @SpringBootTest for every test, making the test suite take 18 minutes to run and blocking the CI pipeline. How do you restructure the test pyramid and what annotations and patterns do you introduce?

Q022Testing (JUnit/Mockito)Senior

Your team needs to test a Spring Boot service that calls three downstream APIs and writes to two databases. The tests must be deterministic, fast, and catch contract regressions between services. Design the full testing strategy.

Q023Resilience (Resilience4j)Mid

Your Spring Boot service integrates with a third-party credit scoring API that sometimes takes 30 seconds to respond. This blocks your thread pool and causes your own service to return 503 to customers. Implement a resilience strategy using Resilience4j.

Q024Resilience (Resilience4j)Senior

A Spring Boot order service calls inventory, pricing, and shipping microservices in parallel to assemble an order summary. One service is flaky and causing overall p99 latency to spike to 8 seconds. Design a comprehensive resilience pattern including bulkheads, timeouts, and graceful degradation.

Q025Build & CI (Maven/Gradle)Mid

Your Maven-based Spring Boot project takes 12 minutes to build in CI. The team says it was 4 minutes six months ago. You need to bring it back to under 5 minutes. Walk through your investigation and optimization steps.

Q026Build & CI (Maven/Gradle)Senior

Your organization wants to enforce that no Spring Boot service can be deployed with a CVSS-7+ vulnerability in its dependencies. Design the toolchain and pipeline enforcement without creating a bottleneck that blocks 50 developer teams.

Q027Production DebuggingMid

A Spring Boot service in production starts throwing java.lang.OutOfMemoryError: Metaspace after running for several days. The heap appears normal. What causes Metaspace exhaustion and how do you diagnose and fix it?

Q028Production DebuggingSenior

A Spring Boot service at a ride-sharing company processes trip completion events. Production logs show the service responding correctly, but every 4 hours a subset of trips is missing from the reporting database. No exceptions are logged. Design your debugging approach from first principles.

Q029Reactive (WebFlux)Mid

Your team is migrating a Spring MVC REST controller to Spring WebFlux. The existing controller calls a JPA repository synchronously. The developer wraps the JPA call in Mono.fromCallable() and subscribes on a scheduler. A senior engineer says this is wrong. Explain why and propose the correct approach.

Q030Reactive (WebFlux)Senior

A Spring WebFlux service at a streaming platform aggregates real-time viewer counts from 50 data sources using WebClient. Under peak load the service OOMs with reactor.netty.http.client.pool.FixedChannelPool is full. Diagnose and redesign the connection management strategy.

Q031Spring Boot CoreSenior

A Spring Boot application deployed as a multi-tenant SaaS platform needs to route each request to the correct tenant's database schema at runtime. The tenant identifier comes from a JWT claim. Design the dynamic data source routing approach.

Q032Spring Data & JPA/HibernateMid

A Spring Boot service exports customer data for GDPR compliance. The query returns 500,000 rows and crashes with an OutOfMemoryError. The developer currently loads all records into a List<Customer>. Fix this without changing the database schema.

Q033REST API DesignSenior

Your Spring Boot public API serves 200 million requests per day. The product team wants to introduce API versioning. You currently have no versioning strategy and 40 external clients. Design a versioning strategy that minimizes client disruption.

Q034Spring SecurityMid

A Spring Boot API exposes an admin endpoint /admin/reports that accidentally returns data to any authenticated user. The @PreAuthorize annotation is present but not firing. You have @EnableWebSecurity on the config class. What do you check?

Q035Microservices & Spring CloudSenior

Your Spring Cloud microservices use Eureka for service discovery. During a network partition, Eureka enters self-preservation mode and stops evicting stale instances. Your services are routing requests to dead pods. Explain the trade-off and how you harden the discovery layer.

Q036Concurrency & JVMSenior

A Spring Boot service processes financial reports using @Async methods. Developers notice that after several hours, no async tasks execute even though the thread pool shows threads as active. No exceptions are logged. Diagnose this thread pool starvation scenario.

Q037Kafka & MessagingSenior

Your Kafka producer in a Spring Boot payment service is experiencing message loss during a pod restart. The ops team confirms that messages sent in the 2 seconds before shutdown are not in the Kafka topic. What producer configuration changes and application shutdown changes do you make?

Q038SQL & TransactionsMid

A Spring Boot service marks orders as SHIPPED by calling orderRepository.save(order) inside a @Transactional method. A separate scheduled job reads orders with status=SHIPPED and sends notifications. Occasionally notifications are sent before the order is truly saved. Explain the root cause and fix.

Q039Caching (Redis/Caffeine)Mid

A Spring Boot product API uses @Cacheable on a method that returns a Page<Product> from Spring Data. The cache works for the first request but subsequent requests with different page numbers return the same first page. What is wrong?

Q040Testing (JUnit/Mockito)Senior

A developer on your team writes a test that passes in isolation but fails when the full test suite runs. The failure is a NullPointerException in a Spring @Autowired field that is injected correctly in isolation. What are the common causes and how do you eliminate test ordering dependencies?

Q041Resilience (Resilience4j)Senior

A Spring Boot service at a travel booking company uses Resilience4j rate limiting to protect a hotel inventory API limited to 100 requests per second. During a burst of search traffic, users see error pages instead of degraded results. Re-design the rate limiting and user experience strategy.

Q042Production DebuggingSenior

Your Spring Boot service's CPU usage spikes to 100% every 30 minutes for about 90 seconds then returns to normal. The spikes correlate with nothing in the application logs. The service handles 5,000 req/min during the spike. Identify the cause systematically.

Q043Spring Boot CoreMid

A Spring Boot application has two @Configuration classes that each define a DataSource bean with the same name. At startup the application behaves unpredictably depending on classpath order. How do you detect and resolve this ambiguity?

Q044Spring Data & JPA/HibernateSenior

A Spring Boot service at a gaming company handles player leaderboard updates. At peak load 10,000 concurrent threads try to update the same leaderboard row. Hibernate's optimistic locking causes an avalanche of StaleObjectStateExceptions and retry storms. Redesign the write path.

Q045REST API DesignMid

Your Spring Boot service's POST /orders endpoint is not idempotent. A mobile client with intermittent connectivity retries failed requests and creates duplicate orders. How do you implement idempotency without major changes to the business logic?

Q046JVM Tuning & GCSenior

A Spring Boot batch processing service runs nightly to process 50 million records. The JVM is configured with -Xmx16g. The batch runs fine for the first 2 hours then slows down progressively, taking 6 hours total instead of 3. CPU and I/O look normal. What do you investigate?

Q047Reactive (WebFlux)Senior

A Spring WebFlux service must implement a request deduplication window: identical payment requests arriving within 5 seconds of each other must return the same response without re-processing. Design this using reactive primitives.

Q048Build & CI (Maven/Gradle)Senior

Your team wants to publish a shared Spring Boot starter library to an internal Nexus repository. The starter must auto-configure a custom AuditFilter bean only when a specific property is set. Design the starter from scratch and the CI publication pipeline.

Q049Production DebuggingMid

A Spring Boot REST service returns correct data in your local environment but returns stale data in production, even after a fresh deployment. You have Caffeine caching on the service layer. The Redis instance appears healthy. Describe your debugging steps.

Q050Resilience (Resilience4j)Mid

Your Spring Boot service wraps a downstream call with both a Retry and a CircuitBreaker from Resilience4j. During an incident, you observe that the CircuitBreaker never opens despite hundreds of failures. You suspect the decorator order is wrong. Explain the issue and the correct order.

Q051Spring Boot CoreSenior

Your company builds a platform that allows customers to upload and execute custom Spring Boot plugins at runtime. You need to isolate each plugin's classes from each other and from the platform. Design the classloader isolation strategy.

Q052Kafka & MessagingMid

Your Spring Kafka application needs to process messages in strict per-customer order, but different customers can be processed in parallel. You have a single Kafka topic with 20 partitions. Explain how you ensure ordering guarantees.

Q053SQL & TransactionsSenior

A Spring Boot reporting service runs complex analytical queries on a PostgreSQL database shared with an OLTP application. The reports are causing lock contention and slowing down transaction-processing throughput. Design the architectural solution.

Q054Reactive (WebFlux)Mid

A junior developer writes a Spring WebFlux controller that catches an exception inside a Mono chain and logs it, but users still see HTTP 500. The developer is confused because no exception appears to propagate. Explain the behavior and correct the error handling.

Q055Spring SecuritySenior

A Spring Boot multi-tenant SaaS platform's security team discovers that a tenant can call the API with a valid JWT for tenant A but include tenant B's resource IDs in the request path, gaining unauthorized access. Spring Security's authentication passes. What systematic fix do you implement?

Q056Spring Boot CoreMid

Your Spring Boot application starts fine locally but on the staging Kubernetes pod it fails with 'No qualifying bean of type DataSource'. Both environments use the same JAR. How do you diagnose and fix this without changing application code?

Q057Spring Boot CoreSenior

A fintech startup runs 12 Spring Boot microservices. On every deployment, each service takes 45 seconds to become READY, which blocks their 6-minute deploy pipeline. The team asks you to cut startup time below 15 seconds without migrating to Quarkus or native image. What is your plan?

Q058Spring Data & JPA/HibernateMid

A Spring Boot service managing an e-commerce product catalog starts throwing 'could not initialize proxy - no Session' errors in production logs after you added a new REST endpoint. The entity has a lazily loaded collection. What is happening and how do you fix it correctly?

Q059Spring Data & JPA/HibernateSenior

A high-traffic SaaS platform reports that during a daily 9 AM spike, database connection pool exhaustion causes a cascade of 503s across three services. All three use Spring Data JPA with HikariCP defaults. Connection pool max-pool-size is 10. Walk through your diagnosis and remediation strategy.

Q060REST API DesignMid

You inherit a Spring Boot REST API where every endpoint returns HTTP 200 even for validation errors and business exceptions, embedding a custom 'status' field in the JSON body. A new mobile team complains this breaks their error-handling middleware. How do you migrate to proper HTTP semantics without breaking existing consumers?

Q061REST API DesignSenior

Your team is designing a bulk order-import API for a logistics platform that must accept up to 5,000 orders per request. Clients need to know which individual orders succeeded and which failed. Synchronous processing will cause timeouts. Design the API end-to-end.

Q062Spring SecurityMid

A Spring Boot API returns 403 Forbidden to all POST requests from a React SPA even though the user has the correct role. GET requests work fine. The application uses JWT-based authentication. What is most likely wrong and how do you fix it?

Q063Spring SecuritySenior

A healthcare SaaS platform must enforce row-level access control: a doctor can only read records belonging to their patients, and a hospital admin sees all records in their hospital. The data model has millions of records. How do you implement this in Spring Security and JPA without duplicating the filter logic in every repository?

Q064Microservices & Spring CloudMid

Your Spring Cloud gateway is routing requests correctly, but downstream services intermittently receive requests without the Authorization header. The header is present on the client request. How do you investigate and fix this?

Q065Microservices & Spring CloudSenior

After a Kubernetes cluster upgrade, your service mesh shows that 15% of inter-service calls between two Spring Boot microservices are failing with connection resets. The services use Spring Cloud OpenFeign with a 5-second timeout. Infrastructure says the upgrade changed nothing at the network level. What is your investigation approach?

Q066Concurrency & JVMMid

A Spring Boot service processes webhook events from a payment provider. Events arrive as HTTP POSTs and are processed synchronously in the controller. At 500 events/second the service threads saturate and response times exceed the provider's 5-second timeout, causing retries that amplify the problem. How do you redesign this?

Q067Concurrency & JVMSenior

A Java 21 Spring Boot service uses virtual threads (Project Loom). After migrating from platform threads, you observe that throughput increased but latency at p99 worsened and there are occasional deadlocks in logs showing 'pinned carrier thread'. Explain what is happening and how you diagnose and fix it.

Q068JVM Tuning & GCMid

A Spring Boot service serving a real-time bidding platform has GC pause times averaging 200ms, causing bids to miss auction windows. The heap is 4GB and the application uses G1GC. Show your tuning approach step by step.

Q069JVM Tuning & GCSenior

A containerized Spring Boot service is allocated 2GB of container memory but the container is OOMKilled repeatedly even though the JVM heap is set to -Xmx1g. The service does no large file I/O. What is consuming the extra memory and how do you fix it?

Q070Kafka & MessagingMid

Your Spring Kafka consumer group is processing order events. After a routine deployment, you notice the consumer lag grows indefinitely on one partition while the others drain normally. The consumer is single-threaded. What do you check and how do you resolve it?

Q071Kafka & MessagingSenior

An insurance claims processing system publishes events from Spring Boot services to Kafka. After a downstream service outage of 2 hours, 400,000 events need to be replayed. The replay causes out-of-order processing of claim state transitions and data corruption. Design a replay-safe architecture.

Q072SQL & TransactionsMid

A Spring Boot service transfers funds between accounts. You use @Transactional on the service method. QA reports that under concurrent load, account balances occasionally go negative despite a CHECK constraint in the database. The DB is PostgreSQL. What is the isolation issue and how do you fix it?

Q073SQL & TransactionsSenior

A logistics platform uses a distributed saga pattern across three Spring Boot microservices. A compensating transaction in the 'inventory' service fails to rollback after an 'order' service timeout, leaving inventory reserved indefinitely. How do you make the saga robust?

Q074Caching (Redis/Caffeine)Mid

A Spring Boot product catalog service uses @Cacheable with Redis. After a marketing team bulk-updates 10,000 product records, the cache is stale for 30 minutes (the TTL) and customers see incorrect prices. The team wants near-real-time cache updates. What do you implement?

Q075Caching (Redis/Caffeine)Senior

A Spring Boot API server uses a two-level cache: Caffeine as L1 (in-process, 1 minute TTL) and Redis as L2 (5 minute TTL). Under production load, you observe cache inconsistency: two pods serve different values for the same key minutes apart. The L1 caches are diverging. How do you solve this at scale?

Q076Testing (JUnit/Mockito)Mid

A developer on your team says unit testing a Spring Boot service class is slow because it loads the full application context with @SpringBootTest. You are doing code review. What is wrong with this approach and how do you recommend they fix it?

Q077Testing (JUnit/Mockito)Senior

A team of 8 engineers shares a Spring Boot monolith test suite with 1,200 tests. The CI pipeline takes 22 minutes to run, blocking PRs for half an hour. You are asked to cut it to under 8 minutes without deleting tests. What is your approach?

Q078Resilience (Resilience4j)Mid

A Spring Boot service calls a third-party credit bureau API that occasionally takes 30 seconds to respond. This blocks a Tomcat thread for the duration, causing thread pool exhaustion and cascading failures to unrelated endpoints. How do you fix this with Resilience4j?

Q079Resilience (Resilience4j)Senior

Your Spring Boot order service uses Resilience4j circuit breakers for calls to inventory and payment services. In production, both circuit breakers open simultaneously during a traffic spike, and the fallbacks return degraded responses that cause order confirmation rates to drop to 12%. Describe how you tune and improve the resilience strategy.

Q080Build & CI (Maven/Gradle)Mid

A Spring Boot project's Maven build takes 12 minutes in CI, with 9 minutes spent on running tests. The pipeline runs on every commit to a feature branch. Developers are skipping tests with -DskipTests to get feedback faster. How do you fix the pipeline design?

Q081Build & CI (Maven/Gradle)Senior

Your organization is migrating 20 Spring Boot services from Maven to Gradle. Three services have complex multi-module Maven builds with custom lifecycle bindings, code generation from Protobuf schemas, and OS-specific native library compilation. What is your migration strategy and the main risks?

Q082Production DebuggingMid

A Spring Boot service in production is unresponsive but not returning errors — health check returns 200 and Kubernetes considers it healthy. Memory and CPU look normal. Users report all requests hang indefinitely. What is the most likely cause and how do you diagnose it?

Q083Production DebuggingSenior

A Spring Boot service starts leaking file descriptors in production. Every 48 hours, the process exhausts its FD limit (1024) and starts throwing 'Too many open files' errors on new connections. You cannot reproduce it locally. Walk through the full investigation.

Q084Reactive (WebFlux)Mid

You are migrating a Spring MVC controller to Spring WebFlux. The controller calls a service that uses a blocking JDBC call. After migration, the service occasionally deadlocks and throughput drops below the original MVC version. What is the issue and how do you fix it?

Q085Reactive (WebFlux)Senior

A Spring WebFlux API gateway aggregates data from five downstream services per request. Under load, even when only one of the five services is slow, p99 latency for the entire response degrades to the slowest service's time. The team expects the gateway to mask slow services. How do you implement a scatter-gather with deadline-bounded aggregation?

Q086Spring Boot CoreMid

Your team needs to support multi-tenancy in a Spring Boot SaaS app where each tenant has a separate database schema. Tenant context comes from the JWT sub-domain header. Describe how you implement schema-per-tenant routing in Spring Boot without restarting the application when a new tenant is onboarded.

Q087Spring SecurityMid

A new compliance requirement mandates that all API requests to a Spring Boot service must be audited: who called, what endpoint, when, what was the response code. Implementing this in every controller is not acceptable. Design a clean cross-cutting solution.

Q088Microservices & Spring CloudSenior

A travel booking platform uses 8 Spring Boot microservices communicating via REST. During a Black Friday spike, the order service times out calling the pricing service, but the pricing service logs show it was not overloaded. Network metrics show normal latency. What is the likely hidden cause and how do you find and fix it?

Q089Spring Data & JPA/HibernateSenior

A Spring Boot service for a social media platform needs to load a user's feed: the 50 most recent posts from all accounts they follow (up to 500 follows). The current implementation uses a nested JPA query that takes 4-8 seconds. Redesign this for sub-200ms response time.

Q090REST API DesignMid

Your Spring Boot API returns a 200 with the full user object (including address, payment methods, and preferences) on every login response. A mobile team says this causes a 2-second parse delay on low-end devices. How do you fix this at the API level?

Q091Concurrency & JVMSenior

A Spring Boot batch service processes 10 million records nightly using a thread pool of 50 workers. After running for 3 hours, memory usage grows continuously and GC cannot reclaim it. A heap dump shows millions of instances of a DTO class with no references to them in live code. How do you explain this and fix it?

Q092Kafka & MessagingMid

A Spring Boot service publishes events to Kafka. You need to guarantee that a database update and the corresponding Kafka publish happen atomically — if the database update succeeds but Kafka is down, you must not lose the event. How do you implement this without a distributed transaction?

Q093SQL & TransactionsMid

A Spring Boot report service runs a complex analytics query against a PostgreSQL database that takes 45 seconds. The query scans a 200M-row orders table with a date range filter. EXPLAIN ANALYZE shows a sequential scan. Describe your optimization approach.

Q094Caching (Redis/Caffeine)Mid

A Spring Boot service caches product recommendations per user in Redis with a 10-minute TTL. After a price update for a viral product, customers are seeing the stale cached price in recommendations for up to 10 minutes, causing customer service complaints. What is your short-term fix and long-term design change?

Q095Testing (JUnit/Mockito)Senior

Your Spring Boot service integrates with three external APIs (payment, shipping, notification). Integration tests pass in CI but fail intermittently in production-like staging because the external sandboxes are flaky. The team is considering removing integration tests. How do you improve test reliability without removing coverage?

Q096Production DebuggingSenior

After a Spring Boot service upgrade from 2.7 to 3.2, the service is deployed and starts receiving 10x the number of 500 errors it had before the upgrade. Most errors are 'ClassNotFoundException: javax.persistence.Entity'. The database schema is unchanged. What is wrong and how do you resolve it systematically?

Q097Spring Boot CoreSenior

You are architecting a Spring Boot library used by 30 internal teams. The library provides common security, observability, and HTTP client configuration. Teams complain that the library's auto-configuration overrides their own beans and breaks their services. How do you design the library to be non-invasive?

Q098Reactive (WebFlux)Senior

A Spring WebFlux service processing financial transactions starts silently dropping messages under high load. Logs show no errors. The Flux pipeline has multiple flatMap operations. What is the silent failure mode and how do you fix it?

Q099Resilience (Resilience4j)Mid

A Spring Boot service calls an internal reporting API that is known to be slow but reliable. You add a @Retry annotation from Resilience4j. After deployment, you notice the reporting API is getting 3x more traffic than before. Why and how do you fix it?

Q100Build & CI (Maven/Gradle)Senior

A fintech Spring Boot service's Docker image is 1.2GB and takes 8 minutes to push to the container registry during CI, delaying deployments. The JAR is 150MB. Describe how you reduce image size and push time significantly.

Q101JVM Tuning & GCSenior

A Spring Boot service processes large XML documents (50-100MB each) in memory. After processing 50-60 documents, the service becomes unresponsive. Heap dumps show Humongous Objects filling G1GC's old generation. What is happening and how do you fix it?

Q102Spring Data & JPA/HibernateMid

A Spring Boot service's test suite runs correctly but in production a @Transactional method that calls another @Transactional method in a different bean is not rolling back on exception. The outer method has REQUIRED propagation and the inner has REQUIRES_NEW. Explain what is happening.

Q103Microservices & Spring CloudMid

Your team is implementing a Spring Cloud Config Server for 15 microservices. During a config update, you need all 15 services to pick up the new configuration without restarting. Some services are stateless, some have in-memory state. Design the refresh mechanism.

Q104Spring SecuritySenior

A Spring Boot SaaS platform is adding OAuth2 social login (Google, GitHub). After a user logs in via Google, they should be linked to an existing account if the email matches, or a new account should be created. Describe the full implementation including security pitfalls.

Q105Kafka & MessagingSenior

A Spring Boot event-driven system must process exactly 1 million events per day with guaranteed exactly-once semantics end-to-end from the Kafka producer through to a PostgreSQL write. Describe the configuration for producer, broker, and consumer to achieve this.

Q106Spring Boot CoreMid

A logistics startup uses Spring Boot 3.x and notices that after adding a third-party autoconfiguration library, two DataSource beans conflict and the app fails to start. How do you diagnose and resolve the duplicate bean conflict without removing the library?

Q107Spring Boot CoreSenior

An e-commerce platform runs 40 Spring Boot service instances. A new regulatory requirement demands that a single configuration property (feature flag) must propagate to all instances within 30 seconds without restarts. The current setup uses static application.yml files. Design a solution.

Q108Spring Data & JPA/HibernateMid

A healthcare application experiences LazyInitializationException in production when serializing Patient entities to JSON outside of a transaction. The team's fix is to add @Transactional to every REST controller method. Why is that wrong and what is the correct approach?

Q109Spring Data & JPA/HibernateSenior

A financial trading system performs 50,000 order inserts per minute via Spring Data JPA. Database CPU spikes to 90% during peak hours. Profiling shows 98% of time is in individual INSERT statements. The schema has no unusual constraints. What architectural changes eliminate the bottleneck?

Q110REST API DesignMid

You are reviewing a Spring Boot REST API for a B2B SaaS product. The PATCH /customers/{id} endpoint currently replaces the entire customer document if any field is provided. Several clients are already using it. How do you fix the semantics without breaking existing integrations?

Q111REST API DesignSenior

A telecom company's Spring Boot API gateway handles 200,000 requests per minute. Operations reports that 15% of responses return stale data because downstream services are slow. Product insists on real-time data for billing endpoints but accepts eventual consistency for reporting endpoints. Design a caching and routing strategy.

Q112Spring SecurityMid

A Spring Boot API was recently migrated to use OAuth2 JWT bearer tokens. QA reports that after a user's role is revoked in the identity provider, the user continues to access protected endpoints for up to one hour. What is causing this and how do you fix it without sacrificing performance?

Q113Spring SecuritySenior

A fintech platform needs to support both machine-to-machine API clients (using client credentials flow) and human users (using authorization code with PKCE) through the same Spring Boot resource server. Both audiences share some endpoints but machine clients must be blocked from user-only endpoints. Design the authorization model.

Q114Microservices & Spring CloudMid

A Spring Boot microservice registers with Eureka and is deployed as 5 instances behind Spring Cloud Gateway. Load testing shows that traffic is unevenly distributed — one instance receives 60% of requests while others idle at 10%. What are the likely causes and how do you fix them?

Q115Microservices & Spring CloudSenior

A retail platform has 30 Spring Boot microservices. During Black Friday, a cascade failure starts from the inventory service timing out, propagating through the order and cart services, and eventually taking down the API gateway. Describe the architectural changes required to prevent this next year.

Q116Concurrency & JVMMid

A Spring Boot service processes incoming webhook events using a @Scheduled method that reads from an in-memory queue. Under load, multiple @Scheduled executions overlap and events are processed twice. The team added synchronized but the issue persists. Explain why and fix it correctly.

Q117Concurrency & JVMSenior

A media streaming platform's Spring Boot transcoding service uses a custom ExecutorService with 200 threads to process video jobs. Operations reports that the service intermittently hangs for 10–20 minutes — all threads appear to be alive in thread dumps but no jobs are completing. What is happening and how do you diagnose it?

Q118JVM Tuning & GCMid

A Spring Boot batch service running on Java 17 with G1GC processes 1 million records nightly. Operations reports GC pause times averaging 800ms during the run, causing missed SLAs. Heap is 8GB and the service allocates many short-lived 10KB byte arrays. What tuning steps would you take?

Q119JVM Tuning & GCSenior

After a Spring Boot service is deployed to a Kubernetes pod with a 4GB memory limit, it crashes with OOMKilled even though heap is set to -Xmx2g. The service uses Netty for HTTP, many reflection-heavy libraries, and a large Spring context. Explain all the memory regions involved and how to right-size them.

Q120Kafka & MessagingMid

A Spring Boot consumer using @KafkaListener with a concurrency of 3 processes payment events. After a deployment, the team notices some payments were processed twice. Kafka lag is 0 but duplicate transactions appear in the database. What caused this and how do you make the consumer idempotent?

Q121Kafka & MessagingSenior

A Spring Boot service consumes from a Kafka topic with 48 partitions at 500,000 messages per minute. A new requirement demands that all messages for the same customer ID are processed strictly in order, but throughput must not drop below 400,000 per minute. Design the consumer architecture.

Q122SQL & TransactionsMid

A Spring Boot service uses @Transactional on a method that calls three repository save operations. The third save fails. Developers report that the first two saves are sometimes committed and sometimes not, depending on which instance handles the request. Explain the possible cause and fix it.

Q123SQL & TransactionsSenior

A Spring Boot service for a hotel booking platform must reserve a room and charge a credit card as an atomic operation, but the payment gateway is an external REST API with no two-phase commit support. The team proposes wrapping both in a single @Transactional method. Why will this fail and what pattern solves it?

Q124Caching (Redis/Caffeine)Mid

A Spring Boot product catalog service uses @Cacheable with Redis. After a bulk product update via an admin API, 30% of users still see old prices for up to 5 minutes. The CacheEvict calls are in the service layer and they succeed (no exceptions). What could cause stale data to persist?

Q125Caching (Redis/Caffeine)Senior

A Spring Boot API for a global news platform experiences a thundering herd: after a scheduled job invalidates 10,000 cached articles simultaneously at 00:00 UTC, all cache misses hit the database at once, causing a 45-second database outage. Redesign the caching strategy to prevent this.

Q126Testing (JUnit/Mockito)Mid

A Spring Boot service's test suite takes 12 minutes to run in CI, blocking deployments. Investigation shows 80% of tests use @SpringBootTest with a full application context. How do you reduce suite runtime without sacrificing meaningful coverage?

Q127Testing (JUnit/Mockito)Senior

A Spring Boot microservice team wants to adopt consumer-driven contract testing to prevent integration failures caused by independent deployments of producer and consumer services. The current setup uses only unit tests and manual integration testing in a shared staging environment. Design the contract testing strategy.

Q128Resilience (Resilience4j)Mid

A Spring Boot service calls a third-party currency exchange API. The API is flaky — it succeeds 70% of the time and returns a 503 on the other 30%. The current implementation has no retry logic, causing 30% of currency conversions to fail. Add retry with backoff using Resilience4j.

Q129Resilience (Resilience4j)Senior

A Spring Boot payment service uses Resilience4j CircuitBreaker, Retry, and Bulkhead around its bank integration. During an incident, the circuit breaker stays CLOSED despite 80% error rate because the metrics window has not filled. Explain why and redesign the configuration for faster detection.

Q130Build & CI (Maven/Gradle)Mid

A Spring Boot project's Maven build takes 18 minutes in CI, mostly due to downloading dependencies on each run. The CI environment is ephemeral (fresh container per build). How do you speed up the build without compromising reproducibility?

Q131Build & CI (Maven/Gradle)Senior

A Spring Boot team has a Gradle multi-module project: core, api, service, and integration-tests modules. A change in core triggers a full rebuild of all modules. Developers complain that a one-line change in a utility class takes 12 minutes to validate. Design a CI strategy that reduces feedback time to under 3 minutes.

Q132Production DebuggingMid

A Spring Boot REST service is returning HTTP 500 for specific product IDs in production, but the same IDs work fine in staging. Logs show a NullPointerException but the stack trace is only 3 lines deep because the JVM is omitting stack frames. How do you get the full trace and investigate the root cause?

Q133Production DebuggingSenior

A Spring Boot service processes insurance claims and has been running for 3 weeks. Memory usage grows steadily from 1GB to 3.8GB over 72 hours, triggering OOMKill. Heap dumps are enabled. You have a heap dump from the moment before the crash. Walk through your analysis process.

Q134Reactive (WebFlux)Mid

A Spring Boot WebFlux service makes five parallel API calls and must return a combined response. A developer implemented it using Mono.zip but notes that if any one call fails the entire zip fails immediately. The business requires partial results: return whatever succeeded and mark the failed ones with an error indicator.

Q135Reactive (WebFlux)Senior

A Spring Boot WebFlux service consuming a Kafka topic via Project Reactor Kafka reports that during high-throughput periods, memory grows unboundedly and the service crashes. The flux processes one message per second but Kafka produces 10,000 per second. What is happening and how do you fix it?

Q136Spring Boot CoreSenior

A large enterprise Spring Boot application has 400+ beans and cold-start time is 45 seconds. Kubernetes liveness probes fail during this period, causing crash loops on deployment. The team cannot switch to a different framework. Describe five concrete optimizations to reduce startup time.

Q137Spring Data & JPA/HibernateSenior

A Spring Boot service for an airline's seat selection experiences a lost update anomaly: two passengers simultaneously select the same seat and both get a success response, but only one seat assignment persists. The database is PostgreSQL. Fix this with the least-expensive locking strategy.

Q138REST API DesignSenior

A Spring Boot public API serves 50 million daily requests. The API versioning strategy is URL-based (/v1/, /v2/). The v1-to-v2 migration has been running for 18 months; 30% of clients still use v1. The business wants to sunset v1 in 90 days. Design the deprecation and migration enforcement process.

Q139Concurrency & JVMSenior

A Spring Boot service for a stock exchange uses a HashMap shared across request threads to cache in-flight order state. Under high concurrency (500 RPS), the service occasionally hangs for minutes. A thread dump reveals most threads stuck in HashMap.get(). Explain the root cause and provide a production-safe fix.

Q140Microservices & Spring CloudSenior

An engineering team at a bank is debating whether to use Spring Cloud Gateway or a dedicated service mesh (Istio) for cross-cutting concerns like rate limiting, mTLS, and distributed tracing across 80 Spring Boot microservices. You are asked to make the recommendation. What do you advise and why?

Q141Kafka & MessagingSenior

A Spring Boot service publishes events to Kafka for downstream analytics. After a Kafka broker outage lasting 10 minutes, the service resumed sending but analytics reported 200,000 missing events from the outage window. The producer was configured with acks=1. Redesign the producer for zero event loss.

Q142SQL & TransactionsSenior

A Spring Boot service for a logistics company runs a nightly report that executes a long-running query joining three tables (30M, 5M, and 2M rows). During the report run, the primary application experiences 2–3x increased latency on transactional queries. The database is PostgreSQL 15. Diagnose and fix without adding hardware.

Q143Spring SecurityMid

A Spring Boot API receives reports that a CORS error in the browser is blocking a legitimate request from the company's React frontend hosted on a different subdomain. The server logs show the request never reaches the controller. What is happening and how do you fix it properly?

Q144JVM Tuning & GCSenior

A Spring Boot service running Java 21 with ZGC has consistently low latency (p99 < 10ms) but the operations team reports that every 4 hours the service's CPU spikes to 100% for 30–60 seconds, causing brief p99 latency increases to 500ms. Heap is 6GB with moderate allocation rate. Investigate.

Q145Testing (JUnit/Mockito)Senior

A Spring Boot team discovers that their Mockito-based unit tests pass 100% but production bugs appear frequently in the integration between their service and the PostgreSQL database. The service uses complex JPQL queries and stored procedures. Design a test strategy that closes this gap without requiring a full production database.

Q146Resilience (Resilience4j)Senior

A Spring Boot service orchestrating a multi-step mortgage application workflow must complete all steps within 30 seconds. Step 3 (credit check) occasionally takes 25 seconds. Adding a TimeLimiter causes the entire workflow to abort. Design a resilience strategy that enforces the SLA without discarding completed work.

Q147Production DebuggingSenior

A Spring Boot API for a payment processor starts returning HTTP 503 from the load balancer during peak hours even though all instances report healthy in /actuator/health. Thread dumps show many threads in TIMED_WAITING on HikariPool-1. CPU is at 5%. Diagnose and fix.

Q148Reactive (WebFlux)Senior

A Spring Boot WebFlux service backs a real-time dashboard that pushes live metrics to 5,000 concurrent browser clients via Server-Sent Events. After 2 days of operation, memory grows by 500MB and the number of active SSE connections reported by Micrometer keeps climbing even as browsers disconnect. What is the likely leak and how do you fix it?

Q149Spring Boot CoreMid

A Spring Boot application must expose metrics from a third-party library that uses its own internal counters. The library does not integrate with Micrometer. How do you bridge these counters into your Actuator metrics endpoint without modifying the library?

Q150Caching (Redis/Caffeine)Mid

A Spring Boot service uses Caffeine as its primary cache for user sessions. A security audit finds that after a user logs out, their session data remains in the cache for up to 10 minutes because the default TTL has not elapsed. How do you implement immediate invalidation on logout?

Q151Build & CI (Maven/Gradle)Senior

A Spring Boot team wants to enforce that no dependency with a known CVE above CVSS 7.0 can be merged to main. The team uses Maven and GitHub Actions. The current process relies on developers manually running OWASP Dependency-Check locally. Design an automated enforcement pipeline.

Q152Production DebuggingMid

A Spring Boot service in production is logging a high volume of 'Connection reset by peer' errors in the HTTP client logs when calling a downstream service. The downstream service team reports no errors on their end. What are the possible causes and how do you investigate?

Q153Spring Data & JPA/HibernateMid

A Spring Boot service imports 100,000 product records nightly from a CSV file using Spring Data JPA's save() method in a loop. The import takes 4 hours. Product says it must complete in under 30 minutes. How do you optimize it?

Q154Reactive (WebFlux)Mid

A Spring Boot WebFlux service chains three external HTTP calls sequentially using flatMap. A developer says the calls run one after the other and do not benefit from non-blocking I/O, so they might as well use RestTemplate. Are they correct? Explain when WebFlux provides a throughput benefit.

Q155Spring SecuritySenior

A Spring Boot multi-tenant SaaS platform stores all tenants' data in the same PostgreSQL schema, distinguished by a tenant_id column. After a security audit, the team discovers that a misconfigured repository query returns data from all tenants when the tenant_id filter is accidentally omitted. Design a systematic defense against cross-tenant data leakage.

Q156Microservices & Spring CloudMid

A Spring Boot service using Feign Client to call a partner API starts failing after the partner enables mutual TLS (mTLS) on their endpoint. The current Feign client configuration has no TLS customization. How do you configure Feign to present a client certificate?

Q157Spring Boot CoreMid

A new developer joins and finds that @Autowired on a field works in integration tests but throws NoSuchBeanDefinitionException when running the same code in isolation with a new @SpringBootTest. The test class has no @ComponentScan. Explain the injection mechanism and why it fails.

Q158Kafka & MessagingMid

A Spring Boot service consumes Kafka messages and deserializes them using a custom Jackson deserializer. After a schema update adds a new required field to the message, older messages in the topic (produced before the update) cause deserialization failures, causing the consumer to stop processing. Fix this without discarding old messages.

Q159Spring Data & JPA/HibernateSenior

A Spring Boot service managing a CRM system has a Customer entity with 40 columns. The customer list endpoint loads all 40 fields for 10,000 customers to display only name, email, and account status in a table. P99 latency is 3.5 seconds. Optimize without changing the database schema.

Q160Resilience (Resilience4j)Mid

A Spring Boot service calls an internal user profile service using @RateLimiter from Resilience4j. During a traffic spike, 40% of requests are rejected with RequestNotPermitted. The business says users must never see a RateLimiter error — they should see slightly stale data instead. Implement this.

Q161Testing (JUnit/Mockito)Mid

A Spring Boot developer writes a Mockito test for a service that sends welcome emails. The test calls the service and verifies the EmailService.send() mock was called with the correct recipient. After a refactor that introduces async email sending via @Async, the test starts failing intermittently. Explain why and fix the test.

Q162JVM Tuning & GCMid

A Spring Boot service on Java 17 is being containerized for the first time. On the developer's machine (16-core, 32GB) JVM performs well. In the Kubernetes pod (2-core, 4GB limit), startup is very slow and the service reports 'GC overhead limit exceeded' within minutes. The Dockerfile sets no JVM flags. What do you fix?

Q163REST API DesignMid

A Spring Boot API endpoint POST /orders is not idempotent. Intermittent network timeouts are causing client apps to retry and create duplicate orders. The API team wants to add idempotency key support without changing the order creation business logic. Design the solution.

Q164Spring Boot CoreSenior

Your e-commerce platform's Spring Boot application starts in 45 seconds on Kubernetes, causing pod readiness probe failures during rolling deployments. The DevOps team is threatening to increase the initialDelaySeconds to 90 seconds, which ruins your deployment velocity. How do you diagnose and fix the startup time?

Q165Spring Boot CoreMid

You are building a multi-tenant SaaS API where each tenant's configuration (database URL, feature flags) must be loaded dynamically at runtime without restarting the service. Spring Boot's default externalized configuration doesn't cover this case. What approach do you take?

Q166Spring Data & JPA/HibernateSenior

A fintech reporting service runs a JPQL query joining four tables to generate daily settlement reports. The query takes 8 seconds on a 10M-row orders table. Your DBA shows the explain plan has a sequential scan. Hibernate is generating the SQL differently from what you'd write by hand. How do you diagnose and resolve this?

Q167Spring Data & JPA/HibernateMid

Your team is using Spring Data JPA repositories and you notice that updating a single field on a large User entity causes Hibernate to issue an UPDATE statement touching all 40 columns. This is generating excessive database write I/O. What options do you have to fix this?

Q168REST API DesignSenior

You are designing a bulk-import API for an HR platform that accepts up to 5,000 employee records per request. Product wants synchronous success/failure feedback per record. The current monolithic Spring Boot service cannot process 5,000 records within a 30-second API timeout. How do you redesign this?

Q169REST API DesignMid

Your Spring Boot REST API currently returns `500 Internal Server Error` with a stack trace in the response body for every unhandled exception. Security auditors flag this as an information disclosure vulnerability. How do you implement proper global error handling?

Q170Spring SecuritySenior

Your SaaS platform issues JWT access tokens with a 15-minute expiry. A security incident reveals that an attacker obtained a valid JWT and is making API calls. Your tokens are stateless, so revoking them is non-trivial. How do you design a revocation mechanism without sacrificing statelessness benefits?

Q171Spring SecurityMid

A new developer on your team accidentally exposed an actuator endpoint (`/actuator/env`) in production, leaking datasource passwords. How do you harden Spring Boot Actuator exposure as a permanent policy, and what configuration changes prevent this from happening again?

Q172Microservices & Spring CloudSenior

Your Spring Cloud Gateway is the entry point for 15 downstream microservices. During a Black Friday sale, one slow microservice (inventory-service) causes Gateway's connection pool to exhaust, making all other services unreachable — a classic bulkhead failure. How do you architect the gateway to prevent this?

Q173Microservices & Spring CloudMid

Your team is migrating a monolith to microservices. Service A calls Service B synchronously over REST. During a network partition test, Service B is unreachable and Service A begins queuing threads, eventually running out of memory. What patterns do you apply at the Spring Boot level?

Q174Concurrency & JVMSenior

Your batch processing service uses a `ThreadPoolTaskExecutor` with 50 threads to process order files. Under high load, you observe thread starvation: tasks queue up, latency spikes to 30 seconds, but CPU is at only 40%. Profiling shows threads are blocked on a synchronized block inside a third-party library. How do you address this?

Q175Concurrency & JVMMid

A junior developer on your team used `HashMap` in a Spring singleton bean to cache lookup results. In production, the service occasionally throws `ConcurrentModificationException` and corrupt entries appear. What is the root cause and how do you fix it correctly?

Q176JVM Tuning & GCSenior

Your Spring Boot service handling 50,000 requests per minute experiences GC pause spikes of 800ms every 90 seconds, causing P99 latency to blow through its 500ms SLA. JVM flags show `-XX:+UseG1GC` is active. Heap dumps show mostly short-lived `byte[]` from HTTP response bodies. How do you tune this?

Q177JVM Tuning & GCMid

After deploying a new feature involving heavy string manipulation in a document processing service, you notice the old generation heap is growing without being collected, eventually causing `OutOfMemoryError: Java heap space`. How do you diagnose whether this is a memory leak versus a sizing issue?

Q178Kafka & MessagingSenior

Your order-processing service consumes Kafka messages using Spring Kafka. After a deployment, you discover that 12,000 messages were processed twice, causing duplicate orders in the database. The consumer group ID is unchanged. What happened and how do you make processing idempotent?

Q179Kafka & MessagingMid

Your Spring Kafka consumer is reading from a high-volume topic with 24 partitions. Consumer lag is growing from 0 to 500,000 messages during business hours. You have only 3 consumer instances. What are your options for reducing lag without changing the topic partition count?

Q180SQL & TransactionsSenior

Your inventory service uses `@Transactional` on a method that decrements stock and places a reservation. Under high concurrency in load testing (500 TPS), you see stock going negative — the optimistic locking path is not behaving as expected. Describe your debugging process and the correct fix.

Q181SQL & TransactionsMid

A developer reports that a `@Transactional` method in a Spring service is not rolling back when a `RuntimeException` is thrown from a private helper method called within the same class. What is happening and how do you fix it?

Q182Caching (Redis/Caffeine)Senior

Your product catalog service uses Redis for caching with 2-hour TTLs. After a Redis cluster failover during peak traffic, every request misses cache, floods the database, and takes the service down — a classic cache stampede. How do you architect against this?

Q183Caching (Redis/Caffeine)Mid

You add `@Cacheable("products")` to a service method and notice that cache keys collide between different product types when the method has two parameters: `getProduct(String type, Long id)`. Queries for type 'electronics', id 5 return data for type 'clothing', id 5. How do you debug and fix this?

Q184Testing (JUnit/Mockito)Senior

Your Spring Boot integration test suite takes 18 minutes to run in CI, gating PRs significantly. Most tests use `@SpringBootTest` with a full application context. How do you restructure the test suite to run in under 5 minutes without losing meaningful coverage?

Q185Testing (JUnit/Mockito)Mid

A developer wrote a unit test for an order service that verifies email notifications are sent. The test uses `Mockito.verify()` but intermittently fails in CI with 'Wanted but not invoked' even though the code works in production. What are the likely causes?

Q186Resilience (Resilience4j)Senior

Your payment service wraps calls to an external payment gateway with a Resilience4j CircuitBreaker. During a gateway brownout, the circuit opens correctly, but after the gateway recovers, the circuit stays open for 10 minutes because the half-open probe requests are also failing. The gateway is healthy but your probe is hitting a rate-limited endpoint. How do you fix this?

Q187Resilience (Resilience4j)Mid

You are adding a Resilience4j Retry policy to a notification service that calls an SMS API. The SMS provider charges per API call. After adding the retry policy, your costs triple because the retry is re-sending successful messages that appear to fail due to slow acknowledgment. How do you redesign the retry logic?

Q188Build & CI (Maven/Gradle)Senior

Your multi-module Maven project takes 22 minutes to build and test in CI. Every PR builds all 18 modules even when only 2 modules changed. How do you implement incremental builds and what are the pitfalls to avoid?

Q189Build & CI (Maven/Gradle)Mid

Your Spring Boot fat JAR is 180MB and taking 4 minutes to push to your container registry on every CI build, slowing down deployment pipelines. How do you restructure the Docker image layering to fix this?

Q190Production DebuggingSenior

A Spring Boot service handling financial transactions begins logging `Connection is not available, request timed out after 30000ms` errors at 2 AM every night. CPU and request volume are low. By 2:05 AM it self-recovers. The issue has been occurring for 3 weeks. How do you diagnose this?

Q191Production DebuggingMid

After a routine Spring Boot upgrade from 2.7 to 3.1, your application's `/health` endpoint returns HTTP 200 but all downstream calls from the load balancer health check start failing with `SSL handshake_failure`. What do you investigate first?

Q192Reactive (WebFlux)Senior

Your Spring WebFlux service aggregates data from three downstream REST APIs in parallel using `Mono.zip()`. Under load, the service's event loop thread is occasionally blocked for 2-3 seconds, causing all requests to stall. How do you identify which operation is blocking and fix it?

Q193Reactive (WebFlux)Mid

You are writing a Spring WebFlux endpoint that streams a large CSV export (500MB) from a database to an HTTP client. A naive implementation loads the entire result set into memory, causing OutOfMemoryError. How do you implement true streaming with backpressure?

Q194Spring Boot CoreSenior

Your company mandates that all internal Spring Boot services share the same security, logging, and metrics configuration. Currently each team copy-pastes the same 200 lines of `@Configuration` across 30 services. When a CVE requires updating the JWT library, all 30 services need PRs. How do you centralize this?

Q195Spring Data & JPA/HibernateSenior

Your event-sourced audit log table accumulates 2 billion rows over three years. A compliance report query scanning six months of data for a single tenant takes 45 seconds. The table has a composite index on `(tenant_id, event_type, created_at)`. Explain why the query is still slow and how you fix it.

Q196REST API DesignMid

Your public Spring Boot API is versioned via URL path (`/v1/users`, `/v2/users`). The team is debating whether to use header-based versioning (`Accept: application/vnd.api+json;version=2`) instead. A client built against v1 will break in v2 due to field renames. What is your recommendation?

Q197Spring SecuritySenior

Your Spring Boot API is being attacked with credential stuffing — bots are making 50,000 login attempts per hour using leaked username/password pairs from other breaches. Your database is handling the bcrypt load. How do you mitigate this without blocking legitimate users?

Q198Microservices & Spring CloudSenior

Your microservices architecture uses Feign clients for synchronous inter-service calls. During a canary deployment of the user-service, some Feign calls in the order-service are hitting the old version and some the new, causing inconsistent behavior. How do you implement request-scoped routing to ensure a request follows the same version throughout the call chain?

Q199Concurrency & JVMSenior

Your Spring Boot service processes insurance claim documents using virtual threads (Java 21 Project Loom). After migrating from a thread pool, you observe that pinned virtual threads are causing carrier thread starvation under load. Which JVM operations pin virtual threads and how do you restructure the code to avoid pinning?

Q200JVM Tuning & GCSenior

Your Spring Boot 3 service running on Java 21 with ZGC is allocated 8GB heap. Production monitoring shows RSS (resident set size) at the OS level is consistently 14GB despite the 8GB heap cap. Your DevOps team is threatening to kill pods for OOM. Explain what is consuming the extra 6GB and how to control it.

Can you defend these answers under follow-up pressure?

Book a mock interview with a senior Java / Spring Boot Developer mentor — structured scorecard, replay, and a gap plan.

Book a Mock Interview →
FREE PROFILE AUDIT

Book your free audit

Tell us where you are — a senior mentor reviews your profile and shows you exactly what's blocking interview calls. Only name, email and role are required; the more you share, the sharper your audit. No spam, no obligation.

A FEW MORE DETAILS (OPTIONAL)
I want

* required · Prefer talking? WhatsApp +91 83598 96054 or email connect@hikecatalyst.com

📄 Score My Resume