- TL;DR: If you don’t know how to start learning data structures and algorithms
- Overview
- Data Structure & Algorithms Roadmap
- Questions: Corner Cases and Constraints
- Resources for learning data structures
- Resources for practicing
- Problem solving approach
- General Tips
- Must Watch and Must Read Resources
- Extra resources to Watch and to Read
- If you found the content interesting, I would appreciate your support 👍
TL;DR: If you don’t know how to start learning data structures and algorithms
Start from here — https://neetcode.io/practice?tab=neetcode250. Watch course videos.
Or start with AlgoExpert and watch courses, try solving the problems yourself, and watch video solutions.
The secret isn't in finding a 'great' resource or a 'great' textbook — it’s about actually starting somewhere and igniting a spark of interest within yourself.
If you solve 1–2 problems every day, you’ll finish it in 5 months. You need to spend 1–2 hours every day solving problems. You’ll finish, get hired by companies like Google, Meta, Amazon, Yandex, etc., make a lot of money, and gain valuable experience on large-scale projects.
Just be ready when you get your chance and don't miss it.
Overview
This article will guide you through my steps for preparing for my Google interviews.
Overall, it took me 1.5 years to crack my Google interview, including learning algorithms and data structures, practicing coding & problem-solving, and applying and passing all interviews. During this period I had interviews at Meta, and a successful interview at Bloomberg.
Data Structure & Algorithms Roadmap
Choose Python, JavaScript or Java as a language to solve algo problems. I suggest to go with Python.
🔁 Then repeat: learn data structure and algorithms, solve algorithms and learn patterns & concepts. You can do all in AlgoExpert or Neetcode in 2026.
Practice coding & problem-solving questions together with friends on a whiteboard, paper. This is how i was learning:
Roadmap:
- Big O complexity analysis = how quickly the runtime or memory grows relative to the input as the input gets arbitrarily large.
- Array
- Learn the details of implementation in your programming language. For example, for C++ you need to know the implementation using pointers, and vectors. For vectors, you also need to know, for example, that it periodically does resize, and other similar details.
- Most common patterns:
- Sliding window algorithm
- Two pointers = more general version of sliding window where the pointers can cross each other and can be on different arrays. Examples: Sort Colors, Palindromic Substrings
- Fast and slow pointers
- Sorting
- Index as a hash key = If you are given a sequence and the interviewer asks for O(1) space, it might be possible to use the array itself as a hash table. For example, if the array only has values from 1 to N, where N is the length of the array, negate the value at that index (minus one) to indicate presence of that number. Examples: First Missing Positive, Daily Temperatures
- String
- ASCII, Unicode
- How are strings implemented in your programming language (for example, is there a maximum length)?
- RegEx
- Most common patterns:
- Siding window (for problems like “longest substring without repeating chars”)
- Two pointers
- Count frequency with hash map or array
- Rabin-Karp algorithm
- Matrix
- Hash set
- Array that contains always unique items, elements must be hashable and immutable
- Search=O(1), insert=O(1), remove=O(1)
- Hash map
- Key and value
- Search=O(1), insert=O(1), remove=O(1)
- Stack
- Queue
- Sorting algorithms
- https://github.com/Rustam-Z/cracking-maang/tree/main/sorting#sorting
- Especially make sure you know heap sort, merge sort and quick sort.
- Searching algorithms
- Binary search O(log n)
- Linked list
- https://github.com/Rustam-Z/cracking-maang/blob/main/linked_list/README.md#linked-list
- https://www.techinterviewhandbook.org/algorithms/linked-list/
- Singly linked list
- Doubly linked list
- Patterns:
- Fast and slow pointer
- Pointers with next
- Searching in linked lists
- In-place reversal
- Tree
- https://github.com/Rustam-Z/cracking-maang/tree/main/trees#trees
- DFS (must learn)
- BFS (must know)
- Preorder (must know)
- Postorder
- Inorder
- Recursive and iterative problem solving
- Adding and removing elements
- Less common tree types (e.g., red black trees, B-trees) — what are they, how they differ from the binary trees, basic complexities, and how they are used. No need to know all the rotations in the RB-tree, for example.
- Tries
- Heap
- https://github.com/Rustam-Z/cracking-maang/blob/main/heap/README.md#heap
- Top=O(1), insert=O(log n), remove=O(log n), heapify=O(n)
- Heap sort
- Allocating elements on a heap vs on a stack - what does it mean?
- Patterns:
- Using heaps for tracking top-K
- Graph
- https://github.com/Rustam-Z/cracking-maang/tree/main/graphs#graphs
- DFS, BFS
- Topological search
- Shortest path
- Hash
- Hash functions
- Universal hash
- Dynamic programming
- https://github.com/Rustam-Z/cracking-maang/blob/main/dynamic_programming/README.md#dynamic-programming
- Problems, which are problems where the solution is composed of solutions to the same problem with smaller inputs.
- Recursion
- Memoization
- Backtracking = Backtracking is an algorithmic technique for solving problems recursively by trying to build a solution incrementally, one piece at a time. https://github.com/Rustam-Z/cracking-maang/blob/main/backtracking/README.md#backtracking--brute-force-approach
- Button up
- Top down
- Algorithmic paradigms
- Greedy Algorithms https://github.com/Rustam-Z/cracking-maang/blob/main/greedy/README.md#greedy-algorithms
- Divide and Conquer
When you are given two arrays to process, it is common to have one index per array (pointer) to traverse/compare the both of them, incrementing one of the pointers when relevant. For example, we use this approach to merge two sorted arrays. Examples: Merge Sorted Array
Questions: Corner Cases and Constraints
- Ask about edge cases (propose edge case). Explain and clarify, DS tradeoff, time and space complexity.
- Questions
- How am I receiving this data?
- How should I output the result?
- What if wrong input is provided?
- Is size, speed, using not build-in library a concern?
- How I would be testing? Tests: Zero, one, two, two to max-1, max, max+1
- Questions to ask
- OOP
- how many call will we get for each?
- Do we need caching if similar calls or similar work needs to be done?
- what if the data object is empty before calling the remove/pop/top methods?
- Number (int, float)
- what if we have floats?
- zero?
- Can we have negative/positive numbers?
- what is the range on integer? max and min integer?
- dividing by zero?
- do we have leading 0s?
- Can we use bit manipulation? XOR?
- Strings
- ASCII, Unicode UTF-8 (special chars)? Character encoding standards.
ProTip™, 👻, 60%, https://google.com - Only lower-case English characters, or? How to handle them?
- what if the string is empty, “ “, NULL, length is 1?
- spaces in string in the beginning or in the end?
- max and min length of string?
- sorted? can we sort it?
- DS: Can we use stack, queue, heap? If duplicates maybe use stack?
- Array
- Mutable or immutable array?
- Should it be in place? Or we need to return new one?
- Items in array are all unique?
- Do we have repeated items in array? OR can I use the same element twice?
- Does array contain NULLs?
- How to handle an empty array?
- What would I do if the array is super large.
- Can we sort the array?
- Do we need to preserve ORDER?
- Sorting algorithm
- empty input, null input
- 1 element, very long input
- duplicate elements (sort on a second condition?)
- odd/even length input
- Collection with all elements equal?
- Garbage inside the collection?
- Stack/queue
- removing elements from empty stack/queue
- Linked list
- Single linked list or doubly linked list?
- Is it a circular linked list?
- How many nodes does the linked list contain?
- Null values for head/root
- Can it be empty?
- Values are sorted? Are there any duplicate numbers?
- Can I convert it to array?
- Tree
- Is it a Binary Tree? (Each node has at most two children.)
- Is it a Binary Search Tree (BST)? (Left child is less than the parent, and right child is greater.)
- If BST do we have duplicates? And in which side?
- Height of the tree? (Longest path from a leaf node to root.)
- Depth of a specific node? (Length of the path from the root to that node.)
- Is it a Balanced Tree? (Height of left and right subtrees differ by at most 1. Ensuring
O(logn)for insert and find) - Is it a Complete Binary Tree? (All levels are filled, except possibly the last one, and nodes are left-justified.)
- Is it a Full Binary Tree? (Each node has either 0 or 2 children.)
- Is it a Perfect Binary Tree? (All internal nodes have two children, and all leaves are at the same level.)
- Is it a Binary Heap? (Specifically for Binary Trees that follow the heap property.)
- Is it a Symmetric Tree (or Mirror Tree)? (The left subtree of one node is a mirror image of the right subtree of the other node.)
- Graph
- Directed (one-way street) or undirected (two-way)?
- Connected graph(undirected graph, there is always a path to the node) or not-connected?
- Strongly connected graph (directed graph, when there is always a route)
- Cyclic or Acyclic? (Does the graph contain any cycles, or is it a directed acyclic graph (DAG)?)
- Weighted or Unweighted? (Are there numerical values assigned to the edges?)
- Tree or Forest? (Is the graph a connected acyclic graph, or is it a collection of disconnected trees?)
- Complete or Incomplete? (Does every pair of distinct vertices have an edge between them?) From any node (vertex) you can do to any node.
- Should I use DFS or BFS?
- Dijkstra?
- Loops
- while loops running forever (properly incre./decre. pointers)
- Recursion
- recursion 1.000 call stack size is input it too big?
- Extra: Taking the Edge Off of Edge Cases
How long/big our input could be?
Empty inputs, null values, 0 length, 1 element input, super long input.
1. Edge = link between any two nodes.
2. Height of node = number of edges from the deepest leaf to node.
3. Depth of a node = number of edges from the root to the node.
4. Height of a tree = height of the root node.Resources for learning data structures
How to learn data structures? I had a Data Structures class at university. Here are the notes from the class. And here other resources to watch and learn.
- AlgoExpert Data Structures course — https://www.algoexpert.io/content#algoexpert OR
- NeetCode course
- https://neetcode.io/roadmap (start with 150, move to 250)
- https://neetcode.io/courses/dsa-for-beginners
- https://neetcode.io/courses/advanced-algorithms
- Tech Interview Handbook Algorithms Cheat Sheet
- Programiz.com/dsa
data-structures-and-algorithms
Extra:
- Jenny's DSA playlist — free YouTube playlist
- Data Structures by a Google Software Engineer
- The Last Algorithms Course You'll Need
Resources for practicing
- Interviewbit.com
- Neetcode.io & NeetCode playlist
- Start with 250 if you have 0 knowledge in DS & A, otherwise start with TOP 150.
- AlgoExpert video solutions
- LeetCode Explore (only data structures cards)
- LeetCode Study Plan — Data Structure 1, Algorithm 1, Programming Skills 1
- "Cracking the Coding Interview" + CTCI problems in LeetCode
- LeetCode Study Plan — Data Structure 2, Algorithm 2, Programming Skills 2
- LeetCode company-tagged questions, check LeetCode discussions, check Team Blind, check Glassdoor for recently asked questions.
Problem solving approach
- Read the problem. Don’t immediately jump into coding!
- Understand inputs and outputs. Draw some examples on paper.
- Clarify requirements, ask questions (I am providing the list of questions below), and find constraints (edge cases). Example questions: Is it ASCII or Unicode? What is the max value? Is there a difference between capital letters and small letters?
- Think about the solution in your mind. Divide problems into sub-problems. Come up with different ideas (ask whys, think about trade-offs, solve simpler versions, imagine helper functions - go from high level to low level).
- Evaluate the complexity and trade-offs.
- Think of a better alternative solution.
- Write code on paper.
- Debug your code on paper and test with new corner case inputs.
- Write code. Write clean code.
- Write tests. Positive, negative, with edge-cases.
More to read:
General Tips
Interviews are not only about evaluating your technical knowledge. Explain your thought process and show how you approach problem-solving in a structured way step by step.
Many questions asked by interviewers are open-ended, so ask good questions to clarify a full set of criteria to solve the problem and clarify requirements.
Always, always, always ask clarifying questions before jumping to a solution.
Try thinking of different solutions to a given problem and explain why you came up with this solution or this code. Compare your solutions, compare complexities, and think about their trade-offs.
Overall, the interview should be like a dialogue — show how it is to work with you, how collaborative you are.
Must Watch and Must Read Resources
- Interview Cake Coding Interview Tips
- Prepare for Your Google Interview: Coding
- Interview tips from Google Software Engineers
- Coding Mock Interview
Extra resources to Watch and to Read
- Tech Interview Process
- Preparing for a Technical Interview
- Prepare for your Google Interview: General Cognitive Ability
- Prepare for your Google Interview: Leadership
- "100ta Intervyu Nima O'rgatdi?" by Azimjon