This Skillable lab activity requires you to implement a social network system that uses graphs to represent user connections, find mutual friends, discover connection paths between users, and recommend connections.
- Implement graph data structures using adjacency list representation
- Implement BFS traversal algorithm for finding paths
- Find mutual friends using graph intersection techniques
- Implement friend recommendation algorithm based on mutual connections
- Optimize solutions for handling large user bases efficiently
- Use Github Copilot effectively for code generation and exploration
You're building a social network system that needs to:
- Represent user connections using a graph structure (undirected graph)
- Find paths between users using graph traversal algorithms
- Identify mutual friends between users
- Recommend connections based on mutual friends and graph analysis
- Handle large user bases efficiently
src/main/java/com/jse/socialnetwork/
├── User.java # User data class
├── SocialNetwork.java # Main graph implementation
└── FriendRecommendation.java # Recommendation algorithm
src/test/java/com/jse/socialnetwork/
└── SocialNetworkTest.java # Test cases
- Use adjacency list representation for the graph
- Implement undirected graph (friendships are bidirectional)
- Support adding users and connections
- Efficient neighbor lookup
- Implement BFS traversal algorithm
- Find shortest path between two users
- Handle disconnected users (no path exists)
- Return path as list of user IDs
- Find all mutual friends between two users
- Use graph intersection techniques
- Return list of mutual friend user IDs
- Handle cases where users have no mutual friends
- Recommend friends based on mutual connections
- Consider users who are friends of friends
- Rank recommendations by number of mutual friends
- Return top N recommendations
- Efficient graph representation (adjacency list)
- Optimized BFS implementation
- Efficient mutual friend calculation
- Memory management for large networks
- Use Copilot to explore implementation options
- Generate helper methods with Copilot
- Validate and understand Copilot suggestions
- Document Copilot usage in code comments
- Implement graph structure - Create adjacency list representation
- Implement BFS traversal - Find paths between users
- Find mutual friends - Use graph intersection
- Implement recommendations - Algorithm based on mutual connections
- Use Github Copilot - Explore options and generate code
- Optimize performance - Apply optimization techniques
- Test and validate - Run tests and validate Copilot suggestions
Run the provided test cases:
mvn test- Social network framework provided
- User connection dataset
- System requirements document
- Github Copilot access
- Code examples for reference