Hi all, below are the questions asked in paytm interview for 2yr experienced guy in java technology. I could remember these much only, although there were more questions.
- Round 1:
- Explained previous projects.
- Interfaces vs abstract class interface i1 : void fun() interface i2 : int fun() interface i3 : Object fun(int x) class implementing all these interfaces has to implement all methods or one? interface i1 : void fun() interface i2 : void fun() interface i3 : void fun() now what will be the behavior if a class implement all interfaces?
- Given m*n matrix containing 0s and 1s in sorted order. count the row with a maximum number of 1s.
- Given a rod of length d. there is a price associated with every piece of rod. the buyer wishes to buy a rod of length n where there can be any number of cuts in it. find the no. of cuts required to get rod of length n with minimum cost to be paid.
- Last question of the round with a choice to attempt only 1.
- Given 8 balls out of which 1 is unequal. find it in a minimum number of comparisons. or
- Given some integers. there can be only 3 operations to be performed on the integers i.e., add, subtract and concat. find minimum no. of operations to get number x (100).
- Round 2:
- Static synchronized and synchronized method, will both of them executed parallelly if called by different threads at the same time?
- Set, hashmap implementations, linkedhashmap how it works. what is the threshold value of hashmap, load factor?
- How to resize happens in hashmap.
- When java structures the linked list entry buckets in a hashmap to tree? what kind of tree does it maintain? avl or rbtree?
- What are the properties of the two trees?
- Remote method invokation (rmi), socket?
- Find nth largest from stream of integers. Hint: use partition algo to identify nth largest, loop till pivot is not equal to n.
- C: what does printf return? what does scanf return?
- Optimistic locking.
- Thread pool executor. concurrent packages.
- What is hibernate? why do we use it?
- spring ioc, di.
- Design patterns.
- Given a 2-d plane with 3 coordinates which forms a triangle. given a point tell whether it is present inside triangle or not.
- Thread states? difference between blocked and waiting state?
- Java is pass by value or pass by reference?
- Asked about previous projects.
- Round 3:
- Design a car parking system. there are slots, return the best slot for vehicle arrived, APIs, DB, classes etc. Also telling best slot should be less than o(n).
- What all interfaces are there in collections? their implementations?
- Stack queue in what package?
- Singleton class, what if two threads access singleton at same time, what if constructor made accessible by reflection?
- Asked about previous projects.
- Heap implementations.
- Implement arraylist using a data structure.
- Heapsort methods with each taking how much time?