English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2006-09-14 18:07:05 · 4 answers · asked by parimala 1 in Computers & Internet Programming & Design

i am doing this work for my company.they wanted me to collect interview questions.php is not my subject.thtsy plz give me a link tht got questions along with answers bcz if i go to forums i can not decide which answer is best as i am not aware of php.plz help me out.thanks in advance

2006-09-14 18:23:23 · update #1

4 answers

The quickest way to test an applicant is to discuss differences in object models between PHP 4 and PHP 5:

http://www.php.net/oop
http://www.php.net/oop5

Specific questions may include:

How are class constructors named in PHP 4 (constructor has the same name as class within which it is defined) and PHP 5 (__construct())?

How are class destructors named in PHP 4 (they're not; PHP 4 has no concept of a destructor) and PHP 5 (__destruct())?

Can you declare a property or method as public, private, or protected in PHP? (Yes, but only in PHP 5; PHP 4 does not support these definitions, so all methods and properties are public.)

In PHP 5, what happens if you don't declare a property or method as public, private, or protected? (Nothing; unless otherwise declared, a property or method is assumed to be public.)

Can you declare a property or method as static? (Yes, but only in PHP 5.)

Can you define class constants in PHP? (Yes, but only in PHP 5.)

What is an abstract class? (You cannot create an instance of a class that has been defined as abstract.) Can you define an abstract class in PHP? (Yes, but only in PHP 5.)

What is an abstract method? (Methods defined as abstract only declare the method's signature; they cannot define the implementation.) Can you define an abstract method in PHP? (Yes, but only in PHP 5.) Can you create an instance of class containing an abstract method? (No; declaring a method as abstract automatically renders the containing class abstract.)

What are final methods? (They cannot be redefined by child classes.) Can you define a method as final in PHP? (Yes, but only in PHP 5.)

What are final classes? (They cannot be extended.) Can you define a class as final in PHP? (Yes, but only in PHP 5.)

Can you use type hinting in PHP? (Yes, but only in PHP 5.)

2006-09-18 06:47:39 · answer #1 · answered by NC 7 · 0 0

Why do you need interview questions. If you are good in your subject just attend the interview with confidence and you will get thru. Recently I heard a company called Greynium, (greynium.com) is hiring good PHP people in Bangalore. Why dont you apply there and see if you can get thru.

Wish you the very best.

2006-09-14 18:17:23 · answer #2 · answered by oneindia 1 · 0 1

I've given a few interviews at my job before. What I usually try to do is to figure out if the interviewee knows:

1. the PHP syntax
2. basic regular expressions
3. object oriented design concepts
4. familiarity of modern web based MVC framework concepts
5. experience in working with a team
6. teachability

Here's a quick question I asked someone to get a good sense of 1-4:

Given a MVC framework uses a singleton router object to intercept the request before handing it to the appropriate controller object like so:

$url = "http://domain.com/blog/edit/5";

$router = Router::getInstance();
$controller = $router->getController($url);

The input above of $url is passed to getController() method. The string "blog" in the $url means the router should return an instantiated controller object named "controller_blog". Please implement a Router::getController().

BONUS: implement the getInstance static method.

ANSWER:

class Router
{
private $instance;
private function __construct() {}
public static function getInstance()
{
if (empty($instance))
$instance = new Router;

return $instance;
}

public function getController($url)
{
if (preg_match('#^http://[^/]+/([^/])#', $url, $matches))
{
$controller_name = $matches[1];
$controller_object = new $controller_name;
return $controller_object;
}

return false;
}

}

2006-09-14 18:30:37 · answer #3 · answered by Ken Chau 1 · 0 0

Try Freshersworld.com you may find it their or else type "PHP interview questions" in the Google search

2006-09-14 18:23:34 · answer #4 · answered by A D I T Y A 2 · 0 0

fedest.com, questions and answers