"Race Condition i,e multiple threads modifying simultaneously can lead to data inconsistency
Operations like putIfAbsent() or computeIfAbsent() are not atomoic i.e duplicate entries or missing updates when multiple threads perform operations
Data Corruption : during resizing of a hashmap by a thread, if another thread is accessing the same data , buckets can get corrupted, leading to a loss of data"
Sue G. - "Race Condition i,e multiple threads modifying simultaneously can lead to data inconsistency
Operations like putIfAbsent() or computeIfAbsent() are not atomoic i.e duplicate entries or missing updates when multiple threads perform operations
Data Corruption : during resizing of a hashmap by a thread, if another thread is accessing the same data , buckets can get corrupted, leading to a loss of data"See full answer
"This is another Fermi problem — an estimation or approximation problem with limited information and back-of-the-envelope calculations. There's no right answer: interviewers want to understand how you think and how well you can explain your reasoning, rather than what you already know.
Recall the formula for Fermi problems:
Ask clarifying questions
Catalog what you know
Make equation(s)
Think about edge cases to add to equation
**Breakdown components of your"
Exponent - "This is another Fermi problem — an estimation or approximation problem with limited information and back-of-the-envelope calculations. There's no right answer: interviewers want to understand how you think and how well you can explain your reasoning, rather than what you already know.
Recall the formula for Fermi problems:
Ask clarifying questions
Catalog what you know
Make equation(s)
Think about edge cases to add to equation
**Breakdown components of your"See full answer
"This is a Design a Product question. For this, we'll want to follow the formula for success:
Ask clarifying questions
Identify user types, behaviors, and pain points
State the goal and use cases
List current solutions
Improvements / net new solutions
Evaluate and select solutions
Measure Success
Summarize
Ask clarifying questions
It's important to get clarity on anything unclear. Asking questions also helps us limit scope early on s"
Exponent - "This is a Design a Product question. For this, we'll want to follow the formula for success:
Ask clarifying questions
Identify user types, behaviors, and pain points
State the goal and use cases
List current solutions
Improvements / net new solutions
Evaluate and select solutions
Measure Success
Summarize
Ask clarifying questions
It's important to get clarity on anything unclear. Asking questions also helps us limit scope early on s"See full answer
"Java language
public static int[] FirstLastOccurence(int[] arr, int target){
int[] ans = new int[2];
ans[0] = -1 // if value not present
ans[1] = -1 // if value not present
for(int i =0;i=0;i--){
if(arr[i] == target){
ans[1] = i;
break;
}
return ans;
}"
Shashwat A. - "Java language
public static int[] FirstLastOccurence(int[] arr, int target){
int[] ans = new int[2];
ans[0] = -1 // if value not present
ans[1] = -1 // if value not present
for(int i =0;i=0;i--){
if(arr[i] == target){
ans[1] = i;
break;
}
return ans;
}"See full answer
"function findMinMax(array){
array.sort((a,b) => a - b);
let min = array[0];
let max = array.slice(-1);
return [min,max];
}
`"
Adam S. - "function findMinMax(array){
array.sort((a,b) => a - b);
let min = array[0];
let max = array.slice(-1);
return [min,max];
}
`"See full answer