Docsity

Magento 2 Certified Professional Developer Plus Practice Exam Questions, Exams of Technology

Toggle sidebar
bg1
MAGENTO 2 CERTIFIED PROFESSIONAL DEVELOPER PLUS Practice
Exam
Question 1. In Magento 2, which directory contains the module registration file?
A) etc
B) registration
C) registration.php
D) module.xml
Answer: C
Explanation: registration.php is required for module registration and is typically at the module root.
Question 2. What does a virtual type in di.xml allow you to define?
A) A new class
B) A class alias with custom arguments
C) A plugin
D) A new module
Answer: B
Explanation: Virtual types allow you to create aliases for classes with altered constructor arguments.
Question 3. Which plugin method can modify the return value of the original method?
A) Before
B) After
C) Around
D) Both After and Around
Answer: D
Explanation: After and Around plugins can change the return value.
Question 4. What is the scope code used for the global configuration in Magento?
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51

Partial preview of the text

Download Magento 2 Certified Professional Developer Plus Practice Exam Questions and more Exams Technology in PDF only on Docsity!

Exam

Question 1. In Magento 2, which directory contains the module registration file? A) etc B) registration C) registration.php D) module.xml Answer: C Explanation: registration.php is required for module registration and is typically at the module root. Question 2. What does a virtual type in di.xml allow you to define? A) A new class B) A class alias with custom arguments C) A plugin D) A new module Answer: B Explanation: Virtual types allow you to create aliases for classes with altered constructor arguments. Question 3. Which plugin method can modify the return value of the original method? A) Before B) After C) Around D) Both After and Around Answer: D Explanation: After and Around plugins can change the return value. Question 4. What is the scope code used for the global configuration in Magento?

Exam

A) website B) store C) default D) admin Answer: C Explanation: 'default' is used for global configuration scope. Question 5. Which CLI command sets a configuration value in Magento? A) bin/magento config:set B) bin/magento setup:upgrade C) bin/magento cache:flush D) bin/magento setup:di:compile Answer: A Explanation: config:set sets configuration values via CLI. Question 6. How do you define a custom event in Magento 2? A) By creating an event.xml file B) By updating routes.xml C) By editing config.php D) By adding to di.xml Answer: A Explanation: Custom events are defined in etc/events.xml. Question 7. Which method is called when an observer is executed? A) execute()

Exam

C) By editing di.xml D) By changing module.xml Answer: B Explanation: extension_attributes.xml defines extension attributes for entities. Question 11. Which authentication method is used for REST API in Magento by default? A) OAuth B) JWT C) Token-based D) Basic Auth Answer: C Explanation: Magento REST API uses token-based authentication by default. Question 12. What does layout XML allow you to manipulate? A) Database schema B) Block and container placement C) Product attributes D) User roles Answer: B Explanation: Layout XML controls page structure, blocks, and containers. Question 13. Which file contains template logic for a block? A) phtml file B) xml file C) js file

Exam

D) css file Answer: A Explanation: phtml files contain the presentation logic for blocks. Question 14. What is the purpose of theme inheritance in Magento? A) To override admin routes B) To extend or override parent theme assets/layouts C) To register new modules D) To manage ACLs Answer: B Explanation: Theme inheritance allows customization by extending a parent theme. Question 15. Which command deploys static assets in Magento 2? A) bin/magento setup:static-content:deploy B) bin/magento cache:clean C) bin/magento setup:upgrade D) bin/magento config:set Answer: A Explanation: This command deploys static files for the frontend. Question 16. What is the main role of RequireJS in Magento? A) Managing PHP dependencies B) Asset compilation C) Modular JavaScript loading D) Theme fallback

Exam

Explanation: Resource models interact directly with the database for CRUD operations. Question 20. How do you perform a complex SQL join in Magento? A) Using the Collection class with joinTable() B) Editing schema.xml C) Using layout XML D) Using config.php Answer: A Explanation: Collection's joinTable() enables complex SQL joins. Question 21. What is the advantage of using data patches over setup scripts? A) They are idempotent and easier to manage B) They run faster C) They are only for uninstalling modules D) They require no code Answer: A Explanation: Data patches are idempotent and provide better management for updates. Question 22. Which table stores product EAV attributes? A) catalog_product_entity_varchar B) eav_attribute C) sales_order D) core_config_data Answer: B Explanation: eav_attribute contains definitions for EAV attributes.

Exam

Question 23. How do you add a custom product attribute programmatically? A) Using the EAV setup class in a data patch B) Editing product.php C) Modifying core_config_data D) Changing theme.xml Answer: A Explanation: The EAV setup class facilitates adding attributes programmatically. Question 24. What is a performance drawback of the EAV model? A) Slow attribute retrieval B) High memory usage C) Missing tables D) No indexers Answer: A Explanation: Retrieving EAV attributes can be slower due to multiple table joins. Question 25. How are customer addresses stored in Magento? A) As flat tables B) Using the EAV model C) In order tables D) Only in session Answer: B Explanation: Customer addresses utilize the EAV model.

Exam

A) Massaction B) ActionsColumn C) Listing D) DataProvider Answer: A Explanation: Massaction UI component handles bulk actions in grids. Question 30. What is the main purpose of a View Model in Magento? A) To hold logic for templates without polluting block classes B) To manage database connections C) To store session data D) To define admin routes Answer: A Explanation: View Models separate presentation logic from block classes. Question 31. Which Magento product type supports configurable options? A) Simple B) Configurable C) Virtual D) Downloadable Answer: B Explanation: Configurable products offer multiple options/variations. Question 32. What does the price indexer do in Magento? A) Calculates and stores product prices for fast retrieval

Exam

B) Manages ACL permissions C) Handles asset deployment D) Encrypts customer data Answer: A Explanation: The price indexer calculates and caches prices for performance. Question 33. How are catalog price rules applied in Magento? A) Via indexers and rule engine B) In the checkout only C) By editing product.php D) Through admin routes Answer: A Explanation: Catalog price rules are processed by indexers and a rule engine. Question 34. What is the purpose of custom category attributes? A) To extend category properties for specific business needs B) To manage cache C) To define admin routes D) To deploy static content Answer: A Explanation: Custom attributes allow for category-based extensions. Question 35. Which command reindexes all indexers in Magento? A) bin/magento indexer:reindex B) bin/magento cache:clean

Exam

D) To create admin routes Answer: A Explanation: Layout Processors alter the checkout's UI component configuration. Question 39. How do you create a custom payment method in Magento? A) Implement a payment module with method and frontend model classes B) Edit product.php C) Change admin routes D) Modify category attributes Answer: A Explanation: Custom payment methods require dedicated classes and configuration. Question 40. What determines order state in Magento? A) Predefined workflow in sales_order table B) Category attributes C) Indexer mode D) Asset deployment Answer: A Explanation: Order states are managed in the sales_order table and workflow. Question 41. Which model is used for creating invoices in Magento? A) \Magento\Sales\Model\Order\Invoice B) \Magento\Checkout\Model\Cart C) \Magento\Catalog\Model\Product D) \Magento\Quote\Model\Quote

Exam

Answer: A Explanation: Order\Invoice model is used to generate invoices. Question 42. What is the primary function of RabbitMQ in Magento Commerce? A) Asynchronous message queue processing B) Asset deployment C) Theme inheritance D) Price indexing Answer: A Explanation: RabbitMQ provides message queuing for asynchronous processing. Question 43. What is customer segmentation used for? A) Targeted promotions and content B) Caching assets C) Managing admin routes D) Encrypting payments Answer: A Explanation: Segmentation enables personalized promotions and experiences. Question 44. Which database table stores scheduled content updates for staging? A) staging_update B) sales_order C) catalog_product_entity D) customer_entity Answer: A

Exam

Explanation: Gift Registry lets customers create lists for gifting events. Question 48. How does Magento prevent Cross-Site Request Forgery (CSRF)? A) By using form keys and session validation B) Through price indexing C) By asset compilation D) By theme inheritance Answer: A Explanation: Form keys and session checks protect against CSRF. Question 49. What should sensitive data (e.g., passwords) be stored as in Magento? A) Encrypted format B) Plain text C) In cache D) In assets Answer: A Explanation: Sensitive data should always be encrypted. Question 50. Which caching layer stores entire page output in Magento? A) Full Page Cache B) Block Cache C) Redis D) Varnish Answer: A Explanation: Full Page Cache improves performance by caching whole pages.

Exam

Question 51. How can cache be programmatically cleaned in a custom module? A) Using \Magento\Framework\App\Cache\TypeListInterface B) Editing config.php C) Using asset publishing D) Through admin routes Answer: A Explanation: TypeListInterface enables programmatic cache cleaning. Question 52. What is the benefit of using flat tables over EAV tables for catalog data? A) Faster read performance B) Slower writes C) No indexers needed D) No support for custom attributes Answer: A Explanation: Flat tables improve read performance for catalog data. Question 53. What is the role of extension attributes in service contracts? A) Adding extra fields to data objects without changing the database schema B) Managing ACLs C) Setting up admin routes D) Compiling assets Answer: A Explanation: Extension attributes extend data objects for APIs and service contracts.

Exam

A) By creating etc/adminhtml/menu.xml B) Editing cron.xml C) Changing theme.xml D) Modifying product attributes Answer: A Explanation: menu.xml configures admin menu structure. Question 58. Which file contains admin ACL rules for a Magento module? A) etc/acl.xml B) etc/routes.xml C) etc/module.xml D) etc/di.xml Answer: A Explanation: acl.xml defines permissions and access rules. Question 59. What is the main purpose of a plugin in Magento? A) To modify the behavior of public class methods B) To manage static assets C) To create new tables D) To define admin routes Answer: A Explanation: Plugins intercept class methods for customization. Question 60. Which Magento command switches the application mode? A) bin/magento deploy:mode:set

Exam

B) bin/magento cache:clean C) bin/magento indexer:reindex D) bin/magento config:set Answer: A Explanation: deploy:mode:set changes application mode (developer/production). Question 61. How do you optimize collection loading in custom code? A) By using only needed attributes and filters B) Loading all attributes C) Disabling cache D) Using static assets Answer: A Explanation: Selective loading reduces memory and improves performance. Question 62. What is the main use of the SearchCriteria class? A) To filter and sort data in repositories B) To render templates C) To manage cache D) To handle admin routes Answer: A Explanation: SearchCriteria enables flexible querying in repositories. Question 63. Which file defines module dependencies in Magento? A) composer.json B) registration.php