npkatre104
BAN USER- 0of 0 votes
Answer/*Find minimum size of text window which contain all keywords of a search query from document.
- npkatre104 in United States
Order of keywords don't matter.
Input:
Document: "MS(1) x y Is MS(5) x y MS(8) x Is Awesome x y z Awesome"
doc index dictionary:
{
Keyword: Index Position for keyword in doc
"MS": [1,5,8],
"Is": [4,10]
"Awesome": [ 11, 15] (n)
}
Search Input 1 : "MS is" ( k)
Result: "Is MS Ms" --> [Ms: 5 ; "Is" : 4] --> 2
Search Input 2: "Ms is Awesome",
Result : "MS x is Awesome" --> [Ms:8, Is: 10, Awesome: 11] ---> 4
for -> n
n^k
[1 4 5 8 10 11 15]
*/| Report Duplicate | Flag | PURGE
Microsoft Solutions Engineer - 0of 0 votes
AnswersAn ABC notation in a tree is defined as folllows:
- npkatre104 in United States
1. "0" means travel left
2. "1" means travel right
3. "Undefined" means hit the root
4. "Not Found" means not present in tree
Given a BST insertion order, {5,2,8,3,6,9,1} find the ABC notation for 6, 1, 10, 2 which is "10","00","NotFound", "0"| Report Duplicate | Flag | PURGE
Apple Software Engineer
There are certain edge cases to this code. Why to check for the entire response. Why not just check the response code of '200'. This might save some time. As this is "Performance Team", I bet the requirements would be high enough to provide production quality code. Though the question is simple I agree, but the answer would require handling edge cases, such as checking if the remote is reachable, checking the response code for 200 and others
- npkatre104 June 14, 2017