I am not able to do coding tasks/challenges sent by companies. How to prepare for algorithmic questions?
Hi,
This is my fourth semester at UNI and I have already finished Data structures and Algorithms. I do feel like I understand most of the data structures.
However, I am not able to do Leetcode questions or even the coding test which lead to interviews. This has led to multiple rejections.
Last interview question That I couldn't answer - Design a data structure that gets you the last inserted element or can remove the minimum element in constant time. How difficult is it? How long will it take you to do it?
What do I do? How should I prepare? How to prepare if I have 4 months left until the next internship applications period?
EDIT - The Question was- "Say your data structure has the following data stored:
[10, 3, 1, 6, 9] (first -------> Last)
then you should be able to remove out 9 (last) or 1 (min) in constant time. Say you remove then you should be able to take 9(last) or 3 (now min) in constant time. Total time complexity has to be o(1) which includes insertions or any other adjustments. "
EDIT 2- If everyone is saying it is impossible to do in o(1) , then maybe there must have been misunderstanding the problem on my part.
Thanks everyone for you suggestions.
Thanks