Sde Interview Experiences
Sde Interview Experiences
1. Nutanix
Role: MTS 2
Team: Distributed systems
Round 1:
2 dsa medium questions
Q1: Find the k most frequent elements in a given array
Eg: [1,1,1,2,2,3] k = 2. ans = [1,2]
What went well?
-> Was able to give both nlogn and nlogk approach using min heap
What went wrong?
-> Made error while adding the element in heap {a,b} instead of {b,a}.
Took some time to debug this but interviewer pointed out in a haste.
Q2: Given an array of heights, find the cut height such that the total area above and
below cut is equal.
Ex : [3,4,5]
If i make a cut at h = 2,
we have the total area above = 6
total area below = 6
Think of it as a bar graph and you make a horizontal cut across the bar graph;
Ex: [1,1,1]
If i make a cut at h = .5
we have total area above = 1.5
total area below = 1.5
What didn't go well?
-> I assumed the answer would be an integer and went with a best effort
solution for this. Interviewer pointed out it will be a decimal with the second example (only
then i could come up with bsearch).
-> I did not pay heed to double comparison in cpp. used == and made a
fool of myself.
What went well ->
-> Was able to write the code for it. But only after interviewer hints (sed life)
Observations:
1. Interviewer was focussed on micro optimisations. First question where k>size of
array i needed to return the unique elements all together w/o going to min heap.
2. Interviewer was hasty and would provide me hints very quickly. This means i need to
be faster at thinking the solutions and writing it down on the very first go
3. Need to pay attention to things like double conversions and comparisons. I knew
those and it totally slipped my mind during the interview.
4. Double comparison:
#include <cmath>
#include <iostream>
using namespace std;
int main()
{
Overall: would rate myself 3/5 given the massive hint I needed for the second problem and
the double comparison mishap.
First I was grilled on my resume. Interviewer asked me about a significant impactful work
done.
Post that he started with an ice breaker question. Why do you need distributed systems?
-> Explain this using a single instance sql server example. Expanded on scalability, reliability
and availability. Post that discussed replication. techniques suitable for read heavy and write
heavy workloads.
Then he moved to hackerrank and asked for a preferred language. I told cpp.
Then the interviewer asked me to design a task scheduler and I instantly switched to golang.
Started off with assumptions here regarding the LLD bit (Made a mistake here. Interviewer
wanted a mix of both. I was keen on impl bits, clarified this later).
Verdict: Selected.