Uploaded June 2023 | Updated November 2026, 2 days ago
Part 2 - Golden rules for solving a Coding problem in an interview #coding #interview
👉 If the coding problem is around a Singly Linked List, and you are stuck in traversals logic, then try to use either Two Pointers or Slow/Fast Pointers.
👉 If the coding problem has a recursive solution but it's hard to visualize/code, try using a Stack data structure with a loop.
👉 If the coding problem revolves around iterating an array, and takes O(N2) time complexity, O(1) space complexity than try to use a HashMap/HashSet. It makes the algorithm faster with O(N) time complexity but takes more space with O(N) space complexity.
👉 If the coding problem has input in the form of a Graph like connections, links etc, then most of the time it can be solved by applying Graph traversals algorithms like Breadth First Search (BFS) and Depth First Search (DFS).
👉 If the coding problem requires optimization around the recursive the solution, there could be a possibility that dynamic programming can be used.
👉 If the coding problem has a group of strings or some manipulation/find/storing needs to be done around the substring, there is a high possibility that either Tries or HashMap can be used.
Part 2 - Golden rules for solving a Coding problem in an interview #coding #interview
👉 If the coding problem is around a Singly Linked List, and you are stuck in traversals logic, then try to use either Two Pointers or Slow/Fast Pointers.
👉 If the coding problem has a recursive solution but it's hard to visualize/code, try using a Stack data structure with a loop.
👉 If the coding problem revolves around iterating an array, and takes O(N2) time complexity, O(1) space complexity than try to use a HashMap/HashSet. It makes the algorithm faster with O(N) time complexity but takes more space with O(N) space complexity.
👉 If the coding problem has input in the form of a Graph like connections, links etc, then most of the time it can be solved by applying Graph traversals algorithms like Breadth First Search (BFS) and Depth First Search (DFS).
👉 If the coding problem requires optimization around the recursive the solution, there could be a possibility that dynamic programming can be used.
👉 If the coding problem has a group of strings or some manipulation/find/storing needs to be done around the substring, there is a high possibility that either Tries or HashMap can be used.










