Microsoft Interview Question: Design a scheduler to run man... | Glassdoor

Find your next job here

Interview Question

Software Development Engineer II Interview Redmond, WA

Design a scheduler to run many functions at different

  times. It needs to (obviously) be thread-safe. Each task which is scheduled to run will have a time stamp, containing a desired execution time, a function pointer (containing the desired function). Also, find a way to supply the arguments to each function. Implement the mechanisms for scheduling/removing work to be done. How would you handle functions that must be serialized as opposed to ones that didn't need to be?
data structures algorithms operating systems

Interview Answer

1 Answer


Too much to write in this box, but open your operating systems 101 book. If you know how to dispatch threads, use a mutex and a condition variable, you're good to go. Also, know how to implement a min-heap or perhaps a circular queue. You'll need one. Make quite sure it's thread safe!

Interview Candidate on Jan 27, 2013

Add Answers or Comments

To comment on this, Sign In or Sign Up.