"
Compare alternate houses i.e for each house starting from the third, calculate the maximum money that can be stolen up to that house by choosing between:
Skipping the current house and taking the maximum money stolen up to the previous house.
Robbing the current house and adding its value to the maximum money stolen up to the house two steps back.
package main
import (
"fmt"
)
// rob function calculates the maximum money a robber can steal
func maxRob(nums []int) int {
ln"
VContaineers - "
Compare alternate houses i.e for each house starting from the third, calculate the maximum money that can be stolen up to that house by choosing between:
Skipping the current house and taking the maximum money stolen up to the previous house.
Robbing the current house and adding its value to the maximum money stolen up to the house two steps back.
package main
import (
"fmt"
)
// rob function calculates the maximum money a robber can steal
func maxRob(nums []int) int {
ln"See full answer
"I tried solving this problem and here is the recorded video for the answer.
https://www.youtube.com/watch?v=d1tOkeQjyI4
And here is the link to Excalidraw board - https://excalidraw.com/#json=uabNFHcZm5qNh8CInMvyh,Wn9Vf1ZhGdl_iBCQYFkYdw"
Rjj - "I tried solving this problem and here is the recorded video for the answer.
https://www.youtube.com/watch?v=d1tOkeQjyI4
And here is the link to Excalidraw board - https://excalidraw.com/#json=uabNFHcZm5qNh8CInMvyh,Wn9Vf1ZhGdl_iBCQYFkYdw"See full answer
"Functional Requirement
Ingest Book Reviews in real time
User in the website needs specify title tho search books, return response is the list of reviews on the books.
Non Functional Requirement:
User get real-time book reviews>
It nees to handle the search among 1 million of active users daily"
Simon O. - "Functional Requirement
Ingest Book Reviews in real time
User in the website needs specify title tho search books, return response is the list of reviews on the books.
Non Functional Requirement:
User get real-time book reviews>
It nees to handle the search among 1 million of active users daily"See full answer
"S – Situation:
In a university project, my team was building a collaborative code editor. As part of the functionality, we needed a login system so users could securely access their sessions and collaborate in real time.
T – Task:
I was responsible for implementing the authentication system. Initially, I planned to build the entire login system from scratch, including user management, password storage, and session handling. But as the deadline approached, I realized that implementing thi"
Hamzeh H. - "S – Situation:
In a university project, my team was building a collaborative code editor. As part of the functionality, we needed a login system so users could securely access their sessions and collaborate in real time.
T – Task:
I was responsible for implementing the authentication system. Initially, I planned to build the entire login system from scratch, including user management, password storage, and session handling. But as the deadline approached, I realized that implementing thi"See full answer
"
At low level:
I would use two stacks: one for forward history and other for backward history.
i go to tryexponent.com => this url will be stored in backward history stack.
i go to google => again this url will be stored in backward history stack.
i press back => data from backward history will be popped and put in to forward history stack.
I press forward => data from forward history stack will be popped and put in to backward history tab.
Also, whenever i go to any url,"
Anubhav S. - "
At low level:
I would use two stacks: one for forward history and other for backward history.
i go to tryexponent.com => this url will be stored in backward history stack.
i go to google => again this url will be stored in backward history stack.
i press back => data from backward history will be popped and put in to forward history stack.
I press forward => data from forward history stack will be popped and put in to backward history tab.
Also, whenever i go to any url,"See full answer
Software Engineer
System Design
+1 more
🧠 Want an expert answer to a question? Saving questions lets us know what content to make next.
"I generally struggle with stakeholders and partners who doesn't communicate enough. Now it could be either they don't invest sufficient time and energy in doing so or at times they lack the skill sets to do so. In both the cases, the entire responsibility fell on the other person to dig deep into why someone is doing the way they are doing, reading into patterns and behaviour of their personality and adapting to those communication styles"
Lati K. - "I generally struggle with stakeholders and partners who doesn't communicate enough. Now it could be either they don't invest sufficient time and energy in doing so or at times they lack the skill sets to do so. In both the cases, the entire responsibility fell on the other person to dig deep into why someone is doing the way they are doing, reading into patterns and behaviour of their personality and adapting to those communication styles"See full answer
"I follow a variation of the RICE framework when prioritizing how I ship product features. I start by looking at:
Reach: Because the customer segmentation across our product portfolio is so similar, I tend to hold a lot of weight on product features that will maximize our customer reach with a minimal LOE.
Impact: After establishing which customer segments will benefit from the product feature, I determine the urgency and estimated impact on each customer segment based on customer i"
Ashley C. - "I follow a variation of the RICE framework when prioritizing how I ship product features. I start by looking at:
Reach: Because the customer segmentation across our product portfolio is so similar, I tend to hold a lot of weight on product features that will maximize our customer reach with a minimal LOE.
Impact: After establishing which customer segments will benefit from the product feature, I determine the urgency and estimated impact on each customer segment based on customer i"See full answer
"Since there is a need for the data to be accurate and consistent without any latency to allocate a spot, can't the data be synchronously synced to replicas after every write as the number of writes are not many per min, instead of read lock phenomena
Let me know if i am on a wrong thought here."
Chitapuram N. - "Since there is a need for the data to be accurate and consistent without any latency to allocate a spot, can't the data be synchronously synced to replicas after every write as the number of writes are not many per min, instead of read lock phenomena
Let me know if i am on a wrong thought here."See full answer
"#simple solution
1.firstly find the node in the bst (O(logn) time complexity it take)
2.now removing the node consists of 3 cases:
1.if the node is leaf (no children):
(keep track of parent and do)
parent.left or parent.right=NULL
simply remove the node ()
2.if(has one child) replace the node with its child
3.if has both childs
we replace the node with either inorder predesor(max of left tree)or inorder succesor and remove
the node wh"
Sambangi C. - "#simple solution
1.firstly find the node in the bst (O(logn) time complexity it take)
2.now removing the node consists of 3 cases:
1.if the node is leaf (no children):
(keep track of parent and do)
parent.left or parent.right=NULL
simply remove the node ()
2.if(has one child) replace the node with its child
3.if has both childs
we replace the node with either inorder predesor(max of left tree)or inorder succesor and remove
the node wh"See full answer
"The addition of an intermediate "sanitization" ML is something Neeraj used in the Uber Eats design and again seems kind of outside the scope here and redundant. This can simply be built into the AI response model to save a step. It's not clear what benefit this step provides, and he basically said we should have it "just because it would be good" and there's no concrete reasoning why to include it.
Adding a Kafka queue to handle the thumbs-down ratings? For what purpose do you need a queue othe"
Robert H. - "The addition of an intermediate "sanitization" ML is something Neeraj used in the Uber Eats design and again seems kind of outside the scope here and redundant. This can simply be built into the AI response model to save a step. It's not clear what benefit this step provides, and he basically said we should have it "just because it would be good" and there's no concrete reasoning why to include it.
Adding a Kafka queue to handle the thumbs-down ratings? For what purpose do you need a queue othe"See full answer
"Implemented a recursive function which returns the length of the list so far. when the returned value equals k + 1 , assign current.next = current.next.next. If I made it back to the head return root.next as the new head of the linked list."
דניאל ר. - "Implemented a recursive function which returns the length of the list so far. when the returned value equals k + 1 , assign current.next = current.next.next. If I made it back to the head return root.next as the new head of the linked list."See full answer
"We can use dictionary to store cache items so that our read / write operations will be O(1).
Each time we read or update an existing record, we have to ensure the item is moved to the back of the cache. This will allow us to evict the first item in the cache whenever the cache is full and we need to add new records also making our eviction O(1)
Instead of normal dictionary, we will use ordered dictionary to store cache items. This will allow us to efficiently move items to back of the cache a"
Alfred O. - "We can use dictionary to store cache items so that our read / write operations will be O(1).
Each time we read or update an existing record, we have to ensure the item is moved to the back of the cache. This will allow us to evict the first item in the cache whenever the cache is full and we need to add new records also making our eviction O(1)
Instead of normal dictionary, we will use ordered dictionary to store cache items. This will allow us to efficiently move items to back of the cache a"See full answer
"I would like to speak loud to narrow the scope of this question so I can be effective in identifying a solution to the problem on hand. Hope that is OK.
You mentioned, “Re-design the airport experience”. Is there a goal for this re-design exercise? Some top goals that come to my mind are the following. Please guide me so I can set it and we can proceed from there.
“Increase the number of passengers who travel to and from this airport”
“Improve customer satisfaction”
**“Get in"
Tara J. - "I would like to speak loud to narrow the scope of this question so I can be effective in identifying a solution to the problem on hand. Hope that is OK.
You mentioned, “Re-design the airport experience”. Is there a goal for this re-design exercise? Some top goals that come to my mind are the following. Please guide me so I can set it and we can proceed from there.
“Increase the number of passengers who travel to and from this airport”
“Improve customer satisfaction”
**“Get in"See full answer