Maximum element problem in stack

Finding a maximum element problem in stack is one of the problem that we get to see occuring on many different technical interviews and primary reason for this occurence is due to it’s implementation as there are numerous ways one can do it. But the most apt way is to have two separate stack instances, one to maintain the list of items and the other to track the highest value in from the first stack and keep those high values in the tracker stack.