Backend Developer Interview Questions and Answers: Java, REST APIs, DBMS

Backend interviews for freshers and early-career developers stick to Java fundamentals, REST API design, DBMS and a bit of system design. These are the backend developer interview questions that come up most, with short answers you can build on.

, Former CTO

· 7 min read

Backend Developer Interview Questions and Answers: Java, REST APIs, DBMS

Backend roles are some of the most common openings for engineering freshers in India, from service companies hiring Java developers in bulk to startups looking for Node.js and Spring Boot engineers. The interviews run to a familiar pattern: language fundamentals, data structures, databases, APIs and a little design. Below are the backend developer interview questions we see asked most, grouped into Java interview questions for freshers, REST API interview questions, DBMS interview questions and system design basics. Answers are kept short so you can expand them in your own words.

What backend interviews test

  • Language depth: can you explain how your main language works, beyond writing syntax?
  • Problem solving: DSA questions in an online test or live round.
  • Data: schema design, SQL and transactions.
  • APIs: how clients and services talk to each other.
  • Engineering sense: errors, logging, testing, performance and security basics.

Java interview questions for freshers

1. What is the difference between JDK, JRE and JVM?

The JVM runs Java bytecode. The JRE is the JVM plus the core libraries you need to run programs. The JDK adds development tools on top of that, such as the compiler (javac) and the debugger.

2. Explain the four pillars of OOP.

Encapsulation hides state behind methods. Abstraction exposes only what callers need. Inheritance reuses behaviour from a parent class. Polymorphism gives you one interface with many implementations, through overloading and overriding. Have a small example ready for each, because the follow-up question is almost always "show me".

3. What is the difference between an abstract class and an interface?

An abstract class can hold state, constructors, and both abstract and concrete methods, and a class can extend only one. An interface defines a contract. Since Java 8 it can have default and static methods, and a class can implement as many interfaces as it likes.

4. Why are Strings immutable in Java?

Security is one reason, since strings are used in class loading, file paths and network calls. Thread safety is another, and immutability lets the string pool share instances safely. When you need to modify a string repeatedly, use StringBuilder.

5. What is the difference between == and equals()?

For objects, == compares references, while equals() compares logical content when it's overridden. Override equals() and you must override hashCode() too, or hash-based collections will behave wrongly.

6. How does HashMap work internally?

Entries live in an array of buckets, and the key's hashCode() decides the bucket. Collisions go into a linked list, which becomes a balanced tree once a bucket grows large (since Java 8). When the load factor (0.75 by default) is crossed, the table resizes and every entry is rehashed.

7. Checked vs unchecked exceptions?

Checked exceptions such as IOException have to be declared or handled at compile time. Unchecked exceptions extend RuntimeException (for example NullPointerException) and usually point to a programming error.

8. What are the main features added in Java 8 and later?

Java 8 brought lambdas, the Stream API, Optional, default methods and the new date-time API. Later versions added var, records, text blocks, pattern matching and virtual threads. Talk about the version you use day to day, not the newest one you've read about.

9. What is the difference between a process and a thread?

A process gets its own memory space, while threads share their process's memory. Threads are cheaper to create, but they need synchronisation to avoid race conditions.

REST API interview questions

10. What makes an API RESTful?

Resources identified by URLs, standard HTTP methods, stateless requests where each one carries everything it needs, representations such as JSON, and status codes that mean something.

11. Explain the HTTP methods and idempotency.

GET reads, POST creates, PUT replaces, PATCH partially updates and DELETE removes. GET, PUT and DELETE are idempotent, meaning that repeating the same request leaves the server in the same state. POST isn't, and that's why payment APIs use idempotency keys.

12. PUT vs PATCH?

PUT sends the whole resource and replaces it. PATCH sends only the fields you want to change.

13. Which status codes should you know?

200 OK, 201 Created, 204 No Content, 400 Bad Request, 401 Unauthorized (not authenticated), 403 Forbidden (authenticated but not allowed), 404 Not Found, 409 Conflict, 422 Unprocessable Entity, 429 Too Many Requests, 500 Internal Server Error and 503 Service Unavailable.

14. How do you secure a REST API?

Use HTTPS everywhere. Add authentication (session cookies or tokens such as JWT, and OAuth 2.0 for third parties), check authorisation on every resource, validate input, rate limit, and never return sensitive fields by default.

15. How would you design endpoints for orders?

GET    /orders?status=shipped&page=2
POST   /orders
GET    /orders/{id}
PATCH  /orders/{id}
DELETE /orders/{id}
GET    /users/{id}/orders

Then talk about pagination, filtering, versioning (/v1/ or a header) and keeping error bodies consistent.

DBMS interview questions

16. What are ACID properties?

Atomicity (all or nothing), Consistency (constraints hold before and after), Isolation (concurrent transactions don't interfere incorrectly) and Durability (committed data survives a crash).

17. Explain normalisation up to 3NF.

1NF means atomic values and no repeating groups. 2NF removes partial dependency on part of a composite key. 3NF removes transitive dependency, so non-key columns depend only on the key. It's worth adding that read-heavy systems sometimes denormalise on purpose.

18. What is an index and when can it hurt?

An index, usually a B-tree, speeds up lookups and sorting on its columns. It takes storage and slows down writes. It also may not get used if you wrap the column in a function or filter with a leading wildcard like LIKE '%abc'.

19. What are transaction isolation levels?

Read uncommitted, read committed, repeatable read and serializable. Each level prevents more anomalies (dirty reads, non-repeatable reads, phantom reads) and costs more in concurrency.

20. SQL vs NoSQL: when would you choose each?

Pick SQL for structured data with relationships and strong consistency needs, payments being the classic case. Pick NoSQL (document, key-value, wide-column) for flexible schemas, very high write volumes or simple access patterns at scale.

21. What is a deadlock?

Two transactions each hold a lock the other one needs, so neither moves. The database detects this and aborts one of them. You lower the risk by locking rows in a consistent order and keeping transactions short.

System design basics

22. How would you design a URL shortener?

Start with requirements. Then an API (POST /urls, GET /{code}), a table mapping code to URL, a way to generate codes (base62 of an ID, or a hash with collision checks), a cache for popular codes, and a redirect with status 301 or 302.

23. What is caching and where would you add it?

Caching keeps frequently read data in fast memory such as Redis. Put it in front of expensive reads, and decide up front how you'll invalidate it: time-based expiry, or updating the cache when the data changes.

24. Monolith vs microservices?

A monolith is simpler to build, test and deploy in the early days. Microservices let you scale and deploy pieces independently, but you pay with network calls, distributed data and operational overhead. Most teams should start with a well-structured monolith.

25. How do you debug a slow API?

Measure first. Use logs and traces to find out whether the time goes to the database, external calls or your own code. Then check query plans and missing indexes, add caching, and get rid of N+1 queries.

How to prepare

  • Go deep on one language instead of skimming three.
  • Build and deploy one backend project with authentication, a database and tests, and know every line of it.
  • Practise SQL and DSA daily for the online rounds.
  • Say your answers out loud. Interviewers judge clarity as much as correctness.

Your profiles should back up what you say in the interview. Read our guide to the GitHub, LinkedIn and resume triangle and the ATS optimisation guide for developers.

LetSwitch is built for this kind of preparation. Get backend questions matched to your stack from the dynamic question generator, practise them in AI mock interviews, and book a live expert interview with a working engineer. Start free on LetSwitch.

  • backend developer interview questions
  • java interview questions for freshers
  • rest api interview questions
  • dbms interview questions
  • spring boot
  • software engineering

Frequently asked questions

What topics are covered in a backend developer interview for freshers?

One programming language in depth (usually Java, Python or Node.js), data structures and algorithms, DBMS and SQL, REST API concepts, OS and networking basics, and for some roles a framework like Spring Boot. Product companies often add a short system design or low-level design round.

Is Java still a good choice for backend roles in India?

Yes. Java with Spring Boot is still everywhere in Indian IT services, banks, fintech and enterprise product companies, which is why Java interview questions for freshers come up so often. Node.js, Python and Go are popular too, especially at startups.

What REST API questions are commonly asked?

HTTP methods and idempotency, status codes, statelessness, PUT vs PATCH, token authentication such as JWT, pagination, versioning, and how you'd design endpoints for a simple resource like orders or users.

Which DBMS concepts should I revise for backend interviews?

Normalisation, primary and foreign keys, ACID properties, transactions and isolation levels, indexes and when they help, joins, SQL vs NoSQL, and deadlocks. Expect to write SQL queries on a whiteboard.

Do freshers get system design questions?

Usually only basic ones, like designing the API and database for a URL shortener or explaining caching. The interviewer is looking for structured thinking: requirements, APIs, data model and one or two scaling ideas. Nobody expects a full distributed architecture from a fresher.