Google Interview Report
- -6of 8 votes
Answers2.
- mapan0817 October 30, 2014 in United States
String encode(List<String> input);
List<String> decode(String input);| Report Duplicate | Flag | PURGE
Google Software Engineer Intern - -5of 7 votes
AnswersThis is two questions I got from a google interview. Not very sure how to solve it. Any comments would be appreciated.
- mapan0817 October 30, 2014 in United States
1.
interface RateLimit {
/** Sets the rate, from 1 to 1000000 queries per second */
void setQPS(int qps);
/** accept or reject a request, called when request is received */
boolean allowThisRequest();
}
brief example:
server instantiates your object, calls setQPS(1)
at at time t, user1 makes a request, allowThisRequest() returns true
at time t+0.01 sec, user2 makes a request, allowThisRequest() returns false
at at time t+1, user4 makes a request, allowThisRequest() returns true
at time t+5 sec, user3 makes a request, allowThisRequest() returns true| Report Duplicate | Flag | PURGE
Google Software Engineer Intern Algorithm