Find Interview Questions for Top Companies
Ques:- Do you sometimes trace code by stepping through it? How?
Asked In :- truworths,
Right Answer:
Yes, I trace code by using a debugger tool, setting breakpoints, and stepping through the code line by line to observe the flow and variable values.
Ques:- Are you familiar with xdebug? What features of xdebug do you use, how and why?
Asked In :-
Right Answer:
Yes, I am familiar with Xdebug. I use its features such as stack traces for debugging errors, remote debugging to step through code in an IDE, and profiling to analyze performance. These features help identify issues, improve code quality, and optimize application performance.
Ques:- How to make a product’s custom attribute searchable in advanced search?
Asked In :-
Right Answer:

To make a product's custom attribute searchable in advanced search in Magento, follow these steps:

1. Go to **Stores** > **Attributes** > **Product**.
2. Find and edit the custom attribute you want to make searchable.
3. Set **Use in Advanced Search** to **Yes**.
4. Set **Visible on Frontend** to **Yes** if needed.
5. Save the attribute and reindex the data if required.

This will allow the custom attribute to be searchable in the advanced search functionality.

Ques:- How to set different themes for each store?
Asked In :-
Right Answer:
To set different themes for each store in Magento, follow these steps:

1. Log in to the Magento Admin Panel.
2. Navigate to `Content` > `Design` > `Configuration`.
3. Select the store view you want to change the theme for.
4. In the "Applied Theme" section, choose the desired theme from the dropdown menu.
5. Click `Save Configuration`.

Repeat these steps for each store view to assign different themes.
Ques:- How to create magento custom module?
Right Answer:
To create a Magento custom module, follow these steps:

1. **Create the module directory**:
- For Magento 2, create the directory `app/code/VendorName/ModuleName`.

2. **Create the module.xml file**:
- Inside `app/code/VendorName/ModuleName/etc`, create a file named `module.xml` with the following content:
```xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="VendorName_ModuleName" setup_version="1.0.0"/>
</config>
```

3. **Create the registration.php file**:
- In `app/code/VendorName/ModuleName`, create a file named `registration.php` with the following content:
```php
<?
Ques:- How to get the Total Price of items currently in the Cart?
Asked In :-
Right Answer:
You can get the total price of items currently in the cart in Magento by using the following code:

```php
$cart = Mage::getSingleton('checkout/cart');
$totalPrice = $cart->getQuote()->getGrandTotal();
```

This will give you the total price of all items in the cart.
Ques:- What technology used by Magento?
Asked In :- Relinns Technologies,
Right Answer:
Magento is built using PHP and utilizes MySQL for database management. It also employs technologies like HTML, CSS, JavaScript, and XML.
Ques:- Where is the module’s base definition file located?
Asked In :-
Right Answer:

The module’s base definition file is located in `app/code/[Vendor]/[Module]/etc/module.xml`.

Ques:- Where does all core modules are located in Magento2?
Asked In :-
Right Answer:
All core modules in Magento 2 are located in the `vendor/magento` directory.
Ques:- What is resource attribute for admin menu item?
Asked In :-
Right Answer:
The resource attribute for an admin menu item in Magento defines the permissions required to access that menu item. It is used to control access based on user roles and is specified in the menu item's configuration in the `menu.xml` file.
Ques:- What is the difference between cache:clean and cache:flush?
Asked In :-
Right Answer:
`cache:clean` removes outdated items from the cache storage, while `cache:flush` clears the entire cache storage, including any external caches.
Ques:- Which function refers the action in any controller file?
Asked In :-
Right Answer:
The function that refers to the action in any controller file in Magento is `execute()`.
Ques:- Which class Magento 2 helper extend?
Asked In :-
Right Answer:
Magento 2 helper extends the `MagentoFrameworkAppHelperAbstractHelper` class.
Ques:- Which file stores the vendor path?
Asked In :- codilar technologies,
Right Answer:
The vendor path is stored in the `composer.json` file.
Ques:- Which file is responsible for keeping database credentials in Magento2?
Asked In :-
Right Answer:
The file responsible for keeping database credentials in Magento 2 is `app/etc/env.php`.
Ques:- Which command is used to enable or disable a magento2 module?
Asked In :-
Right Answer:
The command used to enable a Magento 2 module is `php bin/magento module:enable <Module_Name>`, and to disable it, use `php bin/magento module:disable <Module_Name>`.
Ques:- What is the latest version of magento?
Asked In :-
Right Answer:
As of October 2023, the latest version of Magento is Magento 2.4.6.
Ques:- How to reset admin password in magento ?
Asked In :-
Right Answer:
To reset the admin password in Magento, you can use the following SQL query in your database:

```sql
UPDATE admin_user SET password = CONCAT(SHA2('new_password', 256), ':') WHERE username = 'admin_username';
```

Replace `'new_password'` with your desired password and `'admin_username'` with the actual admin username. After executing the query, you can log in with the new password.
Ques:- How to add Custom javascript and css file in magento
Asked In :-
Right Answer:
To add custom JavaScript and CSS files in Magento, you can follow these steps:

1. **Create a custom theme** (if you haven't already) or use an existing one.
2. Place your custom JavaScript files in the `web/js` directory and CSS files in the `web/css` directory of your theme.
3. In your theme's `default_head_blocks.xml` file (located in `app/design/frontend/Vendor/Theme/Magento_Theme/layout/`), add the following code:

```xml
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="css/your-custom-file.css"/>
<script src="js/your-custom-file.js"/>
</head>
</page>
```

4. Clear the cache by running `php bin/magento cache:clean`
Ques:- How to run custom MySql query in Magento ?
Asked In :-
Right Answer:
To run a custom MySQL query in Magento, you can use the following code snippet:

```php
$connection = Mage::getSingleton('core/resource')->getConnection('core_write');
$query = "YOUR SQL QUERY HERE";
$connection->query($query);
```

Replace `"YOUR SQL QUERY HERE"` with your actual SQL query.


The Magento category on takluu.com is crafted for web developers and e-commerce professionals preparing for interviews related to the Magento platform. Magento is a powerful, flexible, and widely-used open-source e-commerce platform that allows businesses to build scalable online stores.

This section covers key topics such as Magento installation, architecture, module and theme development, product management, payment gateways, and security best practices. You’ll also find questions related to performance optimization, caching strategies, database management, and troubleshooting common Magento issues.

Interviewers often focus on practical knowledge and problem-solving skills with questions like:

  • “How do you customize Magento themes and layouts?”

  • “Explain the Magento module development process.”

  • “What strategies do you use for optimizing Magento site performance?”

Our content simplifies complex Magento concepts with detailed explanations, code snippets, and real-world examples. Whether you’re a fresher or experienced developer, this category helps you build confidence for technical rounds and practical assignments.

At Takluu, we update the Magento category regularly with the latest platform versions, features, and best practices to keep you ahead in the competitive e-commerce job market.

AmbitionBox Logo

What makes Takluu valuable for interview preparation?

1 Lakh+
Companies
6 Lakh+
Interview Questions
50K+
Job Profiles
20K+
Users