Sunday, June 19, 2016

Classification of Array interview questions


 1. Sorting of array
  1. Partially sorted array 
  2.  Random element array 
  3.  Reverse order
  4. Finding kth largest or smallest element 
2. Searching array
  1.   Sorted Arrays 
    1. with known size
      1. linear search 
      2. non-linear search or binary search etc.
    2.   with unknown size 
      1. Interpolation Search 
  2.  Cyclic Arrays / rotated arrays 
  3.  Unsorted Arrays 

 

3. Stream Statistic
  1. Stream statistic  max, min , average , median etc .

4. Array statistic
  1.    Same as stream statistic but you know size in advance .

5. Tracking particular condition  (Max, Min , Diff etc .)
  1. Tracking max , min values - like find max diff between max and min in array   

6. De-Duplication of elements 
  1.  remove dupes
  2.  count dupes 

7. Combinatorics 
  1.    Permutations 
  2.    Combinations 
  3.    possible sets operations 
8. Sub-Sequence or subset   
  1.   Find subset with particular condition (like sum , product etc.)
  9. String to char array interchangeable string problems
  1.    If you see string as char array then those might fall in one of the above categories.
  2.    String compression / de-compression