Rozmowa o odwróceniu listy jednokierunkowej i nieskończony stos
Post z LinkedIna: pytanie rekrutera o odwrócenie listy, a kandydat odpowiada żartem, że wsadzi elementy na stos. Gdy lista jest nieskończona, stos też jest, bo bierze się go z tego samego miejsca.
Tekst z mema
At one of my first interviews I was asked to reverse a singly linked list. Interviewer: "How would you reverse a singly linked list" Me: "Would stick the items into a stack, and pop them out and link them again" Interviewer: "But the linked list can be infinite" Me: "Would stick the items into an infinite stack" Interviewer: "Where would you find the infinite stack?" Me: "Exactly at the same place where you found the infinite linked list"
Po polsku
Na jednej z pierwszych rozmów kazano mi odwrócić listę jednokierunkową. Rekruter: „Jak odwróciłbyś listę jednokierunkową” Ja: „Wrzuciłbym elementy na stos, zdjął je i połączył ponownie” Rekruter: „Ale lista może być nieskończona” Ja: „Wrzuciłbym elementy na nieskończony stos” Rekruter: „Gdzie znajdziesz nieskończony stos?” Ja: „Dokładnie tam, gdzie znalazłeś nieskończoną listę”
Źródło
Autor: u/GamesMint, serwis Reddit, opublikowano 26 listopada 2021.
Obrazek wyświetlamy prosto z serwisu Reddit (r/ProgrammerHumor), bez kopiowania.
Jesteś autorem i chcesz, żeby to zniknęło? Zgłoś, usuniemy.
Dodano 17 listopada 2026, tematy: rozmowa kwalifikacyjna, listy, algorytmy, linkedin, dział Praca.