Unicorns Interview Coding Question: Job Processor with Priority Queue

16 Views
No Comments

Hyperproof has a feature called Automated Controls Testing, where our users can write tests against data fetched from our Hypersyncs (integrations).

This allows our customers to continually check their compliance in an automated and hands-free manner.

An example we can use are tests defined to ensure our customers’ employees are following password and two-factor policies required by their compliance frameworks.

The data from these automations gets parsed, packaged into a job, and sent off to a priority queue to get processed and return a result.

The priority queue is based on the role of the user who submitted the test. Admins get faster results, while users get slower results.

Processing the job means taking the job’s data, running it against our pre-defined test (aka a tester function), and returning a result.

Goals:

  • define a job
  • a job processor
  • and a way to run a test against a job’s data

This problem asks you to design a job-processing flow with priority handling: each automation test is wrapped as a job, queued according to the submitter's role, and then executed by a processor against a predefined tester function. The main ideas are object modeling, queue or priority-queue scheduling, and clean separation between job data, test logic, and execution order.

END
 0