Arrays Data Structures
Arrays Data Structures
Things to look out for during interviews
- Clarify if there are duplicate values in the array. Would the presence of duplicate values affect the answer? Does it make the question simpler or harder?
- When using an index to iterate through array elements, be careful not to go out of bounds.
- Be mindful about slicing or concatenating arrays in your code. Typically, slicing and concatenating arrays would take O(n) time. Use start and end indices to demarcate a subarray/range where possible.
Corner cases
- Empty sequence
- Sequence with 1 or 2 elements
- Sequence with repeated elements cloze emphasizes both the repetition and order of elements in the sequence
- Duplicated values in the sequence cloze highlights the presence of duplicate values without giving as much importance to the order of elements.
Essential questions
Recommended practice questions
- These are recommended questions to practice after you have studied for the topic and have practiced the essential questions.
- Contains Duplicate
- Maximum Product Subarray
- Search in Rotated Sorted Array
- 3Sum
- Container With Most Water
- Sliding Window Maximum
This post is licensed under CC BY 4.0 by the author.