Uploaded June 2023 | Updated November 2026, 2 days ago
Part 1 - Golden rules for solving a Coding problem in an Interview #coding #interview
👉 If the coding problem requires performing an operation that needs faster search in O(1), try to use Set or a Map.
👉 If the coding problem requires dealing with the top, bottom, maximum, minimum, closest, and farthest "K" elements among given "N" elements, try to use a Heap.
👉 If the coding problem has input as a sorted Array, List, or Matrix, try to use Two Pointer strategy or try to use Binary Search.
👉 If the coding problem requires rearrangemnt or removal of elements from an Array, try to use Two Pointer strategy.
👉 If the coding problem requires generating all Permutations and Combinations, we can use either Backtracking or Breadth First Search.
👉 If the coding problem has input in the form of a Tree, then most of the time it can be solved by applying Tree Traversals algorithms called as Breadth First Search (BFS) and Depth First Search (DFS).
Part 1 - Golden rules for solving a Coding problem in an Interview #coding #interview
👉 If the coding problem requires performing an operation that needs faster search in O(1), try to use Set or a Map.
👉 If the coding problem requires dealing with the top, bottom, maximum, minimum, closest, and farthest "K" elements among given "N" elements, try to use a Heap.
👉 If the coding problem has input as a sorted Array, List, or Matrix, try to use Two Pointer strategy or try to use Binary Search.
👉 If the coding problem requires rearrangemnt or removal of elements from an Array, try to use Two Pointer strategy.
👉 If the coding problem requires generating all Permutations and Combinations, we can use either Backtracking or Breadth First Search.
👉 If the coding problem has input in the form of a Tree, then most of the time it can be solved by applying Tree Traversals algorithms called as Breadth First Search (BFS) and Depth First Search (DFS).










