Education: Bachelor’s from Tier 2/3 College (not sure some state govt college)
Years of Experience: 6 years (Product based, mostly in MAANG)
Applied through referral [However if you have strong resume for job requirement it will go through without referral as well (Applied for L4 in 2021 without referral)]
Recruiter reachout for interviews date and explained the process. For L5, three round of DSA, one round of System design and one round of googlyness & leadership.
Recruiter told me System design and Leadership round will be conducted only if I clear DSA round ( at least 2 hire call in 3 rounds)
You will have options to have multiple round on same day or you can have it on different day as well
I had all rounds on different day (DSA had ~2/3 days of gap between each round)
For System design and Leadership round I took another 3/4 weeks
I took around 4 week to prepare ( I was already in interview mode, you can ask for more)
[My advice] I would suggest, do not hurry and take your time to prepare
Since, I was already taking some interviews, my basic concept was in check. The time that I took for Google interviews, I tried to solve 4/5 problem daily on medium/hard level on leetcode, gfg along with taking leetcode contest regularly. I used needcode roadmap to make sure that I am solving problem from different category. Created my own sheet with the problems. FYI, I used needcode roadmap just for reference so that topics are covered.
I followed multiple channels on youtube for understanding different concepts (Mostly they are quite popular on youtube). Some were really helpful and some were just copy paste of editorial.
Tip: Take as much help as you can from youtube and online resources, don't stick to one sheet (Your goal should be to learn and understand fundamentals rather than focusing on one interview)
Tip: Try solving needcode roadmap problems after having good understanding of fundamental concepts. Treat this as quick revision for any interview
- Create your own sheet and keep track of time you take to solve
- Your goal should not be just get AC on leetcode but think through the problem.
e.g. https://leetcode.com/problems/sliding-window-maximum/description/ This problem has multiple solution. Like using basic brute force (which will throw TLE) but using multiset (leetcode will AC). However, if you dig deep you can find the better solution using deque.- Most interviewers have this expectation that you should gradually build up solution and pin point the bottlenecks to improve upon your solution
Preparing for this was a bit tricky. There are not enough structed resources are available for free. I started with some youtube channels on system design. First, let me provide the resources that I used to prepare for system design.
Basic Concepts : Gaurav Sen : System Design Primer ⭐️: How to start with distributed systems?
Leveling up : System Design Interview: An Insider's Guide – Volume 1 and Volume 2 by Alex Xu (you can find free pdf version on github)
I would recommend buying this book as they are really good for leveling up and preparing for interiew
Alex Xu's books have some shortcoming as well. While going through the different system design aspect it talks about some choices which is not covered in details.
Tip: Dig deep into these concepts instead of memorizing for a particular problems. For e.g. It has described some locking methods for payment gateways which lacks depth. I would recommend to explore those topics if you have time.
Advance Concepts : Designing Data-Intensive Applications by Martin Kleppmann
This book has details on how to handle distributed system which requires processing of large amount of data
LLD : System design interviews are generally focus on HLD, however I have seen some companies asking LLD as well.
I followed
Christopher Okhravi - Head First Design patterns(its available on youtube) while I was actually learning different design pattern
Tips:
- Try making small notes about new terminologies that you are coming across while going through the books. This will later on help you with revisions and to recall on why and where this was being used or should be used.
- There are 1000s of resources online, try to find the one which you find interesting.
Each round takes around 45mins, some of my round was extended to 60mins as well due to interviewers interest in follow up questions
Problem Statement
Given a single string which has space separated sorted numbers, determine whether a specific target number is present in the string.
E.g. Input: "1 23 34 123 453" Target: 123
Output: true
Tip: always ask follow up questions
This looks a straight forward problem of binary search but the way it should be implemented can be based on your follow up questions else you end up with solution which may not cover all the cases
- e.g. Since input is provided in string, numbers can be large like 10000's digit large which you cannot fit in regualar numeric data type in most language
Solution
My take
Asking follow up question helped me writing optimal and cleaner code.
I don't remember the exact problem, It was based on some timeseries logging information. Optimal solution was based on sliding window.
- I followed the same pattern, like asking follow up questions on problem statement and it's constraint
My take
I found this round bit easier than the first one, as there was only one followup question was asked which my code was already handling
Problem was based on binary tree. It was standard binary tree problem which required some calculation on it's leaf node
Solution Discussion
I provided the dfs (inorder) solution, however interviewer asked on if bfs can be applied which was like level order traversal.
Provided both the solution, fumbled a little bit in complexity analysis which I corrected when interviewer nudged me to think about different kind of trees.
Took 3/4 weeks to prepare for system design and Leadership round
I was asked to design small image/gifs/video hosting platform which does not require sign up.
Steps I followed
Gather all the information that you can, and before moving to the next steps, follow up with interview if they are good with current requirement and assumption.
Performed some math based on requirement.
Confirmed with interviewer on output and assumption
Tips: Write these down, so that you can come back to it for reference
Drew high level component for the system. and explain underlying tech that can be used. e.g. storing metadata in DB (relation/non-relational) and image on file bases on storage system like S3
Had indepth discussion on relational vs non-relational. I went ahead with no-sql based db to store meta data. Provided strong points on why, I am using this
Note : I did not provided loadbalancer, gateways, proxy at this point of time
Discussed the bottleneck of HLD components. Then introduced, tech that can be used to solve those issues like loadbalanacer, proxies (forward, backward). Cache to store metadata. Having a background image processing system to ensure images can be stored in different format to serve all kind of user (like slow internet etc)
Zoomed into high level components to further break down the system and it's responsibilities
Work done in step-4 & step-5 helped me in fitting these new requirements in incremental fashion rather the re-architecting the system
Discussion went for 80mins although time assigned was 60mins
PS: Please don’t judge me for any grammar mistakes — this is my first time writing something like this. Just trying to give back to the community that helped me a lot during my preparation.
EDIT-1: Had to remove the external links for resources due to leetcode policy which disabled the post visiblity.
EDIT-2: If accessible, same post with external liks are available. post with external link
EDIT-3: Some Interview tip while interview is in progress
💡 During interview, do not hesistate to ask questions even if you think it is silly one.
💡 Do not assume anything. If assuming make sure interviewer and you are on same page about it
💡 Think loud, it provides interviewer to look into your thought process. E.g. I was taking about linear search and then storing each number in a list etc along with why it is not optimal etc and finally concluded the binary search
💡 If you get time at the end, do ask questions to your interviewer about their work, daily routine etc. I generally ask them to give me some brief intro about their work so that I can ask related questions instead of generic one
Edit-4 Binary Search on String code
#include<bits/stdc++.h>
using namespace std;
string findNumAtMid(string &str, int mid) {
while(mid >= 0 && str[mid] != ' ') {
mid--;
}
string res;
mid += 1;
while(mid < str.size() && str[mid] != ' ') {
res.push_back(str[mid]);
mid += 1;
}
return res;
}
int compareTarget(string &str, string &target, int mid) {
string num = findNumAtMid(str, mid);
if(num.size() > target.size())
return 1;
if(target.size() > num.size())
return -1;
for(int i=0; i<target.size(); i++) {
if(num[i] > target[i])
return 1;
else if(num[i] < target[i])
return -1;
}
return 0;
}
bool hasTarget(string &str, string &target) {
if(target.size() > str.size())
return false;
int start = 0;
int end = str.size() - 1;
while(start <= end) {
int mid = start + (end-start) / 2;
int res = compareTarget(str, target, mid);
if(res==0) {
return true;
} else if(res==-1) {
start = mid + 1;
} else {
end = mid - 1;
}
}
return false;
}
int main() {
string str = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1000000000000000000000000000";
string target = "1000000000000000000000000000";
cout<<"has Target "<<hasTarget(str, target);
return 0;
}
AMA in comments. I will try to answer as much as possible.