Back to blog
Interview Prep8 min read

The LeetCode Patterns You Need for UK Tech Interviews (2026)

UK tech companies are testing specific algorithm patterns - not random LeetCode grinding. Here are the patterns that come up most often at UK graduate interviews.

Why Pattern Recognition Beats Random LeetCode Grinding

Most graduates prepare for coding interviews by grinding through hundreds of LeetCode problems in no particular order. This approach is inefficient and often ineffective. UK tech interviewers - from Arm to Amazon UK to Barclays Technology - tend to test a small set of recurring patterns repeatedly.

Master these patterns, and you'll be able to solve problems you've never seen before, because you'll recognise the underlying structure.

Pattern 1: Sliding Window

When it appears: Any problem involving a subarray or substring, max/min in a contiguous sequence, or "find the longest/shortest subsequence that satisfies X."

Core idea: Maintain a window of elements and expand or contract it based on a condition, rather than re-computing from scratch each iteration.

Classic problems: Longest Substring Without Repeating Characters (LC 3), Maximum Sum Subarray of Size K, Minimum Window Substring (LC 76).

UK companies known to test this: Arm, Wise, Deliveroo, and most investment bank technology teams.

Pattern 2: Two Pointers

When it appears: Sorted arrays, pair-sum problems, palindrome checks, or anything where you need to compare elements from both ends.

Core idea: Use two indices starting at different positions (often the two ends of an array) and move them toward each other conditionally.

Classic problems: Two Sum II (LC 167), 3Sum (LC 15), Container With Most Water (LC 11).

Why UK interviewers love it: It elegantly reduces O(n²) brute force to O(n), which demonstrates algorithmic thinking - a core signal for UK graduate roles.

Pattern 3: BFS / Level-Order Traversal

When it appears: Any shortest path problem, tree level-order questions, or graph connectivity problems.

Core idea: Use a queue. Process nodes level by level. BFS guarantees the shortest path in unweighted graphs.

Classic problems: Binary Tree Level Order Traversal (LC 102), Number of Islands (LC 200), Word Ladder (LC 127).

UK context: Systems design roles at companies like GCHQ, BT, and network infrastructure teams often have graph problems in the first technical screen.

Pattern 4: DFS / Backtracking

When it appears: Permutations, combinations, tree path problems, maze solving, constraint satisfaction.

Core idea: Explore every possibility recursively. "Try → recurse → undo" is the backtracking template.

Classic problems: Subsets (LC 78), Combination Sum (LC 39), N-Queens (LC 51).

Important: UK interviewers frequently ask you to explain the time complexity of backtracking solutions. Practice articulating this clearly.

Pattern 5: Dynamic Programming (Bottom-Up)

When it appears: Optimisation problems - minimum cost, maximum profit, number of ways to reach a target.

Core idea: Break the problem into overlapping subproblems. Store results in a table (memoisation = top-down, tabulation = bottom-up).

Essential problems to know: Climbing Stairs (LC 70), Coin Change (LC 322), Longest Common Subsequence (LC 1143), 0/1 Knapsack.

Pro tip: In UK graduate interviews, you'll often be given a simpler DP problem but asked to optimise your space complexity after getting the initial solution. Prepare for that follow-up.

Pattern 6: Binary Search (Beyond the Basics)

When it appears: Not just sorted arrays - also "find the minimum/maximum value satisfying a condition" problems.

Core idea: The key insight is recognising when a search space is monotonic (answers are either all valid or all invalid as you move in one direction).

Classic problems: Search in Rotated Sorted Array (LC 33), Find Minimum in Rotated Sorted Array (LC 153), Koko Eating Bananas (LC 875).

Pattern 7: Hashmaps for Frequency and Lookup

When it appears: Almost everywhere. Frequency counting, finding duplicates, caching subresults, implementing LRU Cache.

Core idea: Trade memory for time. If you're O(n²) without a hashmap, you're probably O(n) with one.

Essential problems: Two Sum (LC 1), Group Anagrams (LC 49), LRU Cache (LC 146).

How to Structure Your Prep

Rather than tackling these patterns in isolation, use a company-specific approach. Before interviewing at a company, find out which patterns they test most. GradSignal's interview playbooks give you exactly that - the actual LeetCode patterns each UK tech company tests, based on real candidate experience.

A solid 4-week schedule looks like this:

  • Week 1: Sliding window, Two pointers, Hashmaps (20 problems)
  • Week 2: BFS, DFS, Backtracking (15 problems)
  • Week 3: DP, Binary search, Trees (15 problems)
  • Week 4: Mock interviews, company-specific prep, system design basics

Quality beats quantity. Deeply understand 50 problems rather than loosely recognising 200.

Find your next graduate tech role

GradSignal lists UK graduate tech jobs alongside company-specific interview playbooks - so you can apply and prepare in one place.