Next was the karat interview:
3 js related questions
1) one was a given code and asked what would print
2) was a question about cross site scripting
3) asked me to define the difference between bandwith and latency and whether wireless networking or mobile connection would have higher or lower bandwith. and asked if it was higher or lower latency
4) ways to improve page perfomance
A function matches the given search string if all of the characters in the search string appear in order (but not necessarily consecutively) in the function. For example, consider the function "replacefirst" and the following search strings:
replacefirst Search String:
^^^ "rep" matches
^ ^ "rf" matches
^ ^ "fr" matches
"fre" does NOT match. There is an f and r in order, but no e after them
Write a function that takes in a list of strings representing function names, and a search string,
autocomplete(functions, "li") => 6
autocomplete(functions, "rep") => 3
autocomplete(functions, "cize") => 1
autocomplete(functions, "ssh") => 1
autocomplete(functions, "sp") => 3
autocomplete(functions, "fre") => 0
functions = ["blank", "capitalize", "endswith", "escape", "includes", "indexof", "join", "lastindexof", "lowercase", "requotereplacement", "replace", "replacefirst", "reverse", "split", "splitlines", "startswith", "trim", "trimnewline", "triml", "trimr", "uppercase"]
and returns how many strings in the list match the search string.