Adobe | MTS 2 | Noida | July-Sept' 24

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2024-10-01Added By Anonymous
Source: Link

R1: PSDS


Q1. given a string, sort it according to the frequency of characters from heighest to lowest

•Eg: tree → eert or eetr both are valid
•Eg: Aacc → ccAa or ccaA both are valid
•Approcah 1: count frequency of all chars and sort them according to fre and then creat string: TC: O(n+ mlogm), m= distinct chars
•Approach 2: store freq of all chars and traverse multiple times picking one having max fre. TC: O(n+ m*m)
•Approach 3: put all chars fre in max heap. TC: O(n + mlogm)
•Implemented this
•He was saying can you avoid sorting, I couldnot come up with best approach also my code didnot ran in 1st run due to wrongly writting pair as Pair in c++
•Approach 4: bucket sort. But this also has TC of: O(n + max(m, max freq of char). I think he wanted this approach


Q2. Tell whether a binary tree is heap or not

•I gave him the 2 conditions to tell, he asked have I ever seen this question before? I said yes. Then he said I will give you another question


Q3. Tell whether a tic tac toe board is a valid one?

•In requirements I didn’t asked which player will turn first and this he pointed out later
•coded in c++, a lot of struggle with parsing the input
•At last he asked if I have any questions
•There was a constraint of time on the interviewer which he was clearly telling to do this question in next 30-35mins so we can go to another one


R2: Java PS

•He took me to some hackrrank code pair


Q1. Next permutation

•I enacted as if I have come up with solution there only and seeing this question first time, telling him each and every approach
•He asked me to optimize how I search a number GT given number in descending arr
•Then he didn’t asked to code next permutation ques


Q2. Implement binary search to find number GT a given number on an arr

•Then ask to write edge cases for it


Q3. Number of ways to reach nth stair given I can take 1.2….k steps at a time

•such a simple ques, I did a big mistake. fn(n) = SUM(fn(n-i)+1) where i= [1,2,..k] and n-i≥0
•He couldnot understand my function, I explained him multiple times
•Then he asked to give an example, I explained and then he pointed out mistake that we need not to add +1
•I wrote base condition of recursions, told how it can be efficiently solved using DP
•He didn’t asked me to code, although I said I can code in 1 min


Q4. About most difficult problem/project I have worked upon

•I explained it was an algorthim challenging problem, he couldnot asked any question from it, just understood the business
•then he said was it monolithic or microservices. How microservices used to interact
•Difference between asyn and sync operations and when to use them
•I explained giving a bussiness example of prev org transaction/payout process


Q5. what is difference between REST and normal API?

•I explained that REST apis are stateless
•He asked more, then I couldnot


Q6. difference between PUT and PATCH on and explain on basis of input parameters?

•I couldnot explain satisfactorily
•Atlast do you have any questions for me, I can answer only 1 question
•I asked 3 ques and showed my enthusiasm


R3: LLD

•Design Cache system supporting get and put operation and configurable eviction strategy. Initially assume it is LRU eviction strategy
•My initial system was tightly coupled with LRU
•Later he told this strategy can be different also
•Then optimized it
•One very big mistake I was doing again and again was, I was de
•signing the classes attributes on the fly according to the usage and thus interviewer had to correct me again and again, when he point I quickly gave the reason why it will not work and then improve it. Bad impact.
•I was jumping more into writing the algo rather then first structuring the classes. Bad impact.


R4: HM

•Asked how the Adobe process looks
•Project and prev work
•Migration:
•How much related the data was in DynamoDB
•Why you moved from DynamoDB to PG?
•I said it was cost reason, he said if scale is not there then what is the point of cost? I said it was decided by management and also we were querying on the DB
•Schema of product
•What are new new things you are expecting?
•scale
•more specific requirements
•Q. Design:


1/* 2currency values 31 Dollar -> 80 Rs 41 Dhiram -> 35 Rs 5. 6. 7. 8. 9. 10 111 Dollar -> 81 Rs 12 13- What is the value for 1 currency to another 14Dollar, Dhiram, USD -> Rupees 15 16(125 Dollar) -> 125 17 18- can also asked in the past or current 19*/ 20 21Money 22 - float amount 23 - CurrencyEnum currency 24 25CurrencyEnum 26- Dollar 27- Dhiram 28- Rupees 29 30GET public Money convert(Money input, Timestamp time){ 31 if(time==null){ 32 time = System.time; 33 } 34 ... 35 ... 36 ... 37 ... 38 ... 39} 40 41POST public bool createConversion(CurrencyEnum fromCurrency, 42float conversionFactor){ 43 ... 44} 45Map<String, Vector<pair<cf, time>> 46 47HashMap -> currency -> (timstamp, conversionFactor) 48 Dollar-> (75 T1), (76 T2), (75, T3) 49 50 Dhiram 35 T3


•In this he corrected me couple of times about the the inputs I am taking
•I felt I was little slow in telling
•How many types on indexing PG supports?
•He wanted B, B+ tree type answer
•What are my expectations from the role?
•Are those things am I not getting in the current role?
•AMA


Comments