Scrivio Interview library

Other Spring projects

26 questions in 10 subtopics.

Spring Integration

ConceptFoundations7 min read
What problem does Spring Integration solve? Explain message, message channel, endpoint and the IntegrationFlow Java DSL with a small example that reads files from a directory, transforms each line and sends it to a channel.
DesignIntermediate7 min read
Design a Spring Integration flow that picks up partner order files from SFTP every minute, validates each record, sends valid records to Kafka and invalid ones to a dead-letter table, without processing a file twice when two instances run.
LeadershipPrincipal6 min read
Your organisation has integration code in Spring Integration, Apache Camel, a commercial ESB and many hand-written Kafka consumers. As the senior technical leader, how would you decide the integration strategy for the next five years?

Spring Modulith

CodingFoundations6 min read
In Spring Modulith, how are application modules defined, and how do you write a test that fails the build when one module uses another module's internal classes?
InternalsIntermediate6 min read
Explain Spring Modulith's event publication registry. What happens when an @ApplicationModuleListener fails or the application crashes after the publishing transaction commits, and how do you externalize such events to Kafka?
DesignAdvanced6 min read
Several teams share one large Spring Boot monolith with tangled packages. Leadership wants microservices. Explain how you would use Spring Modulith as the first step, and how you would decide later which modules become separate services.

Spring Data REST

ConceptFoundations6 min read
What does Spring Data REST generate from a repository interface, and how do you control which repositories and methods are exported, what the JSON looks like, and what validations run?
ScenarioIntermediate6 min read
A security review of a service built with Spring Data REST finds that any authenticated user can DELETE customers, can PATCH the role field of their own user record, and can list all users. What went wrong and how do you fix it?

Spring HATEOAS

CodingFoundations6 min read
Using Spring HATEOAS, write a controller method that returns an order with a self link and a cancel link only when the order can still be cancelled. What does the response look like in HAL?
DesignAdvanced7 min read
An API guild debates whether all public REST APIs should use hypermedia (HAL with Spring HATEOAS) or plain JSON with OpenAPI. Give your recommendation and the criteria behind it.

Spring Session

ConceptFoundations6 min read
A Spring MVC application uses HttpSession and is scaled from one instance to four behind a load balancer; users are logged out randomly. How does Spring Session solve this, and what do you configure to store sessions in Redis?
DebuggingIntermediate6 min read
After a deployment, users of a Spring Session application backed by Redis get 500 errors with SerializationException: Cannot deserialize, and the log mentions InvalidClassException for a class stored in the session. Explain the cause and how to make future deployments safe.
DesignAdvanced7 min read
Your company runs 60 web applications, some on server sessions with Spring Session and Redis, some on JWTs stored in browser storage, some on sticky sessions. Define the session standard for web and mobile clients.

Spring Shell

CodingFoundations6 min read
Write a small Spring Shell command 'import-users --file users.csv --dry-run' and explain how the command is registered, how options are parsed, and how you run the same command non-interactively from a script.
DesignIntermediate6 min read
Operations wants an internal admin CLI for support tasks (replay events, fix stuck orders) built with Spring Shell and using the same domain services as the main application. How would you design, secure and ship it?

Spring Statemachine

ConceptFoundations7 min read
Explain the main concepts of Spring Statemachine (states, events, transitions, guards, actions) using an order lifecycle NEW, PAID, SHIPPED, CANCELLED, and say how you would persist the state between requests.
ScenarioIntermediate6 min read
A team built an insurance claim workflow on Spring Statemachine with 30 states, nested regions and timers. Bugs appear when two events for the same claim arrive at once, and upgrades are painful. What would you review, and what alternatives would you consider?
LeadershipPrincipal6 min read
Your organisation depends on several smaller Spring projects with low release activity, such as Spring Statemachine and Spring Shell, plus many third-party libraries. As the senior technical leader, how do you govern adoption and exit of such dependencies?

Spring LDAP

CodingFoundations6 min read
Using Spring LDAP, find all users in ou=people with a given email domain and map them to a Java object. How do you avoid LDAP injection?
DebuggingIntermediate7 min read
A Spring LDAP batch that reads all accounts from Active Directory returns only 1,000 entries, and under load another service gets connection timeouts to the directory. Explain both problems and the fixes.

Spring Cloud Function

ConceptFoundations6 min read
What is Spring Cloud Function? Show how a java.util.function.Function bean becomes an HTTP endpoint or an AWS Lambda handler, and how you compose two functions.
ScenarioIntermediate7 min read
A Spring Cloud Function running on AWS Lambda has p99 cold starts of 6 seconds, and the business wants under 1 second. What options do you have and what are their trade-offs?
DesignAdvanced6 min read
Your company wants event-processing logic that can run on AWS Lambda, Azure Functions and Kubernetes depending on customer region. Would you standardize on Spring Cloud Function for this, and how would you structure the code and platform?

Spring Vault

ConceptFoundations6 min read
How does a Spring Boot application read secrets from HashiCorp Vault with Spring Vault or Spring Cloud Vault, and which authentication method would you use on Kubernetes instead of a static token?
DesignIntermediate6 min read
You want each Spring Boot service to get short-lived PostgreSQL credentials from Vault's database secrets engine instead of a shared password. Explain the flow and how you handle credential expiry with a HikariCP pool.
LeadershipPrincipal6 min read
HashiCorp changed Vault's license to the Business Source License in 2023 and the OpenBao fork appeared, while cloud providers offer their own secret managers. As the senior technical leader, how do you decide the company's secrets management strategy?