We're going to practice writing live code with linked lists!
Linked lists are an important data structure. Some of the data structures you use every day are built out of linked lists, for example stacks and queues. Having said that, you will never create a linked list from scratch in real life, except in job interviews.
Here's what we're going to cover:
- quick review of the linked list data structure
- how linked lists are done differently in job interviews
- working with the
Node
class - iterating through linked lists
- more topics will appear here for future workshops!
This repo is divided into sections so that you can build up your linked list coding skills gradually. Each section focuses on a different skill in linked list coding, like how to represent a linked list with a simple Node
class, or how to iterate through a linked list.
In each section there is a README with some introductory information that (I hope) is useful. You'll also see at least one example of an algorithm that uses the skill we're focusing on in that section.
The rest of the files in each section are challenges for you to do!
You should do these challenges with a partner, taking turns playing the role of an interviewer and interviewee. The more you make this like a true live coding interview, the better. If you are playing the interviewer, you can give hints but don't solve the problem for the other person. If you are the interviewee, you can Google things, but don't Google the answer to the challenge.
I can't emphasize enough that the most valuable interview skills you can have are:
- Never giving up
- Always describing what you are thinking
- Making the most of the hints and suggestions you're given
- Going through code line by line and explaining how it works
Most non-horrible interviewers are going to be judging you mostly on these skills, and you can always demonstrate these skills whether you solve the problem or not.
When it is the right time to look at the suggested solution to a challenge, you can find it in the xx-answers
branch of this repo.