Java full stack engineer interview questions and how to answer them

Java full stack engineer interview questions focus on the seam between a Spring Boot backend and a React or Angular front end: how you design the API contract, validate data on both sides, handle login, sessions and CORS, page and cache data end to end, and ship one feature through every layer. Expect a coding round in Java or TypeScript, a feature exercise that spans the database to the screen, and questions about bugs that only appear when the two halves meet.

By Published 11 min read

What a Java full stack engineer does, and how this guide differs

Most Java full stack roles sit on a product team that owns a feature from database migration to the screen. A typical stack is Spring Boot with JPA on a relational database, a REST API, and a single-page app in React or Angular, built and deployed through a pipeline into containers or a cloud platform. The engineer is expected to pick up a ticket, change the schema, the service, the endpoint and the UI, write the tests at each level, and see it into production.

Language depth such as collections, generics and the JVM is covered in Java developer interview questions. Thread pools, transactions under load and message consumers are on Java backend developer interview questions, and stack-neutral web topics are on full stack developer interview questions. This page covers what is specific to running both halves of a Java web product yourself.

How Java full stack interviews usually run

  1. Recruiter or hiring manager screenYour stack in plain words: which Spring Boot and front-end framework versions you have shipped on, what you owned, and how releases happened.
  2. Coding roundOften a data structure problem in Java, sometimes a small TypeScript task such as debouncing a search box or reshaping API data for a table.
  3. Feature or take-home exerciseBuild or design one slice: an endpoint plus a screen that lists, filters and edits records, with validation and error handling.
  4. Design and behavioralA broader design talk about a small product, plus stories about bugs, trade-offs and working with designers, testers and product managers.

Some companies split the loop into a backend round and a frontend round with different interviewers. Ask the recruiter which framework the frontend round uses. A React shop and an Angular shop will probe different habits, and you should practice in the one they use.

API contract questions

Where the backend and the front end agree, or break
QuestionWhat it testsWhat a strong answer shows
Why return DTOs from a controller instead of JPA entities?Layer boundariesEntities leak internal fields, trigger lazy loading during serialization and couple the UI to the schema. A DTO or Java record fixes the shape the client depends on.
What status code do you return when validation fails, and what body?Error contractA 400 with a consistent, machine-readable body listing each field and message, so the form can highlight the right input. Mention Problem Details (RFC 9457) as one standard shape.
How do you paginate a list endpoint that the UI shows as a table?Pagination end to endPage and size or a cursor, a hard cap on size, a stable sort, and a response that tells the UI whether more data exists. Offset paging gets slow and skips rows on changing data.
A field is renamed in the API. How do you avoid breaking the app?Change managementAdditive changes first, support both names for a period, release the client, then remove the old one. Versioning the path is a last resort, not the first move.
How do the front end and backend stay in sync on types?Shared contractAn OpenAPI spec generated from the controllers or written first, with TypeScript types or a client generated from it, checked in CI so drift fails a build.
When would you use PUT versus PATCH?HTTP semanticsPUT replaces the resource, PATCH applies a partial change. Say how you handle a missing field versus an explicit null in a partial update.
How do you represent dates and money in JSON?Data fidelityISO 8601 strings with an offset or UTC instants for time, and integer minor units or decimal strings for money, never floating point. The UI formats for the locale.
Where the backend and the front end agree, or break. Scroll sideways on a small screen.
public record PageResponse<T>(List<T> items, int page, int size, long total) {}

@RestController
@RequestMapping("/api/orders")
class OrderController {
    private final OrderService service;

    OrderController(OrderService service) {
        this.service = service;
    }

    @GetMapping
    PageResponse<OrderSummary> list(@RequestParam(defaultValue = "0") int page,
                                    @RequestParam(defaultValue = "20") int size) {
        int capped = Math.min(Math.max(size, 1), 100);
        return service.list(page, capped);
    }

    @PostMapping
    ResponseEntity<OrderSummary> create(@Valid @RequestBody CreateOrderRequest body) {
        OrderSummary created = service.create(body);
        return ResponseEntity.created(URI.create("/api/orders/" + created.id())).body(created);
    }
}
A list and create endpoint that returns its own page shape (illustrative, Spring Boot 3 style)

Expect follow-ups on this kind of snippet. Why cap the size on the server when the UI already limits it? Because any client can call the API. Why return 201 with a Location header? Because the client can link to the new record without guessing its address. Why a custom page record? Because serializing a framework page object ties your JSON to library internals that can change between versions.

Validation and data flow questions

  • If the form already validates input, why validate again on the server? Browser checks are for the user's convenience; the server is the trust boundary. Use Bean Validation annotations on the request DTO and keep business rules, such as stock limits, in the service.
  • How do you show a server-side validation error next to the right field? Return field paths that match the form's field names, map them in one place on the client, and fall back to a general message for anything that does not match.
  • A user double-clicks Save and two orders appear. Fix it. Disable the button while the request is in flight, and make the server safe too: an idempotency key or a unique constraint, because network retries can repeat a request without any click.
  • Two people edit the same record. What happens? Without care, the last write silently wins. Use optimistic locking with a version column, return a 409 on conflict, and let the UI show what changed.
  • Where does a lazy-loading exception come from in a REST response? Serializing an entity after the persistence context is closed. Fetch what the view needs in the query, map to a DTO inside the transaction, and keep open-session-in-view off if the team agrees.
  • How do you handle an enum that the backend adds a value to? The client should tolerate unknown values with a sensible default, otherwise a backend release can break an older cached front end.

Auth, sessions and security across the stack

Security questions that span both halves
QuestionWhat it testsWhat a strong answer shows
Session cookie or token for a single-page app?Auth designAn HttpOnly, Secure, SameSite cookie keeps the credential away from scripts but needs CSRF protection. A bearer token in memory avoids CSRF but needs a refresh strategy. Pick one for the context and say why.
Why does the browser block a call from localhost:5173 to localhost:8080?CORSDifferent origin. Configure allowed origins, methods and credentials in Spring Security's CORS config, or use a dev proxy so the browser sees one origin.
Spring Security returns 403 on every POST from your SPA. Why?CSRF defaultsCSRF protection is on by default. Send the token the way the framework expects, often read from a cookie into a header, rather than switching protection off.
Where do you check that a user may edit a given record?AuthorizationOn the server, per object, such as the order belonging to the caller's account. Hiding a button in the UI is not access control.
How do you stop XSS in a React or Angular app?Output encodingBoth frameworks escape bound text by default. The danger is opting out, such as raw HTML injection or bypassing the sanitizer, and building URLs from user input.
How should the UI react to an expired session?Session lifecycleA central HTTP interceptor catches 401, tries a refresh once if tokens are used, then routes to login and restores the user's place after.
Security questions that span both halves. Scroll sideways on a small screen.

For deeper token questions, JWT interview questions and OAuth interview questions go further into signing, scopes and flows. In a full stack round the interviewer mostly wants to see that you know which layer each protection belongs to.

Front-end questions for Java engineers

  • Where should server data live in a React app? In a data-fetching layer with caching and request states, not copied into global state by hand. Name the library you used, or describe the same idea in your own hook.
  • How do you structure an Angular feature that calls your API? A typed service using HttpClient, a component that subscribes through the async pipe, and interceptors for auth headers and error handling.
  • A table re-renders on every keystroke in the filter box. What do you do? Debounce the input, keep the filter in the URL or local state, and request filtered data from the server rather than filtering thousands of rows in the browser.
  • How do you show loading, empty and error states? Treat them as designed states of the screen, not afterthoughts, and make sure an error leaves the user a way to retry.
  • How do you keep the URL in step with filters and pages? Store them in query parameters so refresh, back and shared links all work, and read them on load.
  • What is your approach to forms with many fields? A form library or reactive forms, one schema for client rules, and server errors mapped onto the same fields.

If the job lists one framework, review the matching guide: React interview questions or Angular interview questions. Java engineers often lose points here by writing correct but untyped JavaScript, so practice in TypeScript.

Data and performance from table to screen

Performance questions that cross layers
QuestionWhat it testsWhat a strong answer shows
The orders page takes six seconds. Where do you start?Diagnosis orderMeasure first: browser network tab for request time versus render time, then server timing and the SQL log. Fix the slowest layer, not the one you know best.
The list endpoint runs 101 queries for 100 rows. Why?N+1 queriesA lazy association touched per row. Use a fetch join or an entity graph for that query, or a projection straight into the DTO.
What would you cache, and where?Caching layersHTTP caching headers for static assets with hashed file names, short server-side caches for expensive reads, and the client's request cache. Say how each is invalidated.
Search should feel instant. How?Latency budgetDebounce, cancel stale requests, an index that supports the query, a limit on results, and a loading state that does not flicker.
How do you add a column to a large table without downtime?Schema changeMigration tools such as Flyway or Liquibase, additive change first, backfill in batches, deploy code that handles both states, then enforce constraints.
Performance questions that cross layers. Scroll sideways on a small screen.

Build, test and deploy questions

  • How do you serve the front end: from the Spring Boot jar or separately? Bundling is simple and keeps one origin. Separate hosting on a CDN scales and releases independently but brings CORS or a gateway. Both are fine if you can explain the trade.
  • What tests do you write for one feature? Unit tests for service logic, slice tests such as MockMvc for the controller contract, repository tests against a real database engine in a container where possible, component tests in the UI, and one end-to-end test for the main path.
  • How does one pipeline build both halves? Maven or Gradle builds the backend, a Node build produces the static bundle, and the pipeline runs both test suites before producing one artifact or two. Cache dependencies so the build stays fast.
  • How do you configure the app per environment? Spring profiles and environment variables on the server; a runtime config file or the server's own endpoint for the client, so you do not rebuild the bundle per environment.
  • A release breaks only in production. What do you check? Configuration differences, the browser caching an old bundle against a new API, database migration order and feature flags.

If the team deploys to Kubernetes, expect a few platform questions about probes, config and rollouts. Kubernetes DevOps engineer interview questions shows the operations side you will be working next to.

The end-to-end feature exercise

A common format: "Add a way for support staff to search customers by email and update their phone number." You may code it, or talk it through on a whiteboard. Interviewers grade the order of your thinking and the edges you catch, not only whether the code compiles.

  1. ClarifyWho uses it, how many records, partial or exact email match, who may edit, and whether changes need an audit trail.
  2. DataAn index on the normalized email column, a version column for concurrent edits, and a migration script.
  3. APIA paged search endpoint and a PATCH for the phone number, with validation, authorization per record and clear error bodies.
  4. UIA debounced search box, a results table, an edit form with field errors, and loading, empty and conflict states.
  5. Tests and releaseService and controller tests, a UI test for the form, one end-to-end path, then a feature flag and a log line or metric to confirm use.

Fictional example

Answering "tell me about a bug that crossed the stack"
Interviewer
Tell me about a bug that involved both the front end and the backend.
Candidate
On an invoicing app, customers in one region saw due dates a day early. The Angular screen showed the right date for us and the wrong one for them.
Candidate
I traced one invoice through every layer. The database stored a date, the entity used a LocalDate, but the DTO converted it to a timestamp at midnight in the server's zone. The browser then shifted that instant into the user's zone.
Candidate
I changed the DTO to send a plain date string, updated the generated TypeScript type, and added a test that renders the date under two time zones. Then I searched for other fields with the same pattern and found two more.
Candidate
What I took from it: dates and times now have a written rule in our API guide, and contract changes go through the shared spec so both halves see them in review.

Behavioral questions for full stack engineers

  • Which half of the stack are you stronger in, and how do you cover the other? Be honest. Show a concrete habit, such as pairing with a frontend specialist or a course plus a shipped feature.
  • Tell me about a disagreement with a designer over what was feasible. Show that you offered options with costs, not a flat no, and what you shipped.
  • Describe a feature you shipped from schema to screen. Walk the layers in order and name one decision at each.
  • When did you push back on scope to protect quality? Say what you cut, what you kept, and how the release went.

For the story structure behind these, see behavioral interview questions.

A two-week preparation plan

  1. Days 1 to 3: the contractWrite a small Spring Boot API with DTOs, validation, a standard error body and paging. Generate or hand-write the TypeScript types for it.
  2. Days 4 to 6: the screenBuild the list, filter and edit screens in the framework the job uses, including loading, empty, error and conflict states.
  3. Days 7 to 8: authAdd login with Spring Security, decide cookie or token, and make CORS and CSRF work without turning them off.
  4. Days 9 to 10: performance and testsSeed a few thousand rows, find and fix an N+1 query, and add tests at each layer plus one end-to-end test.
  5. Days 11 to 14: rehearseTalk through the feature exercise aloud twice, practice two coding problems a day, and prepare three stories that cross the stack.

Practicing with Natively

When you rehearse the feature exercise out loud, it helps to see afterward where you skipped a layer. Natively transcribes a mock interview on your computer and can suggest answers live. During practice it can also read a coding problem from a screenshot. Add your résumé and the job description (Pro or the free trial) so suggestions match the Spring and front-end stack in the posting, then review the transcript and notes to find the moments you rushed past validation or auth. Read more about an AI interview assistant.

Questions people ask

What questions are asked in a Java full stack engineer interview?

Expect Java coding, API contract questions such as DTOs, status codes and paging, auth across the stack including CORS and CSRF with Spring Security, front-end questions in React or Angular, and an exercise that builds one feature from the database to the screen.

How is a Java full stack interview different from a Java developer interview?

A Java developer interview goes deeper into the language and the JVM. A full stack interview spends more time where the layers meet: the API contract, validation on both sides, sessions and tokens, and how a feature is tested and released as a whole.

Should I prepare React or Angular for a Java full stack role?

Prepare the one in the job description. Many Java shops use Angular and many use React; ask the recruiter which framework the frontend round uses and practice building a list, filter and edit screen in it.

How do I prepare for a Java full stack interview in two weeks?

Build one small Spring Boot API with validation, paging and a standard error body, add a matching screen with all its states, wire up login with CORS and CSRF working, fix an N+1 query, then rehearse the feature exercise out loud.

Where to go next

Practice with the same assistant you would use on a call: it listens, transcribes and suggests answers from your own resume and the job description.

Facts on this page were last checked on . Product details come from the Natively app itself; if something here is out of date, tell us at hello@heynatively.com.

Keep reading

Put it on your own machine.

A live-conversation assistant that runs locally. Your conversations stay on your machine.

macOS 12+ · Windows 10/11

© 2026 Natively AI Private Limited

Source-available under the Natively Personal Use Source License v1.0 · IP geolocation by DB-IP