Wider Spring Portfolio
The rest of the portfolio: GraphQL, HATEOAS, SOAP web services, Modulith, Spring AI, and the operational projects — Session, Shell, LDAP and Statemachine. Interviewers dip in here to see how wide your exposure is beyond web and data.
part ofSpring Frameworkoverview, primer and where to startread it →on this pageshowhide
explore
- Spring GraphQL (has its own guide)34 questions
- Schema-First Development5 questions
- Annotated Controllers5 questions
- Batch Loading & DataLoader4 questions
- Transports & Interception5 questions
- Federation Overview5 questions
- Error Handling5 questions
- Cursor-Based Pagination5 questions
- Spring HATEOAS14 questions
- Representation Models4 questions
- Link Building5 questions
- HAL & Affordances5 questions
- Spring Web Services (SOAP)14 questions
- Contract-First Endpoints5 questions
- WSDL Generation4 questions
- Marshalling, Client & WS-Security5 questions
- Spring Modulith21 questions
- Application Modules5 questions
- Module Verification & Docs5 questions
- Externalized & Published Events5 questions
- Moments & Module Testing6 questions
- Spring AI36 questions
- ChatClient & ChatModel5 questions
- Prompts & Structured Output5 questions
- Embeddings & Vector Stores5 questions
- RAG Overview5 questions
- Tool Calling & Multimodality6 questions
- Chat Memory & Conversation State5 questions
- Model Context Protocol Integration5 questions
- Session, Shell & Other Portfolio Projects25 questions
- Spring Session: Externalized Store5 questions
- Spring Session: Replication & ID5 questions
- Spring Shell5 questions
- Spring LDAP Overview5 questions
- Spring Statemachine Overview5 questions
→ has its own guide
questions
144 · 6 sectionsWhat is the N+1 problem in a GraphQL API, and how does batch loading solve it?
basics
~20 sWhen a query returns a list of N items and each item triggers its own lookup for a related field, you get 1 query for the list plus N extra queries. Batch loading collects those N lookups and runs them as one query.
In Spring for GraphQL, how do @QueryMapping and @MutationMapping map controller methods to schema fields, and how does @Argument bind incoming arguments?
basics
~10 sPut @QueryMapping or @MutationMapping on a method in a @Controller; the method name matches the schema field under the Query or Mutation type. @Argument binds a named GraphQL argument to a method parameter.
In Spring for GraphQL, what happens to the response when a single data fetcher throws an exception?
basics
~10 sSpring catches the exception, sets that field to null, and adds an entry to the top-level "errors" array in the response. Other fields that resolved successfully still return their data — a partial response.
What is Relay-style cursor-based pagination in Spring for GraphQL, and what do the Connection, Edge, and PageInfo types represent?
basics
~20 sIt is a standard way to page a list using opaque cursors instead of page numbers. A Connection wraps Edges; each Edge has a node (the item) plus its cursor; PageInfo carries hasNextPage/hasPreviousPage and start/end cursors.
What is schema-first GraphQL development in Spring for GraphQL, and where do you put the schema files?
basics
~10 sYou write the GraphQL schema by hand in SDL (.graphqls) files. Spring Boot loads them from classpath:graphql/ by default and builds the schema from them; your Java code just supplies the data.
What is HAL in Spring HATEOAS, and how does a HAL JSON response differ from a plain JSON response?
basics
~20 sHAL (Hypertext Application Language) is a JSON format that adds hyperlinks to a resource under a _links object, plus embedded related resources under _embedded. Its media type is application/hal+json. Plain JSON has only data, no links.
In Spring HATEOAS, how do you build a self link to a controller method, and what does the resulting Link contain?
basics
~10 sUse WebMvcLinkBuilder: linkTo(methodOn(MyController.class).getItem(id)).withSelfRel(). It returns a Link with an href (the URL Spring built from the mapping) and the relation 'self'.
What is RepresentationModel and EntityModel<T> in Spring HATEOAS, and why would you use EntityModel instead of adding links directly to your DTO?
basics
~10 sRepresentationModel is the base class that carries hypermedia links. EntityModel<T> wraps a single domain object plus its links, so you can attach links without changing or extending your original DTO class.
What is a RepresentationModelAssembler and why would you use one instead of building links inline in the controller?
basics
~10 sRepresentationModelAssembler<T, D> is a component that converts a domain entity T into a link-bearing model D (usually EntityModel<T>). It centralizes link-building so controllers and other places produce identical representations instead of duplicating link code.
How do you assemble self and collection links consistently across endpoints, e.g. with RepresentationModelAssembler and CollectionModel?
basics
~10 sPut link-building in a RepresentationModelAssembler: toModel(entity) returns an EntityModel with linkTo(methodOn(...)).withSelfRel() plus related rels. For lists, wrap items in a CollectionModel and add a self link to the collection endpoint.
What is Jaxb2Marshaller in Spring Web Services and what does it do?
basics
~10 sJaxb2Marshaller is a Spring adapter around JAXB that converts Java objects to XML (marshal) and XML back to Java objects (unmarshal), so you work with typed objects instead of raw XML in SOAP messages.
How does @PayloadRoot map a SOAP request to a handler method, and what are its namespace and localPart attributes?
basics
~20 s@PayloadRoot maps a method to the root XML element of the SOAP body. namespace is that element's XML namespace URI, localPart is its element name. Spring-WS matches the incoming payload's root element by this qualified name and calls the method.
How do you wire MessageDispatcherServlet with ServletRegistrationBean in a Spring Boot app, and why can't you reuse the default DispatcherServlet?
basics
~10 sRegister MessageDispatcherServlet as a separate servlet via a ServletRegistrationBean mapped to something like /ws/*. It's Spring-WS's own front controller for SOAP; the regular DispatcherServlet handles MVC/REST, not SOAP message dispatching or WSDL serving.
In Spring Web Services, what is a contract-first SOAP endpoint and what does the @Endpoint annotation do?
basics
~10 sContract-first means you write the XML schema (XSD/WSDL) first, then code against it. @Endpoint marks a class as a Spring-WS handler for SOAP requests — like @Controller but for SOAP instead of REST.
What is dynamic WSDL generation in Spring Web Services, and how does DefaultWsdl11Definition produce it?
basics
~10 sSpring-WS generates the WSDL at runtime from your XSD schema instead of you hand-writing it. You declare a DefaultWsdl11Definition bean pointing at an XsdSchema, and Spring builds the WSDL from that schema on request.
In Spring Modulith, what defines an 'application module' and how do you obtain the module model in code?
basics
~10 sBy default an application module is a direct sub-package of your main application class's package. You get the model in a test with ApplicationModules.of(Application.class).
Why do Spring Modulith applications communicate between modules with published events, and what does @ApplicationModuleListener do?
basics
~10 sInstead of one module directly calling another, it publishes an event. A method marked @ApplicationModuleListener in the other module receives that event asynchronously after the publisher's transaction commits, so the modules stay loosely coupled.
What does ApplicationModules.verify() do in Spring Modulith, and how do you wire it into a test?
basics
~20 sIt scans your application's packages, discovers each top-level package as a module, and checks that modules only depend on ones they are allowed to. You run it from a JUnit test; if a rule is broken the test fails.
How does Spring Modulith decide which types of a module are public API versus internal, and how is that enforced?
basics
~10 sTypes directly in the module's base package are public API; types in nested sub-packages are internal. Other modules referencing internal types cause ApplicationModules.of(App.class).verify() to fail.
What is @ApplicationModuleTest and how does it differ from @SpringBootTest? Explain its bootstrap modes.
basics
~20 s@ApplicationModuleTest is a Spring Modulith slice test that bootstraps only one module (plus chosen dependencies) instead of the whole app. Its BootstrapMode is STANDALONE (module only), DIRECT_DEPENDENCIES, or ALL_DEPENDENCIES, giving faster, isolated per-module integration tests.
What is Spring AI's ChatClient, and how do you make a basic call to a model with it?
basics
~10 sChatClient is Spring AI's fluent client for talking to an LLM. You write chatClient.prompt().user("...").call().content() to send a user message and get the reply back as a String.
What is Spring AI's ChatMemory abstraction and why is it needed when talking to an LLM?
basics
~20 sLLM calls are stateless — the model forgets previous turns. ChatMemory is a Spring AI interface that stores a conversation's past messages and replays them into each new request, so the model appears to remember the dialogue.
What is an EmbeddingModel in Spring AI and what does it produce?
basics
~10 sEmbeddingModel is a Spring AI interface that turns text into an embedding — a list of floating-point numbers (a vector) representing the text's meaning. Similar texts get numerically similar vectors, which powers semantic search.
In Spring AI, what is a Prompt, and what roles do SystemMessage and UserMessage play inside it?
basics
~10 sA Prompt is the request sent to the model: a list of Messages plus optional options. A SystemMessage sets the model's behavior/persona; a UserMessage carries the user's actual input.
What is RAG in Spring AI, and what does the QuestionAnswerAdvisor do?
basics
~10 sRAG (Retrieval-Augmented Generation) fetches relevant documents from a vector store and adds them to the prompt so the LLM answers from your data. Spring AI's QuestionAnswerAdvisor does this automatically on each ChatClient call.
Session, Shell & Other Portfolio Projects
all 25 Session, Shell & Other Portfolio Projects questions →Why does Spring Session let you run multiple stateless app instances behind a load balancer, and what problem does it solve?
basics
~20 sBy default an HTTP session lives in one server's memory, so a user must stick to that server. Spring Session stores sessions in a shared external store (Redis, JDBC), so any instance can read them.
What is Spring Session, and why would you externalize HttpSession to Redis or JDBC instead of using the servlet container's default session?
basics
~10 sSpring Session stores the HttpSession in an external store (Redis, a database, etc.) instead of in the app server's memory. This lets multiple server instances share sessions and lets sessions survive restarts.
What is Spring Shell, and how do you define a basic interactive command with @ShellComponent and @ShellMethod?
basics
~20 sSpring Shell builds interactive command-line apps. You annotate a bean class with @ShellComponent, then annotate a method with @ShellMethod. The method becomes a command you can type at the shell prompt; its parameters become command arguments.
What is Spring Statemachine, and what are the core building blocks of a state machine (states, transitions, events)?
basics
~20 sSpring Statemachine is a framework for modelling finite state machines. A machine has states (where it currently sits), events (inputs you send), and transitions (rules that move it from one state to another when an event fires).
Compare CookieHttpSessionIdResolver and HeaderHttpSessionIdResolver. When would you switch from cookies to a header?
basics
~20 sAn HttpSessionIdResolver decides how the session ID travels between client and server. The cookie resolver (default) uses a Set-Cookie/Cookie. The header resolver reads/writes it in an HTTP header (e.g. X-Auth-Token), which suits non-browser clients like mobile apps or SPAs across domains.