Expert · Choosing a stack and getting hired · topic 54 of 54 · 30 min
Backend interview preparation
Explanation
What the hiring process usually looks like
- Online coding test: 60 to 90 minutes on a test platform, usually 2 or 3 programming problems and some MCQs on SQL, operating systems and networks.
- DSA round: a live interview on data structures and algorithms (arrays, strings, hash maps, sorting, sometimes trees). They watch how you think, not only the final answer.
- Backend fundamentals round: HTTP, REST, status codes, authentication, caching, plus questions about your project.
- SQL round: write queries live, such as joins, GROUP BY and "second highest salary".
- System design round: mostly for people with 2 or more years of experience. Freshers may get a small version, like "design a URL shortener".
- HR or managerial round: your background, why this company, notice period, salary expectations.
Some companies replace the DSA round with a take-home assignment: build a small API in 2 or 3 days. Service companies hiring many freshers often do the test plus one technical round plus HR. Product companies usually have more technical rounds.
Common backend questions with short answers
| Question | Short model answer |
|---|---|
| What happens when you type a URL and press Enter? | DNS finds the IP address, the browser opens a TCP connection and a TLS (HTTPS) session, sends an HTTP request, the server routes it and replies, and the browser renders the HTML and loads CSS, JS and images. |
| PUT vs PATCH? | PUT replaces the whole resource with what you send. PATCH changes only the fields you send. |
| What does idempotent mean? | Doing the same request many times has the same effect as doing it once. GET, PUT and DELETE are idempotent; POST is not by default. |
| 401 vs 403? | 401: we do not know who you are (not logged in or bad token). 403: we know you, but you are not allowed. |
| What is a database index? Any downside? | A sorted structure (usually a B-tree) that finds rows fast without scanning the whole table. It uses space and makes inserts and updates slower. |
| What is a transaction? What is ACID? | A group of statements that succeed or fail together. ACID: Atomicity, Consistency, Isolation, Durability. |
| INNER JOIN vs LEFT JOIN? | INNER JOIN keeps only rows that match on both sides. LEFT JOIN keeps every row of the left table and fills NULL where there is no match. |
| SQL vs NoSQL? | SQL: fixed tables, joins, strong transactions; good for money and linked data. NoSQL: flexible documents or key-values; good for changing shapes and very large simple reads. |
| How do you store passwords? | Never plain or encrypted. Hash with a slow algorithm like bcrypt or Argon2, which adds a random salt to each password. |
| Sessions vs JWT? | Session: a random id in a cookie, data kept on the server, easy to log out. JWT: a signed token holding the data, no server lookup, but hard to cancel before it expires. |
| What is SQL injection and how do you stop it? | User input is pasted into a SQL string and changes the query. Stop it with parameterised queries (placeholders), never string joining. |
| What is CORS? | A browser rule that blocks a page from reading responses from another origin unless the server allows it with Access-Control-Allow-Origin. |
| What is caching? What is the hard part? | Keeping a copy of slow results in fast storage like Redis. The hard part is invalidation: removing or updating the copy when the data changes. |
| Vertical vs horizontal scaling? | Vertical: a bigger machine. Horizontal: more machines behind a load balancer; needs stateless servers. |
| What is rate limiting? | Capping how many requests a client can make in a time window (for example 5 logins per minute); extra requests get 429 Too Many Requests. |
| Why use a queue or background job? | Slow work (emails, PDFs, image resizing) is done later by a worker, so the API can reply fast and retry failures. |
| How does Node.js handle many requests on one thread? | The event loop: while waiting for the database or network, Node handles other requests; callbacks run when results arrive. CPU-heavy work blocks it. |
| What is the N+1 query problem? | Loading a list with 1 query, then running 1 more query per item. Fix it with a JOIN or a single IN (...) query. |
| Offset vs cursor pagination? | Offset: LIMIT 20 OFFSET 40, simple but slow and shaky on big, changing tables. Cursor: "after id 1234", fast and stable. |
How to explain your project
- The problem: who uses it and what pain it removes (one sentence).
- The stack and why: language, framework, database, where it is hosted.
- Your part: exactly what YOU built. Say "I", not "we", for your own work.
- One hard bug: what went wrong, how you found it (logs, a failing test), and how you fixed it.
- What you would improve with more time: tests, caching, a queue, better security.
"I built a canteen order API for my college, because students waited 15 minutes
in the lunch queue. It uses Node.js with Express and PostgreSQL, deployed on a
cloud platform. I wrote the order and payment-status endpoints and the tests.
The hardest bug: two students could order the last samosa at the same time.
I fixed it with a transaction and a stock check inside it. Next, I would add
Redis caching for the menu and a background job for receipts."One strong portfolio project
- Idea: a "college canteen order API". Students see the menu and order; canteen staff mark orders Preparing, Ready and Collected.
- Auth: sign up and log in with bcrypt-hashed passwords, and JWT or session cookies; two roles, student and staff.
- Menu: staff-only create, update and delete; stock count per item.
- Orders: the total is calculated on the server; stock is reduced inside a transaction.
- Order history with pagination; validation with clear 400 errors in one JSON error format.
- Unit and integration tests, OpenAPI docs, rate limiting on login.
- Deployed with a live URL, plus a README with setup steps, sample requests and seed data.
Resume tips
- One page for freshers. A plain layout (no tables or images for text) so applicant tracking systems can read it.
- Put projects near the top, each with a live link, a GitHub link and 2 lines of what you built.
- Use true numbers where you have them: "API handles 200 test orders in under 1 second in load tests".
- List only skills you can answer questions on. Group them: languages, frameworks, databases, tools.
- Match words from the job post where they are true for you (for example "REST API", "PostgreSQL", "Docker").
A 30-day revision plan
| Days | Focus | Daily work (about 3 hours) |
|---|---|---|
| 1-7 | Web and backend basics | HTTP, REST, status codes, auth. Say 5 table questions aloud. 2 easy DSA problems. |
| 8-14 | SQL and databases | Joins, GROUP BY, subqueries, indexes, transactions. 8 to 10 SQL problems. 2 DSA problems. |
| 15-21 | Your project | Add tests, docs and deployment. Write and practise your 60-second explanation. 2 DSA problems. |
| 22-27 | Design and mock interviews | Small system designs (URL shortener, rate limiter). 2 or 3 mock interviews with friends. 2 DSA problems. |
| 28-30 | Polish and apply | Revise weak areas from mocks, update resume and LinkedIn, apply to 10 or more roles. |
Watch the lesson
Backend interview preparation · 1/7
Backend interviews follow a common pattern. Knowing it removes half the fear.
Prefer a video by a teacher? Find free videos on “backend developer interview questions and answers for freshers india” on YouTube ↗
In real life: How Priya turned rejections into an offer
Priya cleared online tests but failed three technical rounds: she froze on "what happens when you type a URL" and could not explain her group project. She followed a 30-day plan, built her own canteen order API with tests and a live link, and practised her project story and the common questions aloud with a friend every evening. In her next interview she was asked about the N+1 problem and about a hard bug; she explained both with examples from her own code and got the offer.
Practice (0/3 done)
A classic SQL interview question: return the second highest DIFFERENT salary from the employees table, in one column named second_highest. Careful: two people share the top salary.
Write (and then say aloud in under 2 minutes) your answer to "What happens when you type www.irctc.co.in in the browser and press Enter?"
Write a 60 to 90 second explanation of one backend project you built, using the five steps: problem, stack and why, your part, a hard bug, what you would improve. Record yourself saying it and listen once.
Quick quiz
Read more (free)
Pass the quiz (60% or more) or mark this topic as done when you are ready.
Your progress is saved on this device only.