Coding Interview Preparation Guide
Coding Interview Preparation Guide
2. Reverse a string.
○ Hint: Use two-pointer technique.
○ Time Complexity: O(n)
○ Asked By: Infosys, Wipro
8. Find the missing number in an array of size n containing numbers from 1 to n+1.
○ Hint: Use the sum formula or XOR approach.
○ Time Complexity: O(n)
○ Asked By: Wipro, Accenture
11. Find the maximum difference between two elements in an array such that larger
element appears after the smaller element.
● Hint: Track the minimum value while traversing.
● Time Complexity: O(n)
● Asked By: Cognizant, Infosys
Data Structures
4. Find the pair of elements with the given sum in a sorted array.
○ Hint: Use the two-pointer technique.
○ Time Complexity: O(n)
○ Asked By: Infosys, Wipro
5. Find the product of the array elements except for the current index.
○ Hint: Use prefix and suffix product arrays.
○ Time Complexity: O(n)
○ Asked By: TCS, Cognizant
Strings
Dynamic Programming
Graph Algorithms
Bonus Problems
Happy Learning !