Round 1: PSDS
Questions:
- Q1. Given a string, sort it according to the frequency of characters from highest to lowest.
- Eg: tree → eert or eetr both are valid.
- Eg: Aacc → ccAa or ccaA both are valid.
- Approach 1: Count frequency of all chars and sort them according to frequency and then create string: TC: O(n + m log m), m = distinct chars.
- Approach 2: Store frequency of all chars and traverse multiple times picking one having max frequency. TC: O(n + m * m).
- Approach 3: Put all chars frequency in max heap. TC: O(n + m log m).
- Implemented this.
- He was saying can you avoid sorting, I could not come up with the best approach also my code did not run in 1st run due to wrongly writing 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 a 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 ask 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 the next 30-35 mins so we can go to another one.
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.
Round 2: Java PS
Questions:
- Q1. Next permutation.
- I enacted as if I have come up with a solution there only and seeing this question for the first time, telling him each and every approach.
- He asked me to optimize how I search a number greater than a given number in a descending array.
- Then he didn’t ask to code the next permutation question.
- Q2. Implement binary search to find a number greater than a given number in an array.
- Then asked 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 question, I did a big mistake. fn(n) = SUM(fn(n-i) + 1) where i = [1, 2, .. k] and n-i ≥ 0.
- He could not understand my function, I explained it to him multiple times.
- Then he asked to give an example, I explained and then he pointed out the mistake that we need not to add +1.
- I wrote the base condition of recursions, told how it can be efficiently solved using DP.
- He didn’t ask me to code, although I said I can code in 1 min.
- Q4. About the most difficult problem/project I have worked upon.
- I explained it was an algorithm challenging problem, he could not ask any question from it, just understood the business.
- Then he said was it monolithic or microservices. How microservices used to interact.
- Difference between async and sync operations and when to use them.
- I explained giving a business example of previous org transaction/payout process.
- Q5. What is the difference between REST and normal API?
- I explained that REST APIs are stateless.
- He asked more, then I could not.
- Q6. Difference between PUT and PATCH and explain on the basis of input parameters?
- I could not explain satisfactorily.
- At last do you have any questions for me, I can answer only 1 question.
- I asked 3 questions and showed my enthusiasm.
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.
Round 3: LLD
Questions:
- Design a 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 designing the classes attributes on the fly according to the usage and thus the interviewer had to correct me again and again, when he pointed I quickly gave the reason why it will not work and then improved it. Bad impact.
- I was jumping more into writing the algorithm rather than first structuring the classes. Bad impact.
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.
Round 4: HM
Questions:
-
Asked how the Adobe process looks.
-
Project and previous 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 things you are expecting?
- Scale.
- More specific requirements.
Q. Design:
/* currency values 1 Dollar -> 80 Rs 1 Dhiram -> 35 Rs . . . 1 Dollar -> 81 Rs - What is the value for 1 currency to another Dollar, Dhiram, USD -> Rupees (125 Dollar) -> 125 - can also asked in the past or current */ Money - float amount - CurrencyEnum currency CurrencyEnum - Dollar - Dhiram - Rupees GET public Money convert(Money input, Timestamp time){ if(time == null){ time = System.time; } ... ... ... ... ... } POST public bool createConversion(CurrencyEnum fromCurrency, float conversionFactor){ ... } Map<String, Vector<pair<cf, time>> HashMap -> currency -> (timestamp, conversionFactor) Dollar -> (75 T1), (76 T2), (75, T3) Dhiram 35 T3
- In this he corrected me a couple of times about the inputs I am taking.
- I felt I was a little slow in telling.
- How many types of 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.
- Migration:
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.