SO I completed 2 rounds of tech interviews for a Staff SWE role at Visa Bangalore recently
Here's how it went
Round 1 : Problem solving + system design
q1) Find the longest strictly increasing subsequence in an array.
I solved the problem with an iterative dp approach with O(n2) time complexity.
Follow up question : Can you optimise this ?
Ans ) Optimisation would be done most likely via Binary Search with a binary search on answers based approach.
I did not know how to implement binary search for this so could not code it, but mentioned the technique.
while Binary search part was correct, but it was not a binary search on answers, it was something else which I checked after the interview.
I didn't know how to do this so didn't waste much time on it and asked to move on to another question.
q2) How do you create microservices from a single monolith, what approach will you use.
I answered this question in detail mentioning the strategies I's use starting from implementing Strangler Fig pattern then diverting requests via api gateway, usage of feature flags, canary deployment. I mentioned all of these things and answered this in full detail.
q3) Once you have your microservices in place, then how do you handle transaction cases, earlier you had monolith now you have microservices, data is scattered, so how does transaction takes place ?
I talked about SAGA Pattern here.
q3) How do you design a notification system.
For this I gave an approach involving Kafka Queues, notification consumer and producers.
He wanted to know how do I make sure that the data is consistent for users which is being served via services hosted at different datacenters ?
I mentioned that we need to make sure that whatever changes that are happening at the Database at DC1 are asynchronously replicated to database at DC2, similarly our Kafka partitions should also have a replica at other datacenter. Replication is important because services are largely stateless, but there should be consistent record of all notification events across all datacenters.
He asked how do I make sure that a notification event is not consumed twice, I said for every notification event we can generate a globally unique id which we can use to figure out if this event has been seen before or not, this globally unique id can help us with idempotency
Round 2 : High Level System design round
So the interviewer asked me about my current project and asked to explain about it and show him end to end flow of one core functionality which I own.
My current project involves a Monolith at core and there are microservices which are coupled with the monolith.
So on excalidraw I drew diagram of an end-to-end functionality that I had worked on.
He asked me questions about it and then came his followup.
Now imagine you have to scale this to a level of facebook or google, I want you to redesign your current project and considering it should work at a planet scale.
This is where round went intense and he probed me a lot about handling massive write traffic, ensuring resiliency, multi data center setup, data base replication, DNS Routing.
It was an intense round.
Takeway for System Design
If there's one thing that i'd recommend then it will be to definitely read about how multi-datacenter systems are developed.
I had read about Database replication from Designing Data Intensive Applications which definitely helped me a lot for this particular round.
Other than that i'd say, if you are adding in components like Kafka or Flink, then make sure you know your basics about them and various kinds of operational complexity that they add and definitely read about how to ensure their resiliency and make them fault tolerant. These are super important things.