Google | Question
Anonymous User
2713

Given an array of meeting blocks for each person, each person has a range of days they are unavailable,
The following is a block structure:

It was given :
class block:

int personId;
int startDay;
int endDay;

Find all the days where everyone is available. Return 0 if there are no available slots

Follow up : How would you find all the days where at least P people are available.
Second follow up : find all the periods where P people are available for atleast X consective days. - I could not complete this one because of time limit.

Q: A and B wants to reach some destination in an undirected graph using the least number of unique edges.
Find the count of unique edges.

Let's say the two paths come out to be this..
A-x-y-D
B-y-D

Output : 4

Explanation :
A-x, x-y, y-D and B-y

I am guessing doing bfs on both source A,B and set of path will work, but is there any other optimal approach to this question?

Follow Up : What if there are K sources?

Question - You are given a list of coordinates that represent the bottom left and top right coordinates of the rectangle. You have to find a line parallel to the y-axis which will divide all the rectangles into 2 equal halves.

Please suggest your approach & solutions.

Comments (19)