"A red-black tree is a self-balancing binary search tree. The motivation for this is that the benefits of O(logN) search, insertion, and deletion that a binary tree provides us will disappear if we let the tree get too "imbalanced" (e.g. there are too many nodes on one side of the tree or some branches have a depth that is way out of proportion to the average branch depth). This imbalance will occur if we don't adjust the tree after inserting or deleting nodes, hence our need for self-balancing c"
Alex M. - "A red-black tree is a self-balancing binary search tree. The motivation for this is that the benefits of O(logN) search, insertion, and deletion that a binary tree provides us will disappear if we let the tree get too "imbalanced" (e.g. there are too many nodes on one side of the tree or some branches have a depth that is way out of proportion to the average branch depth). This imbalance will occur if we don't adjust the tree after inserting or deleting nodes, hence our need for self-balancing c"See full answer
"bool isValidBST(TreeNode* root, long min = LONGMIN, long max = LONGMAX){
if (root == NULL)
return true;
if (root->val val >= max)
return false;
return isValidBST(root->left, min, root->val) &&
isValidBST(root->right, root->val, max);
}
`"
Alvaro R. - "bool isValidBST(TreeNode* root, long min = LONGMIN, long max = LONGMAX){
if (root == NULL)
return true;
if (root->val val >= max)
return false;
return isValidBST(root->left, min, root->val) &&
isValidBST(root->right, root->val, max);
}
`"See full answer
"Whenever I find resistance to my idea, my general approach is to :
Validate my idea
Identify if it is a political reason or is it a valid engineering tech reason
Assuming it is not political but it is resource/difference of opinions that are causing resistance.
Then I would try to do a quick POC and show a value proposition for the idea to get the buy-in.
One similar situation happened
The situation was that stakeholders were promised a feature that would decrease their number of ticket"
Jaim - "Whenever I find resistance to my idea, my general approach is to :
Validate my idea
Identify if it is a political reason or is it a valid engineering tech reason
Assuming it is not political but it is resource/difference of opinions that are causing resistance.
Then I would try to do a quick POC and show a value proposition for the idea to get the buy-in.
One similar situation happened
The situation was that stakeholders were promised a feature that would decrease their number of ticket"See full answer
"This could be done using two-pointer approach assuming array is sorted: left and right pointers. We need track two sums (left and right) as we move pointers. For moving pointers we will move left to right by 1 (increment) when right sum is greater. We will move right pointer to left by 1 (decrement) when left sum is greater. at some point we will either get the sum same and that's when we exit from the loop. 0-left will be one array and right-(n-1) will be another array.
We are not going to mo"
Bhaskar B. - "This could be done using two-pointer approach assuming array is sorted: left and right pointers. We need track two sums (left and right) as we move pointers. For moving pointers we will move left to right by 1 (increment) when right sum is greater. We will move right pointer to left by 1 (decrement) when left sum is greater. at some point we will either get the sum same and that's when we exit from the loop. 0-left will be one array and right-(n-1) will be another array.
We are not going to mo"See full answer
"Example:
bucket A: 3 liters capacity
bucket B: 5 liters capacity
goal: 4 liters
You are asked to print the logical sequence to get to the 4 liters of water in one bucket.
Follow up:
How would you solve the problem if you have more than 2 buckets of water?"
B. T. - "Example:
bucket A: 3 liters capacity
bucket B: 5 liters capacity
goal: 4 liters
You are asked to print the logical sequence to get to the 4 liters of water in one bucket.
Follow up:
How would you solve the problem if you have more than 2 buckets of water?"See full answer
"Project Schedule is a living document which is prepared based on inputs from the entire team including product, engineering, finance, sales, marketing, legal etc.
It is owned by Project/Program Manager but it reflects progress of the whole team.
Inputs required for the development of schedule includes project charter, list of stakeholders, project scope, WBS, freeze calendar, vendor SOWs etc.
I will use the following approach for schedule development:
Copy Milestone level plan from Project"
Saket S. - "Project Schedule is a living document which is prepared based on inputs from the entire team including product, engineering, finance, sales, marketing, legal etc.
It is owned by Project/Program Manager but it reflects progress of the whole team.
Inputs required for the development of schedule includes project charter, list of stakeholders, project scope, WBS, freeze calendar, vendor SOWs etc.
I will use the following approach for schedule development:
Copy Milestone level plan from Project"See full answer
"Understood the problem statement by confirming details with interviewer.
Approached by listing down all the basic features being provided by the platform.
Platform -> Organizations can register themselves. One org can have more than one recruiters. Recruiters create jobs on the org portal. Candidate can apply to the jobs. Recruiters can accept and reject the applications.
Categorized 4 parent tables by taking hints in between. The tables were USER -> ID, Name, Phone No, mail ID, Profile Des.("
Jaya S. - "Understood the problem statement by confirming details with interviewer.
Approached by listing down all the basic features being provided by the platform.
Platform -> Organizations can register themselves. One org can have more than one recruiters. Recruiters create jobs on the org portal. Candidate can apply to the jobs. Recruiters can accept and reject the applications.
Categorized 4 parent tables by taking hints in between. The tables were USER -> ID, Name, Phone No, mail ID, Profile Des.("See full answer
"In Java, GC is the process of automatically identifying and reclaming memory occupied by objects that are no longer reachable.. the process involves the 3 steps
Mark phase -- identify the objects that are still in use. i.e reachable
sweep Phase -- removes the unreachable objects
compact phase -- rearragnes objects to prevent fragmentation
4 types of Garbage collection
Serial GC -- single threaded simple and compacting -- best for small applications
Parrallel GC -- throughput GC"
Sue G. - "In Java, GC is the process of automatically identifying and reclaming memory occupied by objects that are no longer reachable.. the process involves the 3 steps
Mark phase -- identify the objects that are still in use. i.e reachable
sweep Phase -- removes the unreachable objects
compact phase -- rearragnes objects to prevent fragmentation
4 types of Garbage collection
Serial GC -- single threaded simple and compacting -- best for small applications
Parrallel GC -- throughput GC"See full answer