"we can use two pointer + set like maintain i,j and also insert jth character to set like while set size is equal to our window j-i+1 then maximize our answer and increase jth pointer till last index"
Kishor J. - "we can use two pointer + set like maintain i,j and also insert jth character to set like while set size is equal to our window j-i+1 then maximize our answer and increase jth pointer till last index"See full answer
"Applying the STAR method to explain a time when I had to teach myself certain skills to meet project demands.
Situation : I was working for a medical devices company that didn't have CI-CD setup for its embedded software
Task : Build the entire CI-CD pipeline from scratch using the tools available within a month
Action : I had to learn Docker and other basic DevOps technologies to build this
Result : We were able to reduce build time by 70% and create a process for package manage"
Soutrik M. - "Applying the STAR method to explain a time when I had to teach myself certain skills to meet project demands.
Situation : I was working for a medical devices company that didn't have CI-CD setup for its embedded software
Task : Build the entire CI-CD pipeline from scratch using the tools available within a month
Action : I had to learn Docker and other basic DevOps technologies to build this
Result : We were able to reduce build time by 70% and create a process for package manage"See full answer
"It would have been more interesting to focus on the system design rather than the Trie DS, Interviewee could have just mentioned the Trie and passed to things more important.
Interviewee should have focused on the factors on which he wants to scale the API servers, popularity of the query parts ? region may be ? A hash of many factors ?
Caches should have definitely be discussed, Cache eviction policies, Cache invalidation managements...
Interviewee should have mentioned which kind of API pro"
Aymen D. - "It would have been more interesting to focus on the system design rather than the Trie DS, Interviewee could have just mentioned the Trie and passed to things more important.
Interviewee should have focused on the factors on which he wants to scale the API servers, popularity of the query parts ? region may be ? A hash of many factors ?
Caches should have definitely be discussed, Cache eviction policies, Cache invalidation managements...
Interviewee should have mentioned which kind of API pro"See full answer
"While answering such a question, it is important to focus on personal growth, learning, and how the experience improved your teamwork. You want to demonstrate self-awareness, humility, and an ability to adapt.
I had this experience while working on a cross-functional project that involved collaboration between the engineering and marketing teams. In the interview, I shared a story when I misjudged someone and showed unconscious bias towards due their gender, ethnicity or age. It was embarrassin"
Malay K. - "While answering such a question, it is important to focus on personal growth, learning, and how the experience improved your teamwork. You want to demonstrate self-awareness, humility, and an ability to adapt.
I had this experience while working on a cross-functional project that involved collaboration between the engineering and marketing teams. In the interview, I shared a story when I misjudged someone and showed unconscious bias towards due their gender, ethnicity or age. It was embarrassin"See full answer
"#inplace reversal without inbuilt functions
def reverseString(s):
chars = list(s)
l, r = 0, len(s)-1
while l < r:
chars[l],chars[r] = chars[r],chars[l]
l += 1
r -= 1
reversed = "".join(chars)
return reversed
"
Anonymous Possum - "#inplace reversal without inbuilt functions
def reverseString(s):
chars = list(s)
l, r = 0, len(s)-1
while l < r:
chars[l],chars[r] = chars[r],chars[l]
l += 1
r -= 1
reversed = "".join(chars)
return reversed
"See full answer
"To answer this, I will focus my efforts on explaining the most common type of API used in most modern software development applications - the REST API. For the purpose of simplicity, I will also keep the topics of Authorization and Authentication out of the mix.
In essence, an API is a group of logic that takes in a specific set of inputs and responds with a specific set of outputs. This is analogous to going to a drive-thru and placing an order for a meal.
When you give an API a bunch of"
Pathworks P. - "To answer this, I will focus my efforts on explaining the most common type of API used in most modern software development applications - the REST API. For the purpose of simplicity, I will also keep the topics of Authorization and Authentication out of the mix.
In essence, an API is a group of logic that takes in a specific set of inputs and responds with a specific set of outputs. This is analogous to going to a drive-thru and placing an order for a meal.
When you give an API a bunch of"See full answer
"General response: Apple’s approach to delivering seamless, personalized experiences through data, while upholding a strong ethical commitment to privacy, resonates with my own values. I want to contribute to projects that optimize user engagement and create meaningful interactions on a large scale, and I believe Apple is the ideal place to make that impact.
Tailored to the team: Talk about the product, its impact internally, and the customer."
Arshia I. - "General response: Apple’s approach to delivering seamless, personalized experiences through data, while upholding a strong ethical commitment to privacy, resonates with my own values. I want to contribute to projects that optimize user engagement and create meaningful interactions on a large scale, and I believe Apple is the ideal place to make that impact.
Tailored to the team: Talk about the product, its impact internally, and the customer."See full answer
"
The Situation
A few months ago, our trading platform started experiencing significant latency issues during peak trading hours. This latency was affecting our ability to process real-time market data and execute trades efficiently, potentially leading to substantial financial losses and missed opportunities.
Identifying the Problem
The first step was to identify the root cause of the latency. I organized a team meeting with our data engineers, DevOps, and network specialists to gather"
Scott S. - "
The Situation
A few months ago, our trading platform started experiencing significant latency issues during peak trading hours. This latency was affecting our ability to process real-time market data and execute trades efficiently, potentially leading to substantial financial losses and missed opportunities.
Identifying the Problem
The first step was to identify the root cause of the latency. I organized a team meeting with our data engineers, DevOps, and network specialists to gather"See full answer
"DFS with check of an already seen node in the graph would work
from collections import deque, defaultdict
from typing import List
def iscourseloopdfs(idcourse: int, graph: defaultdict[list]) -> bool:
stack = deque([(id_course)])
seen_courses = set()
while stack:
print(stack)
curr_course = stack.pop()
if currcourse in seencourses:
return True
seencourses.add(currcourse)
for dependency in graph[curr_course]:
"
Gabriele G. - "DFS with check of an already seen node in the graph would work
from collections import deque, defaultdict
from typing import List
def iscourseloopdfs(idcourse: int, graph: defaultdict[list]) -> bool:
stack = deque([(id_course)])
seen_courses = set()
while stack:
print(stack)
curr_course = stack.pop()
if currcourse in seencourses:
return True
seencourses.add(currcourse)
for dependency in graph[curr_course]:
"See full answer
"Initialize left pointer: Set a left pointer left to 0.
Iterate through the array: Iterate through the array from left to right.
If the current element is not 0, swap it with the element at the left pointer and increment left.
Time complexity: O(n). The loop iterates through the entire array once, making it linear time.
Space complexity: O(1). The algorithm operates in-place, modifying the input array directly without using additional data structures.
"
Avon T. - "Initialize left pointer: Set a left pointer left to 0.
Iterate through the array: Iterate through the array from left to right.
If the current element is not 0, swap it with the element at the left pointer and increment left.
Time complexity: O(n). The loop iterates through the entire array once, making it linear time.
Space complexity: O(1). The algorithm operates in-place, modifying the input array directly without using additional data structures.
"See full answer
"Time taken: 25 minutes
My approach:
I would start by listing the use cases, what could be the length of cable needed, quantifying each and weight average those.
The % make the assumption that it is what it represents the share in the total nb of iphone recharges. In fact total should be more than 100% because it not exclusive but for sake of simplicity let’s say it tops at 100%.
\# In details:
charging next to bed: 50%generally speaking there is a bedside table that is 80 cm high and the"
Adaneir W. - "Time taken: 25 minutes
My approach:
I would start by listing the use cases, what could be the length of cable needed, quantifying each and weight average those.
The % make the assumption that it is what it represents the share in the total nb of iphone recharges. In fact total should be more than 100% because it not exclusive but for sake of simplicity let’s say it tops at 100%.
\# In details:
charging next to bed: 50%generally speaking there is a bedside table that is 80 cm high and the"See full answer
"Should be able to charge the airpod case when pluged into energy.
Should be able to charge when the airpod case has battery.
Should be able to alert if the airpod case is out of battery.
Should be able to sync with non-paired devices.
Should be able to sync automatically with paired devices.
Should be able to sync automatically with paired devices that are closer to the airpod.
Should be able to switch the connection to a device answering a call.
Should be able to pause during us"
Daniel M. - "Should be able to charge the airpod case when pluged into energy.
Should be able to charge when the airpod case has battery.
Should be able to alert if the airpod case is out of battery.
Should be able to sync with non-paired devices.
Should be able to sync automatically with paired devices.
Should be able to sync automatically with paired devices that are closer to the airpod.
Should be able to switch the connection to a device answering a call.
Should be able to pause during us"See full answer
"In 2019, I was given a very important problem to solve. In a team of 3 we had to build a mobility assist device. The customer segment we would go for was something we could decide. The project was very close to me as I had lost someone I loved because of cancer and I saw how reduced mobility was a huge pain point in not being able to do physical activities. My team could only think of elderly people as the main target market.
As the Head of Product what I did was:
1) I helped them dive even d"
Soumya S. - "In 2019, I was given a very important problem to solve. In a team of 3 we had to build a mobility assist device. The customer segment we would go for was something we could decide. The project was very close to me as I had lost someone I loved because of cancer and I saw how reduced mobility was a huge pain point in not being able to do physical activities. My team could only think of elderly people as the main target market.
As the Head of Product what I did was:
1) I helped them dive even d"See full answer
"In python
def find_duplicates(arr1: List[int], arr2: List[int]) -> List[int]:
result = list(set(arr1) & set(arr2))
return result
"
Sammy R. - "In python
def find_duplicates(arr1: List[int], arr2: List[int]) -> List[int]:
result = list(set(arr1) & set(arr2))
return result
"See full answer
"If 0's aren't a concern, couldn't we just
multiply all numbers.
and then divide product by each number in the list ?
if there's more than one zero, then we just return an array of 0s
if there's one zero, then we just replace 0 with product and rest 0s.
what am i missing?"
Sachin R. - "If 0's aren't a concern, couldn't we just
multiply all numbers.
and then divide product by each number in the list ?
if there's more than one zero, then we just return an array of 0s
if there's one zero, then we just replace 0 with product and rest 0s.
what am i missing?"See full answer
"First of all, stack and heap memory are abstraction on top of the hardware by the compiler. The hardware is not aware of stack and heap memory. There is only a single piece of memory that a program has access to. The compiler creates the concepts of stack and heap memory to run the programs efficiently.
Programs use stack memory to store local variables and a few important register values such as frame pointer and return address for program counter. This makes it easier for the compiler to gene"
Stanley Y. - "First of all, stack and heap memory are abstraction on top of the hardware by the compiler. The hardware is not aware of stack and heap memory. There is only a single piece of memory that a program has access to. The compiler creates the concepts of stack and heap memory to run the programs efficiently.
Programs use stack memory to store local variables and a few important register values such as frame pointer and return address for program counter. This makes it easier for the compiler to gene"See full answer