Pergunta de entrevista da empresa ZS

Q: Write a program to reverse a linked list.

Resposta da entrevista

Sigiloso

1 de jul. de 2026

I explained the iterative approach using three pointers (prev, current, and next). I traversed the linked list, reversed each node's pointer, and updated the pointers until the end of the list. The solution has O(n) time complexity and O(1) extra space complexity. These are common interview questions and suitable for an interview experience form.