InterviewForge AI Logo
InterviewForge
Start practice

Interview preparation hub

Technical Interview Questions

A developer-first guide covering patterns that show up across top companies — structured like modern docs so you can skim, search, and drill deep.

All levels·Updated 2026-03-28·28 min read
DSASystem DesignWebBehavioralJava

Data structures & algorithms

Complexity, patterns, and how interviewers evaluate your problem-solving.

~10 minPractice

Questions

MediumHow do you choose between BFS and DFS on a graph interview problem?
Use BFS when you need the shortest path in an unweighted graph or level-by-level traversal. Use DFS for exhaustive exploration, detecting cycles, topological order, or when the state space stacks naturally. State space and pruning strategy matter more than memorizing templates.

Pro tip

Start by clarifying whether the graph is directed/weighted and expected output (path vs. reachability).

EasyWhat does it mean to "trade time for space" in interviews?
You may use extra memory (hash maps, prefix arrays, auxiliary structures) to reduce time complexity — e.g. O(n²) → O(n). Interviewers often accept O(n) space if it simplifies correctness. Always mention the trade-off aloud.
// Example: complement lookup turns two-sum into O(n)
Map<Integer, Integer> idx = new HashMap<>();
for (int i = 0; i < nums.length; i++) {
  int need = target - nums[i];
  if (idx.containsKey(need))
    return new int[] { idx.get(need), i };
  idx.put(nums[i], i);
}

Pro tip

If you use a hash map, call out worst-case collisions and why Integer keys are still fine here.

EasyHow do you communicate your approach before coding?
Give constraints, brute force with complexity, then improve. Outline test cases (empty, large, duplicates). Narrate invariants you will maintain. Pause for buy-in —"Does this API / input format sound right?"

System design foundations

High-level architecture, scalability vocabulary, and structured trade-offs.

~8 minPractice

Questions

MediumWhat are the first clarifying questions you ask in a system design round?
Functional: core features, read vs write ratio, latency/availability targets. Non-functional: expected scale (DAU, QPS), consistency vs availability, compliance, multi-region. Scope: MVP vs nice-to-haves. Write assumptions on the whiteboard.

Pro tip

Time-box discovery (~5 minutes) so you still draw a full architecture.

EasyExplain horizontal vs vertical scaling in one minute.
Vertical: bigger machine — simpler ops, hard limits, downtime risk. Horizontal: more nodes — needs load balancing, stateless tiers, sharding, and operational maturity. Most large systems combine both at different layers.
HardWhy do teams introduce caches, and what can go wrong?
Caches reduce latency and protect databases from hot keys. Risks: stale reads, thundering herd, cache poisoning, and invalidation complexity. Pair caches with TTLs, request coalescing, and clear consistency promises to clients.

Web & backend engineering

HTTP semantics, APIs, databases, and production hygiene.

~6 minPractice

Questions

MediumHow do idempotent HTTP methods help in distributed systems?
GET/PUT/DELETE are idempotent: repeating the request should not compound side effects. That makes retries safer with intermittent failures. POST creates resources — use idempotency keys when clients may retry creates.
// Example header pattern (conceptual)
// Idempotency-Key: <uuid> on POST /payments

Pro tip

Mention at-least-once delivery from message brokers and why deduplication matters.

EasyWhat is connection pooling and why does it matter?
Opening DB connections is expensive. Pools reuse connections with caps (min/max) to avoid exhausting the database. Tune pool size with traffic, query latency, and instance limits — not “as high as possible.”

Behavioral & communication

STAR stories, cross-functional work, and signals hiring managers listen for.

~4 minPractice

Questions

EasyHow do you structure a behavioral answer without rambling?
STAR: Situation (one sentence), Task (your responsibility), Action (what *you* did, with specifics), Result (metrics or learning). Keep Actions 50–60% of the answer. End with what you'd improve next time if relevant.

Pro tip

Prepare 6–8 stories that map to leadership principles or company values you research beforehand.

MediumHow do you discuss conflict on a team?
Focus on shared goals, facts, and assumptions you validated. Describe how you listened, proposed experiments or data to resolve ambiguity, and followed up. Avoid blaming individuals; show accountability.