TL;DR

SWE interviews test four areas: Coding (algorithms, data structures),System Design (architecture, scalability), Behavioral (teamwork, communication), and Technical Deep Dive (past projects). Practice 100-150 problems, learn to think out loud, and study system design fundamentals. The best candidates communicate their reasoning clearly-not just write correct code.

The Four Types of SWE Interview Questions

Understanding what each round tests helps you prepare efficiently.

TypeWhat It TestsTime
CodingProblem-solving, data structures, algorithms45-60 min
System DesignArchitecture, scalability, trade-offs45-60 min
BehavioralTeamwork, communication, culture fit30-45 min
Technical Deep DivePast experience, technical decisions30-45 min

Coding Questions: Arrays & Strings

The most common category. Master these patterns and you'll handle most interview problems.

  1. Two Sum: Find two numbers that add up to a target. (Hash map approach)
  2. Best Time to Buy and Sell Stock: Find max profit from one transaction.
  3. Contains Duplicate: Check if array has any duplicates.
  4. Product of Array Except Self: Calculate products without division.
  5. Maximum Subarray: Find contiguous subarray with largest sum. (Kadane's algorithm)
  6. 3Sum: Find all unique triplets that sum to zero.
  7. Container With Most Water: Find two lines that hold the most water.
  8. Longest Substring Without Repeating Characters: Sliding window classic.
  9. Valid Anagram: Check if two strings are anagrams.
  10. Group Anagrams: Group strings that are anagrams of each other.

Pattern: Two Pointers

Use when: Searching for pairs in a sorted array, or when you need to compare elements from both ends.

Example: Two Sum II (sorted array) - Start pointers at both ends. If sum is too small, move left pointer right. If too big, move right pointer left.

Time: O(n) | Space: O(1)

Coding Questions: Trees & Graphs

These questions test your ability to think recursively and traverse complex data structures.

Binary Trees

  1. Maximum Depth of Binary Tree: Find the height of a tree.
  2. Invert Binary Tree: Swap left and right children recursively.
  3. Same Tree: Check if two trees are identical.
  4. Binary Tree Level Order Traversal: BFS to get nodes level by level.
  5. Validate Binary Search Tree: Check BST property holds.
  6. Lowest Common Ancestor: Find LCA of two nodes.
  7. Serialize and Deserialize Binary Tree: Convert tree to string and back.

Graphs

  1. Number of Islands: Count connected components in a grid.
  2. Clone Graph: Deep copy a graph with cycles.
  3. Course Schedule: Detect cycle in directed graph (topological sort).
  4. Pacific Atlantic Water Flow: Multi-source BFS/DFS.
  5. Word Ladder: BFS to find shortest transformation sequence.
  6. Network Delay Time: Dijkstra's shortest path algorithm.

Pattern: BFS vs DFS

Use BFS when: Finding shortest path, level-order traversal, nearest neighbor.

Use DFS when: Exploring all paths, detecting cycles, topological sort, backtracking.

Both are O(V + E) for graphs, O(n) for trees.

Coding Questions: Dynamic Programming

DP questions are often the hardest. The key is recognizing the pattern and defining the subproblem correctly.

  1. Climbing Stairs: Classic Fibonacci-style DP.
  2. House Robber: Max sum of non-adjacent elements.
  3. Coin Change: Minimum coins to make a target amount.
  4. Longest Increasing Subsequence: O(n²) DP or O(n log n) with binary search.
  5. Longest Common Subsequence: 2D DP classic.
  6. Word Break: Check if string can be segmented into dictionary words.
  7. Unique Paths: Count paths in a grid (combinatorics or DP).
  8. Edit Distance: Minimum operations to convert one string to another.
  9. Decode Ways: Count ways to decode a numeric string.

DP Approach Framework

1. Define the subproblem: What does dp[i] represent?

2. Find the recurrence: How does dp[i] relate to smaller subproblems?

3. Identify base cases: What are dp[0], dp[1]?

4. Determine order: Bottom-up or top-down (memoization)?

5. Optimize space: Can you reduce from O(n) to O(1)?

Coding Questions: Other Essential Topics

Linked Lists

  1. Reverse Linked List: Iterative and recursive approaches.
  2. Merge Two Sorted Lists: Combine into one sorted list.
  3. Linked List Cycle: Detect cycle using Floyd's algorithm.
  4. Remove Nth Node From End: Two-pointer technique.
  5. Merge K Sorted Lists: Heap or divide-and-conquer.

Stacks & Queues

  1. Valid Parentheses: Match brackets using a stack.
  2. Min Stack: Stack with O(1) getMin operation.
  3. Daily Temperatures: Monotonic stack classic.
  4. Implement Queue using Stacks: Amortized O(1) operations.

Binary Search

  1. Search in Rotated Sorted Array: Modified binary search.
  2. Find Minimum in Rotated Sorted Array: Binary search variation.
  3. Search a 2D Matrix: Treat matrix as sorted array.
  4. Median of Two Sorted Arrays: Hard binary search problem.

Heap / Priority Queue

  1. Kth Largest Element: Quick select or min-heap.
  2. Top K Frequent Elements: Heap or bucket sort.
  3. Find Median from Data Stream: Two heaps approach.

System Design Questions

For senior roles (3+ years), expect at least one system design round. These test your ability to design scalable, reliable systems.

  1. Design a URL Shortener (like bit.ly)
  2. Design Twitter/X Feed
  3. Design a Chat System (like WhatsApp)
  4. Design a Video Streaming Service (like YouTube)
  5. Design a Ride-Sharing Service (like Uber)
  6. Design a Web Crawler
  7. Design a Rate Limiter
  8. Design a Key-Value Store

System Design Framework

1. Clarify requirements (5 min): Users, scale, features, constraints

2. Estimate scale (5 min): QPS, storage, bandwidth

3. High-level design (10 min): Main components, data flow

4. Deep dive (20 min): Database schema, API design, specific components

5. Address bottlenecks (5 min): Caching, sharding, replication

Behavioral Questions for Engineers

Don't underestimate these. Many strong coders fail because they can't articulate their experience. Use the STAR method.

  1. Tell me about a challenging bug you solved.
  2. Describe a time you disagreed with a technical decision.
  3. Tell me about a project you're proud of.
  4. How do you handle tight deadlines?
  5. Describe a time you had to learn a new technology quickly.
  6. Tell me about a time you improved a process or system.
  7. How do you handle code reviews-giving and receiving feedback?
  8. Describe a situation where you had to work with a difficult teammate.

How to Practice Effectively

Solving problems is only half the battle. You need to practice explaining your thinking out loud.

  • Time yourself: Medium problems in 25-30 min, Hard in 40-45 min
  • Explain out loud: Talk through your approach even when practicing alone
  • Review solutions: Even if you solve it, study optimal approaches
  • Learn patterns: Most problems are variations of common patterns
  • Do mock interviews: Practice with real interview pressure

LeetCode builds problem-solving skills, but it doesn't help with the communication part-explaining your approach while you code. That's where mock interviews make the difference. MORT's technical interview practice simulates the real experience, including follow-up questions based on your approach.

Company-Specific Tips

  • Google: Heavy on algorithms. Expect 2-3 coding rounds. They value optimal solutions.
  • Meta: Fast-paced coding rounds (2 problems in 45 min). Strong system design focus.
  • Amazon: Leadership principles in every round. Prepare stories for each one.
  • Apple: Domain-specific questions based on the team. More collaborative coding.
  • Microsoft: Mix of coding and design. More conversational style.
  • Startups: Often include take-home assignments. Focus on practical skills.

Practice technical interviews with AI

MORT's Interview Practice simulates coding interviews with real-time feedback on your problem-solving approach and communication. Practice explaining your thinking-not just writing code.