Skip to main content

Coding interview prep

The 12 coding interview patterns

Most coding interview questions are variations on a small set of patterns. Learn to recognise the pattern and the solution writes itself. Each page below covers when to reach for the pattern, its time and space complexity, a worked walkthrough, a translatable skeleton, a curated problem set, and the mistakes that cost candidates the offer.

Why patterns beat grinding

Recognise, do not memorise

Solving five hundred random problems teaches you five hundred problems. Learning the dozen patterns underneath them teaches you to solve problems you have never seen, which is exactly what the interview tests. When you read a new question, scan for the tells: a contiguous-subarray ask points to sliding window, a sorted array points to two pointers or binary search, an all-configurations ask points to backtracking. Naming the pattern out loud is also a strong interview signal in its own right.

Practise these patterns on AlgoExpert
Recommended
200+ video-explained coding interview questions organised by the patterns covered on this page, with timed practice and solution walkthroughs.
Start practising

An external resource we recommend. AlgoExpert is not affiliated with us and we earn nothing from this link.

Take it into the interview

Pair the patterns with the coding and system-design questions for your role, rehearse the behavioral round with worked STAR answers, and when the offer comes, check it against the salary comparison tool.