You need to implement the following interface:
public interface FindMaxFreqNumber {
void add(int num); // adds a number to the sequence
void removeOldest(); // removes the oldest inserted number
int getMaxFreqNumber(); // returns (not removes) max frequent number
}