Prepin
Log in

Determine the number of users who have made video calls to three or more other users.

Approach / Explanation

This question requires you to envision a scenario where you have a list of users along with information on whom they've made video calls to. Your objective is to determine and report the number of users who have made video calls to three or more other users. It's important to clearly understand the question and to summarize any key points before proceeding with the solution. If an interviewer asks you to find out 'how many users have video-called 3 or more other users', they are evaluating your skills in data manipulation and analysis. Keep the following in mind: It is essential to grasp the nature and structure of the data. You may need to make assumptions if the data is incomplete or if its source and structure are not defined. Familiarity with databases and query languages, especially SQL for structured relational databases, can be highly beneficial.

Suggested Answer

Initially, I would examine the data to gain a clearer understanding of its structure, source, and format. If the data comes from a structured database such as SQL, I could utilize a SQL query to extract the necessary information. Given that it is a relational database, I would expect there to be a table that records the video calls made by users. This table likely contains fields for 'caller' and 'receiver' to indicate who initiated the call and who received it. Using SQL, I would formulate the following: SELECT caller, COUNT(DISTINCT receiver) FROM videocall_logs GROUP BY caller HAVING COUNT(DISTINCT receiver) >= 3 This query will tally the distinct receivers (users) that each caller (user) has contacted and will filter the results to show only those callers who have contacted three or more different users.

Alternative Answer

When the data is presented in an unstructured format, such as a log file, I may utilize a scripting language like Python to parse and analyze it. from collections import defaultdict # Assume calls is a list of tuples (caller, receiver) representing each call calls = [("User1", "User2"), ("User1", "User3"), ...] call_dict = defaultdict(set) for call in calls: caller, receiver = call call_dict[caller].add(receiver) users_3plus_calls = [caller for caller, receivers in call_dict.items() if len(receivers) >=3 ] print('Number of Users who have called 3+ users: ', len(users_3plus_calls)) In this demonstration, we employ a defaultdict that uses sets to gather unique receivers for each user. Subsequently, we tally how many users have made calls to three or more distinct users. This example presumes that the data is formatted in a way that a Python script can easily process.

Question Details

Difficulty & Category

Medium

Companies

Meta (Facebook)

Product

For CandidatesFor RecruitersCompaniesBrowse JobsInterview QuestionsDeep ProfileSkill AssessmentOpportunity Matching
Prepin.ai

© 2026 Prepin LLC · Philadelphia, PA · All rights reserved.