why the graph is favourite for FAANG?

Abhishek Raj
2 min readJul 31, 2021

If you are a competative programmmer or a computer science student ,you often heard about a buzzword in tech industry “Graph”.Let’s talk about a graph .what basically graph is ?In my point of view graph is a data structure which contains the node and edges for the sake of visualizing the data.Graph has ultimate use in real life problem .Let’s talk a real life example facebook , facebook is consider as graphical network whose vertices represent the collection of people and edge represent the connectivity among the people .What does it mean? Consider a person A that has a facebook account and their friend ‘B’. Both ‘A’ and ‘B’ are nodes of graphical network of facebook.When ‘A’ sends a friend request to ‘B’ and ‘B’ accept it , then a connection develop in ‘A’ and ‘B’ is consider as edge.

Some of the best uses of graph data structure are in path optimisation algorithms such as Google map platform which are a big gaint of graph with lots of node and egde to figure fastest and shortest way to travel .There are amny more example of graph in real life .To meet these type of real life problem there is a need of graph .Most of the company wants to work in non-linear fashion .So that they want to work with those guys who have a knowlege of non-linear data structure. This is the reason that tech companies favour tougher algorithms like graph,tree and dp rather than asking simple algorithms .Some questions explicitly reference graphs in the problem statement; more common, however, are the questions that are not formulated directly as graph questions but where graphs can / should be used to reach a good solution like dictionary of word etc.Algorithms that are most comman in interview are:-

  1. BFS
  2. DFS
  3. Cycle detection of undirected graph using DFS/BFS
  4. Bipartite Graph Using DFS/BFS
  5. Cycle detection of directed graph using DFS/Kahn’s algorithms
  6. Topological sort using DFS/BFS
  7. shortest Path of Undirected graph using BFS
  8. shortest path of DAG using Stack
  9. shortest path using Dijkstra algorithms
  10. All pair of shortest path Using Floyd Warshall Algorithms.
  11. Negative cycle detection using Bellman ford Algorithms.
  12. DFS on 2d Grid
  13. BFS on 2d Grid
  14. Prims Algorithms
  15. Union find data structure
  16. Union by rank and path compression
  17. kruskal Algorithms using DSU.
  18. Bridges And Articulation point.
  19. 0/1 BFS
  20. Online Bridges
  21. Strongly connected Component Using kosaraju Algorithms
  22. LCA binary lifting

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response