Top 25 Interview Questions

Here is the collection of TOP 25 frequently asked questions based on experience (mine and friends) of interviews in multiple companies.

1) Lowest common Ancestor (

2) A unsorted array of integers is given; you need to find the max product formed my multiplying three numbers. (You cannot sort the array, watch out when there are negative numbers)

3) Left View of a tree (

4) Reversing of Arrays (

5) Cache Line, Cache internal concept, RR scheduling

6) Print the middle of a given linked list (

7) Pair wise swap of elements in linked list (

8) HashMap internals (

9) Double checking Singleton (

10) Factory Pattern (

11) Print a given matrix in spiral form (

12) DFS on Graph and its representation (,

13) Object Oriented concept, Polymorphism , Method overloading, method overriding, Difference between abstraction and encapsulation, Aggregation and Composition

14) Print nth last node in linked list

15) Delete a given node in Linked List under given constraints (

16) Implement Stack using Queues(

17) Find if two rectangles overlap (

18) Multithreading concepts

19) Given an array of integers, update the index with multiplication of previous and next integers,

   e.g. Input: 2 , 3, 4, 5, 6
        Output: 2*3, 2*4, 3*5, 4*6, 5*6

20) Difference of creating threads in Java using Thread and Runnable

21) How hashset is implemented in Java internally.

22) DeadLock example code (Producer & Consumer Code)

23) Find the number which is not repeated in Array of integers, others are present for two times.

e.g. Input : 23, 34,56,21,21,56,78,23, 34        
     Output: 23
     Hint: USE XOR

24) Serialization and related concepts.

25) Comparators in TreeSet

Thanks to geeks4geeks team for providing a nice platform. You guys are the best.

This article is contributed by Rishi Verma. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

Article Tags :
Practice Tags :