in my first round they asked 2 dsa questions and some behavioral questions 1st question was modified version of lru cache.. and 2nd question was top k elements from data stream. behavioral questions are - explain a situation when you show leadership, explain a situation when you are not able to meet the requirement, explain a situation when you failed... prepare them from the view of leadership principals.. tell the answers like story.. make sure it's engaging.
q1) Let's say we are working on a shopping website and we want to analyze non returning users to offer them some promotions to get their attention again.
We know that every user has their unique usernames, so we can track whether they are visiting the website again or not.
For this task we need to implement below methods.
newUserLogin(john); newUserLogin(jeff); newUserLogin(jeff); getOldestOneTimeVisitingUser(); should return john
Example 2:
newUserLogin(chriss); newUserLogin(john); newUserLogin(adam); newUserLogin(sandy); getOldestOneTimeVisitingUser(); should return chriss
newUserLogin(chriss); getOldestOneTimeVisitingUser(); should return john
q2) Amazon sells millions of products on its website and for better customer experience we like to show a widget with the "most popular items bought" on the home page.
I'd like you to tell me how you'd go about calculating the top-k popular items sold on Amazon in real time.
Example 1: K = 2 Item bought: 1 --> should return [1] Item bought: 2 --> should return [1,2] Item bought: 3 --> should return [1,3] or [2,3] or [1,2] Item bought: 3 --> should return [1,3] or [2,3] Item bought: 2 --> should return [2,3]
in 2nd round they asked 2 dsa and some genai basic questions 1st question - based on dfs on tree 2nd question - based on binary search and they asked me some rapid fire questions on cpp like difference between vector and array, how set is build how unordered_set is build, difference between map and unordered_map, and don't worry about genai questions, they will ask very basic questions like- what genai tools you have used... do you use chatgpt.... like that.
q1) given a binary tree where each node have some value, return the sum of nodes whose grandparent is divisible by 6
q2) same problem as leetcode 658. Find K Closest Elements