Monday, July 26, 2021

FB- E5| Google-L5| Bloomberg- Sr SWE ~ All Offers 📚💻📝 Interviewing Journey and Prep Tips

Original post: Link


 About Me

Current Occupation : Sr Software Engineer
Company : Non FANG Reputable company in Boston
YOE : 8
Experience : Research and Development of Programming Languages.
Tech Stack : C++ / Linux
Competitive Programming : Bench warmer in previous life

Interviewing Journey
Honestly, I always dreaded interview preparation but Covid pandemic gave me some free time to warm up a little bit by participating in the monthly coding challenges. I mostly sucked and why not, did not really practice stuff. Over a period of two months or so I slowly got better ( read more in prep strategy). As luck would have it I got an interview opportunity with Bloomberg

**Interview Experiences : **

Disclaimer
I am not posting questions due to NDA, I feel posting specific questions is not super useful either. You might not be asked the same question, worst the question might be blacklisted from company repository. I believe in building skills that help you solve any new problem effectively and efficiently. You will find that the topics are all over the place, working on a strategy to approach new questions in a systematic way is more fruitful. (More in prep strategy)

Bloomberg
I bombed the phone screen or so I thought but the interviewer saw sufficient signal to call me onsite. I took about couple of weeks for prep and gave onsite. I had 2 coding rounds, 1 system design round and a behavioral interview. The interviews went well, I received the offer.

  1. Monotonic Queue Related Question
  2. Top K related question
  3. Graph DFS related questions
  4. System design ~ Design of a distributed system

Facebook
I reached out to Facebook recruiter whose contact had been with for more than an year, told him about Bloomberg offer and scheduled FB interviews. Nothing out of the box.

I am highlighting questions, that I could not solve or implement in italics next to the topic/question. I was mostly able to discuss approaches and was not able to implement the solution due to time constraints.

Phone Screen

  1. Implement a data structure to perform fetch and store operations with constraints
  2. String processing - Gave the approach, ran out of time for implementation.

Virtual Onsite : 2 Coding (2 Coding question/ round) , 2 System Design, 1 Behavioral (1 Coding question)
Onsite

  1. DP - optimize a constraint in a list eg: longest, smallest, max continuous, etc
  2. String manipulation
  3. Matrix traversal related question
  4. Merge Sort Tweaking to find search some requirements in an array - Gave the approach, ran out of time for implementation.
  5. Search a list to find a constraint, eg: biggest, smallest, has sum of, can be expressed as sum of etc
  6. From FB sys design questions article.

Google
I interviewed Google after FB, I was waived off telephonic!

Virtual onsite - 3 coding, 1 sys design ang 1 Googlyness round
Google questions were more vague, and hard to break down. I had to ask clarification questions which lead to breaking down the problem that could be solved using a combination of the following concepts

  1. DP (Very important for Google!)
  2. Backtracking
  3. Heaps
  4. Graphs
  5. System Design ~ Vague questions that did not make any sense, which has to be broken down at multiple levels into orthogonal sub problems before tackling them.

After the onsite, the panel felt that they did not get enough signal to accept me, they asked for 3 more rounds of interviews (sigh!) 2 coding and 1 system design.

Recruiter is your friend, try to learn what signal was missing and work on it.

Take 2:

  1. DP
  2. Complex API design ( Graph + Heap + Map) - I still don't know if I approached this question correctly, turns out doesn't matter now :P
  3. Vague system design question

Motional and other companies pretty much the same, I used them more as dress rehearsal for FANG

Preparation Strategy

  1. Quality over quantity: Friends, I can't stress enough on this, DO NOT chase numbers, chase concepts and skills. I found a curated playlist of some 70 odd problems on leetcode, it was super helpful.

  2. Deliberate Practice: I divided my practice sessions into following
    a. Learning Session : Session where my focus is on learning new skills/concepts. I would pick a problem, solve it using brute force and then optimize it. Once I solved a problem, I would try to think how the question was related to questions with similar concepts, what parameters changed that led to solving this question differently compared to the previous ones. I would spend 30 mins - 60 mins per problem after which I would just look for a good solution on the forum, understand it, copy - paste implement it and mark it for revision. I picked this habit of revising every problem from learning sessions couple of times or more (based on complexity to reinforce the concept, turns out this was was the best thing in my preparation). If there is one thing you want to pick out of this article, it is understanding how to assimilate what you learnt. I would think, "Wow! I spent like 2 hours of my life or so learning this problem, I could have grabbed wine with my wife, played a video game (people tell me that disco elysium is fantastic), played with my son (yes! I have a 18 month old son) I better justify these 2 hours by really getting this concept into my head so that next time I see a problem similar to this concept I shouldn't be like...heck...I solved something like this 2 days ago and now I can't remember"

    b. Rehearsal Session : The focus of this session is to create interview environment and work your problem solving muscles in a simulated environment so that you are at ease during interviews. If you have folks who can do mocks, great! I would use timers, make myself uncomfortable by tackling a hard questions. Problems that you struggled to solve during your learning sessions are a great fit for rehearsals.

    c. Revision Session: I would mark new question and try to revise them while they were still fresh in my memory. Sometimes I would batch process similar questions. This would help me gain a greater understanding of a concept. Eg: Pick 3-5 Dijkstra related questions and solve them together, you will develop a greater appreciation for the algorithm and how it can be used in different contexts. I used leetrepeat for marking problems for revision. While revising solve the problem from scratch and by building the concept in head do not retrieve it from memory!

    Learning sessions are orthogonal, while learning I would approach with an open mindset, I wouldn't be bogged down when faced with problems I couldn't solve, on the contrary I would be happy that I found something new to learn today which I did not have to figure out during a stressful interview session ;)

  3. Coding : The art of solving a problem using brute force, identifying bottle necks and converting it into an optimal solution is priceless. The good news is there are only few ways to do this (some tricks on the top of my head in random order)

    • A quadratic algorithm can be converted to a linear time algorithm by reducing a dimension. How you reduce the dimension is problem dependent (some require auxiliary const lookup data structures like maps queues etc, some require using two pointers). Longest increasing subsequence is 1-D problem, the Russian doll envelopes is a problem in 2-Dimensions, box stacking is 3-D problem. Ideally after solving one of these problems in a learning session you should be able to assimilate the concept and apply it to other variants (this will take time, patience is your friend. Repetition is the key! Big dreams require big actions :))
    • A linear algorithm can be reduced to log N by identifying a structure in the input data.
    • A quadratic algorithm can be reduced to NlogN algorithm using some sorting
    • An exponential algorithm can be reduced to polynomial time by caching results for sub problems.

This set is finite at least for interview problems...work on building this set for yourself and when you solve an unknown hard problem from scratch in an interview you will pleasantly surprise yourself ! :)

  1. Concepts Order: This is personal, I approached problems in the following order

    • Graphs (DFS, BFS...I somehow don't like BFS...lacks the DFS elegance :P)
    • Back tracking
    • DP (Oh! Trust me I dreaded DP first, it was constant love hate relationship...now I love DP)
    • Searching/Sorting (Heaps, Maps etc.)
    • String
    • Misc. Topics (Greedy, DaC, Math, Geometry)

    Why this order?
    Doing graphs helped me model problems into graphs and pick DFS and BFS, backtracking taught me how to approach problems in a brute force fashion. DP built on top of backtracking, I learnt how to divide problems into sub problems and tackle them orthogonally. This method of breaking down any/every problem into sub-problem and tackling it independently helped me a great deal in solving any problem.

I will keep following this article incase people find it super helpful and find gaps I will gladly address them

All the best folks!

If there is enough response, I will update this with some resources and system design prep guide

Answers to few questions from comments

Q: How long did I prepare for?
A: I seriously prepped for 3-4 months! But if you think I prepared only for 3-4 months, you might be mistaken. What I did is a cumulative effort of

  • Me working with friends who were prepping for interviews. This helped me identify gaps in my understanding, the tricky parts and the boring parts.
  • What stuck from my learnings in school
  • What stuck from my learnings in failed onsite interviews in previous years (failed Amazon, Microsoft in 2017)
  • What I learnt during my day job (have been at it for 8 years)
  • What I learnt by attending talks.

Longer answer:
I would have done about 100 - 150 questions in the last 4 months, each question multiple times until the concepts really stuck, I remember solving some stupid backtracking questions like 10 times to really understand how it works (I am a little slow and dumb in that sense)! But after spending that much time I would be comfortable tackling any new similar backtracking problem...(even the ones that I did not see before). I might be old fashioned, I believe in "slow is smooth, smooth is fast". Learning is hard for me and I respect that by trying to have an open mind when failing!

What is "Slow is smooth, smooth is fast?"
https://sites.google.com/site/lehijujitsu/slow-is-smooth-smooth-is-fast

The real question you might want to ask, How long will it take to get to a good level?
Well, it depends...my best guess for L5 (assuming you have the experience):

  • 8 - 12 months if you have zero experience
  • 6 - 10 months if you have some knowledge of DS and no understanding of your gaps.
  • 3 - 6 months if you have good knowledge of DS, some understanding of your gaps, an open mindset, an honesty in accepting short comings, grit to fix them, deliberate practice, discipline in adhering to a process and ability to apply the process in real interviews.
  • 0 - 2 months (Skill level locked, can't comment) :P

Learning is hard (but can be fun :)) , you have to pay your dues somewhere, sometime, there is no short cut or silver bullet.

Be true to the game, because the game will be true to you. If you try to shortcut the game, then the game will shortcut you. If you put forth the effort, good things will be bestowed upon you. - ~ Michael Jordan

Q: How did I turn around my relationship with DP?
A: Spending more time with DP and solving more problems.
Resources:

  1. Eric Demaine MIT DP YouTube.
  2. Model DP as state transition problem (Admin suggested that I cannot link the article)
  3. Model DP problem as a DAG
  4. Everything About Dynamic Programming (search query will find another platform's blog)
  5. Understand DP as smart back tracking (CLRS/Skiena)

No comments:

Post a Comment

My Journey from a Tier-3 College to Microsoft, Google, and Meta: Lessons Learned

Original post: Link   Time to give back to community. Went through couple of post myself and got inspired and belief that cracking FAANG is ...