Add Two Numbers
Medium · Phone screen · Onsite · Full-time
Two linked lists representing numbers in reverse order, add them together and return the sum as a new list. I walked both lists simultaneously with a carry variable, creating new nodes as I went. The main edge case is when the lists have different lengths or there's a leftover carry at the end. Classic linked list problem.
