Yelp Interview Questions
- 1of 1 vote
AnswersGiven the arraylist<meals> input, find the number of dishes with unique ingredients.
class meals{ String cuisine; ArrayList<String> dish = new ArrayList<String>(); meals(String s, String[] arr){ cuisine = s; for(String i:arr){ dish.add(i); } } }
Example:
- venkataratnamkumar7777 September 18, 2018 in United States
Input: [
{
"cuisine" : "American",
"dish" : ["lettuce", "cheese", "olives", "tomato"]
},
{
"cuisine" : "Mexican",
"dish" : ["lettuce", "cheese", "pepper", "tomato"]
},
{
"cuisine" : "French",
"dish" : ["lettuce", "cheese", "pepper", "tomato"]
},
{
"cuisine" : "Continental",
"dish" : ["lettuce", "cheese", "olives", "tomato"]
},
]
Output: 2
Because there are two unique ingredient-dishes; {Mexican, French} and {American, Continental}.
I have tried different methods, but could not get to the solution. Thank you!| Report Duplicate | Flag | PURGE
Yelp Software Engineer Java - 1of 1 vote
AnswersGiven two sparse Vectors, compute the Dot Product.
- rksharma008 March 19, 2015 in United States
Input Format : The first line will contain two numbers(k and n), which are the number of entries for the two vectors respectively.
The next k lines are the entries for the first vector, of the form : x y
where x is the position and y is the value at that position in the vector.
The n lines are the entries of the second vector.
Any entries not specified indicate zero at that position.
The two vectors will always be of the same length
Example input:
3 3
1 4
4 2
5 3
1 7
2 6
5 1
Sample Answer: Dot Product = 4*7+3*1 = 31 (only print 31)| Report Duplicate | Flag | PURGE
Yelp Software Engineer - 1of 3 votes
AnswersGiven
{ //"Restaurant Types"."[categoryNames]" "American" : "[Burger, French fries, Potato Chips]", "Italian":"[Pizza,Bread Sticks, Potato Chips]" }
Assume this kind of data is given as input and loaded into your choice of Data Structure.
- careercupuser June 25, 2014 in United States for Back-End Developer
Using Category name return the no of resturarnt type. Ex: if i/p is Potato Chips, O/P should be : 2 (American and Italian).
Please mention your Data structure and logic.| Report Duplicate | Flag | PURGE
Yelp Software Engineer / Developer Algorithm - 0of 2 votes
Answersimplement the 'cd' command i.e. given a function cd('a/b','c/../d/e/../f'), where 1st param is current directory and 2nd param is the sequence of operations, find the final directory that the user will be in when the cd command is executed
- jason.sarka May 14, 2014 in United States| Report Duplicate | Flag | PURGE
Yelp - 4of 4 votes
AnswersWrite code to generate all possible case combinations of a given lower-cased string. (e.g.
- An Enthusiast March 25, 2014 in United States"0ab" -> ["0ab", "0aB", "0Ab", "0AB"])
| Report Duplicate | Flag | PURGE
Yelp Software Engineer / Developer Algorithm - 0of 4 votes
AnswersYou visit yelp.com (or any other website).
- Aasen October 23, 2013 in United States
What happens? Describe as much of the web stack as you possibly can. (This question is meant to last 45 mins).| Report Duplicate | Flag | PURGE
Yelp Software Engineer Intern - 2of 2 votes
AnswersFrom a given integer array values, find if a Total value is possible or not? The numbers in the array can be used more than once.
- struggler July 29, 2013 in United States
example
int[] points = {3, 7};
isScorePossible(points, 10) => true
isScorePossible(points, 9) => true| Report Duplicate | Flag | PURGE
Yelp Software Engineer / Developer - 0of 0 votes
Answerswhat is the difference?
- holmespanda May 14, 2013 in United States
void test(vector<int> vec)
{
//ptint the vec;
}
void test(const vector<int> &vec)
{
//print the vec;
}| Report Duplicate | Flag | PURGE
Yelp Analyst C++ - 0of 0 votes
AnswerSearch results shows short segments ("snippets") of results and highlights query terms.
- codemonkey November 09, 2012 in United States for Search
Look, for example, at a search for [buy apple ipad] in [tablet]:
http://www.search.google.com/search?find_desc=buy+apple+ipad&find_categ=tablet.
Only a part relevant to query is shown which is shorter than the entire result.
For this question you will write a function that finds the most relevant snippet for a document and highlights all the query terms that appear in the snippet (like the highlights you saw on the linked search page). It is up to you to define what constitutes a good snippet and how big the snippets will be.
Indicate highlights by surrounding the text to be highlighted with [[HIGHLIGHT]] ...
[[ENDHIGHLIGHT]].| Report Duplicate | Flag | PURGE
Yelp Software Engineer / Developer Algorithm