Tuesday, 27 October 2015

SVN interview questions and answers

SVN interview questions and answers


Question: What is SVN?
Subversion is an open source control system which is used to trace all the changes made to your source code.


Question: List out what all things should be stored in SVN repository?
  1. Source Code
  2. MySQL Queries
  3. Database Updates
  4. Project regarding important files
  5. Product Documents
  6. Minutes of Metting and Imp Email


Question: How to add SVN file?
svn add filename.php


Question: How to add SVN folder?
svn add foldername


Question: How to get Updates from SVN Repo
svn update


Question: How to delete file from SVN Repo?
svn delete filename


Question: How to get SVN Info?
svn info


Question: How to get SVN Log for a file?
svn log testFile.php


Question: How to check for modifications?
svn status -v PATH


Question: Difference between SVN commit and SVN update?
SVN commit:: Push (upload) the local changes to Repository.
SVN Update:: Get (download) the Repository changes files to local system.


Question: What is use of Revert in SVN?
Revert your local changes.
It have two types
1) Local Revert: It will delete all changes from files which you made after updates and before commit.
2) Repo Revert: Upload the changes to previous Repo.


Question: List out what is the best practices for SVN?
  1. Work from your own local work-space
  2. Commit small autonomous changes
  3. Use comment
  4. Validate the files you are committing, you actually changed
  5. Take Update before commit to the Repo.



Question: How to apply a patch in SVN ?
First we need to "Create Patch" by making changes and generating the .diff file. Then this .diff file can be applied to the new Code base using "Apply Patch".


Monday, 26 October 2015

CakePHP Interview Questions and Answers for experienced

CakePHP Interview Questions and Answers for experienced



Question: What Is The Current Stable Version Of CakePHP?
3.1.1 / 6 October 2015

Question: What are the System requirement for cakephp3.0
PHP 5.4.16 or greater.
mbstring extension
intl extension
MySQL (5.1.10 or greater)


Question: What Is The Name Of Cakephp Database Configuration File Name And Its Location
FileName: database.php.default
Location: /app/config/database.php.default


Question: What is First cakphpe file loaded in application?
bootstrap.php
Also, We can change its file through index.php file which loaded earlier.


Question: What Is The Use Of Security.Salt And Security.CipherSeed In Cakephp?
The Security.salt is used for generating hashes.
The Security.cipherseed is used for encrypt/decrypt strings.
You can change the above values from /app/Config/core.php.

Question: What Is Default Function For A Controller?
index() function


Question: Which Function Is Executed Before Every Action In The Controller?
beforeFilter() function


Question: List Some Of The Features In CakePHP?
  1. MVC architecture
  2. Built-in validations
  3. Caching
  4. Scaffolding
  5. Auth & ACL
  6. CSRF protection via Security Component.


Question: What Is Scaffolding In Cakephp?
Scaffolding is a technical way that allows a developer to define and create a basic application that can create, retrieve, update and delete objects.


Question: How To Add Scaffolding In Your Application?
var $scaffold;
Add above In Controller Question: What Is A Behavior?
Behaviors in CakePHP are associated with Models.


Question: How To Include Components In Controller?
public $components = array('Emails', 'ImageUploader');


Question: What is callback functions in Cakephp? Please explain?
Callback functions are simple functions which called automatically when are defined by the core cakephp.
Suppose you are inserting record in your database. Now you have two requirement.
1. Validate the data before inserting into database.
2. Want to do some changes after inserting into database.


Question: How callback functions works in CakePHP?
/** In controller**/
$userData = array();
$this->User->InsertRecord($userData );
/** In controller**/

/** In model **/
function InsertRecord($userData){
    $this->save($userData);
}

function beforeSave(){
}

function AfterSave(){
}
/** In model **/



Question: What are associations in CakePHP? What are different types of associations?
Associations are the terms which means getting the data from database which are in different tables.


Relationship Association Type Example in Single Line
one to one hasOne A user has one profile.
one to many hasMany A user can have multiple recipes.
many to one belongsTo Many recipes belong to a user.
many to many hasAndBelongsToMany Recipes have, and belong to, many ingredients.

When Models's save function going to called, beforeSave will be called then AfterSave.




Question: How To Get Current URL In CakePHP?
echo $this->here;

Question: Which Methods Are Used To Create And Destroy Model Associations?
bindModel() used to create Model Associations
unbindModel() used to destroy Model Associations


Question: What Is The Use Of RequestAction Method?
Its used to a call controller action from any location and returns data from the that action.


Question: How Can We Use Ajax In Cakephp?
Use ajax helper.


Question: What Is The Default Extension Of view files In Cakephp?
.ctp



Question: What Is folder structure of cakePHP?
What Is folder structure of cakePHP




Question: How to set Meta title from view files?
$this->set("title_for_layout", "This is page meta title");