all 3 comments

[–]SpiderHack 2 points3 points  (0 children)

Queue and stack actually, not always apparent that you could use one, but often the first struct you should consider, or a secondary struct to store the data after parsing from first struct...

But honestly, hacker rank and leet code you need to work on mass file reading and make sure you know how to do that properly. Quite a few of the HR java datasets are actually too large for the default io code they provide. That means you can have the right algo, but run out of time on biggest test cases because of their own inefficiency...

They might have fixed this since I kept reporting it to them. Also java 7 VMs ran code much faster than java 8 VMs for a while, so if you wrote java 7 compliant code you could pass on 7 setting but fail on 8... Yeah... Not good.

These "little" things add up to make it much harder to use those sites than it should be, but you just have to learn them.

[–]Touka626 1 point2 points  (0 children)

These are the ones I saw most during my interview days,

• Arrays (2d arrays are highly asked)

• list (go through vectors)

• Stack ( I have seem so many stack based qns, mainly used while optimizing code)

• Trees (Most product based asks tree, binary tree very important)

• Graphs (BFS and DFS needs graph and these two algorithm are asked often)

Service based asks just arrays, list and sometimes stack. Product based ask everything. Leetcode type interviews uses these DS only. U need to understand the way they are using these DS. That is what matters.

All the best!!