#504 Implementing a Queue Using a Linked List

Companies:
BetweenExchange
Themes:
AlgorithmsPractice

Implement the CustomLinkedList class so that it works as a queue (FIFO - First In, First Out), together with the push() and pop() methods:

public class CustomLinkedList<T> {

    // Push - add a new element
    public void push(T data) {
        ...
    }

    // Pop - removes and returns an element from the queue
    public T pop() {
        ...
    }
}

class Node<T> {
    ...
}

Question review

Mentor
Answer as you would in a real interview. I’ll ask follow-up questions, then compare your answer with the reference answer and show your accuracy as a %.
Sign in to start the dialogue The mentor keeps the context of the current question and your previous messages.
Sign in