The Hut Group Interview Question: Design a generic Linked List ... | Glassdoor

Interview Question

Software Engineer Industrial Placement Interview Manchester, England (UK)

Design a generic Linked List in Java. Follow up: given

  access only to the head of the list, return the middle element.

Interview Answer

1 Answer


My answer was to first determine the length of the list and then go half the way. They suggested another approach, the slow and fast runner pointers. Both solutions would run in O(n) though.

Interview Candidate on Dec 12, 2016

Add Answers or Comments

To comment on this, Sign In or Sign Up.