Table of Contents
8 Patterns Review For Successful Coding Interview
This is nothing but quick 5 min revision before going to interview.
- Two Pointers
- Use 2 pointer : startPointer=0 & endPointer=len(inputs)-1
- Traverse towards the middle
- Increment start pointer and decrement end pointer based on problem condition mention in question.
- Two Pointers Practice Questions: (Easy, Top Interview Questions)
- Modified Binary Search
- Binary Search Practice Questions: (Easy, Top Interview Questions)
- Binary Tree BFS
- Use Queues : First in First out
- BFS Practice Questions: (Easy, Top Interview Questions)
- Binary Tree DFS
- Use Stack : First in Last out
- DFS Practice Questions: (Easy, Top Interview Questions)
- Topological Sort
- A topological ordering is possible if and only if the graph has no directed cycles, that is, if it is a directed acyclic graph (DAG).
- Topological Practice Questions: (Easy, Top Interview Questions)
- Top K Elements
- Use Min Heap which will always have size k
- At the insertion,
- check if size of min heap is greater than k (k+1), remove root element and then you will have min heap of size k always
- Top K Practice Questions: (Easy, Top Interview Questions)
- Subset
- Use backtracking
- Subset Practice Questions: (Easy, Top Interview Questions)
- Sliding window
- Sliding Window Practice Questions: (Easy, Top Interview Questions)
Visit https: https://codeandalgo.com for more such contents
Leave a Reply