| Sno. | Question | Options | Marks |
|---|---|---|---|
| 1. | Which of the following is true about around plugins? |
(a). They must call $proceed() to execute the original method (b). They cannot access method arguments (c). They always run after before and after plugins (d). They do not support return value modification |
-0 |
| 2. | Which is NOT a valid type of Dependency Injection in Magento 2? |
(a). Constructor Injection (b). Method Injection (c). Property Injection (d). Interface Injection |
1 |
| 3. | In Magento 2, which file is used to declare routes for a custom module? |
(a). routes.xml in etc/frontend or etc/adminhtml (b). webapi.xml in etc (c). di.xml in etc (d). module.xml in etc |
1 |
| 4. | Where are plugins defined in a Magento 2 module? |
(a). routes.xml (b). module.xml (c). di.xml (d). webapi.xml |
1 |
| 5. | In Magento 2, what is the purpose of the generated folder? |
(a). Stores compiled classes and dependency injection generated files (b). Stores static content like CSS and JS (c). Stores cache and logs (d). Stores backup copies of modules |
-0 |
| 6. | Which method type in a plugin allows you to modify both the arguments before execution and the return value after execution? |
(a). before method (b). after method (c). around method (d). All of the above |
-0 |
| 7. | In Magento 2, Dependency Injection primarily helps in: |
(a). Reducing database queries (b). Removing layout dependencies (c). Replacing class dependencies at runtime without modifying code (d). Improving frontend performance |
1 |
| 8. | Which of the following correctly describes a ViewModel in Magento 2? |
(a). A helper class for templates defined via layout.xml (b). A block class replacement for controllers (c). A data provider for UI components only (d). A frontend model for product attributes |
-0 |
| 9. | In Magento 2, if multiple plugins are defined on the same class, the execution order is controlled by: |
(a). pluginOrder tag (b). sortOrder attribute (c). sequence.xml (d). Alphabetical order of module names |
-0 |
| 10. | In Magento 2, which file defines module dependencies and version? |
(a). registration.php (b). di.xml (c). module.xml (d). config.xml |
-0 |
| Total Marks:4/10 | Percentage:40% | ||