The Fabulous Linked List
3 years ago | YouTube
The second time I interviewed at Google I was asked to write a linked list from scratch. I was expecting something a little more “difficult” and thought I would breeze through the question. I had been studying for months for this interview, after all, so this should be easy… right?
It didn’t take long before I completely locked up. The logic for inserting and removing was wild… and then I was asked to reverse the linked list, another ridiculous and annoying question.
And yet I couldn’t do it on the first try.
I failed that interview, which was humiliating. I had 15 years of experience and I couldn’t reverse a linked list?
Know Your Basics
I know I’m not the only one to get blindsided by a basic question like this. Turns out, this is a tactic used by a lot of interviewers when interviewing senior people: ask a basic question and see how they handle it. A friend of mine does this kind of thing routinely for a larger tech company. Their thinking is straightforward: if you get grumpy when asked to do something simple or “beneath you”, you might not be the best candidate.
I can see the logic in that.
That’s what today’s video is all about: doing the very basics with a Linked List. Hope you enjoy! If you want to play along, here is some code to get you started:
//This is the simplest possible linked list
class Node{
constructor(val){
this.value = val;
this.next = null;
}
append(val){
this.next = new Node(val);
return this.next;
}
}
There's More...
👹 The Wrath of the Junior Developer
There are a lot of opinions about AI, whether it helps or hinders our coding process and our team in general. Many are concerned that junior devs will be the ones impacted the most.
Following Your Imagination
I learned to play ice hockey when I was 11 and, as a kid from Southern California, it wasn't easy. I learned how to skate and how to play the game at the same time, all while going through a massive growth spurt. My sister once called me a "baby giraffe on a frozen lake". Nice.
It wasn't what you said, but how you said it
I make videos for a living and I swear: each one is an adventure. You would think I would have a system down by now but, as it turns out, each video is a unique thing that demands it's own type of story telling.