Java Full Stack with React Interview Questions in Delhi
36 practice questions with answers for Java Full Stack with React interviews in Delhi.
Java Full Stack with React jobs in Delhi
Delhi NCR has one of India's biggest pools of IT, consulting, banking and start-up jobs. Delhi itself hosts many corporate, government-tech and consulting offices, and most candidates also apply across Noida and Gurgaon, so interviews here mix service-company and product-company styles.
Below are 36 questions that match the mix of service, product and domain employers hiring java full stack developers in Delhi.
Solved for DelhiStart practicing
3 QUESTIONS FREESign up to unlock the full question bank and track your progress.Unlock every question and answer, then continue practising company-wise and package-wise.
After a successful login, the server issues a JSON Web Token containing a header, a payload of claims such as user ID, roles and expiry, and a signature made with a secret or private key. The client sends it in the Authorization: Bearer header with each request. The server verifies the signature and expiry without a session lookup, which suits stateless APIs. Keep access tokens short-lived, do not store sensitive data in the payload because it is only encoded, and use refresh tokens for renewal.
02
You need to store unique usernames and always display them in alphabetical order. Which collection do you pick?
A TreeSet fits because it rejects duplicates and keeps elements sorted using natural order or a Comparator, with O(log n) add and lookup. Use String.CASE_INSENSITIVE_ORDER as the comparator if Rahul and rahul should be treated as the same. If you only need sorting once at display time, a HashSet followed by sorting may be faster. For concurrent access, ConcurrentSkipListSet is the thread-safe sorted alternative.
03
What changed when moving from Spring Boot 2 to Spring Boot 3?
Spring Boot 3 requires Java 17 or later and is built on Spring Framework 6. The biggest migration task is the switch from javax.* to jakarta.* packages for persistence, validation and servlet APIs. Spring Security 6 removed WebSecurityConfigurerAdapter in favour of SecurityFilterChain beans. Boot 3 also supports GraalVM native images, Micrometer observation and tracing, and from 3.2 the RestClient and virtual thread support.
04
How does the Spring Security filter chain process a request?
Every request passes through a DelegatingFilterProxy into a FilterChainProxy, which picks the matching SecurityFilterChain. Filters run in order: CORS, CSRF, authentication filters such as BearerTokenAuthenticationFilter, exception translation and finally the authorization filter. Authentication filters build an Authentication object, validate it through the AuthenticationManager and store it in the SecurityContextHolder. The authorization filter then checks rules such as hasRole("ADMIN") before the controller runs.
05
What roles do an API gateway and service discovery play in microservices?
An API gateway, such as Spring Cloud Gateway, is the single entry point for clients. It handles routing, authentication, rate limiting, CORS and request logging. Service discovery lets services find each other without hard-coded addresses: with Eureka or Consul, services register themselves, and clients look them up. On Kubernetes, built-in Services and DNS usually replace a separate discovery server, and an ingress or gateway handles external traffic.
06
Which features from Java 17 and Java 21 are useful for a full stack developer?
Java 17 brought records for immutable data carriers, sealed classes to restrict inheritance, text blocks for multi-line JSON or SQL, and pattern matching for instanceof. Java 21, the current widely used LTS alongside 17, added virtual threads for cheap blocking concurrency, pattern matching for switch, record patterns and sequenced collections. Spring Boot 3 needs Java 17 or later, and from Boot 3.2 virtual threads can be enabled with one property.
EXPLAIN ANALYZE
SELECT o.id, o.total
FROM orders o
WHERE o.customer_id = 42
AND o.status = 'PAID'
ORDER BY o.created_at DESC
LIMIT 20;
-- Look for: Seq Scan / type=ALL (full scan), large 'rows' estimates,
-- 'Using filesort' or a Sort node, and actual time per step.
-- Fix with: CREATE INDEX ix_orders_cust_status_date
-- ON orders (customer_id, status, created_at DESC);
Events bubble up from the target element to its ancestors. With event delegation you attach one listener to a parent, such as a ul, and use event.target.closest('li') to find which child was clicked. This saves memory compared with a listener on every item and automatically works for items added later. It is commonly used for dynamic tables and lists. React uses a similar idea by attaching listeners at the root.
09
What is the difference between persist and merge, and between save and saveAndFlush?
persist makes a new entity managed and assigns its ID; it fails for detached entities. merge copies the state of a detached entity onto a managed copy and returns that copy. Spring Data save calls persist for new entities and merge otherwise. saveAndFlush also calls flush, pushing pending SQL to the database immediately, which helps when you need a constraint error or trigger result now. The commit still happens at the end of the transaction.
10
Compare monolithic and microservices architecture.
A monolith is one deployable application. It is simpler to build, test and debug, and suits small teams and early products. Microservices split the system into independently deployable services owned by separate teams, such as orders, payments and inventory, each with its own database. They allow independent scaling and releases but add network latency, distributed data, monitoring and deployment complexity. Many teams start with a modular monolith and split only when needed.
ArrayList is backed by a resizable array, giving O(1) random access and good cache locality, and appending is amortised O(1). LinkedList is a doubly linked list with O(1) insertion at known nodes but O(n) access by index and more memory per element. In practice ArrayList is faster for almost all workloads. For queue or stack behaviour, ArrayDeque is usually better than LinkedList.
12
What is a functional interface and how do lambdas relate to it?
A functional interface has exactly one abstract method, such as Runnable, Comparator, Function, Predicate, Supplier or Consumer, and can be marked with @FunctionalInterface. A lambda expression is a short implementation of that single method, for example Predicate<String> empty = s -> s.isBlank(). Method references like String::toUpperCase are an even shorter form. Lambdas power the Streams API and callback-style code.
13
What is the difference between controlled and uncontrolled components?
In a controlled component, form input values live in React state and change through onChange, so React is the single source of truth, which makes validation and conditional UI easy. In an uncontrolled component, the DOM keeps the value and you read it through a ref when needed, which needs less code and suits simple forms or file inputs. Libraries like React Hook Form use uncontrolled inputs for better performance in large forms.
14
Create a protected route in React Router that redirects unauthenticated users to login.
200 OK for successful reads and updates, 201 Created with a Location header after creating a resource, and 204 No Content for successful deletes. 400 Bad Request for validation errors, 401 Unauthorized when authentication is missing or invalid, 403 Forbidden when the user is authenticated but not allowed, 404 Not Found, 409 Conflict for version or duplicate conflicts, and 429 Too Many Requests for rate limits. 500 means an unexpected server error and 503 means temporarily unavailable.
HashMap is not synchronized and allows one null key and null values. Hashtable is a legacy class where every method is synchronized, so it is slow and allows no nulls. ConcurrentHashMap is the modern thread-safe choice: reads are mostly lock-free, writes lock only a single bucket using CAS and synchronized blocks, and it offers atomic methods such as computeIfAbsent and merge. It also does not allow null keys or values.
The GC frees objects that are no longer reachable from GC roots such as thread stacks and static fields. Most objects die young, so the heap is generational: minor collections clean the young generation often and survivors are promoted. G1 is the default collector since Java 9 and targets predictable pause times by collecting regions. ZGC and Shenandoah offer sub-millisecond pauses for large heaps. Tuning usually starts with -Xmx and choosing the collector, not dozens of flags.
19
Write a repository query that loads orders with their items in one query.
public interface OrderRepository extends JpaRepository<Order, Long> {
@Query("""
select distinct o from Order o
join fetch o.items i
where o.customer.id = :customerId
""")
List<Order> findWithItems(@Param("customerId") Long customerId);
@EntityGraph(attributePaths = {"items", "customer"})
Optional<Order> findWithGraphById(Long id);
}
20
How does @Transactional work, and why does calling it from the same class not work?
Spring wraps the bean in a proxy. When an external caller invokes a @Transactional method, the proxy starts a transaction, calls the method and commits, or rolls back on a RuntimeException or Error. If a method in the same class calls another @Transactional method through this, the call skips the proxy, so the annotation is ignored. Fix it by moving the method to another bean or restructuring the boundary. The annotation also has no effect on private methods.
21
Your code has frequent NullPointerExceptions from repository lookups. How would you redesign it?
Return Optional from lookup methods so callers must handle the missing case, for example findById(id).orElseThrow(). Validate inputs at the API boundary with Bean Validation, initialise collections to empty lists instead of null and use Objects.requireNonNull in constructors. Java 17 helpful NPE messages show which variable was null, which speeds debugging. Do not use Optional for fields or method parameters; it is meant for return values.
22
Write code that runs tasks in parallel using ExecutorService and collects results.
A primary key uniquely identifies each row, cannot be null, and a table has only one, although it may span several columns. A unique key also enforces uniqueness but a table can have many, and most databases allow null values in it. Both create an index automatically. For example, id is the primary key of a users table while email and mobile have unique constraints.
String is immutable, so every change creates a new object. StringBuilder is mutable and fast but not thread-safe, which makes it the default choice for building strings inside a method or loop. StringBuffer is mutable and synchronized, so it is thread-safe but slower, and it is rarely needed today because strings are seldom shared across threads while being built. The compiler already uses optimized concatenation for simple + expressions outside loops.
26
A security test shows a stored XSS vulnerability in a comments feature. How do you fix it?
Stored XSS happens when user input containing script is saved and later rendered as HTML. React escapes text by default, so look for dangerouslySetInnerHTML, direct innerHTML or unsafe URL attributes like javascript: links. If rich text is required, sanitise it with a library like DOMPurify, and validate on the server too. Add a Content Security Policy header and keep tokens out of JavaScript-readable storage to limit damage.
27
Write a query that shows daily sales with a running total for the month.
SELECT order_date,
SUM(amount) AS daily_sales,
SUM(SUM(amount)) OVER (
ORDER BY order_date
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
) AS running_total
FROM orders
WHERE order_date >= DATE '2026-10-01'
AND order_date < DATE '2026-11-01'
GROUP BY order_date
ORDER BY order_date;
28
What is the difference between == and === in JavaScript?
== compares after type coercion, so 0 == '0' and null == undefined are true, which leads to surprising results. === compares both type and value without coercion, so 0 === '0' is false. Always use === and !== in application code. The only common exception is value == null, which checks for both null and undefined in one expression.
29
What are the correct and incorrect ways to use Optional?
Use Optional as a return type when a value may be absent, and consume it with map, filter, orElse, orElseGet or orElseThrow. Avoid calling get() without checking, avoid Optional fields in entities or DTOs, avoid Optional parameters and never return null from a method that returns Optional. Prefer orElseGet over orElse when the default is expensive, because orElse always evaluates its argument.
The heap stores objects and is shared by all threads; it is managed by the garbage collector and split into young and old generations. Each thread has its own stack holding method frames, local variables and references. Metaspace, in native memory since Java 8, stores class metadata. There is also the program counter per thread and the code cache for JIT-compiled code. Stack overflow comes from deep recursion, while OutOfMemoryError usually means heap or metaspace is full.
Constructor injection makes dependencies explicit and lets fields be final, so the object is always fully initialised and immutable. It allows plain unit tests without Spring or reflection, because you can pass mocks to the constructor. A long constructor also signals that a class has too many responsibilities. Field injection with @Autowired hides dependencies and needs a container or reflection in tests. With a single constructor, @Autowired is not even needed.
Flexbox is one-dimensional: it arranges items in a row or a column and is great for navbars, button groups, centring and card rows that wrap. Grid is two-dimensional: it controls rows and columns together, ideal for page layouts, dashboards and galleries with grid-template-areas. They work well together, for example a Grid page layout with Flexbox inside each card. Both reduce the need for floats and positioning hacks.
34
Implement pagination and sorting for a product list API.
volatile guarantees visibility: a write by one thread is immediately visible to others and reordering around it is restricted, but it does not make compound operations like count++ atomic. synchronized gives both mutual exclusion and visibility by acquiring a monitor lock, so only one thread runs the block at a time. Use volatile for simple flags such as a shutdown signal, synchronized or locks for check-then-act logic, and AtomicInteger or LongAdder for counters.
Every element is a box made of content, padding, border and margin, from inside to outside. By default, width applies only to the content, so padding and border add to the final size. Setting box-sizing: border-box makes width include padding and border, which makes layouts predictable, and most projects apply it to all elements. Vertical margins between block elements can collapse into one margin.
Frequently asked questions
Which companies hire Java Full Stack with React professionals in Delhi?
Companies with large offices in Delhi include many IT services and product firms. Use their company pages below to practise employer-specific sets.
Are Java Full Stack with React interviews in Delhi different from other cities?
The questions depend more on the company than the city. Delhi's mix of employers decides the style: Delhi itself hosts many corporate, government-tech and consulting offices, and most candidates also apply across Noida and Gurgaon, so interviews here mix service-company and product-company styles
How do I find Java Full Stack with React jobs in Delhi?
Shortlist companies with Delhi offices, keep your CV focused on Java Full Stack with React projects, apply on company career pages and job portals with the Delhi filter, and practise the questions on this page before each interview.