"Leetcode 347: Heap + Hashtable
Follow up question: create heap with the length of K instead of N (more time complexity but less space )"
Chen J. - "Leetcode 347: Heap + Hashtable
Follow up question: create heap with the length of K instead of N (more time complexity but less space )"See full answer
"Functional Requirement
Monitor health, metrics
Alert in case of failure/anomaly
Visualize the live health
Analyse machines on periodic basis
Non Functional
Should not exert load on machines
low latency
Highly scalable
Logs/Metrics Gathering
push - machine gather and send to system and low priority background thread along with batching
pull - heart beat check (for offline machines)
Processing
Real time streaming using Kafka/kinesis + Flink
TimeSeries database for stor"
Sourabh G. - "Functional Requirement
Monitor health, metrics
Alert in case of failure/anomaly
Visualize the live health
Analyse machines on periodic basis
Non Functional
Should not exert load on machines
low latency
Highly scalable
Logs/Metrics Gathering
push - machine gather and send to system and low priority background thread along with batching
pull - heart beat check (for offline machines)
Processing
Real time streaming using Kafka/kinesis + Flink
TimeSeries database for stor"See full answer
"CIDR (Classless Inter-Domain Routing) -- also known as supernetting -- is a method of assigning Internet Protocol (IP) addresses that improves the efficiency of address distribution and replaces the previous system based on Class A, Class B and Class C networks."
Ali H. - "CIDR (Classless Inter-Domain Routing) -- also known as supernetting -- is a method of assigning Internet Protocol (IP) addresses that improves the efficiency of address distribution and replaces the previous system based on Class A, Class B and Class C networks."See full answer
"Front Page Layout Design for Newspaper App
Header Section
Logo: Displays at the top left.
App Name: Displays alongside, so very prominent.
Search Bar: Centered with search to find articles within the application.
Navigation Menu: The links to the respective sections, World, Politics, Sports, Entertainment, and Opinion, etc
Main Content Area
Top Stories Carousel:
It is a rotating banner that displays the top 3-5 news stories with images along with their headlines.
Each story should be cl"
Midde V. - "Front Page Layout Design for Newspaper App
Header Section
Logo: Displays at the top left.
App Name: Displays alongside, so very prominent.
Search Bar: Centered with search to find articles within the application.
Navigation Menu: The links to the respective sections, World, Politics, Sports, Entertainment, and Opinion, etc
Main Content Area
Top Stories Carousel:
It is a rotating banner that displays the top 3-5 news stories with images along with their headlines.
Each story should be cl"See full answer
"def findAlibaba(countOfRooms, strategy):
#countofrooms: num rooms
#listRooms rooms to look for alibabba
possiblePlaces = []
#initialize rooms
for i in range(countOfRooms):
possiblePlaces.append(True)
for i in range(len(strategy)):
roomToCheck = strategy[i]
#Room is marked as unavailable
possiblePlaces[roomToCheck] = False
#Next day calculatins
nextDayPlaces = []
for j in range(countOfRooms):
nextDayPla"
JOBHUNTER - "def findAlibaba(countOfRooms, strategy):
#countofrooms: num rooms
#listRooms rooms to look for alibabba
possiblePlaces = []
#initialize rooms
for i in range(countOfRooms):
possiblePlaces.append(True)
for i in range(len(strategy)):
roomToCheck = strategy[i]
#Room is marked as unavailable
possiblePlaces[roomToCheck] = False
#Next day calculatins
nextDayPlaces = []
for j in range(countOfRooms):
nextDayPla"See full answer
"I gave multiple answers including polling the service every 10 sec to see customer. Or we can have the client side call which will send this data after 10 sec to us. We will store in dynamo DB and then send through pipelines to redshift DB for analytics."
Deepti K. - "I gave multiple answers including polling the service every 10 sec to see customer. Or we can have the client side call which will send this data after 10 sec to us. We will store in dynamo DB and then send through pipelines to redshift DB for analytics."See full answer
"We can start by considering the key components: waiters, tables and customers. We'll need a database to store information about waiters, tables and customers, each waiter can have a unique ID and we can track the. number of tables they are servicng. Tables can have attributes like table number, capacity, and current status. Customers can be tracked by their arrival time and party size. we can calculat ethe expected waiting time bu considering the average time a table is occupied and the number o"
Brandon C. - "We can start by considering the key components: waiters, tables and customers. We'll need a database to store information about waiters, tables and customers, each waiter can have a unique ID and we can track the. number of tables they are servicng. Tables can have attributes like table number, capacity, and current status. Customers can be tracked by their arrival time and party size. we can calculat ethe expected waiting time bu considering the average time a table is occupied and the number o"See full answer
"I broke down my answer into Understanding the goal, investigating the current state and its challenges, prioritizing opportunities, brainstorming solutions, and selecting solutions.
To understand the goal and current state, I asked questions about the onboarding funnel and the conversion percentages. They have clear metrics to share, with the specific conversion rates for each stage.
I then identified the subscription screen in the flow as one of the key opportunities, as most of the drop happ"
Jaison E. - "I broke down my answer into Understanding the goal, investigating the current state and its challenges, prioritizing opportunities, brainstorming solutions, and selecting solutions.
To understand the goal and current state, I asked questions about the onboarding funnel and the conversion percentages. They have clear metrics to share, with the specific conversion rates for each stage.
I then identified the subscription screen in the flow as one of the key opportunities, as most of the drop happ"See full answer
"Explained in STAR format one of the project situation where I had originally approved problem with different design which was correct approach that time. But as the project progressed that approach needed revision. Emphasized on facts why original approach was taken with points. Also focused tail end of discussion on learnings out of situation and how you end up deploying better solution from that learning."
Vijay P. - "Explained in STAR format one of the project situation where I had originally approved problem with different design which was correct approach that time. But as the project progressed that approach needed revision. Emphasized on facts why original approach was taken with points. Also focused tail end of discussion on learnings out of situation and how you end up deploying better solution from that learning."See full answer
"Explained in STAR format one of the project situation where I had to collect data points by deploying a minimum viable product due to unclear business requirements/dynamic nature of business. Emphasized on exact data points and how they strategically used to iteratively deploy improved version of product."
Vijay P. - "Explained in STAR format one of the project situation where I had to collect data points by deploying a minimum viable product due to unclear business requirements/dynamic nature of business. Emphasized on exact data points and how they strategically used to iteratively deploy improved version of product."See full answer
"I think we can analyse the data that's collected especially the users who are requesting it.if we find that there are set of users who regularly use this service then we may cache the data for those users to speed up processing and better the experience. The fresh data (which will be a delta on the cached data can only be calculated) and the stale data can be left out thereby updating the cache"
Nilanjan D. - "I think we can analyse the data that's collected especially the users who are requesting it.if we find that there are set of users who regularly use this service then we may cache the data for those users to speed up processing and better the experience. The fresh data (which will be a delta on the cached data can only be calculated) and the stale data can be left out thereby updating the cache"See full answer
"Clarifying Questions:
When you say Language Learning app, you're referring to a user wanting to learn a new language through a Meta property - not NLP tech correct? -- Yes
Is this a stand-alone app, or part of Facebook or another Meta app? -- You choose
Are there any restrictions like budget, or time for this learning app? -- Nope.
Give me a moment to think about how I want to structure this answer:
Mission // Goal of Language Learning App
Competition
Audience Segments
Pain Points
"
Brody C. - "Clarifying Questions:
When you say Language Learning app, you're referring to a user wanting to learn a new language through a Meta property - not NLP tech correct? -- Yes
Is this a stand-alone app, or part of Facebook or another Meta app? -- You choose
Are there any restrictions like budget, or time for this learning app? -- Nope.
Give me a moment to think about how I want to structure this answer:
Mission // Goal of Language Learning App
Competition
Audience Segments
Pain Points
"See full answer
"I first asked few clarifying questions like the return array may need not contain the list of building in the same order, to which the interviewer agreed.
Then I came up with an approach where we iterate the array from right to left and keep a max variable which will keep the value of the current max. When we find an item which is greater than max we update the max and add this element into our solution. The interviewer agreed for the approach.
I discussed few corner scenarios with the interview"
Rishabh N. - "I first asked few clarifying questions like the return array may need not contain the list of building in the same order, to which the interviewer agreed.
Then I came up with an approach where we iterate the array from right to left and keep a max variable which will keep the value of the current max. When we find an item which is greater than max we update the max and add this element into our solution. The interviewer agreed for the approach.
I discussed few corner scenarios with the interview"See full answer
"I try to solve this initially using quick select where will take a pivot element and position the remaining elements and check if the current index is answer or not and continue the same but it requires o(n*n), but interviewee is expecting the best from me, so at the end i tried solving using heaps where will check the difference between k and n-k to use min or max heap after that we will heap the array, and will keep popping the element k-1 and return the peek one which leads to answer."
Mourya C. - "I try to solve this initially using quick select where will take a pivot element and position the remaining elements and check if the current index is answer or not and continue the same but it requires o(n*n), but interviewee is expecting the best from me, so at the end i tried solving using heaps where will check the difference between k and n-k to use min or max heap after that we will heap the array, and will keep popping the element k-1 and return the peek one which leads to answer."See full answer