Rippling Interview Experience
This post is to share my interview experience with Ripping for a Software Engineer position in Bangalore(May 2019). I was initially contacted by a recruiting agency who co-ordinated the interview process.
Round 1 - System Design + Coding
There were no telephonic/hackerrank interviews and I was invited for the F2F interview at the Rippling office. I met with a Senior engineer for my 1st round, and after the usual introduction, he asked me the following question:
Design a system that processes jobs from a DB in an exactly-once fashion
I initially started questioning about the DB (so as to check if it’s strongly consistent or eventually consistent ) - The interviewer asked me to assume a simple MySQL database, and suggested me to focus on the application logic for processing the jobs. Assuming each job is represented by a row in the table, the crux of the problem was in figuring out what additional data to store, and how to use it in the code to ensure that a record is processed only once. (There are multiple threads across multiple servers fetching and executing jobs from the DB, and we need to be careful to ensure a job is not processed by multiple threads. There could be valid job failures which need to be retried, but the successful ones should not be).
The first step is to persist the state of the job in the DB -
SUCCESS. We talked
about the retry duration, and for jobs stuck in
PROCESSING status - how to distinguish between dead jobs
(system reboot or dirty shutdown for instance) and valid long-running jobs that run for hours/days together.
The solution involved the executor threads which send a heartbeat msg that’s persisted as a
timestamp the db after
every min. If the
heartbeat timestamp is not updated for a certain duration, it means that the job is dead, and
needs to be restarted.
I needed quite a few hints to get to the solution, and the interviewer was incredibly patient and kept nudging me in the right direction. Learnt a lot about writing a job processing framework during the discussion 😄
Round 2 - Algorithms + Coding + System Design
The next round was with another Senior Engineer, who started off by asking about projects I have worked on previously.
Technical challenge you faced in a previous project
Why do you want to join Rippling?
He then asked a DP-problem:
Given a matrix filled with 0 and 1, find maximum size of the
square sub-matrix of all 1s
The solution for the question is discussed in GeeksforGeeks if you’d like to take a look. I hadn’t solved this question before but was able to figure out and code the solution with minimal hints from the interviewer.
After this, we moved on to a system design question:
Design Quora feed page
The focus was not on personalization or relevancy of the feed, but more to test my understanding of fan-out on read vs fan out on write. I had read about similar questions before and was able to answer this without much trouble.
After these rounds, I was informed that the feedback was positive and I’d be having another video call with an Engineer from the San-Francisco office.
Round-3 - Data Structures + Coding
This was a coding interview that happened over Google hangouts, and focused on data structures and optimizing them for
time and space complexity.
Given n resources (0 to n-1), implement initialize(), allocate() and release(int i)
I implemented a solution using a simple boolean array that says if a resource at index
i is allocated or not.
allocate() involves traversing the array and finding the first element that’s not allocated -
O(n) time complexity
release(int i) involves flipping the boolean value at index
O(1) time complexity
We also discussed another solution with a couple of linked lists, one to hold all
free resources and the other to
avaialble resources. Initially,
free will contain
n nodes and
allocated will be empty.
allocate() involves returning first value from the
free list, and moving it to
allocated list -
release(int i) involves traversing through
allocated the list to find the corresponding node, and move it to the
free list -
O(1) time complexity.
The interviewer shifted the focus to finding a solution whose time complexity would be
O(logn) for both
release operations. I needed lots of hints from him to suggest a Segment-tree like data structure with which the required time complexity can be achieved. I
was then asked to code the solution, which I did with a lot of mistakes (In my defence, this was my first time
implementing such a data structure :sad: ) - We ran out of time before I could correct all the mistakes and he gave
me the chance to ask a few questions (I got to know that he is Rippling’s first employee, which is pretty cool
) before ending the call. I knew that my chances of making it to the next round is slim.
As I was expecting, I did not make it through the 3rd round, and got to know about it in a couple of days. However, it was an incredible learning experience for me, and I’m glad I got a chance to interview with them. What I liked was that there was’t many leetcode style questions - I felt they were really fun, practical but challenging at the same time. Everyone I met with was smart and the kind of people I could’ve learnt from, had I got the opportunity to work with them. Sadly, it wasn’t meant to be 😄