Saturday, August 29, 2009

PART-II - PHP interview questions

  1. How can we repair a MySQL table?
  2. What are the advantages of stored procedures, triggers, indexes?
  3. What is maximum size of a database in MySQL?
  4. Give the syntax of Grant and Revoke commands?
  5. Explain Normalization concept?
  6. What is the maximum length of a table name, database name, and fieldname in MySQL?
  7. How many ways we can we find the current date using MySQL?
  8. What are the advantages and disadvantages of Cascading Style Sheets?
  9. What type of inheritance that PHP supports?
  10. How can increase the performance of MySQL select query?
  11. How many values can the SET function of MySQL take?
  12. What are the other commands to know the structure of table using MySQL commands except explain command?
  13. How many tables will create when we create table, what are they?
  14. What is the purpose of the following files having extensions 1) .frm 2) .myd 3) .myi? What do these files contain?
  15. How can we find the number of rows in a table using MySQL?
  16. How can we find the number of rows in a result set using PHP?
  17. The structure of table view buyers is as follows:
    +----------------+-------------+------+-----+---------+----------------+
    
    | Field | Type | Null | Key | Default | Extra |
    +----------------+-------------+------+-----+---------+----------------+
    | user_pri_id | int(15) | | PRI | NULL | auto_increment |
    | userid | varchar(10) | YES | | NULL | |
    +----------------+-------------+------+-----+---------+----------------+

    the value of user_pri_id the last row 2345 then What will happen in the following conditions?

    Condition1: Delete all the rows and insert another row then. What is the starting value for this auto incremented field user_pri_id ,
    Condition2: Delete the last row(having the field value 2345) and insert another row then. What is the value for this auto incremented field user_pri_id

  18. What are the advantages/disadvantages of MySQL and PHP?
  19. What is the difference between GROUP BY and ORDER BY in Sql?
  20. What is the difference between char and varchar data types?
  21. What is the functionality of md5 function in PHP?
  22. When viewing an HTML page in a Browser, the Browser often keeps this page in its cache. What can be possible advantages/disadvantages of page caching? How can you prevent caching of a certain page (please give several alternate solutions)?
  23. What are the different methods of passing data or information between two calls of a web page? What are the advantages/disadvantages of these methods?
  24. An Apache web server is running on a Linux system. Suddenly, the web server delivers the pages very slow. How could you find out possible reasons for that (when using system commands, please specify their names)?
  25. What are the different ways to login to a remote server? Explain the means, advantages and disadvantages?
  26. Please give a regular expression (preferably Perl/PREG style), which can be used to identify the URL from within a HTML link tag. Example: The regular expression should match the tag and give the URL (”http://www.freshershome.com /”) as a return result. Tags should also be matched if they contain other attributes than the HREF attribute.
  27. How can I load data from a text file into a table?
  28. How can we know the number of days between two given dates using MySQL?
  29. How can we know the number of days between two given dates using PHP?
  30. How can we change the name of a column of a table?
  31. How can we change the name and data type of a column of a table?
  32. What are the differences between drop a table and truncate a table?
  33. When you want to show some part of a text displayed on an HTML page in red font color, what different possibilities are there to do this? What are the advantages/disadvantages of these methods?
  34. A select query over a large table runs very slow because of the growing number of entries in that table. What different measures could be taken to improve speed?
  35. A company wants to store their invoices in a database. They already have their customers and articles in that database. Both customer and article are each identified by an unique integer value. Please create the SQL statements for creating the necessary table(s) for storing the invoices in a MySQL database. An invoice should hold information like invoice number, customer, date, article(s) and quantity etc.
  36. For the database from the previous question, please give an SQL query which returns the invoice number of all invoices which contain the article with the number “1234″. The query should be able to run under a MySQL 4.0 database.
  37. How would you backup and restore a big MySQL database? What are the advantages of the approach which you have taken over the others?
  38. How can I find what type of images that the PHP version supports?
  39. The table tbl_sites contains the following data:
    -----------------------------------------------------
    
    Userid sitename country
    ------------------------------------------------------
    1 Ilyas indian
    2 thewalkin KarnaTaka
    3 PHP.net usa
    4 PHPtalk.com germany
    5 MySQL.com usa
    6 sureshbabu canada
    7 PHPbuddy.com pakistan
    8. PHPtalk.com austria
    9. PHPfreaks.com sourthafrica
    10. PHPsupport.net russia
    11. sureshbabu australia
    12. sureshbabu nepal
    13. PHPtalk.com italy

    Write a select query that will displayed the duplicated site name and how many times it is duplicated? …

  40. Create a PHP web script with the following attributes: on start, three HTML form elements are shown: an string input field, a checkbox field, a dropdown/pull down list with 5 elements and a submit button. On submission, the form should be redisplayed (while remaining all options/inputs as the user has selected/entered them). Additionally, the selections/inputs of the user should be displayed in text. Please solve this without the use of any external libraries.
  41. What is MIME?
  42. What is PEAR in PHP?
  43. How can I use the COM components in PHP?
  44. How can I load the DLLs dynamically?
  45. How many ways we can give the output to a browser?
  46. How can we know that a session is started or not?
  47. What is the default session time in PHP and how can I change it?
  48. What changes I have to done in PHP.ini file for file uploading?
  49. What are the differences between MySQL_fetch_array(), MySQL_fetch_object(), MySQL_fetch_row()?
  50. How can I set a cron and how can i execute it in Unix, Linux, and windows?
  51. Steps for the payment gateway processing?
  52. How many ways I can register the variables into session?
  53. Explain different types of errors in PHP (i.e. arguments in errorreporting function)?
  54. How many ways I can redirect a PHP page?
  55. List out different arguments in PHP header function?
  56. What type of headers have to add in the mail function in which file a attached?
  57. What is the difference between
  58. What are the differences between PHP3 and PHP4 versions?
  59. What are the differences between include() and include_once() functions?
  60. Describe the importance of DABA BASE ABSTRACTION LAYERS in PHP and database connection?
  61. Explain MySQL optimization?
  62. What is the difference between using copy() and move() function in PHP file uploading?
  63. What is the difference between Reply-to and Return-path in the headers of a mail function?
  64. Explain about Type Juggling in PHP?
  65. How can I get the only name of the current executing file?
  66. How can I embed a java programme in PHP file and what changes have to be done in PHP.ini file?

PHP interview questions

Some Best PHP Based Interview Questions

  1. What are the differences between Get and post methods in form submitting, give the case where we can use get and we can use post methods?
  2. Who is the father of PHP and explain the changes in PHP versions?
  3. How can we submit a form without a submit button?
  4. In how many ways we can retrieve the date in the result set of mysql using PHP?
  5. What is the difference between mysql_fetch_object and mysql_fetch_array?
  6. What is the difference between $message and $$message?
  7. How can we extract string ‘theWalkin.com ‘ from a string ‘http://www.TheWalkin.com’ using regular expression of PHP?
  8. How can we create a database using PHP and mysql?
  9. What are the differences between require and include, include_once?
  10. Can we use include (”TheWalkin.php”) two times in a PHP page “makeit.PHP”?
  11. What are the different tables present in mysql, which type of table is generated when we are creating a table in the following syntax: create table employee(eno int(2),ename varchar(10)) ?
  12. Functions in IMAP, POP3 AND LDAP?
  13. How can I execute a PHP script using command line?
  14. Suppose your Zend engine supports the mode Then how can u configure your PHP Zend engine to support mode ?
  15. Shopping cart online validation i.e. how can we configure Paypal, etc.?
  16. What is meant by nl2br()?
  17. Draw the architecture of Zend engine?
  18. What are the current versions of apache, PHP, and mysql?
  19. What are the reasons for selecting lamp (linux, apache, mysql, PHP) instead of combination of other software programmes, servers and operating systems?
  20. How can we encrypt and decrypt a data present in a mysql table using mysql?
  21. How can we encrypt the username and password using PHP?
  22. What are the features and advantages of object-oriented programming?
  23. What are the differences between procedure-oriented languages and object-oriented languages?
  24. What is the use of friend function?
  25. What are the differences between public, private, protected, static, transient, final and volatile?
  26. What are the different types of errors in PHP?
  27. What is the functionality of the function strstr and stristr?
  28. What are the differences between PHP 3 and PHP 4 and PHP 5?
  29. How can we convert asp pages to PHP pages?
  30. What is the functionality of the function htmlentities?
  31. How can we get second of the current time using date function?
  32. How can we convert the time zones using PHP?
  33. What is meant by urlencode and urldocode?
  34. What is the difference between the functions unlink and unset?
  35. How can we register the variables into a session?
  36. How can we get the properties (size, type, width, height) of an image using PHP image functions?
  37. How can we get the browser properties using PHP?
  38. What is the maximum size of a file that can be uploaded using PHP and how can we change this?
  39. How can we increase the execution time of a PHP script?
  40. How can we take a backup of a mysql table and how can we restore it. ?
  41. How can we optimize or increase the speed of a mysql select query?
  42. How many ways can we get the value of current session id?
  43. How can we destroy the session, how can we unset the variable of a session?
  44. How can we destroy the cookie?
  45. How many ways we can pass the variable through the navigation between the pages?
  46. What is the difference between ereg_replace() and eregi_replace()?
  47. What are the different functions in sorting an array?
  48. How can we know the count/number of elements of an array?
  49. What is the PHP predefined variable that tells the What types of images that PHP supports?
  50. How can I know that a variable is a number or not using a JavaScript?
  51. List out some tools through which we can draw E-R diagrams for mysql.
  52. How can I retrieve values from one database server and store them in other database server using PHP?
  53. List out the predefined classes in PHP?
  54. How can I make a script that can be bilanguage (supports English, German)?
  55. What are the difference between abstract class and interface?
  56. How can we send mail using JavaScript?

Call center Interview questions

1. If You join the company then what is the first thing you want to do , which you were not able to do in ur previous company?
2. Being a MCA graduate why you are looking for a call center job?
3. You don’t have any experience in call center field? why should i hire u?

4. q: why did u join in call center:
ans: Now a days call center are glittering high in the market.They offering nice package and career.obviously one day you will be in a good position.it offers a lot of scope in developing your position
5. Tell something about BPO
6. Which colour do u like?
7. Why did you want to join the call center?
8. what is the difference of domestic and international call centre?
9. why do you want to join a call centre being a computer science graduate?
10. Tell me about your favorite colour?
11. What would u do, if u become a prime minister of ur country for six months
12. As am a fresher i don’t know how to attend a interview ,give me some tips?
13. Can u stay awake in the night?
14. Do u know how to speak English with American accent?
15. Do u have the patience to listen to others’ problems?

Advanced PHP Questions

Some of the Advanced questions.
Are available here:

  1. How to Generate Random Numbers using php?
  2. You can generate Random Numbers using php: follow the code.
    srand(time());
    $random = (rand()%9);
    print("random number between 0 and 9 is: $random");
    ?>

  3. How to send Mail Using PHP to send mail?
  4. Let’s get interactive with surfers again. I’d like to create a form mail system in PHP. First we need to create a form in HTML to gather the information. I am going to use one similar to my Perl http://www.tdscripts.com/formmailer.html, because it looks clean.

    form action="send_email.php3" method="POST">

    The $to variable will be defined in the send_mail.php3 script to point to my email address (you’ll see the php code momentarily), of course. I also prefill the subject with the words "diary entry suggestion" which visitors can change to something else, if they want:

    Ok, let’s take a look at the code to mail the contents of the above form to me and if the process is successful it will redirect you right back to this page. In order for this code to work you will need to know the path to sendmail on your server.

    $to = "webmaster@php-scripts.com";
    $from_header = "From: $from";
    if($contents != "")
    {
    //send mail - $subject & $contents come from surfer input
    mail($to, $subject, $contents, $from_header);
    // redirect back to url visitor came from
    header("Location: $HTTP_REFERER");
    }
    else
    {
    print("Error, no comments were submitted!");
    print("");
    }
    ?>

    Notes: I make sure there are some comments submitted or else show an error message by using the != (not equal) with an if statement. When you want to redirect the browser using the header function (like when using the setcookie function) you must do it before any HTML. With the header and $HTTP_REFERER in the code above I am simply sending people who submit the form back where they came from, which should will be this page that calls the form. I could have easily changed the header line to read:

    header("Location: http://www.freshershome.com/thankyou.html");

  5. Using Regular Expressions - Validating Email Addresses
  6. Validating email addresses isn’t a perfect science, unfortunately. When you think of all the different possible formats, you have to be pretty broad — maybe too broad — in defining a matching pattern (or regular expression, whatever you prefer to call it). You will find many different regular expressions other programmers have written for validating email addresses so mine certainly isn’t the only one (nor am I egotistical enough to suggest it is the best one), but it is one that works:

    // join the mail list?
    if ($php_script_list == "yes")
    {
    // is the $from email address in valid format?
    if(ereg("([[:alnum:]\.\-]+)(\@[[:alnum:]\.\-]+\.+)", $from))

    First we make sure the $php_script_list checkbox is checked. Then we check the syntax of the user submitted $from email address. The first portion of the email needs to contain at least one but likely more {alnum} alphanumeric (a-z or 0-9) character or the dash - symbol then there must be the @ symbol followed by at least one, but likely more. Then there is more alphanumeric characters and at least one period mixed in there. That’s what that long somewhat cryptic regular expression means.

    abc@123.com would be a valid email
    abc@123com woud be an INvalid email (missing period)
    1-1@1-1.com would be a valid email
    1-2.com would be an INvalid email (missing @)

    In regular expressions you enclose ranges within brackets. Thus [a-z] would mean any letter between a-z would return true. [a-c] would only return true if a,b,c was in the comparison string. I encourage you to refer to the php manual and look at the ereg function again.Note that when using ereg function patterns are case sensitive.

    int ereg(string pattern, string string, array [regs]);

    Use the eregi function in place of ereg for patterns that are case INsensitive. Let’s look at the rest of the mail list code:

    if(file_exists("email_list.txt"))
    {
    $newfile = fopen("email_list.txt", "r");
    while(!feof($newfile))
    {
    $duplicate = fgetss($newfile, 255);
    // is email address submitted already on file?
    if(eregi("$from", $duplicate))
    {
    print("This email $from");
    print(" is already in the database.
    Please go back");
    print(" and uncheck the mail list box");
    fclose($newfile);
    exit;
    }
    }
    fclose($newfile);
    $addemail = fopen("email_list.txt", "a");
    fputs($addemail, "$from\n");
    fclose($addemail);
    }
    else
    {
    // since file doesn't already exist, let's create for first time
    $newfile = fopen("email_list.txt", "a");
    fputs($newfile, "$from\n");
    fclose($newfile);
    chmod("email_list.txt", 0666);
    }

    Start by determining whether the email_list.txt file exists. If it does not exist then this is the very first time someone is being added to the list and we don’t need to bother with checking to see whether their email address is in the list or not. So we only need to create the file and write the email address. You may also notice I used the chmod function to set the file permissions for the email_list.txt file. This line of code is optional. When using the "a"ppend file option, Unix will automatically create the file for the first time and set the permissions. The problem is, depending, on the directory and umask settings it may create a file that only the script has owner permissions to read and write and update. By using the chmod function sometimes can be the only way to gain the permissions you want once a script has set the initial permissions. If you try to FTP a file to a directory and get the "permissions denied" error, you may very well need to write a small PHP script using the chmod command to change the permissions of the file (or simply delete the file, but then you’ll lose the data in it). Ok, but let’s say the email_list.txt file does exist, now the most logical thing to do is make sure we don’t already have that same email address on file. We do this by reading a line at a time of the existing file and comparing that line (I named the variable $duplicate) against the $from email address and seeing if there is a match. If there is then we print the message to the browser letting the person submitting the form know that we already have that email address in the database, close the open file, and exit the script. They can go back and uncheck the box and resubmit and the email will go through fine. Now if the email address does not match another email in the database they are appended to the end of the database.

  7. Changing a strings case in PHP
  8. // force all uppercase
    print(strtoupper("i bet this will show up as all letters capitalized
    "));
    // force all lowercase
    print(strtolower("I BET THIS WILL SHOW UP AS ALL LETTERS IN LOWERCASE
    "));
    // force the first letter of a string to be capitalized
    print(ucfirst("i bet this will show the first letter of the string capitalized
    "));
    // force the first letter of each WORD in a string to be capitalized
    print(ucwords("i bet this will show the first letter of every word capitalized
    "));
    ?>

  9. Admin Password gateway using PHP
  10. The HTML for the above form looks like:


    Admin password?


    Now the php code to check the submitted password versus the hardcoded one is:

    $adminpass = "test123";
    if ($pw == $adminpass)
    {
    print("Welcome to the administration area!");
    }
    else
    {
    print("Wrong password");
    }
    ?>

    If you try example 18 with password test123 it will let you in, otherwise you’ll get the wrong password message. As you can see it only takes a few lines of code and this will work on NT or Unix. Additionally, you would enclose the contents of the admin area inside the success portion of the if statement. For those using Unix servers, you also have .htacess available which we’ll look at next.

    Using .htaccess (UNIX only)

    For those who aren’t already familiar with .htaccess it is a server side password protection scheme. By uploading a file named .htaccess into a directory you can protect every file in that directory and beneath that directory from unauthorized use. Here’s a good way to look at the way .htaccess fundamentally works:

    yourdomain.com/root <————– same as typing —> www.yourdomain.com/
    yourdomain.com/root/members <———- upload .htaccess here —> www.yourdomain.com/members
    yourdomain.com/root/otherdirectory/dir/ <—- UNprotected –> www.yourdomain.com/otherdirectory/dir/
    yourdomain.com/root/members/otherdirectory/ <—- protected –> www.yourdomain.com/members/otherdirectory

    The code inside the .htaccess file you would upload would look like this:

    AuthName "Name to display"
    AuthType Basic
    AuthUserFile /home/usr/www/.htpasswd
    AuthGroupFile /dev/null
    require valid-user

    The AuthUserFile should contain the absolute path to this file above. The .htpasswd file will contain the user id and pw combinations to allow into the admin area. The code inside the .htpasswd file (you can name this file anything you want, though) will contain the username and encrypted password combination in the format

    username:encrypted_password

    While I know this is a very brief introductory to password protection using .htaccess, there are other resources on the web that can assist you with using .htaccess. Also I can get into .htaccess in more depth if enough people request it.

Aptitude Questions

  1. While traveling in a road, the road diverges left and right. one way goes to the heaven and other one goes to hell i want to go to heaven. In that village only two inhabitants are living one is knight and other one is knave. knight will always speak truth and knave will always speak lie. In that road one inhabitant is standing but we don’t know who is he. He might be an knight or knave i want to ask a question to that inhabitant to go to heaven. how can i identify that inhabitant is knight or कनवे
  2. These words follow a logical progression: CODIFY LAMINA STOVE RESET JOKUL QUIRES Which one of these comes next? REST, GRAIL, STOIC, ORDEAL
  3. There is a whole number n for which the following holds: if you put a 4 at the end of n, and multiply the number you get in that way by 4, the result is equal to the number you get if you put a 4 in front of n. In other words, we are looking for the number you can put on the dots in the following equation: 4… = 4 × …4 Which number must be put on the dots to get a correct equation?
  4. 361 -> 22 121 -> 14 81 -> 12 25 -> X What is the value of X?
  5. there are 4 cars . they all are coming from different directions. they have to cross through one square. they all arrive at the same time. nobody stops . still there is no clash . note : they all are driving at a speed if 100 km/hr. options are: 1) all cars take left 2) all cars turn right 3) two cars turn left and two turn right. tell me the answer with reason.
  6. The legendary king Midas possessed a huge amount of gold. He hid this treasure carefully: in a building consisting of a number of rooms. In each room there were a number of boxes; this number was equal to the number of rooms in the building. Each box contained a number of golden coins that equaled the number of boxes per room. When the king died, one box was given to the royal barber. The remainder of the coins had to be divided fairly between his six sons. Is a fair division possible in all situations?
  7. This is a most unusual paragraph. How quickly can you find out what is so unusual about it? It looks so ordinary that you would think that nothing is wrong with it at all, and, in fact, nothing is. But it is unusual. Why? If you study it and think about it, you may find out, but I am not going to assist you in any way. You must do it without any hints or coaching. No doubt, if you work at it for a bit, it will dawn on you. Who knows? Go to work and try your skill. Good luck! What is unusual about the above paragraph?

Php and MySQL Important Questions

  1. Which will be faster out of these two queries - one with OR or one with IN?
  2. Where does MyISAM cache table records?
  3. Which will be faster out of queries with explicit INNER JOIN and implicit one?
  4. Is InnoDB faster/better than MyISAM?
  5. Is CHAR faster than VARCHAR?
  6. Is VARCHAR(80) faster than VARCHAR(255)?
  7. Are there performance issues when joining tables from different storage engines?
  8. If I see Using temporary; Using filesort” in the Extra column of EXPLAIN output, does that mean a temporary table is created on disk?
  9. Is it possible to do a FULL OUTER JOIN in MySQL?
  10. How do you show the currently running queries? - SHOW FULL PROCESSLIST;
  11. How do you kill a MySQL query? - See the ID of it from the question above, then KILL id. You can separate multiple IDs by space.
  12. I need to find out how many client connections were aborted by MySQL server. - It’s displayed in SHOW STATUS query, alternatively accessible via mysqladmin extended-status.
  13. What does SET SQL_AUTO_IS_NULL =1 do? - you can find the last inserted row for a table that contains an AUTO_INCREMENT column by issuing WHERE auto_increment_column IS NULL
  14. Would I use print “$a dollars” or “{$a} dollars” to print out the amount of dollars in this example? - In this example it wouldn’t matter, since the variable is all by itself, but if you were to print something like “{$a},000,000 mln dollars”, then you definitely need to use the braces.
  15. How do you define a constant? - Via define() directive, like define (”MYCONSTANT”, 100);
  16. How do you pass a variable by value? - Just like in C++, put an ampersand in front of it, like $a = &$b
  17. Will comparison of string “10″ and integer 11 work in PHP? - Yes, internally PHP will cast everything to the integer type, so numbers 10 and 11 will be compared.
  18. When are you supposed to use endif to end the conditional statement? - When the original if was followed by : and then the code block without braces.
  19. Explain the ternary conditional operator in PHP? - Expression preceding the ? is evaluated, if it’s true, then the expression preceding the : is executed, otherwise, the expression following : is executed.
  20. How do I find out the number of parameters passed into function? - func_num_args() function returns the number of parameters passed in.
  21. If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of $$b? - 100, it’s a reference to existing variable.
  22. What’s the difference between accessing a class method via -> and via ::? - :: is allowed to access methods that can perform static operations, i.e. those, which do not require object initialization.
  23. Are objects passed by value or by reference? - Everything is passed by value.
  24. How do you call a constructor for a parent class? - parent::constructor($value)
  25. What’s the special meaning of __sleep and __wakeup? - __sleep returns the array of all the variables than need to be saved, while __wakeup retrieves them.
  26. Why doesn’t the following code print the newline properly?
    < ?php
    $str = ‘Hello, there.\nHow are you?\nThanks for visiting’;
    print $str;
    ?>
  27. Because inside the single quotes the \n character is not interpreted as newline, just as a sequence of two characters - \ and n.
  28. Would you initialize your strings with single quotes or double quotes? - Since the data inside the single-quoted string is not parsed for variable substitution, it’s always a better idea speed-wise to initialize a string with single quotes, unless you specifically need variable substitution.
  29. How come the code works, but doesn’t for two-dimensional array of mine? - Any time you have an array with more than one dimension, complex parsing syntax is required. print “Contents: {$arr[1][2]}” would’ve worked.
  30. What is the difference between characters \023 and \x23? - The first one is octal 23, the second is hex 23.
  31. With a heredoc syntax, do I get variable substitution inside the heredoc contents? - Yes.
  32. I want to combine two variables together:
    $var1 = 'Welcome to ';
    $var2 = '.com';
  33. What will work faster? Code sample 1:
    $var 3 = $var1.$var2;
    Or code sample 2:
    $var3 = "$var1$var2";
  34. Both examples would provide the same result - $var3 equal to “Welcome to.com”. However, Code Sample 1 will work significantly faster. Try it out with large sets of data (or via concatenating small sets a million times or so), and you will see that concatenation works significantly faster than variable substitution.
  35. For printing out strings, there are echo, print and printf. Explain the differences. - echo is the most primitive of them, and just outputs the contents following the construct to the screen. print is also a construct (so parentheses are optional when calling it), but it returns TRUE on successful output and FALSE if it was unable to print out the string. However, you can pass multiple parameters to echo, like:
  36. and it will output the string “Welcome to!” print does not take multiple parameters. It is also generally argued that echo is faster, but usually the speed advantage is negligible, and might not be there for future versions of PHP. printf is a function, not a construct, and allows such advantages as formatted output, but it’s the slowest way to print out data out of echo, print and printf.
  37. I am writing an application in PHP that outputs a printable version of driving directions. It contains some long sentences, and I am a neat freak, and would like to make sure that no line exceeds 50 characters. How do I accomplish that with PHP? - On large strings that need to be formatted according to some length specifications, use wordwrap() or chunk_split().
  38. What’s the output of the ucwords function in this example?
  39. $formatted = ucwords(” IS COLLECTION OF INTERVIEW QUESTIONS”);
  40. print $formatted;
  41. What will be printed is IS COLLECTION OF INTERVIEW QUESTIONS.
  42. ucwords() makes every first letter of every word capital, but it does not lower-case anything else. To avoid this, and get a properly formatted string, it’s worth using strtolower() first.
  43. What’s the difference between htmlentities() and htmlspecialchars()? - htmlspecialchars only takes care of <, >, single quote ‘, double quote ” and ampersand. htmlentities translates all occurrences of character sequences that have different meaning in HTML.
  44. What’s the difference between md5(), crc32() and sha1() crypto on PHP? - The major difference is the length of the hash generated. CRC32 is, evidently, 32 bits, while sha1() returns a 128 bit value, and md5() returns a 160 bit value. This is important when avoiding collisions.
  45. So if md5() generates the most secure hash, why would you ever use the less secure crc32() and sha1()? - Crypto usage in PHP is simple, but that doesn’t mean it’s free. First off, depending on the data that you’re encrypting, you might have reasons to store a 32-bit value in the database instead of the 160-bit value to save on space. Second, the more secure the crypto is, the longer is the computation time to deliver the hash value. A high volume site might be significantly slowed down, if frequent md5() generation is required.
  46. How do you match the character ^ at the beginning of the string? - ^\^

Hardware Interview Questions

Some of the Best Hardware Questions Put together by FreshersHome.com. With the Help of Sharpened.net.

  1. Is it possible to increase the number of available PCI slots on my computer?
  2. How can I print to a printer connected to an Airport Base Station?
  3. What is the difference between the DVD-R and DVD+R formats?
  4. What is the difference between Firewire 1394a and 1394b?
  5. Can I put my computer (tower) on its side, or does it need to stand up?
  6. Why is my mouse jumpy?
  7. What is a lost cluster?
  8. Why is my monitor’s screen smaller than advertised?
  9. Why does a 20″ flat screen display have a larger screen than a 20″ CRT monitor?
  10. Can I hook up two computers to one display or monitor?
  11. If I hook up two monitors to my computer, can two people work on the system at the same time?
  12. What does it mean to defragment a hard disk?
  13. Are Zip disks more reliable than 3.5″ diskettes (floppy disks)?
  14. Why does my hard drive make a lot of noise?
  15. Why does my hard drive spit and shutter so much even after I defragmented it?
  16. What would I want to partition my hard drive?
  17. What does it mean to reformat a hard drive?
  18. What is the difference between AGP and PCI graphics cards?
  19. Why won’t my scanner work?
  20. Why do videos run slow on my computer?
  21. How do find out how much RAM my computer has and how much it is using?
  22. How can I upgrade my computer to USB 2.0?
  23. Can I use a generic v.92 modem from Wal-Mart in my Dell computer?
  24. What is the difference between the AMD Athlon and Intel Pentium processors?
  25. What does scalable mean, in reference to a computer?
  26. Can I still start my computer if my hard drive fails?
  27. Why won’t my computer boot up after I installed new memory?
  28. What does it mean to “power cycle” a device?
  29. How can I tell if my CD/DVD drive burns CDs or DVDs?
  30. How can I make sure everything is deleted off my hard drive before I sell my computer?
  31. How do I know if the blank CDs & DVDs I buy are rewritable?
  32. Is it possible to recover files off a disk that has been reformatted or initialized?
  33. What do I need in order to burn my own CDs?
  34. What is the difference between an AGP and a PCI graphics card?
  35. How can I tell if a memory module is ECC parity RAM or non-ECC non-parity RAM?
  36. Can I replace non-ECC memory with ECC memory?
  37. How do I open files from a USB flash drive?
  38. Why won’t my new IDE hard drive work after I just installed it?
  39. What is the difference between a double density (DD) diskette, and a high density (HD) diskette?
  40. Why is monitor’s screen blank when I start up my computer?
  41. I changed my monitor’s color settings and can’t see anything now. What should I do?
  42. How can I connect my computer to a TV or television screen?
  43. What are some examples of computer peripheral devices?
  44. Why is the picture on my monitor fuzzy?
  45. How many monitors can I hook up to my desktop computer?
  46. Why does my monitor display a “Sync. Out of Range” error message?
  47. Can I fax a document without a fax machine?
  48. What does it mean when a computer is “low on resources?”
  49. What is the difference between physical memory and available memory?
  50. What is the difference between memory and hard disk space?
  51. What is the difference between burning and ripping?
  52. Will a USB 1.0 or 1.1 device work with my computer that only has USB 2.0 ports?
  53. What are the Alt (Option) and Control (Ctrl) keys for?
  54. What is the difference between “recover” and “restore?”
  55. Can I use my internal hard drive as an external hard drive?
  56. Will adding more RAM give my computer more free space?
  57. Can I transfer a program like Print Shop that is on many CDs to a single DVD?
  58. What is the difference between a USB hard drive and a USB flash drive?
  59. How can I free up space on my hard disk?

Important BPO Question Answers

Hai,
I am NOUFAL looking for the call centre jobs in bangalore.
please send me answers for the following questions.

If You join the company then what is the first thing you want to do , which you were not able to do in ur previous company?
ANS: In two parts:
1. If you are a fresher: Since I’m fresher this is my first company that I will be joing, hence I will be very glad to enhance my skills and learn more about the company ethics.
2. If you are experienced: I have been folded into carrying out a stereotype job which involved not much real time thinking and utisling my skilss, hence I will appreciate If given a chance to enhance my skills and made to learn new technologies, and adapt my self to new challanges.

Being a graduate why you are looking for a call center job?
Ans: Being a Graduate I can work more professionaly and understand the requirements of the job. It is my pattionate to work in a Call center.

You don’t have any experience in call center field? why should i hire u?
Every one at one stage in their life have no (0) experience, if they were not given the chance they would not have been in places where they are now, I expect my self to get a chance to prove my talent, skills, and ability to learn and adapt the changes.

Why did u join in call center:
I wanted to work in a call center, that is why I’m here.

Tell something about BPO
Ans: Business process outsourcing (BPO) is a form of outsourcing that involves the contracting of the operations and responsibilities of a specific business functions (or processes) to a third-party service provider. Originally, this was associated with manufacturing firms, such as Coca Cola that outsourced large segments of its supply chain.[1]. In the contemporary context, it is primarily used to refer to the outsourcing of services.

Which colour do u like?
Mention the color you like and why.

Why did you want to join the call center?
Business Process Outsoucing in a indusrty which not only pays in terms of Finacial benifit of course gives me an oppurtunity to be a part of a team which is of course Global Business, My Efforts have always been to be a part of a Global business environment, thats the reason I wish to join in a call centre.

what is the difference of domestic and international call centre?
A Domestic Call Center Involves Offering Support to Local i.e within a country.

Why do you want to join a call centre being a computer science graduate?
Ans: Though I’m a CS Graduate, I prefer working at a Callcenter, where I get to meet a team of Global Business and learn many things which can even enhance my career.

Tell me about your favorite colour?
Mention the color you like and why.

What would u do, if u become a prime minister of ur country for six months
As every one say, Remove povery, bring employement make police free from polictics, remove cast based politics and a lot more…

As am a fresher i don’t know how to attend a interview ,give me some tips?
You have be very clear about what you want as a fresher there can be many ppl guiding you to start off your career which might result into miss-guidance. Hence it is important to set goals and achevie them slowly. Be Confident learn the subject you are willing to work for, Attend the interview with confident be honest do not hide anything, lying causes you to become less confident hence do not lie.

Can u stay awake in the night?
Yes, if the job demands.

Do u know how to speak English with American accent?
Answer it honestly if yes or no.

Do u have the patience to listen to others’ problems?
I’m a good listener. (Answer yes if you r).

Computer Networks Top Interview Questions

Some of the Top Basic Computer Networks Questions, that must be Answered and known if you even think of attending any Networks/Network Admin Interviews.

  1. Virtual meetings on Internet are called………….
  2. LAN can be connected by devices called………..
  3. The bit pattern …………… is the preamble of 802.3 frame format.
  4. Basic SONET frame is a block of ……………. bytes.
  5. The amount of thermal noise is measured by ………………..
  6. Explain the Frequency Modulation.
  7. What is WAN and where it is used? how it is different from LAN and MAN.
  8. Explain single error detecting code with example.
  9. What is Flow control? Explain.
  10. Explain CSMA/CD Protocol.
  11. Describe Multitasking.
  12. Describe Service Primitives.
  13. Explain briefly PCM and its requirements.
  14. What is Concession Control describe i) Load shedding ii) Jitter Control. Under it.
  15. What is QoS?
  16. Token Bucket Algorithm is employed to prevent congestion. The capacity of the bucket is 250k byes Arriving rate of the token is 2MB/sec. if the maximum output rate is 25MB/sec, calculate the burst length in time.
  17. Describe principles considered in the design of network layer in the internet.
  18. Describe Address format used in Internet. [ With figure ]
  19. A Network on the Internet has a Subnet mask of 255.255.240.0. What is the maximum No. of hosts it can handle?
  20. What are basic difference between IPV4 and IPV6?
  21. Describe Address Resolution Protocol, use diagram if required.
  22. What is the difference between Interior gateway protocol and Exterior gateway protocol.
  23. What is the function of ATM adaptation layer.
  24. Illustrate the phenomenon of Silly Window Syndrome in TCP.
  25. What is delayed duplicate problem?
  26. Explain Unicast addresses, Multicast adresses, and broadcast address.

Important Unix Shell Questions

Some Important Unix Shell Questions

  1. There can be multiple Kernels and shells running on your system. True or False?
  2. Why shell is called Command Interpreter?
  3. Two UNIX systems may or may not use the same system calls. True or False?
  4. To obtain help on any feature of the system, what are the possible help sources available?
  5. Why are the directories /bin and /usr/bin usually found first in the output of echo $PATH?
  6. If two commands with the same filename exist in two directories in PATH, how can they be executed.
  7. How is the Current directory is indicated in the value of the PATH?
  8. Use the type command with the following arguments—cd, date, pwd and ls. Which are the internal commands in the list?
  9. What is the difference between an argument and an option?
  10. if the command ls –all works on your system, which flavor of UNIX could you be using?
  11. What does the secondary prompt look like and when does it appear?
  12. You located the string crontab in a man page by searching with /crontab [Enter]. How do you find out the other occurrences of this string in the page?
  13. What is a pager? Name the two standard pagers used by man.
  14. If a command doesn’t seem to complete, which key will you press to interrupt it?
  15. Do you need to wait for a command to finish before entering the next one?
  16. What do the | and the three dots in the SYNOPSIS section of these man pages indicate as shown below?
    /usr/xpg4/bin/tail [ -f | -r ]
    /usr/bin/ls [ -aAbcCdfFgilLmnopqrRstux1 ] [file .. ]
  17. How do you direct man to use a specific pager, say less?
  18. What is a whitespace? Explain the treatment the shell metes out to a command that contains a lot of whitespace.
  19. A Program file named foo exists in the current directory, but when we try to execute it by entering foo, we see the message foo: command not found. Explain how that can happen?
  20. What do multiprogramming, multiuser and multitasking mean?
  21. Why are many UNIX commands designed to perform simple rather than complex tasks?

Operating System Questions

What is MUTEX ?
What isthe difference between a ‘thread’ and a ‘process’?
What is INODE?
Explain the working of Virtual Memory.
How does Windows NT supports Multitasking?

Explain the Unix Kernel.
What is Concurrency? Expain with example Deadlock and Starvation.
What are your solution strategies for “Dining Philosophers Problem” ?
Explain Memory Partitioning, Paging, Segmentation.
Explain Scheduling.
Operating System Security.
What is Semaphore?
Explain the following file systems : NTFS, Macintosh(HPFS), FAT .
What are the different process states?
What is Marshalling?
Define and explain COM?
What is Marshalling?
Difference - Loading and Linking ?

ASP.NET Interview Questions

  1. Describe the role of inetinfo।exe, aspnet_isapi।dll andaspnet_wp.exe in the page loading process.inetinfo.exe is theMicrosoft IIS server running, handling ASP.NET requests among other things.When an ASP.NET request is received (usually a file with .aspx extension),the ISAPI filter aspnet_isapi.dll takes care of it by passing the request tothe actual worker process aspnet_wp.exe.
    What’s the difference between Response.Write() andResponse.Output.Write()?
  2. The later one allows you to write formattedoutput.
  3. What methods are fired during the page load?
  4. Init() - when the pageis instantiated
  5. Load() - when the page is loaded into server memory
  6. PreRender() - the brief moment before the page is displayed to the user asHTML,
    Unload() - when page finishes loading.
  7. Where does the Web page belong in the .NET Framework class hierarchy?
    System.Web.UI.Page
  8. Where do you store the information about the user’s locale?
    System.Web.UI.Page.Culture
  9. What’s the difference between Codebehind=”MyCode.aspx.cs” andSrc=”MyCode.aspx.cs”?
    CodeBehind is relevant to Visual Studio.NET only.
  10. What’s a bubbled event?
  11. When you have a complex control, like DataGrid, writing an event processing
  12. What’s the difference between Response.Write() andResponse.Output.Write()?
    Response.Output.Write() allows you to write formatted output.
  13. What methods are fired during the page load?
    Init() - when the page is instantiated
    Load() - when the page is loaded into server memory
    PreRender() - the brief moment before the page is displayed to the user as HTML
    Unload() - when page finishes loading.
  14. When during the page processing cycle is ViewState available?
    After the Init() and before the Page_Load(), or OnLoad() for a control.
  15. What namespace does the Web page belong in the .NET Framework class hierarchy?
    System.Web.UI.Page
  16. Where do you store the information about the user’s locale?
    System.Web.UI.Page.Culture
  17. What’s the difference between Codebehind=”MyCode.aspx.cs” andSrc=”MyCode.aspx.cs”?
    CodeBehind is relevant to Visual Studio.NET only.
  18. What’s a bubbled event?
    When you have a complex control, like DataGrid, writing an event processing routine for each object (cell, button, row, etc.) is quite tedious. The controls can bubble up their eventhandlers, allowing the main DataGrid event handler to take care of its constituents.
  19. Suppose you want a certain ASP.NET function executed on MouseOver for a certain button. Where do you add an event handler?
    Add an OnMouseOver attribute to the button. Example: btnSubmit.Attributes.Add(”onmouseover”,”someClientCodeHere();”);
  20. What data types do the RangeValidator control support?
    Integer, String, and Date.
  21. Explain the differences between Server-side and Client-side code?
    Server-side code executes on the server. Client-side code executes in the client’s browser.
  22. What type of code (server or client) is found in a Code-Behind class?
    The answer is server-side code since code-behind is executed on the server. However, during the code-behind’s execution on the server, it can render client-side code such as JavaScript to be processed in the clients browser. But just to be clear, code-behind executes on the server, thus making it server-side code.
  23. Should user input data validation occur server-side or client-side? Why?
    All user input data validation should occur on the server at a minimum. Additionally, client-side validation can be performed where deemed appropriate and feasable to provide a richer, more responsive experience for the user.
  24. What is the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other?
    Server.Transfer transfers page processing from one page directly to the next page without making a round-trip back to the client’s browser. This provides a faster response with a little less overhead on the server. Server.Transfer does not update the clients url history list or current url. Response.Redirect is used to redirect the user’s browser to another page or site. This performas a trip back to the client where the client’s browser is redirected to the new page. The user’s browser history list is updated to reflect the new address.
  25. Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?
    Valid answers are:
    ·
    A DataSet can represent an entire relational database in memory, complete with tables, relations, and views.
    · A DataSet is designed to work without any continuing connection to the original data source.
    · Data in a DataSet is bulk-loaded, rather than being loaded on demand.
    · There’s no concept of cursor types in a DataSet.
    · DataSets have no current record pointer You can use For Each loops to move through the data.
    · You can store many edits in a DataSet, and write them to the original data source in a single operation.
    · Though the DataSet is universal, other objects in ADO.NET come in different versions for different data sources.
  26. What is the Global.asax used for?
    The Global.asax (including the Global.asax.cs file) is used to implement application and session level events.
  27. What are the Application_Start and Session_Start subroutines used for?
    This is where you can set the specific variables for the Application and Session objects.
  28. Can you explain what inheritance is and an example of when you might use it?
    When you want to inherit (use the functionality of) another class. Example: With a base class named Employee, a Manager class could be derived from the Employee base class.
  29. Describe the difference between inline and code behind.
    Inline code written along side the html in a page. Code-behind is code written in a separate file and referenced by the .aspx page.
  30. Explain what a diffgram is, and a good use for one?
    The DiffGram is one of the two XML formats that you can use to render DataSet object contents to XML. A good use is reading database data to an XML file to be sent to a Web Service.
  31. Whats MSIL, and why should my developers need an appreciation of it if at all?
    MSIL is the Microsoft Intermediate Language. All .NET compatible languages will get converted to MSIL. MSIL also allows the .NET Framework to JIT compile the assembly on the installed computer.
  32. Which method do you invoke on the DataAdapter control to load your generated dataset with data?
    The Fill() method.
  33. Can you edit data in the Repeater control?
    No, it just reads the information from its data source.
  34. Which template must you provide, in order to display data in a Repeater control?
    ItemTemplate.
  35. How can you provide an alternating color scheme in a Repeater control?
    Use the AlternatingItemTemplate.
  36. What property must you set, and what method must you call in your code, in order to bind the data from a data source to the Repeater control?
    You must set the DataSource property and call the DataBind method.
  37. What base class do all Web Forms inherit from?
    The Page class.
  38. Name two properties common in every validation control?
    ControlToValidate property and Text property.
  39. Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in the combo box?
    DataTextField property.
  40. Which control would you use if you needed to make sure the values in two different controls matched?
    CompareValidator control.
  41. How many classes can a single .NET DLL contain?
    It can contain many classes.