Pubmatic Interview Experinece in Java

Admin
2024-03-01
PubMatic

This interview experience is shared by college pass out senior, In case of any help needed, please contact admin

 

ROUND 1)- Technical Round
1) Tell me about yourself?
2) What will be the output of the following codes in java?
i) String s1="java";
String s2='java";
sysout(s1==s2 );
sysout(s1.equals(s2));
Ii) String s1="java";
String s2=new String("java");
sysout(s1==s2 );
sysout(s1.equals(s2));
iii) String s1=new String("java");
String s2=new String('java");
sysout(s1==s2 );
sysout(s1.equals(s2));
3) Compare & discuss the following collection frameworks based on the time complexities of different 
operations.
i) ArrayList vs LinkedList
ii) HashSet vs TreeSet.
4) Differentiate comparable and comparator in java.
5) Discuss four pillars of OOPs in java in brief.
6) What is Multithreading? How will you create a thread in java?
7) What are the states of the thread? 
8) What is Deadlock? What are the necessary conditions for it? How will you prevent it?
9) What is Virtual memory & demand Paging?
10) Question: Find minimum jumps to reach at the end of the array? 
(link=https://leetcode.com/problems/jump-game-ii/)
(My approach -> i) Recursive brute force ->T.C.=O(n!) S.C.(extra)=O(n); 
i) Dynamic Programming ->T.C.=O(n*n) S.C.(extra)=O(n); 
i) Greedy Approach(Valley-peek approach) ->T.C.=O(n) S.C.(extra)=O(1);) 
2
ROUND 2)- Technical Round
1. Implement a linked list as a queue, perform insert, delete, and getSize operation in O(1) 
complexity, and write clean & concise code for it using OOPs concepts
2. Find the Peek element from the given array(Hill type array) (https://www.geeksforgeeks.org/finda-peak-in-a-given-array/) (Expected complexity- O(log(n))).

 

All articles