Adobe Interview Experience for Computer Scientist-1
Adobe interview Experience for CS-1, Bangalore location. I’ll share my experience in this post . I have around 5 years of experience working as a Java Developer(Backend). The interview was conducted as part of their hiring drive and all the interview rounds were online . The interviewers were very helpful.
Round 1:
- Given a sorted array having all the unique elements. and a target Sum. Find whether there exists a pair of elements in the array with the sum as the targetSum.
eg: Arr={4, 5, 8, 10, 12, 15, 20} targetSum = 23 Op: Yes. (8, 15)Java
/*package whatever //do not write package name here */publicint[] findPair(int[] arr,intsum){int[] res =newint[2];intl =0;intr = arr.length -1;while(l < r) {inttemp = arr[l] + arr[r];if(temp > sum)r--;elseif(temp < sum)l++;else{res[0] = arr[l];res[1] = arr[r];break;}}returnres;} - Given an Unbalanced Binary Search Tree. Find the Second highest element in the tree.
Java
/*package whatever //do not write package name here */Node getSecondMax(Node root) {returnutil(root,null); }Node util(Node root, Node prev){if(root ==null)returnroot;if(root.right !=null) {prev = root;returnutil(root.right, prev);}else{if(root.left ==null)returnprev;elsereturngetRight(root.left);}}Node getRight(Node root){if(root ==null)returnroot;if(root.right ==null)returnroot;if(root.right !=null)returngetRight(root.right);}
Round 2: System Design
- Design an Online Playlist having the following functionalities exposed to the end user.
- search by artist name/song name/genre/year of release/album name
- sort by year of release/no. of hits(likes)
- recommend similar playlist
- resumePlaylist from lastsaved point
Round 3: Manager Round
- Given an array of Unsorted integers and a value k. Find the k smallest elements from the array.
eg: arr={6,3,6,2,2,4,7} k=4 op: 2,2,3,4Java
/*package whatever //do not write package name here */publicvoidkSmallestElements(int[] arr,intk){// Max heapPriorityQueue<Integer> pq =newPriorityQueue<Integer>(Collections.reverseOrder());if(k >= arr.length) {for(inti : arr)System.out.print(i +" ");return;}for(inti =0; i < k; i++) {pq.add(arr[i]);}for(inti = k; i < arr.length; i++) {intmax = pq.peek();if(arr[i] < max) {pq.poll();pq.add(arr[i]);}}for(inti =0; i < k; i++) {System.out.print(pq.poll() +" ");}} - System Design: Design an online Flight reservation system having the features:
- Searching for flights between destinations on a given date
- book the flight
- retrieve the bookings of a user
Round 4:
- The final round was taken by a senior person, maybe the director of engineering, and he asked me to design the system where multiple users are booking for a same seat in apps such as BookMyShow. How to handle the concurrency when multiple users want to book the same resource simultaneously.
Result: I got a call from HR after 2 days saying that I was selected.



