Apple data scientist interviews test statistical reasoning, ML model design, SQL proficiency, A/B testing methodology, and Python-based algorithm implementation.
No verified questions yet for Apple.
app_name, date, and the count of distinct active users for each app on each date. The data is in a table named app_usage with columns user_id, app_name, and timestamp.Example 1:SELECT ... FROM app_usage app_name | date | active_users-----------|-------------|-------------Music | 2023-10-01 | 150Weather | 2023-10-01 | 120Example 2:SELECT ... FROM app_usageapp_name | date | active_users-----------|-------------|-------------Fitness | 2023-10-02 | 200Constraints:1 <= D <= 10^5 (number of rows in table)1 <= user_id, app_name <= 1000.forecast_downloads(data: List[Tuple[str, int]], months: int) -> List[float] that takes the historical download counts and forecasts future counts for the specified months.data: a list of tuples containing the date in YYYY-MM-DD format and download count.months: an integer representing the number of months to forecast.Example 1:data = [("2023-01-01", 200), ("2023-02-01", 240), ("2023-03-01", 300)], months = 3[340.0, 380.0, 420.0]data = [("2023-01-01", 150), ("2023-02-01", 100), ("2023-03-01", 50)], months = 2[0.0, 0.0]Constraints:1 <= len(data) <= 10000 <= downloads <= 10^5.group_users(transactions: List[List[int]], threshold: int) -> List[List[int]] that takes a list of user transactions and groups users by shared purchasing patterns based on a threshold of similarity.transactions: a list of user transaction lists where each inner list contains integers representing item IDs.threshold: an integer representing the minimum number of shared item IDs for users to be grouped together.Example 1:transactions = [[1, 2, 3], [2, 3], [2, 3, 4], [5, 6]][[1, 2, 3], [2, 3], [2, 3, 4]]transactions = [[1], [1, 2], [2, 3], [2], [5]][[1, 1, 2], [2, 3, 2]]Constraints:1 <= len(transactions) <= 1000 <= threshold <= 100 <= item IDs <= 10^5.Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free