Frontend Interview Preparation Day 2 - Linked List
Tags: webdev, javascript, career, beginners
Published: 2024-06-22 13:13:13

Hi there :pray:, today is June 22, 2024. So, I woke up at 7 AM :alarm_clock: today, did some morning walk, yoga for 30 mins. Went to temple & then started the routine.

## Today's Plan - :100:

- **June 22 (Sat)**: Study linked lists, practice easy problems. (4 hours)

Watch the videos for linked list from Udemy Course.
[Master the Coding Interview: Data Structures + Algorithms
](https://www.udemy.com/share/1013ja3@8z3jnE8L7842ZCmS_vaEAdTJmJKxuxPyDvHeXHPejNI9tEGIqTlqmNy897xhr198/)

**:white_check_mark: What is linked list?** :chains:
- A linked list is a linear data structure that stores a collection of data elements dynamically.
- Nodes represent those data elements, and links or pointers connect each node.
- Each node consists of two fields, the information stored in a linked list and a pointer that stores the address of its next node.
- The last node contains null in its second field because it will point to no node.
- A linked list can grow and shrink its size, as per the requirement.
- It does not waste memory space.

**:white_check_mark: The linked list mainly has three types, they are:**

1. Singly Linked List
2. Doubly Linked List
3. Circular Linked List

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/96k8ubgn4t9ylwa24xtd.png)


**:white_check_mark: Essential Operation on Linked Lists** :traffic_light:

1. Traversing: To traverse all nodes one by one.
2. Insertion: To insert new nodes at specific positions.
3. Deletion: To delete nodes from specific positions.
4. Searching: To search for an element from the linked list.

**:white_check_mark: Application of a Linked List**

- A linked list is used to implement stacks and queues.
- A linked list also helps to implement an adjacency matrix graph.
- It is used for the dynamic memory location.
- The linked list makes it easy to deal with the addition and multiplication of polynomial operations.
- Implementing a hash table, each bucket of the hash table itself behaves as a linked list.
- It is used in a functionality known as undo in Photoshop and Word.
- With that, you have reached the end of this tutorial on Linked Lists.

**:white_check_mark: Some leet code question which I solved today** :man_technologist:

1. [linked-list-cycle](https://leetcode.com/problems/linked-list-cycle/description/)
2. [Merge Two Sorted Lists](https://leetcode.com/problems/merge-two-sorted-lists/description/)
3. [Remove Duplicates from Sorted List](https://leetcode.com/problems/remove-duplicates-from-sorted-list/description/)
4. [Intersection of Two Linked Lists](https://leetcode.com/problems/intersection-of-two-linked-lists/description/)

All the above leet code questions are solved from my end, I hope you will also try the same. If you can't solve it no problem. Learn it and try again. Never give up.

> Always remember, your career is a marathon, not a sprint.

**:white_check_mark: Checkout some of my post**

[Frontend Interview Preparation](https://dev.to/nishantsinghchandel/frontend-interview-preparation-cl)

[MAANG Interview Preparation Day 1 - The Plan](https://dev.to/nishantsinghchandel/maang-interview-preparation-day-1-the-plan-3i61)