• Explain abstract class and its behaviour?

      0 comments

    Abstract class is defined as a solitary entity, so other classes can inherit from it. An abstract  class can not be instantiated, only the subclasses of it can have instances. Following is one of the best examples to explain the use of an abstract class and the behavior of it.

     class Fruit {
     private $color;
    
     public function eat() {
      //chew
     }
    
      public function setColor($c) {
       $this->color = $c;
      }
     }
    
     class Apple extends Fruit {
      public function eat() {
       //chew until core
      }
     }
    
     class Orange extends Fruit {
      public function eat() {
       //peel
       //chew
      }
     }
    

    Now taste an apple

    $apple = new Apple();
    $apple->eat();
    

    What’s the taste of it? Obviously it’s apple

    Now eat a fruit

    $fruit = new Fruit();
    $fruit->eat();
    

    What’s the taste of it? It doesn’t make any sense. does it? Which means the class fruit should not be Instantiable . This is where the abstract class comes into play

    abstract class Fruit {
     private $color;
    
     abstract public function eat()
    
     public function setColor($c) {
      $this->color = $c;
     }
    }
    

  • back to the basics

      0 comments

    This is just a quick note about how you must prepare for your technical interview whether it’s a face to face or a written.
    Before you prepare for a technical interview you must re-work on your basics in the first place. if you are not sure enough don’t go to the interview. Prepare well for your next interview. It will help you a lot  :)

    For an instance at least work on following aspects,

    • Client Server  – > What is client server architecture? Basic requesting methods to the server?
    • Sessions  -> What is a session? Where sessions are stored? How session reference is carried in the browser(client) side?
    • OOP     -> What is a class? what is overloading? what is overriding and how you do these with examples?
    • XML    -> What is xml? and what’s the use of it?
    • AJAX -> What is ajax? if you use 3rd party tool at least know the basic functions.
    • Frameworks – > Design patterns used? MVC? Explain cakephp, zend etc
    • CMS-> At least the knowledge of integrating a template. Joomla, Drupal, Magento