"let str = 'this is a test of programs';
let obj={};
for (let s of str )
obj[s]?(obj[s]=obj[s]+1):(obj[s]=1)
console.log(JSON.stringify(obj))"
Anonymous Emu - "let str = 'this is a test of programs';
let obj={};
for (let s of str )
obj[s]?(obj[s]=obj[s]+1):(obj[s]=1)
console.log(JSON.stringify(obj))"See full answer
Software Engineer
Data Structures & Algorithms
+2 more
🧠 Want an expert answer to a question? Saving questions lets us know what content to make next.
"class Solution:
def missingNumber(self, nums: list[int]) -> int:
Sorting approach
n = len(nums)
s = n*(n+1)//2
r = s - sum(nums)
return self.r
l = [3,0,1]
print(missingNumber(l))"
Rohit B. - "class Solution:
def missingNumber(self, nums: list[int]) -> int:
Sorting approach
n = len(nums)
s = n*(n+1)//2
r = s - sum(nums)
return self.r
l = [3,0,1]
print(missingNumber(l))"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
"We are asked to calculate Sum(over value) for time in (t - window_size, t) where key in (key criteria).
To develop a function to set this up.
Let w be the window size. I would have an observer of some kind note the key-value, and for the first w windows just add the value to a temporary variable in memory if the key meets the key criteria. Then it would delete the oldest value and add the new value if the new key meets the criteria. At each step after "w", we would take the sum / w and store"
Prashanth A. - "We are asked to calculate Sum(over value) for time in (t - window_size, t) where key in (key criteria).
To develop a function to set this up.
Let w be the window size. I would have an observer of some kind note the key-value, and for the first w windows just add the value to a temporary variable in memory if the key meets the key criteria. Then it would delete the oldest value and add the new value if the new key meets the criteria. At each step after "w", we would take the sum / w and store"See full answer
"Schema is wrong - id from product is mapped to id from transactions, id from product should point to product_id in transcations table"
Arshad P. - "Schema is wrong - id from product is mapped to id from transactions, id from product should point to product_id in transcations table"See full answer
"This is another Diagnosis problem. To answer this question, we suggest you use our framework (along with the TROPIC method) to be as thorough as possible. The framework is as follows:
Ask clarifying questions
List potential high level reasons
Gather Context (TROPIC)Time
Region
Other features / products (internal)
Platform
Industry / Competition
Cannibalization
Establish a theory of probable cause
Test theories
Propose solutions
Summarize
"
Exponent - "This is another Diagnosis problem. To answer this question, we suggest you use our framework (along with the TROPIC method) to be as thorough as possible. The framework is as follows:
Ask clarifying questions
List potential high level reasons
Gather Context (TROPIC)Time
Region
Other features / products (internal)
Platform
Industry / Competition
Cannibalization
Establish a theory of probable cause
Test theories
Propose solutions
Summarize
"See full answer
"This is a Technical question. It tests your ability to understand high level technical concepts. Even though your job won't have any coding involved, you'll still need to understand these concepts. Being able to cover all these topics with clarity communicates confidence in your interviewer.
Unfortunately, there's no formula for technical questions, but some general tips are:
Use analogies when you can
Break your solution into clear, bite-size steps
Don't be afraid to use examples to b"
Exponent - "This is a Technical question. It tests your ability to understand high level technical concepts. Even though your job won't have any coding involved, you'll still need to understand these concepts. Being able to cover all these topics with clarity communicates confidence in your interviewer.
Unfortunately, there's no formula for technical questions, but some general tips are:
Use analogies when you can
Break your solution into clear, bite-size steps
Don't be afraid to use examples to b"See full answer
"This was a fun question asked recently by Amazon. Let's get to it! This is a Design Question so let's follow the formula:
Ask Clarifying Questions
Identify user behaviors, types, and pain points
State the goal and use cases
List current solutions
Brainstorm new solutions
Evaluate and select solution
Measure success
Summarize
Ask clarifying questions
Here we want to clarify scope and make sure we are on the same page as the interview"
Exponent - "This was a fun question asked recently by Amazon. Let's get to it! This is a Design Question so let's follow the formula:
Ask Clarifying Questions
Identify user behaviors, types, and pain points
State the goal and use cases
List current solutions
Brainstorm new solutions
Evaluate and select solution
Measure success
Summarize
Ask clarifying questions
Here we want to clarify scope and make sure we are on the same page as the interview"See full answer
"This is a straightforward Expansion problem, since we're expanding to a new market. This is the formula you should use when tackling these types of interview questions:
Ask clarifying questions
Perform user analysis
Market risk analysis
State goals
Perform channel analysis
Prioritize growth channels
Strategy
Summarize
Without further ado, let's dive in!
Ask clarifying questions
It's important to ask questions in advance to create a"
Exponent - "This is a straightforward Expansion problem, since we're expanding to a new market. This is the formula you should use when tackling these types of interview questions:
Ask clarifying questions
Perform user analysis
Market risk analysis
State goals
Perform channel analysis
Prioritize growth channels
Strategy
Summarize
Without further ado, let's dive in!
Ask clarifying questions
It's important to ask questions in advance to create a"See full answer
"This is one of the core behavioral questions you should expect in any interview. For this behavioral question in particular, we like to break things down into two parts:
Listing the weakness
How you're actively trying to improve
For this solution, let's say our biggest weakness is being too detail oriented. Here's one potential way to answer this question:
> My biggest challenge is I sometimes am too detail oriented that I miss the forest from the trees. This can cause me to go down rabbit"
Exponent - "This is one of the core behavioral questions you should expect in any interview. For this behavioral question in particular, we like to break things down into two parts:
Listing the weakness
How you're actively trying to improve
For this solution, let's say our biggest weakness is being too detail oriented. Here's one potential way to answer this question:
> My biggest challenge is I sometimes am too detail oriented that I miss the forest from the trees. This can cause me to go down rabbit"See full answer