Vib
BAN USER- 0of 0 votes
AnswerDesign banner in a web page which will show changes in Sensex live.
- Vib in India| Report Duplicate | Flag | PURGE
Bankbazaar System Design - 0of 0 votes
AnswerHow do you handle DB queries in large scale systems. Use case like FB
- Vib in India
(Hint: Map Reduce)| Report Duplicate | Flag | PURGE
Bankbazaar System Design - 0of 0 votes
AnswersReturn the number of pairs of nodes which violate the binary search tree property given a root node. I was lead to the discussion of finding it by handling for different cases like ancestors, siblings, but came to know interviewer was looking for simpler solution. Not sure if it is fair to get this as make/break questions with out any other question for experienced candidate.
- Vib in India| Report Duplicate | Flag | PURGE
Bankbazaar Data Structures - 1of 1 vote
AnswerHow do you design system for identifying groups of contacts in phone. Basic info like mail Id, name are different but the person representing them is same. looking for a deduplication way to identify.
- Vib in India| Report Duplicate | Flag | PURGE
Boomerang Commerce Developer Program Engineer Object Oriented Design - 0of 0 votes
AnswersImplement method to print left view of binary tree.
- Vib in India| Report Duplicate | Flag | PURGE
Boomerang Commerce Developer Program Engineer Algorithm
Looks like Product question,
1. Educate customer about not sharing the private data.
2. Have agreement with Philips asking for an API to query the voice samples anytime and check from Amazon side. Since its support information, they should not have any objecting to sharing.
3. Work with Philips to understand the issue why customers had to call in first place, if there is a bug force Philips to release fix asap.
Use Map to store the parent child relations and construct the tree,
public class TreeNode {
public string data;
public TreeNode parent;
public TreeNode left;
public TreeNode right;
public TreeNode(string d) {
data = d;
parent = null;
left = null;
right = null;
}
}
public TreeNode convertToTree(List<String> pairs)
{
HashMap<string, TreeNode> map = new HashMap<string, TreeNode>;
foreach(String pair in pairs) {
String child = pair.Split(',').Trim();
String parent = pair.Split(',').Trim();
TreeNode ctn , ptn;
if(!map.containsKey(child)) {
ctn = new TreeNode(child);
map.put(child, ctn);
}
if(!map.containsKey(parent)) {
ptn = new TreeNode(parent);
map.put(parent, ptn);
}
if(map.get(parent).left == null) {
map.get(parent).left = ctn;
} else if(map.get(parent).right == null) {
map.get(parent).right = ctn;
} else {
//Invalid binary tree
return null;
}
map.get(child).parent = ptn;
}
Iterator it = map.entrySet().iterator();
while(it.hasNext()) {
Map.Entry pair = (Map.Entry) it.next();
if(pair.getValue() == null) {
return pair.getValue();
}
}
return null;
}
boolean matchPattern(char* str, char* pat)
{
if(*str == '\0' && *pat == '\0)'{
return true;
}
if(*exp == '#'' && *(exp+1) != '\0' && '*str == '\0) {
return true;
}
if(*str == *exp) {
matchPattern(exp + 1, pat +1);
}
if(*exp = '#')'{
return matchPattern(exp +1, pat) || matchPattern(exp, pat + 1);
}
return false;
}
All the product companies you mentioned would look for the same skills as of US since they are US based :). Start and give the first one and try to complete a full loop with any. You would have better idea about what they are expecting (also better chance of cracking the next).
- Vib March 22, 2015Class.forName() will load the driver into memory, If successful, the static initializer of the driver is called.
All JDBC Drivers have a static block that registers itself with DriverManager, something like below.
static {
try {
java.sql.DriverManager.registerDriver(new Driver());
} catch (SQLException E) {
throw new RuntimeException("Can't register driver!");
}
}
JVM executes the static block and the Driver registers itself with the DriverManager.
In order to create the connection to the database, the DriverManager class has to know which database driver you want to use. It does that by iterating over the array of drivers that have registered with it and calls the acceptsURL(url) method on each driver in the array, effectively asking the driver to tell it whether or not it can handle the JDBC URL
careercup + linkdin
- Vib February 02, 2019