Interview prep · 💻 Software Developer (Java · Python · JavaScript)
Software Developer interview questionsand answers (30, by level).
The questions Indian employers actually ask for this role — fresher, mid-level and senior — with model answers written by engineers who sit on the other side of the table. Use with the role path and the 30-day lab plan.
Fresher / L1
Fundamentals they test on day one
1What is the difference between == and equals()/=== ?
Reference vs value equality (Java); === strict equality without coercion (JS). Expect language-specific follow-ups.
2Explain OOP principles with examples.
Encapsulation, inheritance, polymorphism, abstraction — e.g., an interface PaymentMethod implemented by UPI and Card.
3What is Big-O and the complexity of binary search?
Growth of time/space with input; binary search is O(log n) on sorted data.
4HashMap vs ArrayList (or dict vs list)?
Map: key-value, O(1) average lookup; list: ordered, index access, O(n) search.
5What is a REST API? HTTP methods and status codes?
Resource-based HTTP APIs; GET/POST/PUT/PATCH/DELETE; 200/201/400/401/404/500 — see our status-code reference.
6Explain exception handling best practices.
Catch specific exceptions, do not swallow, log with context, fail fast, use custom exceptions sparingly.
7What is Git and a pull request?
Version control; a PR proposes changes for review and CI before merge.
8SQL: write a query for top 5 customers by total orders.
SELECT customer_id, SUM(amount) t FROM orders GROUP BY customer_id ORDER BY t DESC LIMIT 5.
9What is unit testing and mocking?
Testing a unit in isolation; mocks replace dependencies (DB, APIs) so tests are fast and deterministic.
10Synchronous vs asynchronous code?
Sync blocks until done; async continues and handles results later (promises/async-await, futures) — vital for IO-heavy apps.
2–5 years / L2
What a working engineer must know
1Design a URL shortener.
API to create/redirect, base62 IDs, DB with index on code, cache (Redis), rate limits, analytics async, 301 vs 302 choice.
2How do you prevent SQL injection and XSS?
Parameterised queries/ORM, input validation, output encoding, CSP, frameworks’ escaping, security headers.
3Explain JWT auth and its pitfalls.
Signed token carrying claims; pitfalls: no revocation (use short expiry + refresh), storing in localStorage (XSS), weak secrets, alg none.
4N+1 query problem — detect and fix?
Loop issuing a query per row; detect via logs/ORM profiler; fix with joins, eager loading, batching.
5Idempotency in APIs — why and how?
Retries must not duplicate effects; idempotency keys stored with results; PUT semantics.
6How do you structure a Spring Boot/Django/Node service?
Layers (controller/service/repository), DTOs, validation, config via env, logging, health endpoints, tests per layer.
7Caching strategies and invalidation?
Cache-aside, write-through, TTLs, versioned keys; invalidate on writes; beware stale reads and stampedes.
8Explain concurrency issues and how to avoid race conditions.
Shared state mutations; use immutability, locks/atomic ops, queues, database constraints; test with load.
9How do you make an app observable?
Structured logs with correlation IDs, metrics (latency, errors), traces, health checks, dashboards.
10Code review: what do you look for?
Correctness, tests, readability, security, performance hotspots, API contracts, small focused changes.
Senior / L3
Design, judgement and leadership
1Design a WhatsApp-based order system for 10k merchants.
Webhook ingestion (WhatsApp Cloud API), queue (Kafka/RabbitMQ), workers, idempotent processing, PostgreSQL + Redis, templates/approvals, rate limiting, observability, multi-tenant isolation.
2Monolith vs microservices — how do you decide?
Start modular monolith; split on team boundaries and scaling needs; microservices add ops cost (deploys, tracing, data consistency).
3Event-driven architecture pitfalls?
Ordering, duplicates (idempotency), schema evolution, debugging, eventual consistency; use outbox pattern and schema registry.
4How do you integrate LLMs into a product responsibly?
Clear use case, RAG over your data, guardrails/validation, cost/latency budgets, evals, logging, human fallback; see our LLM guide.
5Scaling a database-bound app?
Query optimisation, read replicas, caching, connection pooling, partitioning, CQRS for heavy reads; measure first.
6API versioning and backward compatibility?
Additive changes, version in path/header for breaking ones, deprecation timelines, contract tests.
7Testing strategy for a payments feature?
Unit + integration with sandbox, contract tests, idempotency and retry tests, reconciliation jobs, feature flags, monitoring.
8How do you lead a team through a legacy rewrite?
Strangler pattern, characterisation tests, incremental delivery, metrics for success, avoid big bang.
9Performance profiling in production?
APM/tracing, flame graphs, sampling profilers, slow query logs, load tests on staging; fix the top 20%.
10Mentoring juniors: what works?
Pairing, code review as teaching, small ownership, written standards, regular feedback.
How to answer
Four habits that pass interviews
- Say the structure first“I’d check three things: …” — interviewers reward a method more than a lucky answer.
- Numbers and namesMention real tools, versions and figures from your lab; vague answers lose.
- Admit gaps cleanly“I haven’t run X in production; here is how I’d approach it” beats bluffing.
- Ask about the environmentScale, on-call, tooling — it shows you think like an operator.
Ready to be hired, or ready to hire?
Engineers: join our vetted network for projects and placements. Companies: we shortlist software developers within 48 hours.