Backend Developer Interview: Complete Preparation Guide 2026
From system design to database optimization, REST APIs to behavioral questions — this guide covers the most asked backend developer interview questions in 2026 with detailed answers and practical tips.
🏗️ System Design Basics
1. How would you design a URL shortener like bit.ly?
Key components: a hash function (Base62 encoding of an auto-increment ID or MD5/SHA256 truncation), a key-value store for mapping short→long URLs, and a redirect service (HTTP 301/302). For scale, add a distributed cache (Redis), a load balancer, and partition the database by hash prefix.
💡 Tip: Always start with requirements (read-heavy vs write-heavy, expected QPS), then move to high-level design, then deep-dive into trade-offs.
2. What is the difference between horizontal and vertical scaling?
Vertical scaling (scale up) = bigger machine — more CPU, RAM. Simple but has a ceiling. Horizontal scaling (scale out) = more machines behind a load balancer. More complex (state management, consistency) but virtually unlimited. Most production systems use horizontal scaling.
3. Explain the CAP theorem.
In a distributed system, you can only guarantee two of three: Consistency (all nodes see the same data), Availability (every request gets a response), and Partition tolerance (system works despite network splits). Since partitions are inevitable, you're really choosing between CP (e.g., MongoDB) and AP (e.g., Cassandra).
💡 Tip: Mention real-world examples. Interviewers love when you tie theory to actual systems.
🔌 REST API & GraphQL Questions
4. What makes a REST API truly RESTful?
Key constraints: Statelessness (each request contains all info needed), resource-based URLs (/users/123 not /getUser?id=123), proper HTTP methods (GET, POST, PUT, DELETE), HATEOAS (responses include links to related actions), and uniform interface.
5. REST vs GraphQL — when would you choose each?
REST: simple CRUD, caching is critical (HTTP caching works out of the box), microservices communicating internally. GraphQL: mobile apps needing flexible queries, avoiding over-fetching/under-fetching, multiple frontend teams with different data needs. GraphQL adds complexity — don't use it just because it's trendy.
💡 Tip: Show you understand trade-offs, not just definitions. "It depends" is a great start if followed by concrete criteria.
6. How do you handle API versioning?
Common strategies: URL path (/api/v2/users) — most popular, simple. Header-based (Accept: application/vnd.api+json;version=2) — cleaner URLs but harder to test. Query param (?version=2) — easy but messy. Whichever you choose, maintain backward compatibility and deprecate gracefully.
🗄️ Database Questions (SQL + NoSQL)
7. SQL vs NoSQL — how do you decide?
SQL (PostgreSQL, MySQL): structured data, complex queries, ACID transactions, relationships matter. NoSQL (MongoDB, DynamoDB, Redis): flexible schema, massive scale, high write throughput, denormalized data is OK. Many production systems use both — SQL for core business data, NoSQL for caching/sessions/logs.
8. What is database indexing and when can it hurt performance?
An index is a data structure (typically B-tree) that speeds up reads by avoiding full table scans. But indexes slow down writes (every INSERT/UPDATE must update the index too) and consume storage. Over-indexing is a real problem. Index columns used in WHERE, JOIN, and ORDER BY — not everything.
💡 Tip: Mention composite indexes and explain when column order matters. This shows depth.
9. Explain ACID properties with a real example.
Atomicity: bank transfer — both debit and credit succeed or neither does. Consistency: balance can't go negative if that's a rule. Isolation: two concurrent transfers don't interfere. Durability: once committed, the transfer survives a crash. These guarantees are why SQL databases dominate financial systems.
⚙️ Node.js / Python / Java Common Questions
10. How does the Node.js event loop work?
Node.js is single-threaded but non-blocking. The event loop processes callbacks in phases: timers → pending callbacks → poll (I/O) → check (setImmediate) → close. CPU-heavy tasks block the loop — offload them to worker threads or external services. This is why Node excels at I/O-bound workloads (APIs, real-time apps) but struggles with computation.
11. What is Python's GIL and how does it affect concurrency?
The Global Interpreter Lock allows only one thread to execute Python bytecode at a time. This means CPU-bound tasks don't benefit from multi-threading. Solutions: use multiprocessing (separate processes, no shared GIL), asyncio for I/O-bound tasks, or libraries like NumPy that release the GIL during C operations.
💡 Tip: Mention that Python 3.13+ is experimenting with a no-GIL mode (PEP 703). Shows you stay current.
12. Explain Java's garbage collection in simple terms.
Java automatically frees memory you're no longer using. The heap is divided into Young Generation (short-lived objects, collected frequently via minor GC) and Old Generation (long-lived objects, collected less often via major GC). Modern collectors like G1 and ZGC minimize pause times. Tune GC when you see latency spikes.
🧮 Algorithms & Data Structures Essentials
13. What is Big O notation and why does it matter?
Big O describes how an algorithm's runtime or space grows with input size. O(1) = constant (hash lookup). O(log n) = binary search. O(n) = linear scan. O(n²) = nested loops. It matters because the difference between O(n) and O(n²) on 1 million records is seconds vs hours.
14. When would you use a hash map vs a tree map?
Hash map: O(1) average lookup, no ordering. Use when you just need fast key→value access. Tree map: O(log n) lookup, but keys are sorted. Use when you need range queries or ordered iteration. In interviews, hash maps solve ~70% of problems.
💡 Tip: Always discuss time AND space complexity. Interviewers notice when you consider both.
15. How do you detect a cycle in a linked list?
Use Floyd's Tortoise and Hare algorithm: two pointers, one moves 1 step, the other moves 2 steps. If they meet, there's a cycle. Time: O(n), Space: O(1). The brute-force alternative (hash set of visited nodes) uses O(n) space. Interviewers expect the two-pointer approach.
🐳 DevOps Basics for Backend Devs
16. Docker vs Virtual Machines — what's the difference?
VMs virtualize hardware — each has its own OS, heavy (GBs), slow to start. Docker containers share the host OS kernel, are lightweight (MBs), and start in seconds. Containers are ideal for microservices; VMs for full OS isolation. In 2026, containers are the default for backend deployments.
17. What is a CI/CD pipeline and what stages does it typically include?
A CI/CD pipeline automates: Build → Lint/Static analysis → Unit tests → Integration tests → Security scan → Deploy to staging → E2E tests → Deploy to production. Popular tools: GitHub Actions, GitLab CI, Jenkins. As a backend dev, you should be able to write and debug pipeline configs.
18. How do you monitor a backend service in production?
The three pillars of observability: Logs (structured JSON logs → ELK/Loki), Metrics (request rate, error rate, latency → Prometheus/Grafana), Traces (distributed tracing → Jaeger/OpenTelemetry). Set up alerts on key SLIs and define SLOs. "If you can't measure it, you can't fix it."
💡 Tip: Mention the RED method (Rate, Errors, Duration) for services and USE method (Utilization, Saturation, Errors) for resources.
🎯 Behavioral Questions
19. Tell me about a time you had to debug a critical production issue.
Use the STAR method: Situation (production API returning 500s at peak traffic), Task (find root cause and fix ASAP), Action (checked logs, found DB connection pool exhaustion, increased pool size and added connection timeout), Result (resolved in 30 min, added monitoring to prevent recurrence). Be specific — vague answers don't impress.
20. How do you handle disagreements about technical decisions with your team?
Show maturity: Listen first, understand their reasoning. Use data — benchmarks, docs, proof of concepts beat opinions. Propose experiments ("let's try both approaches and measure"). If no consensus, defer to the team lead and commit fully. Never say "I told you so" if your way would have been better.
💡 Tip: Companies hire for collaboration, not just coding skills. Prepare 2-3 stories about teamwork, conflict resolution, and learning from failure.
Practice these questions with AI
Our Telegram bot simulates real backend developer interviews with adaptive difficulty. Get instant feedback on system design, coding, and behavioral answers.
🚀 Start Free PracticeFree · 5 interviews at no cost