AddThis

Friday 2 December 2022

Cognizant Drupal Interview Questions Latest 2022

  1. What is Trait?
  2. You have three servers, each server have different configuration, how to import the configurations in these servers?
  3. How the multi language works in Drupal 7 and 8, is node id different?
  4. What is batch process? How to write batch operations in Drupal?
  5. How to sent 10,000 mail from your machine using queue by cron?
  6. What is Drush?
  7. How to include js, react components in Drupal page twig?
  8. What are breakpoints in theming?
  9. Do you have experience in Docker, LAMP?
  10. What are distributions?
  11. How to theme page not found in Drupal?
  12. How features work in Drupal 8(import/ export)?
  13. How to theme a page with a name that you like? (Hint: hook_theme_suggestions_page(), hook_theme_suggestions_page_alter())
  14. Have you worked on Acquia?
  15. What is the difference between processor and preprocessor?
  16. Taxonomies in Drupal?
  17. Features in Drupal 7? How is it done in Drupal 8?
  18. Difference between composer install and update?
  19. How to write test cases in PHP?
  20. How to write own hook?
  21. What is events handler, dispatcher, subsription?
  22. What is dependency injection?
  23. What are services? How to create a RestAPI using the same?
  24. How to increase the memory limit in PHP?
  25. What is raw in twig?
  26. What is headless model?
  27. What is middleware in Drupal?
  28. What is Queue API?
  29. What is caching API, max-age, cache-tags, cache-context?
  30. Explain cache architecture using database?
  31. What is the difference between contextual and normal filter in Drupal?
  32. How to make multi site? How to enable module for multi site?
  33. What is the difference between composer lock and update?
  34. How to get the external library other than module using composer.json?
  35. How is migration done in Drupal?
I gave interview for a job position in Kochi, the designation was for Senior Associate - Projects. The interview took one hour to complete.

Thursday 4 May 2017

How to install a module in Drupal 8

There are many ways to install modules in Drupal. But for every time, I chose to go through the following steps to get it done.

Let us assume we are trying to install the module,
Custom Landing Page Builder


Download the version from the module page on drupal.org.



Once downloaded, extract it. 
At the project folder, locate the modules folder, create a new folder as contrib to hold all the contributed modules used for the website. Move the extracted folder at Downloads to the contrib folder.

Navigate to Admin -> Manage -> Extend. Search for landing page in the search field. The system will short list the modules in that name.


Check the check-box and proceed with install button. The module has susuccessfully installed. If any errors encountered, check the Recent log message at Admin -> Reports or else check the apache log.

  

Tuesday 25 April 2017

How to install Drupal 8.3

Few prerequisites are considered to get Drupal installed by the following tutorial,
  1. Ubuntu 14.04
  2. MySQL
  3. PHP 
Assuming http://localhost points to /var/www/html.

Download Drupal 8.3

Download the latest Drupal package from https://www.drupal.org/project/drupal/releases/8.3.1. Find the zip file at Downloads. Extract the zip content and rename it to, let's say test. Move the test folder to /var/www/html from Downloads to make a folder structure as /var/www/html/test.

Navigate to http://localhost/phpmyadmin to create database. Create one as test.

Access http://localhost/test to start installation prcedures. 

Language
 
Choose the language from the first window to proceed further. By default it will be English. You can add as many as languages as Drupal 8 support multi-language

Profile

Chose Standard as the profile.   

Requirements

If you've no proper files and permissions for the website, it will throw two errors at the requirements page.

   
The first error indicates sites/default/files doesn't exist. To erect the issue, navigate the sites/default folder and give 755 permission. 

 
 
Reload the requirements page and the first error is vanished

For the second error, there is no settings.php. To meet this let us make a copy of default.setttings.php in sites/default. And rename it to settings.php. Once it is done, refresh the requirements page. It will let you move further.

Configure Database

Enter the database name, user-name and password created for the website. Click on to proceed.

Configure Site

To complete the Drupal installation, enter the values you find to be relevant for the application that are asked for. The usual values asked for are, Site name, Site email, User name, Password etc. 
  
Installation has completed and will show the front page of the website.

  
Hope this helps. 
:)
  

  
 

 

Friday 21 April 2017

How to setup a virtual host in Ubuntu 14.04

 What is a virtual host? A virtual host is a invisible host to a location somewhere with in your machine.

When I've setup a virtual host, what I literally found to be missing on Internet was a complete and guided documentation. So I thought I would write on how to set up a virtual host on Ubuntu 14.04.

Let us assume, Apache, PHP and MySQL are configured in the working environment. Now you are all set to figure out how to setup a virtual host.

The only reason I'm working as a Programmer nowadays is the show off by bloody Napster, aka Seth Green from The Italian Job. Somehow, I'm happy the way I'm today.

Now let us create a create a folder inside /var/www/html/ as test. So the path is /var/www/html/test. Let us create a file, as index.php

 

And enter the below content,

<?php
  phpinfo();
?>

The terminal was a nightmare to me, but more you learn, more they become your friend.

So let us start by opening the terminal. You are ready to open a terminal by Ctrl+Alt+T. Anyways it is your choice. So this is how the terminal looks like.



Let us assume, the http://localhost points to var/www/html. The apache web server configuration files are located at /etc/apache2. Let us move to /etc/apache2/sites-available. This is where all the virtual hosts set up in your machine resides.









Now let us create a file inside sites-available using the following command.

sudo touch test.loc.conf

Open the file using,

sudo nano test.loc.conf

Copy the below contents to the test.loc.conf

<VirtualHost *:80>
    ServerName test.loc
    DocumentRoot /var/www/html/test/
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost> 


Here ServerName is the url we are using to access the directory. 
DocumentRoot is the path to the contents to be shown when the ServerName is accessed from browser.

ErrorLog is to log the errors that occur in the website. It is very useful for debugging.

Now you've created the files required for the virtual host. Now you need to register the host at /etc/hosts file.

To do that, open /etc/hosts file.

sudo nano /etc/hosts

Add the following line to file as 

127.0.0.1    test.loc

 

 Now you are ready to enable the virtual host.

sudo a2ensite test.loc.conf

And restart apache

sudo service apache2 restart
  
To check whether the host has been enabled you can move to /etc/apache2/sites-enabled 

There you'll see your virtual host file. 

Now you're good enough to access your content at test as http://test.loc

QBurst Drupal Interview Questions

  1. How do you reduce the size of css and js in Drupal?
  2. How to get the id of a javascript element on click event?
  3. Suppose you've a table named pen, with columns id, color, brand and count. Write a query to list the color of pens from highest to the lowest count?
  4. Write the syntax to create a custom block?
  5. What is an entity, entity type, field and properties?

Capgemini Drupal Interview Questions

  1. What is git tagging?
  2. What are the differences between Drupal 7 and 8?
  3. How do the search in Drupal works?
  4. What is Data Abstraction Layer?
  5. What is the software development approach you follow?
  6. What is Scrum, Sprint?
  7. What is Waterfall model?
  8. How do you do theming in Drupal?
  9. How do you deployment in Drupal. What are the tools used?

Digital Craft API Drupal Interview Questions

  1. How will you create a page with the url /page in Drupal website. For example, example.com/page.
  2. If you want to restrict a users on meeting a certain condition, how will you do that?
  3. Have you worked on Rules module? Do you know rules events, actions?
  4. Have you worked on Drush? How do you create custom drush command?
  5. How do you join a table in Views?
  6. Suppose you've a view in your system. You want to include that in a module. How do you do that?
  7. hook_node_view is a hook provided by node module. How to create a hook in your module so that it could be used by other modules?
  8. Assume you've two form fields, and they are select list. First one for country and the other is  for states. The second select list is populated only when the first one is selected. How do you do that?
  9.  How do you theme the components in a page?
  10. How do you format the fields in a form?
  11. What are Drupal behaviours?
  12. How to integrate custom table in views?
  13. Have you ever made any modification on searching functionality in Drupal?
  14. How do you create new version of the module in drupal.org?
  15. How to create a table at the time of module installation. hook_schema() or hook_install() is the right hook to create table at the time of module installation?
  16.  How do you add a new field to the existing table in Drupal?