EPAM Systems interview question

Simple linkedlist task