1. Arrays & Strings:
Concepts: Array operations (traversal, searching, sorting), string manipulation (reversal, palindrome checking).
Question:
Find the missing number in a sorted array. (https://leetcode.com/problems/missing-number/)
Reverse a given string in-place. (https://leetcode.com/problems/reverse-words-in-a-string/)
2. Linked Lists:
Concepts: Singly and doubly linked lists, operations (insertion, deletion, traversal).
Question:
Reverse a singly linked list. (https://leetcode.com/problems/reverse-linked-list/)
Merge two sorted linked lists into a single sorted list. (https://leetcode.com/problems/merge-two-sorted-lists/)
3. Stacks & Queues:
Concepts: LIFO (Last-In-First-Out) and FIFO (First-In-First-Out) principles, stack and queue operations.
Question:
Implement a stack using a queue.
Check if a given expression has balanced parentheses. (https://leetcode.com/problems/valid-parentheses/)
4. Hashing:
Concepts: Hash tables, collision resolution techniques.
Question:
Find the two numbers that add up to a given target sum in an array. (https://leetcode.com/problems/two-sum/)
Check if a given string is a palindrome (can be solved using hashing).
5. Trees:
Concepts: Binary Search Trees (BSTs), operations (insertion, deletion, searching), tree traversals (in-order, pre-order, post-order).
Question:
Implement an in-order traversal on a BST. (This might be a custom problem you're asked to code during the interview)
Find the lowest common ancestor of two nodes in a BST. (https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/)
6. Heaps:
Concepts: Min and Max heaps, heap operations (insertion, deletion).
Question:
Implement a priority queue using a min-heap.
Find the kth largest element in an array. (https://leetcode.com/problems/kth-largest-element-in-an-array/)
7. Graphs:
Concepts: Graph representations (adjacency list, adjacency matrix), graph traversals (DFS, BFS).
Question:
Implement a Depth-First Search (DFS) traversal on a graph. (This might be a custom problem you're asked to code during the interview)
Find the shortest path between two nodes in a graph. (https://leetcode.com/tag/shortest-path/)
8. Searching & Sorting:
Concepts: Time and space complexities of different sorting algorithms (Bubble Sort, Insertion Sort, Merge Sort, Quick Sort), linear search vs. binary search.
Question:
Explain the time and space complexity of Merge Sort.
Implement a binary search algorithm. (https://leetcode.com/problems/binary-search/)
9. Dynamic Programming (DP):
Concepts: Breaking down complex problems into smaller subproblems, memoization to avoid redundant calculations.
Question:
Find the longest common subsequence of two strings. (https://leetcode.com/problems/longest-common-subsequence/submissions/)
Find the minimum number of coins required to make a certain amount of money. (https://leetcode.com/problems/coin-change/)
10. Greedy Algorithms:
Concepts: Making optimal choices at each step based on the current state.
Question:
Given a list of activities with start and end times, find the maximum number of activities that can be done without conflict. (https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/discuss/93786/this-is-actually-activity-selection-problem)
Find the minimum number of jumps required to reach the end of an array (where each element represents the maximum jump range at that position). (https://leetcode.com/problems/jump-game/)
Big O Notation:
Understanding time and space complexities of algorithms is crucial for Google interviews.
Question: Analyze the time complexity of a given sorting algorithm and explain what it means.
Remember, these are just examples. Google may ask variations or a combination of these concepts. The key is to focus on understanding the core principles and how to apply them to solve problems efficiently.
Sources info:
github.com/Dhruv-Arora-Git/LeetCode-DSA
github.com/afrikanjoe/Yeet