TGViewer
Coding Interview Resources Coding Interview Resources @crackingthecodinginterview · 52.1K subscribers
Post #1351 2.92K
Data Structures and Algorithms in Real Life examples

Array :
2D arrays (matrices) are mainly used in Image Processing.
RGB image uses a 3D matrix.
2D arrays are also used in Game Design like Sudoku, Chess.
The Leader Board of game or coding contest.

Stack :
Used in backtracking, check valid parenthesis in an expression.
Evaluating Infix and Postfix expressions.
Used in Recursive function calls to store function calls and their results.
Undo and Redo operations in word processors like MS-Word, and Notepad.
Browsing history of visited websites.
Call history/log in mobile phones.
Java Virtual Machine uses a stack to store immediate calculation results.

Queue:
Windows operating system uses a circular queue to switch between different applications.
Used in First Come First Serve job/CPU scheduling algorithm which follows FIFO order.
All the requests are queued for the server to respond.

Priority Queue :
A priority queue is used in priority scheduling algorithm and interrupt handling in OS.
Used in Huffman Coding in compression algorithms.

Linked List:
Previous and Next Page in Web Browser.
Songs in the music player are linked to the previous and next songs using doubly linked list.
Next and previous images in a phone gallery.
Multiple Applications running on a PC uses circular linked list.
Used for the implementation of stacks, queues, trees, and graphs.

Graph :
In Facebook, LinkedIn and other social networking sites, users are considered to be the vertices and the edge between them indicates that they are connected.
Facebook’s Graph API and Google’s Knowledge API are the best examples of grpah.
Google Maps, Yahoo Maps, Apple Maps uses graph to show the shortest path using Breadth First Search (BFS).
Used in HTML DOM and React Virtual DOM.

Tree :
Representation structure in File Explorer. (Folders and Subfolders) uses N-ary Tree.
Auto-suggestions when you google something using Trie.
Used in decision-based machine learning algorithms.
Used in Backtracking to maintain the state-space tree.
A binary tree is used in database indexing to store and retrieve data in an efficient manner.
To implement Heap data structure.

Binary Search Trees: (BST) can be used in sorting algorithms.

Dijkstra Algorithm :
This algorithm is used to find the shortest path between two vertices in a graph in such a way that the sum of weights between the edges is minimum.

Prims Algorithm :
It is a greedy algorithm to obtain a minimum spanning tree.
  • 👍 6
  • ❤ 2
More from @crackingthecodinginterview
  1. Oct 16, 2026𝗗𝗮𝘁𝗮 𝘀𝗰𝗶𝗲𝗻𝗰𝗲 𝗖𝗲𝗿𝘁𝗶𝗳𝗶𝗰𝗮𝘁𝗶𝗼𝗻 𝗪𝗶𝘁𝗵 𝗔𝗜😍 Future Ready Data Scien…
  2. Oct 16, 2026If you're working with data pipelines, these repositories are very useful: 🚀📊 ibis: A Py…
  3. Oct 13, 2026𝗧𝗢𝗣 𝗙𝗥𝗘𝗘 𝗖𝗢𝗨𝗥𝗦𝗘𝗦 𝗧𝗢 𝗕𝗢𝗢𝗦𝗧 𝗬𝗢𝗨𝗥 𝗦𝗞𝗜𝗟𝗟𝗦 𝗜𝗡 𝟮𝟬𝟮𝟲! Explor…
  4. Oct 12, 2026🚀 𝗪𝗵𝗶𝗰𝗵 𝗧𝗲𝗰𝗵 𝗦𝗸𝗶𝗹𝗹 𝗪𝗶𝗹𝗹 𝗬𝗼𝘂 𝗠𝗮𝘀𝘁𝗲𝗿 𝗶𝗻 𝟮𝟬𝟮𝟲? Want to buil…
  5. Oct 9, 2026🔥 SQL Interview Case Studies (Advanced Business Scenarios) 💯 🧠 Case Study 1: Find Repea…
  6. Oct 9, 2026🇮🇳 𝗚𝗢𝗩𝗘𝗥𝗡𝗠𝗘𝗡𝗧 𝗢𝗙 𝗜𝗡𝗗𝗜𝗔 — 𝗔𝗜𝗖𝗧𝗘 𝗜𝗡𝗧𝗘𝗥𝗡𝗦𝗛𝗜𝗣𝗦 𝟮𝟬𝟮𝟲 🚀…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →