ByteDance software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.
No verified questions yet for ByteDance.
def find_relevant_connections(connections: Dict[str, List[str]], user: str) -> List[str]:connections: a dictionary where keys are user IDs and values are lists of user IDs representing friendships.user: a string representing the target user's ID.connections = {'a': ['b', 'c'], 'b': ['d'], 'c': ['e'], 'd': [], 'e': []} and user = 'a'['b', 'c', 'd', 'e']connections = {'x': ['y'], 'y': ['z'], 'z': []} and user = 'x'['y', 'z']1 <= len(connections) <= 10^4def generate_trending_feed(interactions: List[str], n: int) -> List[str]:interactions: a List of strings representing the IDs of content interacted with by a user.n: an integer representing the number of trending content items to return.List of strings containing the IDs of the trending content items.Example 1:interactions = ['a', 'b', 'a', 'c', 'b', 'a']['a', 'b', 'c']interactions = ['x', 'y', 'y', 'x', 'x', 'z', 'y']['x', 'y', 'z']1 <= len(interactions) <= 10^41 <= n <= 100interactions[i] is a string with length 1 to 100.Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free