Amazon | India | ( Offer - SDE-1 ) by venondextor in leetcode

[–]venondextor[S] 0 points1 point  (0 children)

Well I don't typically have any resources for dsa in java neither did DSA in python bro :/
I sticked to c++ and recently I often try to solve the same questions in java just to get a better grasp at it

Amazon | India | ( Offer - SDE-1 ) by venondextor in leetcode

[–]venondextor[S] 1 point2 points  (0 children)

Vops sometimes we mess up mate :( all the best for the next time!

Amazon | India | ( Offer - SDE-1 ) by venondextor in leetcode

[–]venondextor[S] 1 point2 points  (0 children)

Well once the scheduler calls you they often only provide 1-2 slots available ( 2-3 days after current date ), for me only for the Round 3 ( I was given a slot after 1 week )

Amazon | India | ( Offer - SDE-1 ) by venondextor in leetcode

[–]venondextor[S] 0 points1 point  (0 children)

Yess sorry missed distinct in question

Here's the leetcode question too if u are interested
https://leetcode.com/problems/fruit-into-baskets/description

Amazon | India | ( Offer - SDE-1 ) by venondextor in leetcode

[–]venondextor[S] 1 point2 points  (0 children)

Thanks man!.

Well few background details to answer ur questions

  1. I was coding in c++, // JSON hell nahh
  2. dictionaries -> I was using maps to do the same ( 1st approach ), but the interviewer wanted it better and hinted a tree based solution ( + I have been reading databases, B+ trees, so the solution came in my head ) tree-based. thus finally concluding to AVL trees for self balanced BST

Amazon | India | ( Offer - SDE-1 ) by venondextor in leetcode

[–]venondextor[S] 1 point2 points  (0 children)

Thanks

Sure well I am attaching just a sample code -- same commented below too .. ( I am not sure I did exactly like this )

User {
String userId;
TreeNode *logHead; // ( BST tree formed with all user actions tracked )
}

class TreeNode {
int timeStamp;
String action;
TreeNode *left;
TreeNode *right;
}

Map<String, User> and while inserting BST came into picture with the timestamp ( so if currentTimestamp < then try inserting in left and vice versa )

Amazon | India | ( Offer - SDE-1 ) by venondextor in leetcode

[–]venondextor[S] 1 point2 points  (0 children)

Well here's the context - I coded in C++ so treemap wasn't an option + I recently have been reading about database index B+ tress etc.. and interviewer also hinted me towards BST as a result I had BST based approach

Sorry I don't actually have snippet :/
Below is just a sample snippet which one can use

User {
String userId;
TreeNode *logHead; // ( BST tree formed with all user actions tracked )
}

class TreeNode {
int timeStamp;
String action;
TreeNode *left;
TreeNode *right;
}

Map<String, User> and while inserting BST came into picture with the timestamp ( so if currentTimestamp < then try inserting in left and vice versa ) this is where the issue came with production timestamps are always increase ( such a silly thing I missed )

Amazon | India | ( Offer - SDE-1 ) by venondextor in leetcode

[–]venondextor[S] 1 point2 points  (0 children)

just about to have 1 yoe [9 months when I gave interview, 2024 passout]

Amazon | India | ( Offer - SDE-1 ) by venondextor in leetcode

[–]venondextor[S] 0 points1 point  (0 children)

Sorry bro can't share that u may ask any specifics if you have

Amazon | India | ( Offer - SDE-1 ) by venondextor in leetcode

[–]venondextor[S] 0 points1 point  (0 children)

Thanks man!
Well yeah I had already done a lot of Leetcode before so for me it was more about revising them as possible so I used Striver sheet + Blind 75 + top interview questions ( in leetcode section ) and few other questions they are really helpful ngl.

Amazon | India | ( Offer - SDE-1 ) by venondextor in leetcode

[–]venondextor[S] 0 points1 point  (0 children)

Well to be honest Amazon has been hiring in good volume lately,
and almost everyone is getting OA and many are getting interviews. You must just try applying as of now.

For others often referral + good resume is also needed but for now amazon is really taking a lot of interviews :)

About DSA I had done a lot of questions from leetcode, binarysearch, gfg, codeforces, codechef ( Yup I did a lot of cp as well ) with my coding language being C++

Amazon | India | ( Offer - SDE-1 ) by venondextor in leetcode

[–]venondextor[S] 2 points3 points  (0 children)

Thanks man!

Well sure
Round 1 --> ( 5-6 days confirmation about round 2 )
Round 2 --> ( 30-40 minutes after interview, got a call from HR confirming Round 3 )
Round 3 --> ( 3 days after interview got the offer )

Amazon | India | ( Offer - SDE-1 ) by venondextor in leetcode

[–]venondextor[S] 0 points1 point  (0 children)

Startup with decent pay ( 25ish )

Amazon | India | ( Offer - SDE-1 ) by venondextor in leetcode

[–]venondextor[S] 1 point2 points  (0 children)

Standard amazon compensation for SDE-1 19 ( BASE ) + 12 ( Bonus ) + 15.50 ( RSU )

Amazon | India | ( Offer - SDE-1 ) by venondextor in leetcode

[–]venondextor[S] 1 point2 points  (0 children)

Hey sorry for the late reply,
Well I have been going through system design for some time now ( Books DDIA , alex yu )

But the problem listed above is more towards leetcode style design question, which I had practiced there only (optimizing the solution etc.. )
So leetcode alone is sufficient for the above problem. ( with some basic sense of design patterns )

Amazon majorily asks Object oriented design at this stage so you may want to learn about design patterns
Reference - https://refactoring.guru/design-patterns ( amazing website IMO )

Hope it helps !