If you haven’t looked at my previous post on Binary Search, then please have a look at it. Sliding Window comes in handy when attending any coding Interview in any of the big giant MNC’s(FAANG). I have encountered these patterns many times in my past coding interviews.

  • This method is usually used in array/list, whenever you are asked to calculate anything like minimum or maximum of continues subsets of an array of fixed length.
  • This consists of calculating a value for the given length by moving our widow element by element until we reach the array end.

Let’s consider a…

Binary Search is one of the most commonly asked questions in any technical interviews in top MNC’s. The basic idea is that, given an array/list with sorted elements, you have to find a certain element in it, the algorithm is based on a well know domain divide and conquer technique. It repeatedly breaks down the array in two sub-arrays which might contain the element we need and discards the other sub-array, and this goes on till the array size becomes 0 or till the element is found!

Pawan Jenu

Competitive Programmer, tech enthusiast, Problem Solver

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store