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.
| Type | What It Tests | Time |
|---|---|---|
| Coding | Problem-solving, data structures, algorithms | 45-60 min |
| System Design | Architecture, scalability, trade-offs | 45-60 min |
| Behavioral | Teamwork, communication, culture fit | 30-45 min |
| Technical Deep Dive | Past experience, technical decisions | 30-45 min |
Coding Questions: Arrays & Strings
The most common category. Master these patterns and you'll handle most interview problems.
- Two Sum: Find two numbers that add up to a target. (Hash map approach)
- Best Time to Buy and Sell Stock: Find max profit from one transaction.
- Contains Duplicate: Check if array has any duplicates.
- Product of Array Except Self: Calculate products without division.
- Maximum Subarray: Find contiguous subarray with largest sum. (Kadane's algorithm)
- 3Sum: Find all unique triplets that sum to zero.
- Container With Most Water: Find two lines that hold the most water.
- Longest Substring Without Repeating Characters: Sliding window classic.
- Valid Anagram: Check if two strings are anagrams.
- 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
- Maximum Depth of Binary Tree: Find the height of a tree.
- Invert Binary Tree: Swap left and right children recursively.
- Same Tree: Check if two trees are identical.
- Binary Tree Level Order Traversal: BFS to get nodes level by level.
- Validate Binary Search Tree: Check BST property holds.
- Lowest Common Ancestor: Find LCA of two nodes.
- Serialize and Deserialize Binary Tree: Convert tree to string and back.
Graphs
- Number of Islands: Count connected components in a grid.
- Clone Graph: Deep copy a graph with cycles.
- Course Schedule: Detect cycle in directed graph (topological sort).
- Pacific Atlantic Water Flow: Multi-source BFS/DFS.
- Word Ladder: BFS to find shortest transformation sequence.
- 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.
- Climbing Stairs: Classic Fibonacci-style DP.
- House Robber: Max sum of non-adjacent elements.
- Coin Change: Minimum coins to make a target amount.
- Longest Increasing Subsequence: O(n²) DP or O(n log n) with binary search.
- Longest Common Subsequence: 2D DP classic.
- Word Break: Check if string can be segmented into dictionary words.
- Unique Paths: Count paths in a grid (combinatorics or DP).
- Edit Distance: Minimum operations to convert one string to another.
- 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
- Reverse Linked List: Iterative and recursive approaches.
- Merge Two Sorted Lists: Combine into one sorted list.
- Linked List Cycle: Detect cycle using Floyd's algorithm.
- Remove Nth Node From End: Two-pointer technique.
- Merge K Sorted Lists: Heap or divide-and-conquer.
Stacks & Queues
- Valid Parentheses: Match brackets using a stack.
- Min Stack: Stack with O(1) getMin operation.
- Daily Temperatures: Monotonic stack classic.
- Implement Queue using Stacks: Amortized O(1) operations.
Binary Search
- Search in Rotated Sorted Array: Modified binary search.
- Find Minimum in Rotated Sorted Array: Binary search variation.
- Search a 2D Matrix: Treat matrix as sorted array.
- Median of Two Sorted Arrays: Hard binary search problem.
Heap / Priority Queue
- Kth Largest Element: Quick select or min-heap.
- Top K Frequent Elements: Heap or bucket sort.
- 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.
- Design a URL Shortener (like bit.ly)
- Design Twitter/X Feed
- Design a Chat System (like WhatsApp)
- Design a Video Streaming Service (like YouTube)
- Design a Ride-Sharing Service (like Uber)
- Design a Web Crawler
- Design a Rate Limiter
- 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.
- Tell me about a challenging bug you solved.
- Describe a time you disagreed with a technical decision.
- Tell me about a project you're proud of.
- How do you handle tight deadlines?
- Describe a time you had to learn a new technology quickly.
- Tell me about a time you improved a process or system.
- How do you handle code reviews-giving and receiving feedback?
- 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.