Train your brain with the below algorithms for your coding round interviews!

Algorithms you should cover in your preparation strategy.

Sahil Puri
3 min readNov 12, 2022

Coding rounds can be tricky, especially when you are presented with a question you haven’t seen before! But what’s trickier is the preparation strategy you make weeks before attending that one important interview round which can almost change your career path!

The preparation strategy matters a lot! One such strategy is how to train your brain wires with the right set of input data so that it can connect the dots and think of an approach when presented with a fresh problem. This might sound like ML algorithms which are fed with training data to generate correct prediction models. Yes, the same concept applies to our brain mappings as well which require the right set of algorithms to be fed for proper training before it starts auto-generating the solutions for you. In simple words — What you sow, so shall you reap!

To cut short and come back to this blog’s agenda, let us now discuss some very important algorithms and problems to be understood and practised as a part of your preparations for SDET coding interview rounds!

  1. Binary Search Algorithm — You should be very comfortable with the complexity, prerequisites and implementation of the binary search algorithm. Also, practice all its variations and applications too.
  2. Sorting Algorithms — Sorting programs are rarely asked directly in coding rounds but you are expected to know the complexity comparisons and algorithms of all sorting types. Ex — Insertion sort, bubble sort, merge sort, quick sort etc.
  3. Two/Multiple pointers (Variable) algorithms — These are further categorized below :
  • Both variables start from the 0-index. Ex — Sort an array of 0’s and 1’s, Move zeroes, find a substring inside a string etc.
  • Both variables are initialized at opposite ends (0 and last index). Ex — Two Sum problem, Palindrome check etc.
  • Fast and slow pointers algorithms. This is widely used for solving linked-list problems but can be applied to other data structures too. Ex — Find the middle node of a linked list, Find a cycle in a linked list etc.

4. BFS and DFS — You are required to be comfortable with both types of traversing algorithms. Practice the same on 2D arrays or trees. Ex — Area/Parameter/Number of islands, Binary Tree related problems.

5. BST — Direct implementation and related problems can be asked in some product company rounds, so you can have BST-related questions as part of your strategy. Ex- Validate BST, Search an element in a BST etc.

6. Valid Parenthesis — I am pointing out this question separately since it is one of the favourite questions of interviewers since it involved the application of Stack and Hashmap as data structures and a logical solution. Please cover this for sure.

7. 2D array/matrix traversal and applications — You need to practise the searching and traversal algorithms for a 2-dimensional array. Getting a deeper understanding of its implementation and initialization will help you with this.

8. Sliding Window algorithm — The sliding window is a very intriguing technique used to solve some complex problems involving an array or a string. It is often used to reduce the time complexity of the problem from O(n²) to O(n). Ex — Find the longest substring of a given string containing k distinct characters, Find the minimum sum subarray of given size k.

Although the above list is not exhaustive but covering the above algorithms and problems will surely help you to form patterns in your mind thus training it sufficiently enough to start connecting the dots and at least show you the possible approaches when presented with a new set of questions in the interview.

Remember, a strategised approach to preparing for coding interview rounds will help you to make your mark and score well by avoiding a total blackout which can very well happen sometimes.

See you next time.
Sahil Puri

--

--

Sahil Puri

Engineering Leader : Test Architect | Engg. Productivity | Release Engg. | Tools & Frameworks | Engg. Manager | Open source contributor | Mentor .