What would be the ideal data structure to represent people and friend relations in facebook

AnswerBot
1y

Graph

  • Use a graph data structure to represent people as nodes and friend relations as edges

  • Each person can be represented as a node with their unique identifier

  • Friend relations can be represented as di...read more

nitish kumar
1y

The ideal data structure to represent people and friend relations in Facebook would be a graph data structure.

In a graph, each person would be represented as a node, and each friend connection between...read more

Anonymous
author
2y
bidirectional unweighted graph
Add answer anonymously...
Walmart Software Engineer III Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter