Upwork LAMP Test 2016.
83 Answered Test Questions:
1. Which of the following are correct regarding Linux devices?
Answers:
a. The character devices work with data streams
a. The sockets are special-purpose I/O files offering a type of network interface
a. A block device’s total size varies and a program has random access to any block in the device
a. A named pipe is like a character device, but there is another process at the other end of the I/O stream instead of a kernel driver
2. Which of the following are correct regarding the .htaccess file in an Apache server?
Answers:
a. The name ‘.htaccess’ is universally acceptable
a. Any text editor can be used to create or make the changes to the .htaccess files
a. An .htaccess file is simply a text file containing Apache directives
a. Directives residing in the .htaccess file apply to the documents in the directory where the .htaccess file is located
3. Which of the following are correct with regard to indexes in MySql?
Answers:
a. With clustered indexes, the primary key and the record itself are “clustered” together
a. When your data is almost always searched through via its primary key, clustered indexes can make lookups drastically slow
a. With separate indexes on first_name and last_name, MySQL can eliminate rows based on both fields
a. Indexes are not always used to locate matching rows for a query
4. Which of the following statements are incorrect regarding referential integrity?
Answers:
a. A foreign key can refer to a primary key
a. A foreign key can refer to a unique key
a. The on delete cascade clause will work only if there is a reference to a primary key
a. The referred key can either be in the same table or in some other table
a. A foreign key can be composite
a. Referential integrity can only be applied while creating the table
5. Mike Johnson is running Apache on an extremely busy server where hundreds of requests per second is a requirement. He might have to change the default hard limits set in the MPM module. Which of the following hard limits should he change?
Answers:
a. HARD_SERVER_LIMIT
a. HARD_THREAD_LIMIT
a. HARD_MPM_LIMIT
a. HARD_PROCESS_LIMIT
6. Which of the following MySQL field names are correct?
Answers:
a. EmpNo
a. 25Block
a. #AccountID
a. _CustomerName
a. Product.Name
7. The include directive inserts the text of a document into the SSI document being processed. Which of the following statements has the correct syntax for the include directive?
Answers:
a. include file=”path”
a. include virtual=”URL”
a. include directive=”path”
a. All of the above
8. Refer to the small php script given below:
1. Which of the following are correct regarding Linux devices?
Answers:
a. The character devices work with data streams
a. The sockets are special-purpose I/O files offering a type of network interface
a. A block device’s total size varies and a program has random access to any block in the device
a. A named pipe is like a character device, but there is another process at the other end of the I/O stream instead of a kernel driver
2. Which of the following are correct regarding the .htaccess file in an Apache server?
Answers:
a. The name ‘.htaccess’ is universally acceptable
a. Any text editor can be used to create or make the changes to the .htaccess files
a. An .htaccess file is simply a text file containing Apache directives
a. Directives residing in the .htaccess file apply to the documents in the directory where the .htaccess file is located
3. Which of the following are correct with regard to indexes in MySql?
Answers:
a. With clustered indexes, the primary key and the record itself are “clustered” together
a. When your data is almost always searched through via its primary key, clustered indexes can make lookups drastically slow
a. With separate indexes on first_name and last_name, MySQL can eliminate rows based on both fields
a. Indexes are not always used to locate matching rows for a query
4. Which of the following statements are incorrect regarding referential integrity?
Answers:
a. A foreign key can refer to a primary key
a. A foreign key can refer to a unique key
a. The on delete cascade clause will work only if there is a reference to a primary key
a. The referred key can either be in the same table or in some other table
a. A foreign key can be composite
a. Referential integrity can only be applied while creating the table
5. Mike Johnson is running Apache on an extremely busy server where hundreds of requests per second is a requirement. He might have to change the default hard limits set in the MPM module. Which of the following hard limits should he change?
Answers:
a. HARD_SERVER_LIMIT
a. HARD_THREAD_LIMIT
a. HARD_MPM_LIMIT
a. HARD_PROCESS_LIMIT
6. Which of the following MySQL field names are correct?
Answers:
a. EmpNo
a. 25Block
a. #AccountID
a. _CustomerName
a. Product.Name
7. The include directive inserts the text of a document into the SSI document being processed. Which of the following statements has the correct syntax for the include directive?
Answers:
a. include file=”path”
a. include virtual=”URL”
a. include directive=”path”
a. All of the above
8. Refer to the small php script given below:
The getSal() of emp has to behave exactly as getSal() of person. Which of the following lines of code would you use to replace the ‘???’
Answers:
a. parent::getSal();
a. person::getSal();
a. parent::getSal;
a. person::getSal;
9. Which of the following statements are correct with respect to the get_browser function of PHP?
Answers:
a. It is used to extract the client’s browser information
a. It requires the browscap.ini to be placed on the server
a. It requires the browscap.ini to be placed on the client
a. None of the above is correct
10. Which of the following are the valid operations that MySQL performs simultaneously when a table is dropped?
Answers:
a. It removes all the rows from the table
a. It drops all the table’s indexes
a. It removes all dependent views
a. It removes all dependent procedures
11. Sometimes it is necessary to create a temporary file to collect output for use by a later command. While creating such a file, you must make sure that the filename is unique enough so that no other programs accidentally write on the temporary file. Which of the following are correct with regard to creation of temporary files?
Answers:
a. mktemp command can be used to create temporary filenames
a. The $$ special variable can be used to construct a temporary filename based on the process ID
a. All Linux flavors come with mktemp
a. You must use exit in the handler to explicitly end script execution
12. The architecture of MySql sets it apart from nearly every other database server. Which of the following are correct about different layers of MySql?
Answers:
a. The topmost layer is composed of the services that are not unique to MySQL
a. The second layer is made up of storage engines
a. The third layer is made up of storage engines
a. The interface between the second and the third layers is a single API not specific to any given storage engine
13. Which of the following statements are correct with respect to PHP connections?
Answers:
a. mysql_pconnect keeps the connection open across multiple requests
a. mysql_connect keeps the connection open across multiple requests
a. mysql_pconnect opens up a database connection for each page load
a. mysql_connect opens up a database connection for each page load
14. Which of the following can be used to implement data validation while creating a table in MySql?
Answers:
a. Checking constraint with specified values
a. Referential constraint by creating a foreign key for another table
a. Default value of a column
a. Null constraint
15. You have just installed a Linux system. You have upgraded the kernel and packages to the latest versions and you have turned off all unnecessary services and daemons. What else should you do to enhance security on the system?
Answers:
a. Change the root password
a. Set up a telnet session
a. Audit your log files
a. Turn off network card
16. During heavy INSERT, UPDATE, and DELETE activity, indexes slow down the performance. Which of the following setting controls this behavior?
Answers:
a. compound index
a. index_timer
a. delay_key_write
a. None of the above
17. Which of the following ways of creation of a virtual web site is not supported by Apache?
Answers:
a. Name-based
a. IP-based
a. Multiple main servers
a. None of the above
18. Which of the following is correct with regard to the statements given below?
Statement 1: If the internal network uses nonroutable IP addresses for either security or cost reasons, you can use a proxy server to provide Internet resources to hosts that normally cannot access the Internet.
Statement 2: Using a caching proxy such as Apache (with mod_perl), you can provide seemingly faster access to Internet resources to the local users.
Answers:
a. Statement 1 is true but statement 2 is false
a. Statement 1 is false but statement 2 is true
a. Both the statements are true
a. Both the statements are false
19. Which of the following is the standard authentication module, which implements Basic HTTP authentication?
Answers:
a. mod_auth
a. mod_auth_dbm
a. mod_auth_digest
a. mod_access
a. None of the above
20. What do you infer from the following code?
Statement 2: Using a caching proxy such as Apache (with mod_perl), you can provide seemingly faster access to Internet resources to the local users.
Answers:
a. Statement 1 is true but statement 2 is false
a. Statement 1 is false but statement 2 is true
a. Both the statements are true
a. Both the statements are false
19. Which of the following is the standard authentication module, which implements Basic HTTP authentication?
Answers:
a. mod_auth
a. mod_auth_dbm
a. mod_auth_digest
a. mod_access
a. None of the above
20. What do you infer from the following code?
Answers:
a. Only the first “\n” character will be recognized and the new line will be inserted
a. The last “\n” character will not be recognized and only the first two parts will come in the new lines
a. All the “\n” characters will work and the text will be printed on the respective new lines
a. All will be printed on one line irrespective of the “\n” characters
21. You have a table phone_book with 2 billion rows in it. Adding an index on last_name will require a lot of space. If the average last_name is 8 bytes long, you are looking at roughly 16 GB of space for the data portion of the index. Which of the following will help in reducing the size of index space?
Answers:
a. Indexing only the first 4 bytes
a. Indexing on partition
a. Keeping the index in more than one file
a. None of the above
22. Which of the following helps to keep an eye on the existing number of objects of a given class without introducing a non-class member variable?
Answers:
a. Addition of a member variable that gets incremented in the default constructor and decremented in the destructor
a. Addition of a local variable that gets incremented in each constructor and decremented in the destructor
a. Addition of a static member variable that gets incremented in each constructor and decremented in the destructor
a. This cannot be accomplished since the creation of objects is being done dynamically via “new”
23. Which of the following is the correct way to check whether the cookie is set or not before retrieving the value from “LoginCookie”?
Answers:
a. isset($COOKIE[‘LoginCookie’])
a. isset($_COOKIE[‘LoginCookie’])
a. isCookieSet(‘$LoginCookie’)
a. isCookieSet([‘$LoginCookie’])
24. How would you convert the date set in the following format into a PHP timestamp?
$date = “Monday, July 28, 2008 @ 12:15 am”;
Answers:
a. $date = replace(“@ “,””,$date); $date = strtotimestamp($date);
a. $date = replace(“@ “,””,$date); $date = strtotime($date);
a. $date = str_replace(“@ “,””,$date); $date = strtotime($date);
a. $date = str_replace(“@ “,””,$date); $date = strtotimestamp($date);
25. Refer to the code given below and select the while condition from the following options:
Answers:
a. $date = replace(“@ “,””,$date); $date = strtotimestamp($date);
a. $date = replace(“@ “,””,$date); $date = strtotime($date);
a. $date = str_replace(“@ “,””,$date); $date = strtotime($date);
a. $date = str_replace(“@ “,””,$date); $date = strtotimestamp($date);
25. Refer to the code given below and select the while condition from the following options:
$db = mysql_connect(“localhost”,”root”);
mysql_select_db(“mydb”,$db);
$result = mysql_query(“select state_id, state_text from states”);
mysql_select_db(“mydb”,$db);
$result = mysql_query(“select state_id, state_text from states”);
if ($result)
{
echo “
{
echo “
“;
}
Answers:
a. $myrow = mysql_fetch_array()
a. $myrow
a. $myrow = mysql_fetch_array($result)
a. $myrow = fetch_array($result)
26. The Manager and Office classes are as follows:
}
Answers:
a. $myrow = mysql_fetch_array()
a. $myrow
a. $myrow = mysql_fetch_array($result)
a. $myrow = fetch_array($result)
26. The Manager and Office classes are as follows:
Which of the following should replace ‘???’ to obtain the value of printName() function?
Answers:
a. $ofc->getManager()->printName();
a. new Office()->getManager()->printName();
a. $ofc->getManager->printName;
a. Office::getManager()::printName();
27. Which of the following is correct with regard to the statements given below?
Statement 1: When you set up Apache on an Internet host it can respond to an HTTP request for that host.
Statement 2: Apache does not allow virtual hosts to inherit configuration from the main server, which makes the virtual host configuration quite manageable in large installations.
Answers:
a. Statement 1 is true but statement 2 is false
a. Statement 1 is false but statement 2 is true
a. Both the statements are true
a. Both the statements are false
28. rpm -Uvh filename- 1.2-2.i386.rpm can be used to install an RPM package. What functions does it perform?
Answers:
a. It installs with additional information and hash marks
a. It upgrades with additional information and hash marks
a. It does not upgrade if an older package is not already installed. If the older package exists, then it upgrades with additional information and hash marks
a. It installs the package with additional information and hash marks, then removes the old packages
29. You want to see the block and character devices for which your system currently has drivers. Which of the following commands should you use in this scenario?
Answers:
a. list /proc/devices
a. show /proc/devices
a. find /proc/devices
a. cat /proc/devices
a. None of the above
30. ‘Perfect Services’ provides financial services worldwide. You want to display data from the table pers for joining_date from #1/1/2005# to #31/12/2005# and the job should either be of an analyst, a clerk or a salesman. Which of the following is correct?
Answers:
a. select * from Pers where joining_date from #1/1/2005# to #31/12/2005#, job=Analyst or clerk or salesman
a. select * from Pers where joining_date between #1/1/2005# to #31/12/2005#, job=Analyst or job=clerk or job=salesman
a. select * from Pers where joining_date between #1/1/2005# and #31/12/2005# and (job=Analyst or clerk or salesman)
a. None of the above
31. Based on the code given below, what will be the value of $num if mytable contains 12 records?
Statement 2: Apache does not allow virtual hosts to inherit configuration from the main server, which makes the virtual host configuration quite manageable in large installations.
Answers:
a. Statement 1 is true but statement 2 is false
a. Statement 1 is false but statement 2 is true
a. Both the statements are true
a. Both the statements are false
28. rpm -Uvh filename- 1.2-2.i386.rpm can be used to install an RPM package. What functions does it perform?
Answers:
a. It installs with additional information and hash marks
a. It upgrades with additional information and hash marks
a. It does not upgrade if an older package is not already installed. If the older package exists, then it upgrades with additional information and hash marks
a. It installs the package with additional information and hash marks, then removes the old packages
29. You want to see the block and character devices for which your system currently has drivers. Which of the following commands should you use in this scenario?
Answers:
a. list /proc/devices
a. show /proc/devices
a. find /proc/devices
a. cat /proc/devices
a. None of the above
30. ‘Perfect Services’ provides financial services worldwide. You want to display data from the table pers for joining_date from #1/1/2005# to #31/12/2005# and the job should either be of an analyst, a clerk or a salesman. Which of the following is correct?
Answers:
a. select * from Pers where joining_date from #1/1/2005# to #31/12/2005#, job=Analyst or clerk or salesman
a. select * from Pers where joining_date between #1/1/2005# to #31/12/2005#, job=Analyst or job=clerk or job=salesman
a. select * from Pers where joining_date between #1/1/2005# and #31/12/2005# and (job=Analyst or clerk or salesman)
a. None of the above
31. Based on the code given below, what will be the value of $num if mytable contains 12 records?
$result=mysql_query(“DELETE from mytable”);
$num=mysql_affected_rows();
Answers:
a. 0
a. 1
a. 12
a. undefined
32. Refer to the following declarations of the php variables:
$num=mysql_affected_rows();
Answers:
a. 0
a. 1
a. 12
a. undefined
32. Refer to the following declarations of the php variables:
$company = ‘ABS Ltd’;
$$company = ‘, Sydney’;
?>
Which of the following is not a correct way of printing ‘ABS Ltd , Sydney’?
Answers:
a. echo “$company $$company”;
a. echo “$company ${$company}”;
a. echo “$company ${‘ABS Ltd’}”;
a. echo “$company {$$company}”;
33. When Apache receives a URL request, it processes the request by serving the file to the client (the Web browser). It provides you with a flexible mechanism for rewriting the requested URL to a new one using custom URL rewrite rules. Which of the following is an incorrect server variable for URL Rewrite rules?
Answers:
a. SERVER_PROTOCOL
a. SERVER_SOFTWARE
a. HTTP_REFERER
a. REMOTE_FORWARD
a. REMOTE_ADDR
34. What will be the output of the following code?
$$company = ‘, Sydney’;
?>
Which of the following is not a correct way of printing ‘ABS Ltd , Sydney’?
Answers:
a. echo “$company $$company”;
a. echo “$company ${$company}”;
a. echo “$company ${‘ABS Ltd’}”;
a. echo “$company {$$company}”;
33. When Apache receives a URL request, it processes the request by serving the file to the client (the Web browser). It provides you with a flexible mechanism for rewriting the requested URL to a new one using custom URL rewrite rules. Which of the following is an incorrect server variable for URL Rewrite rules?
Answers:
a. SERVER_PROTOCOL
a. SERVER_SOFTWARE
a. HTTP_REFERER
a. REMOTE_FORWARD
a. REMOTE_ADDR
34. What will be the output of the following code?
$Rent = 250;
function Expenses($Other)
{
$Rent = 250 + $Other;
return $Rent;
}
Expenses(50);
echo $Rent;
Answers:
a. 300
a. 250
a. 200
a. The program will not compile
35. Whenever you create a table, MySQL stores the table definition in a file with the same name as the table. Which of the following is the extension of the table definition file?
Answers:
a. .tab
a. .frm
a. .tbk
a. .str
a. None of the above
36. To start the MySql server in Linux, you type the following from the command line:
function Expenses($Other)
{
$Rent = 250 + $Other;
return $Rent;
}
Expenses(50);
echo $Rent;
Answers:
a. 300
a. 250
a. 200
a. The program will not compile
35. Whenever you create a table, MySQL stores the table definition in a file with the same name as the table. Which of the following is the extension of the table definition file?
Answers:
a. .tab
a. .frm
a. .tbk
a. .str
a. None of the above
36. To start the MySql server in Linux, you type the following from the command line:
bin/safe_mysqld &
What does the ‘&’ mean in the command mentioned above?
Answers:
a. It forces Mysql to ask the password
a. It forces Mysql to run in the background
a. It logins with windows login credentials
a. None of the above
37. Which of the following statements are true with regard to comparisons in PHP5?
Answers:
a. With the “= =” operator, two object instances are equal if they have the same attributes and values, and are instances of different classes
a. With the “= =” operator, two object instances are equal if they have the same attributes and values, and are instances of the same class
a. With the (===) operator, object variables are identical if and only if they refer to the same instance of the same class
a. With the (===) operator, object variables are identical if and only if they refer to a different instance of the same class
38. Which of the following queries will correctly retrieve the ages and addresses of those students who have been studying in the school for the last 2 years?
Answers:
a. $SQL_QUERY=”select age,address from student where regdate =”; $SQL_QUERY .= “DATE_SUB(CURRENT_DATE,Interval 2 YEAR)”;
a. $SQL_QUERY=”select age,address from student where regdate =”; $SQL_QUERY .= “DATE_SUB(CURRENT_DATE,Interval 2)”;
a. $SQL_QUERY=”select age,address from student where regdate =”; $SQL_QUERY .= “CURRENT_DATE-2″;
a. $SQL_QUERY=”select age,address from student where regdate =”; $SQL_QUERY .= “Year(CURRENT_DATE)-Year(CURRENT_DATE-2)”;
39. Check the structure of the following tables:
Answers:
a. It forces Mysql to ask the password
a. It forces Mysql to run in the background
a. It logins with windows login credentials
a. None of the above
37. Which of the following statements are true with regard to comparisons in PHP5?
Answers:
a. With the “= =” operator, two object instances are equal if they have the same attributes and values, and are instances of different classes
a. With the “= =” operator, two object instances are equal if they have the same attributes and values, and are instances of the same class
a. With the (===) operator, object variables are identical if and only if they refer to the same instance of the same class
a. With the (===) operator, object variables are identical if and only if they refer to a different instance of the same class
38. Which of the following queries will correctly retrieve the ages and addresses of those students who have been studying in the school for the last 2 years?
Answers:
a. $SQL_QUERY=”select age,address from student where regdate =”; $SQL_QUERY .= “DATE_SUB(CURRENT_DATE,Interval 2 YEAR)”;
a. $SQL_QUERY=”select age,address from student where regdate =”; $SQL_QUERY .= “DATE_SUB(CURRENT_DATE,Interval 2)”;
a. $SQL_QUERY=”select age,address from student where regdate =”; $SQL_QUERY .= “CURRENT_DATE-2″;
a. $SQL_QUERY=”select age,address from student where regdate =”; $SQL_QUERY .= “Year(CURRENT_DATE)-Year(CURRENT_DATE-2)”;
39. Check the structure of the following tables:
Employee
———
Empno
Employeename
Salary
Deptno
———
Empno
Employeename
Salary
Deptno
Department
———
Deptno
Departname
———
Deptno
Departname
Mike wants to see the departments that have more than 100 employees. Which of the following queries returns the required result?
Answers:
a. Select departname from department where deptno in (select deptno from employee group by deptno having count(*) > 100);
a. Select departname from department where deptno in (select count(*) from employee group by deptno where count(*) > 100);
a. Select departname from department where count(deptno) > 100;
a. Select departname from department where deptno in (select count(*) from employee where count(*) > 100);
40. Refer to the statements given below and identify which of the following is correct.
Answers:
a. Select departname from department where deptno in (select deptno from employee group by deptno having count(*) > 100);
a. Select departname from department where deptno in (select count(*) from employee group by deptno where count(*) > 100);
a. Select departname from department where count(deptno) > 100;
a. Select departname from department where deptno in (select count(*) from employee where count(*) > 100);
40. Refer to the statements given below and identify which of the following is correct.
Statement 1: Without any indexes, the database uses a lot of disk I/O and can effectively pollute the disk cache.
Statement 2: Some extra disk space and a bit of CPU overhead is sacrificed on each INSERT, UPDATE, and DELETE query while using indexes.
Answers:
a. Statement 1 is true but statement 2 is false
a. Statement 1 is false but statement 2 is true
a. Both the statements are true
a. Both the statements are false
41. Which of the following subdirectory of the root directory provides system statistics through a directory-and-file interface which you can browse with standard Unix tools?
Answers:
a. etc
a. sbin
a. proc
a. lib
a. None of the above
42. State whether true or false:
Statement 2: Some extra disk space and a bit of CPU overhead is sacrificed on each INSERT, UPDATE, and DELETE query while using indexes.
Answers:
a. Statement 1 is true but statement 2 is false
a. Statement 1 is false but statement 2 is true
a. Both the statements are true
a. Both the statements are false
41. Which of the following subdirectory of the root directory provides system statistics through a directory-and-file interface which you can browse with standard Unix tools?
Answers:
a. etc
a. sbin
a. proc
a. lib
a. None of the above
42. State whether true or false:
By allowing the use of .htaccess files in user (or customer or client) directories, you are essentially extending a bit of your Webmaster privileges to anyone who can edit those files.
Answers:
a. True
a. False
43. Which of the following statements are true?
Answers:
a. True
a. False
43. Which of the following statements are true?
Statement 1: mysql_fetch_object – Returns an object with properties that correspond to the fetched row, or FALSE if there are no more rows
Statement 2: mysql_fetch_row- Returns a positive MySQL result resource to the query result, or FALSE on error.
Answers:
a. All the statements are true
a. All the statements are false
a. Only Statement 1 is true
a. Only statement 2 is true
44. Based on the code given below, what will be the value of, $num, if mytable contains 20 records out of which 10 have myprice=19, 5 have myprice=20 and 5 have myprice=2, before running the mysql_query?
Statement 2: mysql_fetch_row- Returns a positive MySQL result resource to the query result, or FALSE on error.
Answers:
a. All the statements are true
a. All the statements are false
a. Only Statement 1 is true
a. Only statement 2 is true
44. Based on the code given below, what will be the value of, $num, if mytable contains 20 records out of which 10 have myprice=19, 5 have myprice=20 and 5 have myprice=2, before running the mysql_query?
$resultSet=mysql_query(“UPDATE mytable set myprice = 20 where myprice < 20”);
$num=mysql_affected_rows();
Answers:
a. 0
a. 1
a. 5
a. 10
a. 15
a. 20
45. You want to enable SSI for a directory called ‘/www/mysite/htdocs/parsed’. Which of the following is the correct configuration to be added in httpd.conf?
Answers:
a. <Directory “/www/mysite/htdocs/parsed”> Options +Includes SetFilter INCLUDES
a. <Directory “/www/mysite/htdocs/parsed”> SetOutputFilter INCLUDES
a. <Directory “/www/mysite/htdocs/parsed”> Options Included
a. <Directory “/www/mysite/htdocs/parsed”> Options +Includes SetOutputFilter INCLUDES
a. None of the above
46. Which of the following is introduced in PHP5?
Answers:
a. __construct
a. __construct and __destruct
a. __constructor and __destructor
a. __constructor
47. ‘Web Logic’, a web hosting company, has two system administrators, and one of them has just been terminated from his position. What is the first thing that the current administrator should do to enhance security?
Answers:
a. Change the employee’s account password
a. Set an expiration date on the employee’s account
a. Disable the employee’s account
a. Change the root password
48. A user is trying to set a new password for his account. He wants to use the name of the company “MNC” as his password. Why would the system not allow this password?
Answers:
a. The minimum length of a password should be at least six characters
a. The characters cannot be in alphabetical order
a. Capital letters in a password cannot be used
a. The password is already in use by another user
49. The Apache source distribution comes with a script called configure that allows you to configure the source tree before you compile and install the binaries. Which of the following is an incorrect option for the configure script?
Answers:
a. –cache-file=file
a. –help-file
a. –exec-prefix=eprefix
a. –libexecdir=dir
a. None of the above
50. Which sequence will run successfully for the code given below?
$num=mysql_affected_rows();
Answers:
a. 0
a. 1
a. 5
a. 10
a. 15
a. 20
45. You want to enable SSI for a directory called ‘/www/mysite/htdocs/parsed’. Which of the following is the correct configuration to be added in httpd.conf?
Answers:
a. <Directory “/www/mysite/htdocs/parsed”> Options +Includes SetFilter INCLUDES
a. <Directory “/www/mysite/htdocs/parsed”> SetOutputFilter INCLUDES
a. <Directory “/www/mysite/htdocs/parsed”> Options Included
a. <Directory “/www/mysite/htdocs/parsed”> Options +Includes SetOutputFilter INCLUDES
a. None of the above
46. Which of the following is introduced in PHP5?
Answers:
a. __construct
a. __construct and __destruct
a. __constructor and __destructor
a. __constructor
47. ‘Web Logic’, a web hosting company, has two system administrators, and one of them has just been terminated from his position. What is the first thing that the current administrator should do to enhance security?
Answers:
a. Change the employee’s account password
a. Set an expiration date on the employee’s account
a. Disable the employee’s account
a. Change the root password
48. A user is trying to set a new password for his account. He wants to use the name of the company “MNC” as his password. Why would the system not allow this password?
Answers:
a. The minimum length of a password should be at least six characters
a. The characters cannot be in alphabetical order
a. Capital letters in a password cannot be used
a. The password is already in use by another user
49. The Apache source distribution comes with a script called configure that allows you to configure the source tree before you compile and install the binaries. Which of the following is an incorrect option for the configure script?
Answers:
a. –cache-file=file
a. –help-file
a. –exec-prefix=eprefix
a. –libexecdir=dir
a. None of the above
50. Which sequence will run successfully for the code given below?
Answers:
a. Expenses();Salary();Loan();Balance();
a. Salary();Expenses();Loan();Balance();
a. Expenses();Salary();Balance();Loan();
a. Balance();Loan();Salary();Expenses();
51. Which of the following is correct for specifying the default value?
Answers:
a. function GetDiscount($Type = “Special”) { . . . }
a. function GetDiscount(Type := “Special”) { . . . }
a. function GetDiscount($Type := “Special”) { . . . }
a. function GetDiscount($Type : “Special”) { . . . }
52. What will be the output of the following code?
$var1=”a”;
$$var1=”b”;
echo “$var1 $a”;
Answers:
a. a b
a. $var1 $a
a. Error: $a is undefined
a. Error: Parse error in line 2 ($$var1 = “b”)
53. Which of the following commands will you use if you need to strip the extension off of a filename or get rid of the directories in a full pathname?
Answers:
a. relativename
a. basename
a. firstname
a. None of the above
54. One of your PHP pages is very heavy and loading it takes about two minutes. But before it loads, a browser timeout occurs. Which of the following will help solve this problem?
Answers:
a. set_time_limit(60);
a. set_time_out(60);
a. set_time_limit(150);
a. set_time_out(150);
55. Food Cart Accounting System (FOCAS) is maintaining products in the products table, and wants to see the products which are 50 or more than 50 short of the minimum stock limit. The structure of the Products table is:
ProductID
ProductName
CurrentStock
MinimumStock
$$var1=”b”;
echo “$var1 $a”;
Answers:
a. a b
a. $var1 $a
a. Error: $a is undefined
a. Error: Parse error in line 2 ($$var1 = “b”)
53. Which of the following commands will you use if you need to strip the extension off of a filename or get rid of the directories in a full pathname?
Answers:
a. relativename
a. basename
a. firstname
a. None of the above
54. One of your PHP pages is very heavy and loading it takes about two minutes. But before it loads, a browser timeout occurs. Which of the following will help solve this problem?
Answers:
a. set_time_limit(60);
a. set_time_out(60);
a. set_time_limit(150);
a. set_time_out(150);
55. Food Cart Accounting System (FOCAS) is maintaining products in the products table, and wants to see the products which are 50 or more than 50 short of the minimum stock limit. The structure of the Products table is:
ProductID
ProductName
CurrentStock
MinimumStock
Two possible queries are:
Query 1:select * from products where currentStock>MinimumStock+50
Query 2:select * from products where currentStock-50>MinimumStock
Query 2:select * from products where currentStock-50>MinimumStock
Which of the following is correct?
Answers:
a. Query 1 is true but Query 2 is false
a. Query 1 is false but Query 2 is true
a. Both the queries are true
a. Both the queries are false
56. Indexes are known to speed up the search but they have some limitations also. Which of the following queries take much time despite having indexes on table?
Answers:
a. select * from articles (body) match against (‘database’)
a. select * from pages where page_text like “%buffy%”
a. select last_name from phone_book where last_name rlike “(son|ith)$”
a. select * from articles where body = “%database%”
a. All of the above
57. Read the following code snippet:
Answers:
a. Query 1 is true but Query 2 is false
a. Query 1 is false but Query 2 is true
a. Both the queries are true
a. Both the queries are false
56. Indexes are known to speed up the search but they have some limitations also. Which of the following queries take much time despite having indexes on table?
Answers:
a. select * from articles (body) match against (‘database’)
a. select * from pages where page_text like “%buffy%”
a. select last_name from phone_book where last_name rlike “(son|ith)$”
a. select * from articles where body = “%database%”
a. All of the above
57. Read the following code snippet:
1. for filename in *; do
2. if [ -f $filename ]; then
3. ls -l $filename
4. file $filename
5. else
6. echo $filename is not a regular file.
7. fi
8. done
2. if [ -f $filename ]; then
3. ls -l $filename
4. file $filename
5. else
6. echo $filename is not a regular file.
7. fi
8. done
What does ‘-f’ in line 2 mean?
Answers:
a. It stores a file name in the memory
a. It tests all the items in the current file
a. It tests all the items in the current working directory
a. None of the above
58. What is the function of the ‘swapon’ command while installing Linux in the command line interface mode?
Answers:
a. It creates a swap area in RAM
a. It activates a created swap partition
a. It creates a swap partition
a. It creates and activates a swap partition
59. What is the condition indicated if only the LI appears while attempting to boot a Linux system with LILO?
Answers:
a. Primary boot loader has been started
a. Secondary boot loader has been loaded
a. Tertiary boot loader has been loaded
a. Secondary boot loader signals it has been loaded
60. What will happen if the following code is executed?
Answers:
a. It stores a file name in the memory
a. It tests all the items in the current file
a. It tests all the items in the current working directory
a. None of the above
58. What is the function of the ‘swapon’ command while installing Linux in the command line interface mode?
Answers:
a. It creates a swap area in RAM
a. It activates a created swap partition
a. It creates a swap partition
a. It creates and activates a swap partition
59. What is the condition indicated if only the LI appears while attempting to boot a Linux system with LILO?
Answers:
a. Primary boot loader has been started
a. Secondary boot loader has been loaded
a. Tertiary boot loader has been loaded
a. Secondary boot loader signals it has been loaded
60. What will happen if the following code is executed?
$resultSet = mysql_query(“SELECT fname, lname FROM customers”)
for ($nIndex = 0; $nIndex < mysql_num_rows($resultSet) ; $nIndex++) { if (!mysql_data_seek($resultSet, $nIndex)) { echo “Cannot seek to row $nIndex\n”; continue; } if(!($row = mysql_fetch_object($resultSet))) continue; echo “$row->fname $row->lname
\n”;
}
Answers:
a. The fnames and lnames of all the customers will be printed
a. The lnames and fnames of all the customers will be printed
a. The fnames and lnames of all the customers will be printed in the reverse order
a. Only the fname and lname of the first customer will be printed
a. Only the fname and lname of the last customer will be printed
61. Which of the following are correct with regard to the sbin subdirectory of the root directory in Linux?
Answers:
a. It is the place to find system executables
a. Programs in sbin directories pertain to system management
a. Regular users usually do not have sbin components in their command paths
a. All of the above
62. You are facing a low key buffer problem. You want to increase the size of the key buffer from what it was set to at the startup. Which of the following is the correct syntax to perform this?
Answers:
a. mysql> SET buffer=50M;
a. mysql> SET key_buffer=50M;
a. mysql> SET GLOBAL key_buffer=50M;
a. mysql> SET DEFAULT key_buffer=50M;
a. None of the above
63. Which of the following is correct with regard to the statements given below?
for ($nIndex = 0; $nIndex < mysql_num_rows($resultSet) ; $nIndex++) { if (!mysql_data_seek($resultSet, $nIndex)) { echo “Cannot seek to row $nIndex\n”; continue; } if(!($row = mysql_fetch_object($resultSet))) continue; echo “$row->fname $row->lname
\n”;
}
Answers:
a. The fnames and lnames of all the customers will be printed
a. The lnames and fnames of all the customers will be printed
a. The fnames and lnames of all the customers will be printed in the reverse order
a. Only the fname and lname of the first customer will be printed
a. Only the fname and lname of the last customer will be printed
61. Which of the following are correct with regard to the sbin subdirectory of the root directory in Linux?
Answers:
a. It is the place to find system executables
a. Programs in sbin directories pertain to system management
a. Regular users usually do not have sbin components in their command paths
a. All of the above
62. You are facing a low key buffer problem. You want to increase the size of the key buffer from what it was set to at the startup. Which of the following is the correct syntax to perform this?
Answers:
a. mysql> SET buffer=50M;
a. mysql> SET key_buffer=50M;
a. mysql> SET GLOBAL key_buffer=50M;
a. mysql> SET DEFAULT key_buffer=50M;
a. None of the above
63. Which of the following is correct with regard to the statements given below?
Statement 1: The current implementation of the optional proxy module does not support reverse proxy or the latest HTTP 1.1 protocol.
Statement 2: Apache can be turned into a caching (forward) proxy server.
Answers:
a. Statement 1 is true but statement 2 is false
a. Statement 1 is false but statement 2 is true
a. Both the statements are true
a. Both the statements are false
64. You have defined three variables $to, $subject, and $body to send an email. Which of the following methods would you use to send an email?
Answers:
a. mail($to,$subject,$body)
a. sendmail($to,$subject,$body)
a. mail(to,subject,body)
a. sendmail(to,subject,body)
65. You have to upload a file named “SalesFile” using the form post method mentioned below. What should be the code in line 3 to accomplish the same?
Statement 2: Apache can be turned into a caching (forward) proxy server.
Answers:
a. Statement 1 is true but statement 2 is false
a. Statement 1 is false but statement 2 is true
a. Both the statements are true
a. Both the statements are false
64. You have defined three variables $to, $subject, and $body to send an email. Which of the following methods would you use to send an email?
Answers:
a. mail($to,$subject,$body)
a. sendmail($to,$subject,$body)
a. mail(to,subject,body)
a. sendmail(to,subject,body)
65. You have to upload a file named “SalesFile” using the form post method mentioned below. What should be the code in line 3 to accomplish the same?
1
2 Send this file:
3
4
Answers:
a.
a.
a.
a.
66. Where would you install LILO to allow a dual bootable system on a ‘system’ which already has Microsoft Windows NT 4.0 with an installed NTFS partition?
Answers:
a. Master Boot Region
a. First sector of the NTFS partition
a. Last sector of the boot partition
a. First sector of the boot partition
67. Which permission setting allows a user to run an executable with the permission of the owner of that file?
Answers:
a. Read
a. SUID
a. Write
a. SSH
68. Which of the following lines of the class mentioned below should be commented to execute the code without errors?
2 Send this file:
3
4
Answers:
a.
a.
a.
a.
66. Where would you install LILO to allow a dual bootable system on a ‘system’ which already has Microsoft Windows NT 4.0 with an installed NTFS partition?
Answers:
a. Master Boot Region
a. First sector of the NTFS partition
a. Last sector of the boot partition
a. First sector of the boot partition
67. Which permission setting allows a user to run an executable with the permission of the owner of that file?
Answers:
a. Read
a. SUID
a. Write
a. SSH
68. Which of the following lines of the class mentioned below should be commented to execute the code without errors?
1 class Insurance
2 {
3 function clsName()
4 {
5 echo get_class($this);
6 }
7 }
2 {
3 function clsName()
4 {
5 echo get_class($this);
6 }
7 }
8 $cl = new Insurance();
9 $cl->clsName();
10 Insurance::clsName();
Answers:
a. Line 8 and 9
a. Line 10
a. Line 9 and 10
a. All the three lines 8,9, and 10 should be left as it is
69. Consider the following sample code:
9 $cl->clsName();
10 Insurance::clsName();
Answers:
a. Line 8 and 9
a. Line 10
a. Line 9 and 10
a. All the three lines 8,9, and 10 should be left as it is
69. Consider the following sample code:
$x = 0xFFFE;
$y = 2;
$z = $x && $y;
What will be the value of $z?
Answers:
a. 0
a. 1
a. 2
a. 3
a. 4
70. You are building Apache from the source distribution. Which of the following is a mandatory requirement for Apache installation?
Answers:
a. ANSI C Compiler
a. Perl 5 Interpreter
a. Dynamic Shared Object support
a. None of the above
71. Refer to the classes that are defined as follows:
$y = 2;
$z = $x && $y;
What will be the value of $z?
Answers:
a. 0
a. 1
a. 2
a. 3
a. 4
70. You are building Apache from the source distribution. Which of the following is a mandatory requirement for Apache installation?
Answers:
a. ANSI C Compiler
a. Perl 5 Interpreter
a. Dynamic Shared Object support
a. None of the above
71. Refer to the classes that are defined as follows:
abstract class BaseCls{
protected abstract function getName();
}
protected abstract function getName();
}
class ChildCls extends BaseCls{
}
Which of the following implementations of getName() is invalid in ChildCls?
Answers:
a. protected function getName(){}
a. function getName(){}
a. private function getName(){}
a. public function getName(){}
72. You want to open a file in the PHP application and you also want this application to issue a warning and continue execution, in case the file is not found. Which of the following idea functions would you use in this scenario?
Answers:
a. include()
a. require()
a. nowarn()
a. getFile(false)
73. You need to allow only selected users from the users file into a particular area and you do not want to keep the username information in your .htaccess files. Which of the following is a correct statement to allow a group of users?
Answers:
a. require usergroup
a. require group
a. require users
a. require
74. You have an HTML file called mypage.html and you want to store meta headers of this html page. Which of the following directives specifies the filename extension for metainformation files?
Answers:
a. MetaExt
a. MetaFileType
a. MetaExtension
a. MetaSuffix
75. John Mark, an administrator, wants to set the Web server so that it will not show a directory listing if a user requests a page which is a directory. Which modification should he set up in the httpd.conf?
Answers:
a. User
a. ServerName
a. Remove indexes from configuration file
a. DocumentRoot
76. Which of the following special variables of a shell script holds the number of arguments passed onto the script?
Answers:
a. $~
a. $*
a. $#
a. $@
77. When a Unix program finishes, it leaves an exit code for the parent process that started the program. The exit code is a number. Which of the following numbers is returned if the program ran without problems?
Answers:
a. 0
a. 1
a. 13
a. 108
a. None of the above
78. Which of the following is correct regarding the statements given below?
Which of the following implementations of getName() is invalid in ChildCls?
Answers:
a. protected function getName(){}
a. function getName(){}
a. private function getName(){}
a. public function getName(){}
72. You want to open a file in the PHP application and you also want this application to issue a warning and continue execution, in case the file is not found. Which of the following idea functions would you use in this scenario?
Answers:
a. include()
a. require()
a. nowarn()
a. getFile(false)
73. You need to allow only selected users from the users file into a particular area and you do not want to keep the username information in your .htaccess files. Which of the following is a correct statement to allow a group of users?
Answers:
a. require usergroup
a. require group
a. require users
a. require
74. You have an HTML file called mypage.html and you want to store meta headers of this html page. Which of the following directives specifies the filename extension for metainformation files?
Answers:
a. MetaExt
a. MetaFileType
a. MetaExtension
a. MetaSuffix
75. John Mark, an administrator, wants to set the Web server so that it will not show a directory listing if a user requests a page which is a directory. Which modification should he set up in the httpd.conf?
Answers:
a. User
a. ServerName
a. Remove indexes from configuration file
a. DocumentRoot
76. Which of the following special variables of a shell script holds the number of arguments passed onto the script?
Answers:
a. $~
a. $*
a. $#
a. $@
77. When a Unix program finishes, it leaves an exit code for the parent process that started the program. The exit code is a number. Which of the following numbers is returned if the program ran without problems?
Answers:
a. 0
a. 1
a. 13
a. 108
a. None of the above
78. Which of the following is correct regarding the statements given below?
Statement 1: Before the server can send the page to the browser it must send the http headers.
Statement 2: session_start() is used to send some headers.
Answers:
a. Statement 1 is true but statement 2 is false
a. Statement 1 is false but statement 2 is true
a. Both the statements are true
a. Both the statements are false
79. Which program automatically determines the number of blocks in a device and sets some reasonable defaults?
Answers:
a. mkbds4
a. mke2fs
a. mksdef
a. mkcntd
a. None of the above
80. Which of the following statements is incorrect with regard to PHP interfaces?
Answers:
a. A class can implement multiple interfaces
a. An abstract class cannot implement multiple interfaces
a. An interface can extend multiple interfaces
a. Methods with the same name, arguments and sequence can exist in the different interfaces implemented by a class
81. A construction company is working on three projects: mall construction, residential construction and building business towers. A civil engineer can work only on one type of construction project but more than one civil engineer can work on one project whereas a sales person can handle any type of projects and any number of sales people can work on one project. Define the nature of the relationship between (civil engineer and projects) and (sales person and projects)?
Answers:
a. one to many, one to one
a. one to one, one to many
a. many to one, many to many
a. many to one, many to one
82. A production house has two sale outlets. Both the outlets are maintaining their data separately in servers A and B. The MD wants to see the sale of both the outlets in one report. Both the outlets use the same structure of the Sales table. Which of the following methods will you adopt to create this report?
Answers:
a. Select * from A.Sales join B.Sales
a. Select * from A.Sales union all B.Sales
a. select * from A.Sales,B.Sales
a. None of the above
83. Refer to the following statement:
Statement 2: session_start() is used to send some headers.
Answers:
a. Statement 1 is true but statement 2 is false
a. Statement 1 is false but statement 2 is true
a. Both the statements are true
a. Both the statements are false
79. Which program automatically determines the number of blocks in a device and sets some reasonable defaults?
Answers:
a. mkbds4
a. mke2fs
a. mksdef
a. mkcntd
a. None of the above
80. Which of the following statements is incorrect with regard to PHP interfaces?
Answers:
a. A class can implement multiple interfaces
a. An abstract class cannot implement multiple interfaces
a. An interface can extend multiple interfaces
a. Methods with the same name, arguments and sequence can exist in the different interfaces implemented by a class
81. A construction company is working on three projects: mall construction, residential construction and building business towers. A civil engineer can work only on one type of construction project but more than one civil engineer can work on one project whereas a sales person can handle any type of projects and any number of sales people can work on one project. Define the nature of the relationship between (civil engineer and projects) and (sales person and projects)?
Answers:
a. one to many, one to one
a. one to one, one to many
a. many to one, many to many
a. many to one, many to one
82. A production house has two sale outlets. Both the outlets are maintaining their data separately in servers A and B. The MD wants to see the sale of both the outlets in one report. Both the outlets use the same structure of the Sales table. Which of the following methods will you adopt to create this report?
Answers:
a. Select * from A.Sales join B.Sales
a. Select * from A.Sales union all B.Sales
a. select * from A.Sales,B.Sales
a. None of the above
83. Refer to the following statement:
Select CustomerName, AccountNumber from Customers where AccountNumber in(select AccountNumber from Transactions where TransactionDate=#12/12/2005#)
Which of the following is correct?
Answers:
a. In the sub query, * should be used instead of AccountNumber
a. The sub query can return only one row, so “in” should be replaced with “=in” the prime query
a. The sub query should be used first
a. None of the above
Answers:
a. In the sub query, * should be used instead of AccountNumber
a. The sub query can return only one row, so “in” should be replaced with “=in” the prime query
a. The sub query should be used first
a. None of the above
No comments:
Post a Comment