Skip to content

Instantly share code, notes, and snippets.

@dambrogia
Created April 11, 2026 00:06
Show Gist options
  • Select an option

  • Save dambrogia/0e19ac3bb78f53fdbcf6f04bf64b7df6 to your computer and use it in GitHub Desktop.

Select an option

Save dambrogia/0e19ac3bb78f53fdbcf6f04bf64b7df6 to your computer and use it in GitHub Desktop.
Magento Assessment

Take Home Assessment: A Simple Message Queue

Instructions

Please create a Magento 2 module with the namespace Assessment\SimpleQueue. Minimum requirements are Magento >= 2.4.7 and PHP >= 8.1.

This module should implement Magento's native Message Queue Framework to publish and consume messages. Either a MySQL or AMQP queue adapter is acceptable — the implementation should be adapter-agnostic.


What to Build

You will create three entry points, each of which publishes a message to the same queue:

1. REST Endpoint

  • Route: POST /V1/simple-queue/publish
  • Should return a 200 response with the body OK

2. CLI Command

  • Command: bin/magento simple-queue:publish

3. Product Page Observer

  • Observe the appropriate controller event when a product detail page is viewed

Each entry point should publish the following payload:

$payload = json_encode(["datetime" => date(DATE_ATOM)]);

Consumer

Your consumer should process messages from the queue and log the following to var/log/consumer.log:

Message published at [publish_time] and consumed at [consumed_time]

Design Considerations

This module simulates a lightweight analytics observation layer — imagine each entry point is an event source reporting into a central pipeline. As you build this out, consider whether each of these three event sources would behave the same way in a production environment. Be prepared to discuss your thinking.


Design Principles

  • KISS — keep it simple, stupid.
  • Single Responsibility — each class should do one thing

Environment & Submission

Use your own local Magento development environment to build and test your module. When complete, create a repository containing only the Assessment\SimpleQueue module code and share the link for review.

Your testing instructions should explain how to drop the module into an existing Magento installation and verify it works.


What Are We Looking For?

Code will be reviewed for style, readability, and adherence to best practices. Functionally this is pass/fail, but the details matter:

  • Is your code consistent and well-formatted?
  • Are PSRs 3, 4, and 12 followed?
  • Are your setup instructions clear enough to test blindly?

Your time is appreciated. If you cut a corner, say so in a comment — explain what you did and how you'd improve it with more time. That kind of honesty is valued as well as balancing time, effort and complexity.


Testing Instructions

Replace this section with your own step-by-step instructions for installing and verifying your module. Assume the reviewer is starting from a clean environment and your job is to instruct them to thoroughly check, review and test your work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment