Intermediate Interview Preparation Guide (2-4 Years)

Updated · techinterview.org

Intermediate Interview Preparation Guide

For candidates with 2-4 years of software engineering experience

Overview

As an intermediate engineer, you’re expected to tackle more complex algorithmic problems and demonstrate deeper understanding of system design fundamentals. This 6-8 week intensive guide prepares you for interviews at top tech companies including FAANG.

Prerequisites

  • Comfortable with all basic data structures and algorithms
  • Can solve 80%+ of LeetCode Easy problems
  • Understanding of Big O notation
  • Experience with at least one major programming language
  • Professional software development experience

Timeline: 6-8 Weeks

Week 1: Advanced Arrays and Strings

Focus: Complex Patterns and Optimization

Topics:

  • Sliding window variations — Know both the fixed-size window and the variable-size window that shrinks from the left when a constraint breaks. Interviewers usually push you from a brute-force O(n²) scan to a single O(n) pass.
  • Two pointers advanced techniques — Practice opposite-end pointers on sorted arrays and same-direction pointers for in-place work. The common trap is off-by-one errors when you skip past duplicates.
  • String matching algorithms (KMP, Rabin-Karp) — Understand how KMP’s prefix table avoids re-scanning and how Rabin-Karp uses a rolling hash. You rarely code these from scratch, but explaining why they beat naive O(n·m) matching does come up.
  • Subarray problems — Prefix sums plus a hash map turn “count subarrays that sum to k” from O(n²) into O(n). Watch for negative numbers, which break the sliding-window assumption.

Target Problems (15-20):

  • Longest Substring Without Repeating Characters (Medium) — The canonical variable window: expand the right edge, and jump the left pointer past the last seen index of a repeat.
  • Minimum Window Substring (Hard) — Track character counts with a map and a have/need counter so you know exactly when the window is valid before shrinking it.
  • Longest Palindromic Substring (Medium) — Expand around each center for O(n²); mention Manacher’s O(n) algorithm if asked to optimize.
  • Find All Anagrams in String (Medium) — A fixed-size window plus a frequency count that you slide one character at a time.
  • Sliding Window Maximum (Hard) — A monotonic decreasing deque holds the candidate maxima and gives O(n) overall.

Week 2: Dynamic Programming Fundamentals

Focus: 1D and 2D DP

Topics:

  • Memoization vs tabulation — Memoization is top-down recursion with a cache; tabulation builds a table bottom-up. Be ready to convert one to the other and to explain the space savings when you only need the last row or two.
  • State definition and transitions — Most DP interviews are won or lost here: name what dp[i] means in one sentence, then write the recurrence. If you can’t define the state cleanly, the code won’t come.
  • 1D DP (House Robber, Climbing Stairs) — These reduce to dp[i] depending on dp[i-1] and dp[i-2], so you can drop the array down to two variables.
  • 2D DP (Unique Paths, Edit Distance) — Grid problems where dp[i][j] depends on the cells above and to the left; fill the table by hand before you code it.

Target Problems (10-15):

  • Longest Increasing Subsequence (Medium) — The O(n²) DP is the baseline; the O(n log n) version with binary search is the follow-up interviewers ask for.
  • Coin Change (Medium) — An unbounded-knapsack shape where dp[amount] is the minimum coins; returning -1 for an unreachable amount is the edge case people miss.
  • Word Break (Medium) — dp[i] is true if some split point j has dp[j] true and s[j:i] in the dictionary; a set lookup keeps it fast.
  • Longest Common Subsequence (Medium) — The 2D template that Edit Distance and many string DPs build on: match characters to go diagonal, otherwise take the best of up or left.
  • Edit Distance (Medium) — Three transitions (insert, delete, replace); walking through “horse” → “ros” on the whiteboard shows you understand it.

Week 3: Advanced Tree and Graph Algorithms

Focus: Complex Traversals and Path Finding

Topics:

  • Binary tree serialization/deserialization — Pick one traversal (preorder with null markers is simplest) and use it for both directions. Be explicit about how you encode nulls and delimit values.
  • Lowest Common Ancestor — For a BST, use the ordering to walk down; for a general binary tree, recurse and return the node where the two targets split.
  • Graph traversals (DFS, BFS) — Know when BFS gives shortest paths on an unweighted graph and how to track visited nodes to avoid cycles. Be able to write both iteratively and recursively.
  • Topological sort — Use Kahn’s algorithm (BFS on in-degrees) or DFS post-order; both detect cycles, which is usually the hidden requirement.
  • Union-Find (Disjoint Set) — Path compression plus union by rank gives near-constant operations. It’s the fast answer for connectivity and cycle detection in undirected graphs.

Target Problems (15-20):

  • Binary Tree Maximum Path Sum (Hard) — Each node returns the best single-branch gain upward while updating a global max that may split through the node.
  • Serialize and Deserialize Binary Tree (Hard) — Preorder with explicit null markers, rebuilt with an index or queue on the way back.
  • Course Schedule (Medium) — A topological-sort and cycle-detection problem in disguise; “can you finish” means “is the graph acyclic”.
  • Number of Islands (Medium) — Flood fill with DFS or BFS while marking visited cells; the follow-up is often counting with union-find.
  • Clone Graph (Medium) — A hash map from original node to copy prevents infinite loops while you DFS or BFS the graph.

Week 4: Advanced Dynamic Programming

Focus: Knapsack, Subsequences, and Optimization

Topics:

  • 0/1 Knapsack and variations — Each item is take-or-skip, with dp over items and capacity. Recognizing a problem as knapsack in disguise (subset sum, partition) is the real skill.
  • Unbounded Knapsack — Item reuse is allowed, so you iterate capacity forward; Coin Change is the classic instance.
  • DP on strings — Palindromes, subsequences, and matching all share a 2D dp[i][j] over two indices or two strings; get comfortable choosing the axes.
  • DP with bitmasks — Use an integer as a set when n is roughly 20 or fewer, as in traveling-salesman-style problems, where dp[mask][i] tracks the visited set and current position.

Target Problems (10-15):

  • Partition Equal Subset Sum (Medium) — Reduces to subset-sum for half the total; if the total is odd, answer no immediately.
  • Target Sum (Medium) — Assigning + and – signs becomes a subset-sum count once you rearrange the equation.
  • Palindrome Partitioning II (Hard) — Precompute an is-palindrome table, then run a 1D DP for the minimum cuts.
  • Burst Balloons (Hard) — Interval DP: think about the last balloon to burst in each range, not the first.
  • Regular Expression Matching (Hard) — 2D DP where “*” either drops the preceding element or consumes one more character; the star transitions trip most people up.

Week 5: Heaps, Tries, and Advanced Data Structures

Focus: Specialized Structures

Topics:

  • Min/Max Heap operations — Push and pop are O(log n) and building a heap is O(n). Most languages hand you a priority queue, so practice inverting the comparator to get a max-heap.
  • Trie implementation — A tree of children maps with an end-of-word flag; it turns prefix search and autocomplete into O(word length).
  • LRU Cache design — A hash map plus a doubly linked list gives O(1) get and put; be ready to explain why a plain array or a single map isn’t enough.
  • Design problems — These test data-structure composition and clean APIs more than raw algorithms. Talk through each operation and its target complexity before you write code.

Target Problems (10-15):

  • Implement Trie (Medium) — Insert, search, and startsWith over a children map, the base you extend for word-search and autocomplete follow-ups.
  • LRU Cache (Medium) — The map-plus-linked-list pattern; the follow-up is often LFU, which adds frequency buckets.
  • Top K Frequent Elements (Medium) — A count map then a heap of size k, or bucket sort by frequency for O(n).
  • Find Median from Data Stream (Hard) — Two heaps, a max-heap for the lower half and a min-heap for the upper half, kept balanced so the median sits at the tops.
  • Design Twitter (Medium) — Merge each followed user’s recent tweets with a heap; it’s the news-feed fan-out problem in miniature.

Week 6: System Design Fundamentals

Focus: Scalability and Architecture

Topics:

  • Load balancing — Know round-robin, least-connections, and consistent hashing, and where each fits. Interviewers ask how you keep a single load balancer from becoming the bottleneck.
  • Caching strategies — Compare cache-aside, write-through, and write-back, and explain eviction (LRU) and TTLs. Be ready to discuss cache invalidation and stampede protection.
  • Database sharding — Split data by a shard key (hash or range) to scale writes; the hard parts are hot keys, cross-shard joins, and resharding.
  • CAP theorem — Under a network partition you choose consistency or availability. Name real systems on each side and tie the choice back to the product’s needs.
  • Microservices basics — Understand service boundaries, inter-service communication, and the operational cost they add. Interviewers probe for when a monolith is the better call.

Practice Designs:

  • URL Shortener (bit.ly) — Focus on the encoding for short codes, collision handling, and read-heavy caching. Capacity estimates for the keyspace size come up often.
  • Rate Limiter — Compare token bucket, leaky bucket, and sliding-window counters, and decide where the counters live in a distributed setup.
  • Key-Value Store — Talk through partitioning, replication, and consistency; this is where consistent hashing and quorum reads and writes show up.
  • Notification System — Design fan-out to email, SMS, and push with queues, retries, and de-duplication. Delivery guarantees and user preferences are the depth points.

Weeks 7-8: Mock Interviews and Polish

Focus: Interview Performance

Activities:

  • 10-15 mock coding interviews — Do these live with a person or a timer, and treat thinking out loud as part of the practice, not an afterthought.
  • 3-5 system design mock interviews — Record yourself or get feedback on structure; most people lose points on time management, not on knowledge.
  • Behavioral interview practice — Rehearse your stories until the structure is automatic, then work on trimming each one to about two minutes.
  • Review all patterns and problem types — Re-solve one problem per pattern from memory to confirm you can recall the approach, not just recognize it.

Study Resources

Books:

  • Cracking the Coding Interview (all chapters)
  • System Design Interview by Alex Xu (Volume 1)
  • Designing Data-Intensive Applications by Martin Kleppmann

Online Platforms:

  • LeetCode: Focus on Medium problems, aim for 150-200 total
  • AlgoExpert: Comprehensive video explanations
  • Educative: Grokking the Coding Interview, Grokking System Design

Interview Expectations by Company

Google (L3/L4):

  • 2-3 coding rounds (45-60 min each)
  • Focus: Algorithms, data structures, complexity analysis
  • Expect medium-hard problems
  • 1 round may include system design discussion

Amazon (SDE2):

  • 2-3 coding rounds
  • 1-2 rounds focused on Leadership Principles
  • Expect medium problems with edge cases
  • System design for senior positions

Facebook/Meta (E4):

  • 2 coding rounds (medium-hard)
  • 1 system design round
  • 1 behavioral round (culture fit)
  • Focus on problem-solving speed

Microsoft (60/61):

  • 2-3 coding rounds
  • Mix of easy-medium and medium-hard
  • Strong emphasis on testing and edge cases
  • System design discussion

Problem-Solving Patterns to Master

  1. Sliding Window: Substring, subarray problems
  2. Two Pointers: Pair problems, palindromes
  3. Fast & Slow Pointers: Cycle detection
  4. Merge Intervals: Scheduling, overlaps
  5. Cyclic Sort: Missing numbers in range
  6. In-place Reversal of Linked List: List manipulation
  7. BFS/DFS: Tree and graph traversal
  8. Top K Elements: Heaps
  9. Binary Search: Sorted arrays, search space
  10. Backtracking: Permutations, combinations
  11. Dynamic Programming: Optimization problems

System Design Preparation

Core Concepts to Master:

  • Horizontal vs vertical scaling — Adding more machines versus buying a bigger one; know the ceiling on vertical scaling and why stateless services scale out more easily.
  • Load balancers (L4 vs L7) — L4 routes on IP and port, L7 on HTTP content; L7 lets you route by path or header at some extra processing cost.
  • Caching (Redis, Memcached) — Redis adds data structures and optional persistence; Memcached is a simpler in-memory cache. Be ready to place caches at the client, CDN, or service layer.
  • Databases (SQL vs NoSQL, indexing, sharding) — Justify the choice by access pattern and consistency needs, not preference, and know how an index speeds reads while slowing writes.
  • Message queues (Kafka, RabbitMQ) — Kafka is a durable, replayable log for streaming; RabbitMQ is a broker for task queues. Both decouple producers from consumers and absorb traffic spikes.
  • CDNs and edge caching — Serve static assets close to users to cut latency; know cache-control headers and how invalidation works.
  • Microservices architecture — Independent deploys and clear boundaries at the cost of distributed-systems complexity; mention observability and data consistency across services.

Design Interview Template:

  1. Requirements (5 min): Clarify functional and non-functional requirements
  2. Estimation (3 min): Users, QPS, storage needs
  3. High-Level Design (10 min): Draw main components
  4. Deep Dive (20 min): Focus on 2-3 components in detail
  5. Bottlenecks (5 min): Identify and resolve

Behavioral Interview Prep

Prepare 8-10 stories using STAR method:

  • Situation: Context and background
  • Task: What needed to be done
  • Action: What you specifically did
  • Result: Outcome and learnings

Cover these themes:

  • Leadership and influence — Show impact without formal authority: a time you drove a decision or brought a team along. Ownership is what senior bars look for here.
  • Conflict resolution — Pick a disagreement with a peer or manager and focus on how you reached alignment, not on who was right.
  • Technical challenges overcome — Choose a problem with real ambiguity and walk through your reasoning and tradeoffs, not just the final fix.
  • Failed project and learnings — Own a genuine failure and be specific about what you changed afterward; a sanitized “I just work too hard” answer falls flat.
  • Innovation and creativity — Have an example where you challenged the default approach and it paid off, with a measurable result if you can attach one.

Success Metrics

You’re ready when:

  • ✓ Can solve 60%+ of LeetCode Medium problems
  • ✓ Comfortable with 20%+ of Hard problems
  • ✓ Can design 3-4 common systems from scratch
  • ✓ Pass 70%+ of mock interviews
  • ✓ Can explain tradeoffs clearly

Target Statistics:

  • 150-200 LeetCode problems solved
  • 5-10 system designs practiced
  • 10+ mock interviews completed

Final Tips

  • Focus on understanding patterns, not memorizing solutions
  • Practice explaining your thought process out loud
  • Time yourself consistently (45 min for coding, 45 min for system design)
  • Don’t ignore behavioral prep—it matters at senior levels
  • Apply broadly—interviewing is a skill that improves with practice

Remember: At this level, companies assess not just your coding ability, but also your communication, system design thinking, and cultural fit. Prepare holistically for the best results.

newsletter

What's actually being asked right now

Interview patterns & comp trends, straight to your inbox.

No spam. Unsubscribe anytime.

1972 Soviet postage stamp commemorating the Mars 2 probe

worth a read

Mars For The Rest of Us — a weekly-or-more deep dive on the technical side of Mars exploration: rocket propulsion, microbiology, mission architecture, and everything in between. Written by Maciej Ceglowski.

Read it on Substack
Scroll to Top