"Situation - A time I had to think “outside of the box” was while I was at Google working on hotel solutions for smart displays. Smart displays are mutli-modal meaning they accommodate both touch and voice. I was given the task of leading the effort of scaling a new third party solution on top of our existing first party design system. However, the pandemic caused an unfortunate turn of events in that the needs of guests changed drastically and now needed a much more voice forward solution for"
Ben G. - "Situation - A time I had to think “outside of the box” was while I was at Google working on hotel solutions for smart displays. Smart displays are mutli-modal meaning they accommodate both touch and voice. I was given the task of leading the effort of scaling a new third party solution on top of our existing first party design system. However, the pandemic caused an unfortunate turn of events in that the needs of guests changed drastically and now needed a much more voice forward solution for"See full answer
"Average case - lookup/insert/delete - o(1) -> assuming a low load factor and uniform hash distribution.
Worst case - o(n) -> where are keys collide in same bucket"
Kargi C. - "Average case - lookup/insert/delete - o(1) -> assuming a low load factor and uniform hash distribution.
Worst case - o(n) -> where are keys collide in same bucket"See full answer
"A few months ago I joined a micro-services platform engineering team as their manager, at that time my team was struggling to deliver towards an upcoming production deadline for a customer facing product. Production date had been moved 5 times already and there were about 40% of product features which were remaining to be tested and signed off to move to production . I was made responsible to deliver the release of this product within the deadline and turnaround the software delivery throughput."
Shuchi A. - "A few months ago I joined a micro-services platform engineering team as their manager, at that time my team was struggling to deliver towards an upcoming production deadline for a customer facing product. Production date had been moved 5 times already and there were about 40% of product features which were remaining to be tested and signed off to move to production . I was made responsible to deliver the release of this product within the deadline and turnaround the software delivery throughput."See full answer
"You are working on a SaaS product that currently uses Basic Authentication (username/password) for API and application access. The security and compliance teams have mandated moving to a more secure, modern authentication mechanism — OIDC (OpenID Connect). Design the authentication system migration from Basic Authentication to OIDC. Discuss the architecture changes, the migration approach, and the rollout strategy. What are the technical challenges, impacts on customers, backward compatibility"
Anonymous Stork - "You are working on a SaaS product that currently uses Basic Authentication (username/password) for API and application access. The security and compliance teams have mandated moving to a more secure, modern authentication mechanism — OIDC (OpenID Connect). Design the authentication system migration from Basic Authentication to OIDC. Discuss the architecture changes, the migration approach, and the rollout strategy. What are the technical challenges, impacts on customers, backward compatibility"See full answer
"public static int maxProfitGreedy(int[] stockPrices) {
int maxProfit = 0;
for(int i = 1; i todayPrice) {
maxProfit += tomorrowPrice - todayPrice;
}
}
return maxProfit;
}
"
Laksitha R. - "public static int maxProfitGreedy(int[] stockPrices) {
int maxProfit = 0;
for(int i = 1; i todayPrice) {
maxProfit += tomorrowPrice - todayPrice;
}
}
return maxProfit;
}
"See full answer
Software Engineer
Data Structures & Algorithms
+4 more
🧠 Want an expert answer to a question? Saving questions lets us know what content to make next.
"We have a list of documents.
We want to build an index that maps keywords to documents containing them.
Then, given a query keyword, we can efficiently retrieve all matching documents.
docs = [
"Python is great for data science",
"C++ is a powerful language",
"Python supports OOP and functional programming",
"Weather today is sunny",
"Weather forecast shows rain"
]"
Mridul J. - "We have a list of documents.
We want to build an index that maps keywords to documents containing them.
Then, given a query keyword, we can efficiently retrieve all matching documents.
docs = [
"Python is great for data science",
"C++ is a powerful language",
"Python supports OOP and functional programming",
"Weather today is sunny",
"Weather forecast shows rain"
]"See full answer
"\# Definition for a binary tree node.
class TreeNode:
def init(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def maxPathSum(self, root: TreeNode) -> int:
self.max_sum = float('-inf')"
Jerry O. - "\# Definition for a binary tree node.
class TreeNode:
def init(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def maxPathSum(self, root: TreeNode) -> int:
self.max_sum = float('-inf')"See full answer
"class ListNode:
def init(self, val=0, next=None):
self.val = val
self.next = next
def has_cycle(head: ListNode) -> bool:
slow, fast = head, head
while fast and fast.next:
slow = slow.next
fast = fast.next.next
if slow == fast:
return True
return False
debug your code below
node1 = ListNode(1)
node2 = ListNode(2)
node3 = ListNode(3)
node4 = ListNode(4)
creates a linked list with a cycle: 1 -> 2 -> 3 -> 4"
Anonymous Roadrunner - "class ListNode:
def init(self, val=0, next=None):
self.val = val
self.next = next
def has_cycle(head: ListNode) -> bool:
slow, fast = head, head
while fast and fast.next:
slow = slow.next
fast = fast.next.next
if slow == fast:
return True
return False
debug your code below
node1 = ListNode(1)
node2 = ListNode(2)
node3 = ListNode(3)
node4 = ListNode(4)
creates a linked list with a cycle: 1 -> 2 -> 3 -> 4"See full answer
"function findPrimes(n) {
if (n < 2) return [];
const primes = [];
for (let i=2; i <= n; i++) {
const half = Math.floor(i/2);
let isPrime = true;
for (let prime of primes) {
if (i % prime === 0) {
isPrime = false;
break;
}
}
if (isPrime) {
primes.push(i);
}
}
return primes;
}
`"
Tiago R. - "function findPrimes(n) {
if (n < 2) return [];
const primes = [];
for (let i=2; i <= n; i++) {
const half = Math.floor(i/2);
let isPrime = true;
for (let prime of primes) {
if (i % prime === 0) {
isPrime = false;
break;
}
}
if (isPrime) {
primes.push(i);
}
}
return primes;
}
`"See full answer
"Situation - A time when I worked well on a team was while I was working with the larger team at Blade to do the redesign before their IPO. Essentially, we had a month to launch a redesign (both visual and UX) of the entire project
Task - I was tasked to direct all design efforts and strategy for the mobile and web experience on blade - being a lead in the trifecta group.
Action - Through effective teamwork, we all led strategy and championed our areas of product, design and engineering. As a"
Ben G. - "Situation - A time when I worked well on a team was while I was working with the larger team at Blade to do the redesign before their IPO. Essentially, we had a month to launch a redesign (both visual and UX) of the entire project
Task - I was tasked to direct all design efforts and strategy for the mobile and web experience on blade - being a lead in the trifecta group.
Action - Through effective teamwork, we all led strategy and championed our areas of product, design and engineering. As a"See full answer
"Arrays.sort(inputarray)
sliding window with a size of 2.
Check for the sum in the sliding window.
subtract the start when window moves"
Sridhar R. - "Arrays.sort(inputarray)
sliding window with a size of 2.
Check for the sum in the sliding window.
subtract the start when window moves"See full answer
"Lyft mission.
What do we mean by engagement here? We want higher rides , not just time spent on app. What does social mean? When we create interactions between riders. Lyft line is social.
Ideas:
Idea: Can we maintain interactions between riders by letting them ride with same people again? Benefit: Increases repeat rides.
Idea: Giving riders an option to request a driver they rode with. Benefits: Increases social interaction between riders and drivers. Increases retention and # rides as"
M N. - "Lyft mission.
What do we mean by engagement here? We want higher rides , not just time spent on app. What does social mean? When we create interactions between riders. Lyft line is social.
Ideas:
Idea: Can we maintain interactions between riders by letting them ride with same people again? Benefit: Increases repeat rides.
Idea: Giving riders an option to request a driver they rode with. Benefits: Increases social interaction between riders and drivers. Increases retention and # rides as"See full answer
"This is an interesting Favorite Product question. Normally when we're asked this question we pick technology products, but this time the interviewer wanted to throw us a curveball by asking about a non-technical product. Don't worry - it still follows the same approach:
Choose a product and briefly explain what it is
Who are the users?
What are their pain points?
How did competitors solve it in the past?
**How does this product address these pain points differe"
Exponent - "This is an interesting Favorite Product question. Normally when we're asked this question we pick technology products, but this time the interviewer wanted to throw us a curveball by asking about a non-technical product. Don't worry - it still follows the same approach:
Choose a product and briefly explain what it is
Who are the users?
What are their pain points?
How did competitors solve it in the past?
**How does this product address these pain points differe"See full answer
"public static void sortBinaryArray(int[] array) {
int len = array.length;
int[] res = new int[len];
int r=len-1;
for (int value : array) {
if(value==1){
res[r]= 1;
r--;
}
}
System.out.println(Arrays.toString(res));
}
`"
Nitin P. - "public static void sortBinaryArray(int[] array) {
int len = array.length;
int[] res = new int[len];
int r=len-1;
for (int value : array) {
if(value==1){
res[r]= 1;
r--;
}
}
System.out.println(Arrays.toString(res));
}
`"See full answer
"It is very easy to shy away and not make a decision because you might feel the right information is not there to make a decision
While dealing with ambiguity it is essential to remain Calm. And Establish what it is you want to achieve by asking a lot of questions to the necessary stakeholders
Access the risk, analyze the data at hand, ask the right questions, and be very clear and concise in decision-making"
Satish murthy D. - "It is very easy to shy away and not make a decision because you might feel the right information is not there to make a decision
While dealing with ambiguity it is essential to remain Calm. And Establish what it is you want to achieve by asking a lot of questions to the necessary stakeholders
Access the risk, analyze the data at hand, ask the right questions, and be very clear and concise in decision-making"See full answer
"A much better solution than the one in the article, below:
It looks like the ones writing articles here in Javascript do not understand the time/space complexity of javascript methods.
shift, splice, sort, etc... In the solution article you have a shift and a sort being done inside a while, that is, the multiplication of Ns.
My solution, below, iterates through the list once and then sorts it, separately. It´s O(N+Log(N))
class ListNode {
constructor(val = 0, next = null) {
th"
Guilherme F. - "A much better solution than the one in the article, below:
It looks like the ones writing articles here in Javascript do not understand the time/space complexity of javascript methods.
shift, splice, sort, etc... In the solution article you have a shift and a sort being done inside a while, that is, the multiplication of Ns.
My solution, below, iterates through the list once and then sorts it, separately. It´s O(N+Log(N))
class ListNode {
constructor(val = 0, next = null) {
th"See full answer