We have two options for serving ads within Newsfeed: 1 - out of every 25 stories, one will be an ad 2 - every story has a 4% chance of being an ad For each option, what is the expected number of ads shown in 100 news stories? If we go with option 2, what is the chance a user will be shown only a single ad in 100 stories? What about no ads at all?
Data Interview Questions
132,699 data interview questions shared by candidates
Consider a game with 2 players, A and B. Player A has 8 stones, player B has 6. Game proceeds as follows. First, A rolls a fair 6-sided die, and the number on the die determines how many stones A takes over from B. Next, B rolls the same die, and the exact same thing happens in reverse. This concludes the round. Whoever has more stones at the end of the round wins and the game is over. If players end up with equal # of stones at the end of the round, it is a tie and another round ensues. What is the probability that B wins in 1, 2, ..., n rounds?
Find the second largest element in a Binary Search Tree
Given two tables Friend_request (requester_id, sent_to_id, time) Request_accepted (acceptor_id, requestor_id, time) Find the overall acceptance rate of requests.
Write a sql query to find out the overall friend acceptance rate for a given date? Table :- User_id_who_sent|User_id_to_whom|date|Action (Sent, accepted, rejected etc)
Given the following tables how would you know who has the most friends REQUESTS date | sender_id | accepter_id ACCEPTED accepted_at | accepter_id | sender_id
""" # Question 2: # Fill in the blanks # # Given an array containing None values fill in the None values # with most recent non None value in the array # # For example: # - input array: [1,None,2,3,None,None,5,None] # # - output array: [1,1,2,3,3,3,5,5] #
1) Provided a table with user_id and dates they visited platform, find the top 100 users with the longest continuous streak of visiting the platform as of yesterday. 2) Provided a table with page_id, event timestamp and a flag for a state (which is on/off), find the number of pages that are currently on.
There is a table that tracks every time a user turns a feature on or off, with columns user_id, action ("on" or "off), date, and time. How many users turned the feature on today? How many users have ever turned the feature on? In a table that tracks the status of every user every day, how would you add today's data to it?
given a list of tuples of movie watched times, find how many unique minutes of the movie did the viewer watch e.g. [(0,15),(10,25)]. The viewer watched 25 minutes of the movie.
Viewing 11 - 20 interview questions