KLM Interview Question

assignment with data structure implementation