Category Archives: Techbeamers

Learn Penetration Testing Concept in 10 Minutes

Penetration testing also known as Pen testing intends to detect holes in the system and helps in making sure that the appropriate security measures are in place to secure data and ensure functionality.

Since it is crucial for the Software testers, so we covered everything needed for them to learn. We’ve prepared this tutorial so that they can understand the basics of Penetration Testing and know how to use it at work.

Here, you’ll get to know, “What is Pen Testing?“, “Why is it required?“, “What are its different types?“, as well as its benefits and the limitations. So let’s dive in further to learn the core concepts of Penetration Testing.

read more

15 PHP Interview Questions and Answers for Experienced

PHP developers are still in high demand for the web application development. And there are more and more high-end enterprise level websites getting created using PHP. Hence, we are adding 15 more PHP interview questions and answers for the experienced web developers. In our last post, you might have seen that we’d published the 30 PHP questions for beginners.

All of you might be aware of the fact that Web development market is growing like anything. And especially the web programmers are the primary beneficiary of this growth. Hence, most of them tend to learn technologies like PHP, HTML/CSS, JavaScript, AngularJS, and NodeJS. To turn them into a better programmer, we’d started this series of web developer interview questions.

Starting with our first post on the 50 most essential AngularJS interview questions, we later had taken up other web development topics like NodeJS, CSS/HTML, and now PHP. Our team has studied the latest trends and the patterns of the questions asked in the interviews. All of this help us serve you better and achieve our goal of making you succeed in job interviews.

PHP Interview Questions and Answers for Experienced

PHP Interview Questions and Answers for Experienced

PHP Interview Questions and Answers

Q-1. What is the difference between unlink and unset function in PHP?

Answer.

<unlink()> function is useful for file system handling. We use this function when we want to delete the files (physically). Let’s see a sample code.

<?php
$xx = fopen('sample.html', 'a');
fwrite($xx, '<h1>Hello !!</h1>');
fclose($xx);

unlink('sample.html');
?>

unset() function performs variable management. It makes a variable undefined. Or we can say that unset() changes the value of a given variable to null. Thus, in PHP if a user wants to destroy a variable, it uses unset(). It can remove a single variable, multiple variables, or an element from an array. Let’s see a sample code.

<?php
$val = 200;
echo $val; //Out put will be 200
$val1 = unset($val);
echo $val1; //Output will be null
?>
<?php
unset($val);  // remove a single variable
unset($sample_array['element']); //remove a single element in an array
unset($val1, $val2, $val3); // remove multiple variables
?>

Q-2. What are PHP Traits?

Answer.

It is a mechanism that allows us to do code reusability in single inheritance language, such as PHP. Its structure is almost same as that of PHP class, just that it is a group of reusable functions. Despite having same name and definition, they appear in several classes, each one having a separate declaration leading to code duplicity. We can group these functions and create PHP Traits. The class can use this Trait to include the functionality of the functions defined in it.

Let’s take an example, where we create a Message class.

class Message
{
}

Let say there exists a class Welcome.

class Welcome
{
    public function welcome()
    {
        echo "Welcome","\n"
    }
}

read more

15 PHP Interview Questions and Answers for Experienced

PHP developers are still in high demand for the web application development. And there are more and more high-end enterprise level websites getting created using PHP. Hence, we are adding 15 more PHP interview questions and answers for the experienced web developers. In our last post, you might have seen that we’d published the 30 PHP questions for beginners.

All of you might be aware of the fact that Web development market is growing like anything. And especially the web programmers are the primary beneficiary of this growth. Hence, most of them tend to learn technologies like PHP, HTML/CSS, JavaScript, AngularJS, and NodeJS. To turn them into a better programmer, we’d started this series of web developer interview questions.

Starting with our first post on the 50 most essential AngularJS interview questions, we later had taken up other web development topics like NodeJS, CSS/HTML, and now PHP. Our team has studied the latest trends and the patterns of the questions asked in the interviews. All of this help us serve you better and achieve our goal of making you succeed in job interviews.

PHP Interview Questions and Answers for Experienced

PHP Interview Questions and Answers for Experienced

PHP Interview Questions and Answers

Q-1. What is the difference between unlink and unset function in PHP?

Answer.

<unlink()> function is useful for file system handling. We use this function when we want to delete the files (physically). Let’s see a sample code.

<?php
$xx = fopen('sample.html', 'a');
fwrite($xx, '<h1>Hello !!</h1>');
fclose($xx);

unlink('sample.html');
?>

unset() function performs variable management. It makes a variable undefined. Or we can say that unset() changes the value of a given variable to null. Thus, in PHP if a user wants to destroy a variable, it uses unset(). It can remove a single variable, multiple variables, or an element from an array. Let’s see a sample code.

<?php
$val = 200;
echo $val; //Out put will be 200
$val1 = unset($val);
echo $val1; //Output will be null
?>
<?php
unset($val);  // remove a single variable
unset($sample_array['element']); //remove a single element in an array
unset($val1, $val2, $val3); // remove multiple variables
?>

Q-2. What are PHP Traits?

Answer.

It is a mechanism that allows us to do code reusability in single inheritance language, such as PHP. Its structure is almost same as that of PHP class, just that it is a group of reusable functions. Despite having same name and definition, they appear in several classes, each one having a separate declaration leading to code duplicity. We can group these functions and create PHP Traits. The class can use this Trait to include the functionality of the functions defined in it.

Let’s take an example, where we create a Message class.

class Message
{
}

Let say there exists a class Welcome.

class Welcome
{
    public function welcome()
    {
        echo "Welcome","\n"
    }
}

read more

Latest PHP Interview Questions to Refer for Quick Preparation

Here, we have the latest PHP interview questions for candidates who are sincerely looking for a job in PHP and determined to succeed. Our team has picked PHP questions for all levels starting from freshers to experienced.

Demand for PHP developers is growing consistently. And many IT companies are ready to offer a decent package for the right candidates. However, a lot of freelancing or contract options are also available for them. Large sites like Facebook, Baidu, Wikipedia, VK, and even Twitter are also using PHP for powering their backend services.

Despite so many opportunities, you should prepare hard without being complacent. In this post, we’ve added all relevant PHP interview questions covering most of the important areas of web development. So read them thoroughly, save time, and prepare fast.

Success in a technical interview would not only depend on how much you know but also on what should you know.

Latest PHP Interview Questions.

PHP Interview Questions and Answers.

Top PHP Interview Questions and Answers.

PHP Interview Questions & Answers.

Q-1. What does PEAR signify in PHP?

Answer.

PEAR is an acronym for PHP Extension and Application Repository. It was Stig S. Bakken who introduced it in 1999 with following features.

  • A structured library of open-sourced code for PHP users.
  • Simple code distribution and package management.
  • A standard style for code written in PHP.
  • The PHP Foundation Classes (PFC).
  • The PHP Extension Community Library (PECL).
  • A website, mailing lists, and download mirrors to support the PHP/PEAR community. Thus, PEAR is a community-driven project with the <PEAR Group> as its governing body.
  • It provides a command-line interface that can come into use for installing the packages on demand.

Q-2. What is the difference between $name and $$name?

Answer.

$name is a variable whereas $$name is a reference to the variable.

Let’s see an example.

$name "Welcome";

$Welcome "To";

$To "TechBeamers";

echo $name;
/*prints Welcome*/
echo $$name;
/*prints To*/
echo $$$name;
/*prints TechBeamers*/

This code sample prints the following message <WelcomeToTechBeamers>.

Q-3. How do you embed PHP code in an HTML page?

Answer.

In an HTML page, all PHP code must enclose within either of the three special markup tags recognized by the PHP Parser.

  • <?php PHP code goes here ?>
  • <? PHP code goes here ?>
  • <script language=”php”> PHP code goes here </script>

Amongst these <?php…?> is the most commonly used tag.

We can chain as many statements as required separating them with semicolon as shown below.

<?php

  echo "Hello World";

  echo "A second statement";

?>

Q-4. What is the name of scripting engine of PHP?

Answer.

ZEND Engine 2 is the name of the scripting engine that powers PHP.

Q-5. What is the difference between the GET and POST methods?

Answer.

Following are the key differences between <GET> and <POST>.

  • GET Method.

    • It submits all the Name-Value pairs as a query string in the URL.
    • This method is not secure and reveals the data transmitted with the URL.
    • The allowed length of the GET string should not exceed 2048 characters.
    • If the Form tag does not contain any method name, GET will take over as default.
    • The payload data is in the text format. It accepts only ASCII values.
    • GET is beneficial for performing data retrieval operation.
    • POST Method.

      • It submits all the Name-Value pairs in the Message Body of the request.
      • Unlike the GET, Post method is secure as the Name-Value pairs do not appear in the location bar of the web browser.
      • Since the payload gets encoded into the request, so it doesn’t show up as part of the URL.
      • There is no restriction on the length of the string (i.e. the amount of data transmitted).
      • In case, the POST method is in use and page refresh happens at the same time, then a prompt will occur before processing the request.
      • If the service associated with the processing of a form has side effects (for example, modification of a database or subscription to a service), the method should be POST.
      • It has no restriction on data usage and permits binary data also.
      • POST is beneficial for performing both insert and update operations.

      Q-6. What are Magic functions in PHP?

      Answer.

      They are special PHP functions that start with a double underscore <__>. None of these are stand-alone. And it is mandatory to define them inside a Class.

      Below are some facts about the Magic functions in PHP.

      • It is the programmer who provides their definition instead of PHP. By allowing the programmer to provide the definition, it enables him to achieve powerful things using these Magic functions.
      • PHP does not allow to call them directly from the code. Instead, the call happens indirectly.

      Let’s see an example.

      class Animal {
         // height of animal 
         public $height;
         // weight of animal
         public $weight;
         // code
         public function __construct($height, $weight)
         {
            $this->height = $height;  //set the height instance variable
            $this->weight = $weight; //set the weight instance variable
         }
      }

      read more

How to Setup Genymotion Emulator with Android Studio

What is Genymotion Emulator?

Genymotion emulator is one of the most used Android Studio plugins where you can deploy and test your mobile apps. Here, we have brought a step by step tutorial to download, setup, and use Genymotion with Android Studio.

For your note, there is also a native emulator that you get as default with the Android Studio. But it is quite slow and lags far behind than functioning as a real mobile device. Also, there is no emulator which can completely replace an actual device. But Genymotion is picking up as the best and closest choice of Android developers/testers when it comes to comparing the emulators.

read more