Expedia Interview Question for Software Developers


Country: United States




Comment hidden because of low score. Click to expand.
0
of 0 vote

1. Forced sleep of ( (1/number of threads) + some safety value) sec
2. By Maintaining list of possible servers and recycling list. for example
list of available servers to call 1,2,3,4,5,6
send first call to server 1 then 2 till 6 and then again 1.

- Shrinivas June 09, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

My first guess would be token bucket algorithm, which would allow you to throttle requests.

- animageofmine June 09, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

1. Suppose the API is exposed via RESTful webservice, use a token based mechanism to detect callers, send the token along each call in the HTTP Header, callers which specific tokens have higher priority, after detecting the caller, interrupt any existing running threads to serve the Thread with highest priority, use an OS that supports preemptive task scheduling. After finishing work with thread of highest priority resume unfinished threads.

2. Use a load balancer and a stateless service model, where each request can be treated in isolation inside each server.

- guilhebl June 11, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Delay queue can be used to solve this problem.

- Anand July 28, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I would use a reverse proxy or load-balancer approach, where you will count each incoming request. This is the single point of entry and exit. After this point we do not care which server handles the request. However I would ensure that I capture the token/header information of the incoming call because I need to make sure that the call gets a successful data back.

- Anonymous March 03, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

- Create singleton class which is thread safe (synchronized). in this class save last call time and compare it whenever want to issue new call making sure that diff >= 1 sec.

- For multi-server env, maybe do the request through proxy

- Anonymous February 15, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

we can employ zookeeper for the same

- sandeep February 28, 2017 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More