Tuesday, August 17, 2010

Joomla Interview Questions

Question : What are plugins?

In Joomla 1.5 mambots will be renamed plugins.
Plugins: The new name for mambots. In addition, some 3rd party components, modules and mambots themselves have plugins. is a small, task-oriented function that intercepts content before it is displayed and manipulates it in some way.

Question : What are Joomla modules?

Modules extend the capabilities of Joomla! giving the software new functionality. Modules are small content items that can be displayed anywhere that your template allows it to be displayed by assigning them to positions and pages through the module manager in the administrative interface.
Modules are installed in the Admin Section. Joomla! modules may include: Main Menu, Top menu, Template Chooser, Polls, Newsflash, Hit Counter, etc.
Members of the Joomla! Community produce Joomla! modules on a continuous basis.

Question : What are Joomla components?


Content elements or applications that are usually displayed in the center of the main content area of a template. This depends on the design of the template in use.
Components are core elements of Joomla!’s functionality. These core elements include Content, Banners, Contact, News Feeds, Polls and Web Links.
Members of the Joomla! community produce third party Joomla! components on a continuous basis.
They are freely available to download from http://extensions.joomla.org/ and a number of other web sites.

How do I eliminate the pathway or breadcrumbs?

An example is as follows; You are currently reading a content item "New Page". This content item is a member of the "Pages " category. In the turn the pages category is a member of the "Books" section. In this case the breadcrumb for that page would look like: "Home >> Books >> Pages >> New Page".


If you wish to eliminate the pathway entirely, edit your template html (index) file. Usually it will look like this:




Question : How do I remove the page title from the front page of my site?

To remove the title from being displayed on the front page of your site, you need to change a parameter setting in the front page component.

► First log into the administrative back end.
► On the top menu click "Menu"->"mainmenu"
► Click "Home".
► On the right side of the screen in the parameters section, locate the “Page Title” parameter that is next to the radio buttons “Show” and “Hide”.
► Click the “Hide” radio button.
► Click the “Save” button to make your change permanent.

Question : What determines what is shown on my frontpage?

Frontpage is a component that is part of the core of Joomla!, like the front page of a newspaper, it shows (usually) multiple pieces of content arranged in some way.

When you install Joomla! the front page component is by default set as the homepage of your site (that is it is the first link on your Main Menu) but front page does not have to be your "home" page.

What exactly appears on the front page and how it is laid out is controlled in two ways. First, if you open the menu link in your menu manager in the backend there are numerous parameters that control the number of items shown, the number of columns etc.

To control which items are shown you must also indicate that an item should be placed on the front page by editing the parameters for the content item. In the backend this will be indicated by a check mark in the front page column of the list of content items.

In addition, you can use the front page manager (in the content menu of the backend) to control the publication dates and other variables for content items that are on the front page.

Question : How do I change the favicon?

The joomla favicon is stored in the /images folder. The file is called favicon.ico. By definition a favicon must be 16x16 pixels.
If you wish to use your own favicon, rename the default joomla favicon.ico file and put your file with that name in the images directory.

Alternatively, you can change the favicon in the Joomla! global configuration Site tab (on the bottom).

Question : What are positions in Joomla?

Site templates divides the "pages" displayed on a site into a series of positions, each with a different name.

You can view the location of positions in your default template from the administrator go to Site =>Preview=>Inline with Positions.

You can annotate your positions through the administrator (backend). Go to Site=>Template Manage=>Module Positions.

You can add or remove positions by modifying your template html.

You assign a module to a position using the module manager.

Modules=>Site Modules
On the left side of the page, on the third line, there is a drop down menu that lets you select the position.

How do you install an extension?


From the backend of your joomla site (adminsitration) select Installers and then the type of extension (module, component, mambot/plugin, site template, administrative template, language
-Browse for the package file
-Click the install icon
-Follow any instructions

Sometimes you cannot use the automated installer. For example, very large extensions may exceed the maximum upload size allowed by your host.

In this case, unzip all of the files locally. Then transfer the files to a folder in the the install directory(for example administrator/components/com_installer/components) for the type of extension you are installing (using FTP). Then use the installer, but select "install from directory" indicating the correct folder name.

Question : What determines my homepage?

Your "homepage" in a traditional html site--the page that shows when you type mydomain.com for example-- would be the page displaying that is in the index.html file.

Jooma! is a database driven CMS so it does not have html pages, but rather pulls up the pieces of pages from a mysql database.

The "page" that shows when a user navigates to mydomain.com is the page created by clicking on the first link on the Main Menu. The link can be called anything (Home, Bob it does not matter), that is the page that will show.

Question : Can content items be assigned to multiple categories or sections?


No, content items cannot be assigned to multiple categories or sections.
This menu can be displayed anywhere and can be displayed vertically or horizontally or not at all. The menu does not even need to be published.

When you installl Joomla! by default it has a menu link to the frontpage component as the home page. However, any content or component or other link can be used as the "home" page.

How do I link from inside content to another content item?

The simple answer is that you get the URL for the page you want to link to. Then you make a link using whatever editor you are using or with html if you have nowysiwyg.

The more complicated answer is that some editors have fancier links managers. For example with the JCE editor you can add the advanced linking plugin and it will give you nice lists of static and other content types to pick from.


Question : How do I change the image(s) in my template?




One common template change is to use your own graphic/image. Simple graphics (not banners) are linked in the html file. Simply change the reference to the image of your choice in the html file of your template. In the adminsitrative interface do this by going to Site =>Template manager and then selecting your template. Click the icon for html.

Keep in mind that it if it is a different size than the original image this may change the appearance of the site in unexpected ways.

Additional information:

The images for a given template are generally located in this folder:
/templates/templatename/images (Substitute the name of the template you are using in place of "templatename").

A trick for finding the name of the image is to put your cursor over it and click right. Select view image. This will display the image and give its full url. Sometimes the images are background images. This is viewable in Firefox or you can look for the background tag in your page source.

How to upload an image:

There are many ways to upload images. Which one you use will depend on your host and server.
1. You can use an ftp client.
2. You can use a cpanel file manager.
3. You can use the media manager.
4. You can use various extensions that allow uploading, including joomlaexplorer and galleries.

Question : What do the locks mean? How do I get rid of them?

At any given time you may see a padlock next to a specific item in Joomla!'s administrative backend. These padlocks may be displayed next to any of the following (Content Items, Menu Items, Modules, etc).

The Joomla! system places these padlocks next an item to indicate that a user is currently editing (checked out) the item. The lock is removed by the sytem when the user clicks on the "Save" button for that item.
If the user never clicks save and instead hits the "Back" button or naviagtes to another page, then the item stays locked. If another user needs to work with the item he or she must have the item checked back in before the can work.

There are two ways of checking items back in. One way is to contact the person that has the module checked out to see if they are done with the item.

The other option utilizes the administrative back end;
Click on "System => Global check in"
This option should be used very carefully, especially in multi-user environments. This single action checks in all previously checked out items, whether they were checked out by you or not. Possible undesirable side effects may be that multiple editors end up working on the same document.
In this case who ever clicks the save button last has their version saved as the final copy.

Question : How do I exit the wrapper?

The page that contains the link you click on to load the wrapped content is the parent page.
You can get out of the wrapper by clicking on anyone of the links in the menu of the parent page.
If there are no other menu items visible then the wrapper may have been loaded directly into the parent page, replacing the content that was initially there.
This however defeats the purpose of having a wrapper which is a means of simply enclosing content from another site within the parent site.

Question : What are mambots and plugins?

A Mambot is a small, task-oriented function that intercepts content before it is displayed and manipulates it in some way. Joomla! provides a number of Mambots in the core distribution, e.g. WYSIWYG editors, but there are many other mambots available for specific tasks.
Some 3rd Party developer components have their own mambots which need to be installed in order to make the component work properly. In Joomla! 1.5 mambots will be renamed plugins.
Plugins: The new name for mambots. In addition, some 3rd party components, modules and mambots themselves have plugins.



Oops in PHP

Inheritance:

Inheritance revolves around the concept of inheriting knowledge and class attributes from the parent class. In general sense a sub class tries to acquire characteristics from a parent class and they can also have their own characteristics. Inheritance forms an important concept in object oriented programming.

Polymorphism

This ability of different objects to respond, each in its own way, to identical messages is called polymorphism.
Polymorphism results from the fact that every class lives in its own name space. The names assigned within a class definition won't conflict with names assigned anywhere outside it. This is true both of the instance variables in an object's data structure and of the object's methods:

UML

UML or unified modeling language is regarded to implement complete specifications and features of object oriented language. Abstract design can be implemented in object oriented programming languages. It lacks implementation of polymorphism on message arguments which is a OOPs feature.

Data Abstraction

Data Abstraction increases the power of programming language by creating user defined data types. Data Abstraction also represents the needed information in the program without presenting the details.

Overriding

Overriding polymorphism is known to occur when a data type can perform different functions. For example an addition operator can perform different functions such as addition, float addition etc. Overriding polymorphism is generally used in complex projects where the use of a parameter is more.

Method:

A method will affect only a particular object to which it is specified. Methods are verbs meaning they define actions which a particular object will perform. It also defines various other characteristics of a particular object.
15) Name the different Creational patterns in OO design?
There are three patterns of design out of which Creational patterns play an important role the various patterns described underneath this are: -
1) Factory pattern
2) Single ton pattern
3) Prototype pattern
4) Abstract factory pattern
5) Builder pattern

Overloading

Overloading is one type of Polymorphism. It allows an object to have different meanings, depending on its context. When an exiting operator or function begins to operate on new data type, or class, it is understood to be overloaded

Overloading is polymorphism. In this we use more than one same name function but with different parameter value.For example:

read(int a){
...........
}
read(int a, int b){
........
}
This kind of definition is called overloading, where function is same but having different parameters.
Now, when the read() will required, the passed arguments will match with present read() functions.

Example:

read(5);

if it will passed it will matched with the first read() i.e. read(int a);

OOPS and object:

Different kinds of objects often have a certain amount in common with each other. Mountain bikes, road bikes, and tandem bikes, for example, all share the characteristics of bicycles (current speed, current pedal cadence, current gear). Yet each also defines additional features that make them different: tandem bicycles have two seats and two sets of handlebars; road bikes have drop handlebars; some mountain bikes have an additional chain ring, giving them a lower gear ratio.

Object-oriented programming allows classes to inherit commonly used state and behavior from other classes. In this example, Bicycle now becomes the superclass of MountainBike, RoadBike, and TandemBike. In the Java programming language, each class is allowed to have one direct superclass, and each superclass has the potential for an unlimited number of subclasses:

Constructor:

yes we can implement oops in cell phones through concept called constructor.Wen we create object constructor is automatically invoked llly wen pone is witched off automatticallly a signal is sent to nework

Abstraction:

Abstraction can also be achieved through composition. It solves a complex problem by defining only those classes which are relevant to the problem and not involving the whole complex code into play

Class:

Class describes the nature of a particular thing. Structure and modularity is provided by a Class in object oriented programming environment. Characteristics of the class should be understandable by an ordinary non programmer and it should also convey the meaning of the problem statement to him. Class acts like a blue print.

Object:

An object is a combination of messages and data. Objects can receive and send messages and use messages to interact with each other. The messages contain information that is to be passed to the recipient object.

Encapsulation :

To design effectively at any level of abstraction, you need to be able to leave details of implementation behind and think in terms of units that group those details under a common interface. For a programming unit to be truly effective, the barrier between interface and implementation must be absolute. The interface must encapsulate the implementation--hide it from other parts of the program. Encapsulation protects an implementation from unintended actions and inadvertent access.

Function:

Function overloading is essential to allow the function name (for example the constructor) to be used with different argument types.

CakePHP interview Question


Interviewer : what is cakephp


Me : Cakephp is a rapid development framework for PHP that provides an extensible architecture for developing, maintaining, and deploying applications. it uses commonly known design patterns like MVC,ORM within the convention over configuration paradigm, It also reduces development costs and helps developers write less code.

Interviewer : why cakephp, and why not any other framework.
Me : it has been for years in the market with strong support in the form of communities and online documentation, it supports php 4/5 , sometimes it becomes mandatory to support php4 because of client's limitation in support php5, there cakephp helps.

3. can you remember what is the directory structure when you download cakephp


* app/
o config/
o controllers/
o models/
o plugins/
o tmp/
o vendors/
o views/
o webroot/
* cake/
o config/
o docs/
o libs/
* vendors/

Interviewer : what is the first file that gets loaded when you run a application using cakephp., Me : can you change that file.


bootstrap.php , yes it can be changed , either through index.php , or through htaccess

Interviewer : using cakephp, what all are drawbacks.


Me : The learning curve, and it loads full application before it starts your task. Its not recommended for small projects because of its resource heavy structure.

Interviewer : what is model,view,controller.


Me : Model–view–controller (MVC) is an architectural pattern used in software engineering. Successful use of the pattern isolates business logic from user interface considerations, resulting in an application where it is easier to modify either the visual appearance of the application or the underlying business rules without affecting the other. In MVC, the model represents the information (the data) of the application; the view corresponds to elements of the user interface such as text, checkbox items, and so forth; and the controller manages the communication of data and the business rules used to manipulate the data to and from the model.

Interviewer : what is the naming convention in cakephp


Me : table names are plural and lowercased,model names are singular and CamelCased: ModelName, model filenames are singular and underscored: model_name.php, controller names are plural and CamelCased with *Controller* appended: ControllerNamesController, controller filenames are plural and underscored with *controller* appended: controller_names_controller.php, associations should use the ModelName, and the order should match the order of the foreignKeys: var $belongsTo = ‘User’; , foreign keys should always be: table_name_in_singular_form_id: user_id (foreign key) → users (table) , many-to-many join tables should be named: alphabetically_first_table_plural_alphabetically_second_table_plural: tags_users , columns in many-to-many join tables should be named like other foreign keys: tag_id and user_id , columns named “created” and “modified” will automatically be populated correctly

Interviewer : what is a component,helper and why are they used, is there other way we can do same thing, what is better.


Me: A component is an independent piece of code written for specific task that can be used by calling in controllers (example : email component), helper is used for helping cakephp in rendering the data to be shown to user with views, these only adds to modularity in code otherwise same coding can be implemented in conrollers.

Interviewer : how do you proceed when you have to use cakephp for any application.


Me : take the framework either from cake site or if you have changed according to your needs start from there. proceed with basic software engg. concepts as requirement gathering etc

Interviewer : what is the first function that gets loaded from a controller.


Me : index

Interviewer : what is habtm.


Me : has and belongs to many is a kind of associations that can be defined in models for retrieving associated data across different entities.

Interviewer : how can we use ajax in cakephp.


Me : by calling ajax helper and then using it in controller for rendering.

Interviewer : if you have to validate a registration module for a user, what all can be possible ways , which one is the best.


Me : can be done on submission in controller, or using javascript/ajax while user is still filling the data. second option is better.

Interviewer : can you list some database related functions in cakephp.
find, findAll , findAllBy , findBy , findNeighbours , query

Interviewer : how canInterviewer : how can you include a javascript menu throughout the site. give steps.


Me : By adding the javascript files in webroot and call them in default views if needed everywhere or just in the related veiws.

Interviewer : how can you make urls search engine friendly while using cakephp
Me : it is an automatic task that is done by cakephp.

Interviewer : do you prefer to use cakephp,yes then why ? no then why not.


Me : Its a wide question and the answer would depend upon the kind of application for which it is to be decided, if its a basic cms i would prefer to have joomla. but yes cakephp is prefered for large systems, “simplicity” is the most important factor.
you include a javascript menu throughout the site. give steps.