Amazon Interview Question for SDE-2s

Country: United States
Interview Type: In-Person

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

In simple terms,
1. UI: A task should have task id and start time to execute. User has the provision to create/view list of tasks and its status.
2. DB: A table to model task. Columns to hold task id and schedule.
3. Middle tier:
3a. A poling logic in specific time interval which queries the table to retrieve the task whose time has expired.
3b. Each of the retrieved tasks could be added to a thread pool. A thread pool would contain fixed number of threads each carrying out a task at a time. The basic operations of the Thread Pool can be to add task, start the tasks etc. Thread Pool class would have a queue which holds added tasks. A task object can have its Id, Start Time, Status, operations to start/stop/pause. Time slicing or some greedy technique could be introduced to handle long running tasks.

- Object June 02, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
of 0 vote

The job scheduler can facilitate the client to create a queue of its own with configurable values like timeouts, retry counts, consumption logic, priority and user permissions.
For every queue, the client should be able to create, delete and cancel the execution of the job.The jobs can also belong to a definite group.All the jobs in a particular group will be executed in sequence.
We will have a logic around the failed jobs depending on the status code of the response.If the job has failed with 5XX, it will be sent to a retry queue.If the job has failed with 4XX, it can be sidelined and sent to the sidelined queue.The client can see the sidelined queue and can take corrective action.
We will be able to set a number of consumers of the job queue depending on the load.

- AJ September 08, 2017 | Flag Reply

Add a Comment

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


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


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