1. Which of the following are correct regarding Linux devices?
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
<?php
class person{
function getSal()
{
. . .
. . .
}
}
class emp extends person{
function getSal()
{
???
}
}
?>
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:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
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:
Answers:
<?php
$str = ‘Dear Customer,nThanks for your query. We will reply very soon.?n Regards.n Customer Service Agent’;
print $str;
?>
Answers:
Answers:
Answers:
Answers:
$date = “Monday, July 28, 2008 @ 12:15 am”;
Answers:
$db = mysql_connect(“localhost”,”root”);
mysql_select_db(“mydb”,$db);
$result = mysql_query(“select state_id, state_text from states”);
if ($result)
{
echo “<SELECT NAME=’state_id’>”;
while (…condition…)
{
echo “<OPTION VALUE=””.$myrow[“state_id”].””>”.
$myrow[“state_text”].” </OPTION> “;
}
echo “</SELECT>”;
}
Answers:
<?php
class Manager{
function printName() {
echo “Manager”;
}
}
class Office{
function getManager() {
return new Manager();
}
}
$ofc = new Office();
???
?>
Which of the following should replace ‘???’ to obtain the value of printName() function?
Answers:
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:
Answers:
Answers:
Answers:
$result=mysql_query(“DELETE from mytable”);
$num=mysql_affected_rows();
Answers:
$company = ‘ABS Ltd’;
$$company = ‘, Sydney’;
?>
Which of the following is not a correct way of printing ‘ABS Ltd , Sydney’?
Answers:
Answers:
$Rent = 250;
function Expenses($Other)
{
$Rent = 250 + $Other;
return $Rent;
}
Expenses(50);
echo $Rent;
Answers:
Answers:
bin/safe_mysqld &
What does the ‘&’ mean in the command mentioned above?
Answers:
Answers:
Answers:
Employee
———
Empno
Employeename
Salary
Deptno
Department
———
Deptno
Departname
Mike wants to see the departments that have more than 100 employees. Which of the following queries returns the required result?
Answers:
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:
Answers:
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:
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:
$resultSet=mysql_query(“UPDATE mytable set myprice = 20 where myprice < 20”);
$num=mysql_affected_rows();
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
<?php
function Expenses()
{
function Salary()
{
}
function Loan()
{
function Balance()
{ }
}
}
?>
Answers:
Answers:
$var1=”a”;
$$var1=”b”;
echo “$var1 $a”;
Answers:
Answers:
Answers:
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
Which of the following is correct?
Answers:
Answers:
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
What does ‘-f’ in line 2 mean?
Answers:
Answers:
Answers:
$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 $nIndexn”;
continue;
}
if(!($row = mysql_fetch_object($resultSet)))
continue;
echo “$row->fname $row->lname<br />n”;
}
Answers:
Answers:
Answers:
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:
Answers:
1 <input type=”hidden” name=”MAX_FILE_SIZE” value=”30000″ />
2 Send this file:
3
4 <input type=”submit” value=”Send File” />
Answers:
Answers:
Answers:
1 class Insurance
2 {
3 function clsName()
4 {
5 echo get_class($this);
6 }
7 }
8 $cl = new Insurance();
9 $cl->clsName();
10 Insurance::clsName();
Answers:
$x = 0xFFFE;
$y = 2;
$z = $x && $y;
What will be the value of $z?
Answers:
Answers:
abstract class BaseCls{
protected abstract function getName();
}
class ChildCls extends BaseCls{
}
Which of the following implementations of getName() is invalid in ChildCls?
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
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:
Answers:
Answers:
Answers:
Answers:
Select CustomerName, AccountNumber from Customers where AccountNumber in(select AccountNumber from Transactions where TransactionDate=#12/12/2005#)
Which of the following is correct?
Answers:
Answers:
- The character devices work with data streams
- The sockets are special-purpose I/O files offering a type of network interface
- A block device’s total size varies and a program has random access to any block in the device
- 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
Answers:
- The name ‘.htaccess’ is universally acceptable
- Any text editor can be used to create or make the changes to the .htaccess files
- An .htaccess file is simply a text file containing Apache directives
- Directives residing in the .htaccess file apply to the documents in the directory where the .htaccess file is located
Answers:
- With clustered indexes, the primary key and the record itself are “clustered” together
- When your data is almost always searched through via its primary key, clustered indexes can make lookups drastically slow
- With separate indexes on first_name and last_name, MySQL can eliminate rows based on both fields
- Indexes are not always used to locate matching rows for a query
Answers:
- A foreign key can refer to a primary key
- A foreign key can refer to a unique key
- The on delete cascade clause will work only if there is a reference to a primary key
- The referred key can either be in the same table or in some other table
- A foreign key can be composite
- Referential integrity can only be applied while creating the table
Answers:
- HARD_SERVER_LIMIT
- HARD_THREAD_LIMIT
- HARD_MPM_LIMIT
- HARD_PROCESS_LIMIT
Answers:
- EmpNo
- 25Block
- #AccountID
- _CustomerName
- Product.Name
Answers:
- include file=”path”
- include virtual=”URL”
- include directive=”path”
- All of the above
<?php
class person{
function getSal()
{
. . .
. . .
}
}
class emp extends person{
function getSal()
{
???
}
}
?>
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:
- parent::getSal();
- person::getSal();
- parent::getSal;
- person::getSal;
Answers:
- It is used to extract the client’s browser information
- It requires the browscap.ini to be placed on the server
- It requires the browscap.ini to be placed on the client
- None of the above is correct
Answers:
- It removes all the rows from the table
- It drops all the table’s indexes
- It removes all dependent views
- It removes all dependent procedures
Answers:
- mktemp command can be used to create temporary filenames
- The $$ special variable can be used to construct a temporary filename based on the process ID
- All Linux flavors come with mktemp
- You must use exit in the handler to explicitly end script execution
Answers:
- The topmost layer is composed of the services that are not unique to MySQL
- The second layer is made up of storage engines
- The third layer is made up of storage engines
- The interface between the second and the third layers is a single API not specific to any given storage engine
Answers:
- mysql_pconnect keeps the connection open across multiple requests
- mysql_connect keeps the connection open across multiple requests
- mysql_pconnect opens up a database connection for each page load
- mysql_connect opens up a database connection for each page load
Answers:
- Checking constraint with specified values
- Referential constraint by creating a foreign key for another table
- Default value of a column
- Null constraint
Answers:
- Change the root password
- Set up a telnet session
- Audit your log files
- Turn off network card
Answers:
- compound index
- index_timer
- delay_key_write
- None of the above
Answers:
- Name-based
- IP-based
- Multiple main servers
- None of the above
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:
- Statement 1 is true but statement 2 is false
- Statement 1 is false but statement 2 is true
- Both the statements are true
- Both the statements are false
Answers:
- mod_auth
- mod_auth_dbm
- mod_auth_digest
- mod_access
- None of the above
<?php
$str = ‘Dear Customer,nThanks for your query. We will reply very soon.?n Regards.n Customer Service Agent’;
print $str;
?>
Answers:
- Only the first “n” character will be recognized and the new line will be inserted
- The last “n” character will not be recognized and only the first two parts will come in the new lines
- All the “n” characters will work and the text will be printed on the respective new lines
- All will be printed on one line irrespective of the “n” characters
Answers:
- Indexing only the first 4 bytes
- Indexing on partition
- Keeping the index in more than one file
- None of the above
Answers:
- Addition of a member variable that gets incremented in the default constructor and decremented in the destructor
- Addition of a local variable that gets incremented in each constructor and decremented in the destructor
- Addition of a static member variable that gets incremented in each constructor and decremented in the destructor
- This cannot be accomplished since the creation of objects is being done dynamically via “new”
Answers:
- isset($COOKIE[‘LoginCookie’])
- isset($_COOKIE[‘LoginCookie’])
- isCookieSet(‘$LoginCookie’)
- isCookieSet([‘$LoginCookie’])
$date = “Monday, July 28, 2008 @ 12:15 am”;
Answers:
- $date = replace(“@ “,””,$date); $date = strtotimestamp($date);
- $date = replace(“@ “,””,$date); $date = strtotime($date);
- $date = str_replace(“@ “,””,$date); $date = strtotime($date);
- $date = str_replace(“@ “,””,$date); $date = strtotimestamp($date);
$db = mysql_connect(“localhost”,”root”);
mysql_select_db(“mydb”,$db);
$result = mysql_query(“select state_id, state_text from states”);
if ($result)
{
echo “<SELECT NAME=’state_id’>”;
while (…condition…)
{
echo “<OPTION VALUE=””.$myrow[“state_id”].””>”.
$myrow[“state_text”].” </OPTION> “;
}
echo “</SELECT>”;
}
Answers:
- $myrow = mysql_fetch_array()
- $myrow
- $myrow = mysql_fetch_array($result)
- $myrow = fetch_array($result)
<?php
class Manager{
function printName() {
echo “Manager”;
}
}
class Office{
function getManager() {
return new Manager();
}
}
$ofc = new Office();
???
?>
Which of the following should replace ‘???’ to obtain the value of printName() function?
Answers:
- $ofc->getManager()->printName();
- new Office()->getManager()->printName();
- $ofc->getManager->printName;
- Office::getManager()::printName();
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:
- Statement 1 is true but statement 2 is false
- Statement 1 is false but statement 2 is true
- Both the statements are true
- Both the statements are false
Answers:
- It installs with additional information and hash marks
- It upgrades with additional information and hash marks
- 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
- It installs the package with additional information and hash marks, then removes the old packages
Answers:
- list /proc/devices
- show /proc/devices
- find /proc/devices
- cat /proc/devices
- None of the above
Answers:
- select * from Pers where joining_date from #1/1/2005# to #31/12/2005#, job=Analyst or clerk or salesman
- select * from Pers where joining_date between #1/1/2005# to #31/12/2005#, job=Analyst or job=clerk or job=salesman
- select * from Pers where joining_date between #1/1/2005# and #31/12/2005# and (job=Analyst or clerk or salesman)
- None of the above
$result=mysql_query(“DELETE from mytable”);
$num=mysql_affected_rows();
Answers:
- 0
- 1
- 12
- undefined
$company = ‘ABS Ltd’;
$$company = ‘, Sydney’;
?>
Which of the following is not a correct way of printing ‘ABS Ltd , Sydney’?
Answers:
- echo “$company $$company”;
- echo “$company ${$company}”;
- echo “$company ${‘ABS Ltd’}”;
- echo “$company {$$company}”;
Answers:
- SERVER_PROTOCOL
- SERVER_SOFTWARE
- HTTP_REFERER
- REMOTE_FORWARD
- REMOTE_ADDR
$Rent = 250;
function Expenses($Other)
{
$Rent = 250 + $Other;
return $Rent;
}
Expenses(50);
echo $Rent;
Answers:
- 300
- 250
- 200
- The program will not compile
Answers:
- .tab
- .frm
- .tbk
- .str
- None of the above
bin/safe_mysqld &
What does the ‘&’ mean in the command mentioned above?
Answers:
- It forces Mysql to ask the password
- It forces Mysql to run in the background
- It logins with windows login credentials
- None of the above
Answers:
- With the “= =” operator, two object instances are equal if they have the same attributes and values, and are instances of different classes
- With the “= =” operator, two object instances are equal if they have the same attributes and values, and are instances of the same class
- With the (===) operator, object variables are identical if and only if they refer to the same instance of the same class
- With the (===) operator, object variables are identical if and only if they refer to a different instance of the same class
Answers:
- $SQL_QUERY=”select age,address from student where regdate =”; $SQL_QUERY .= “DATE_SUB(CURRENT_DATE,Interval 2 YEAR)”;
- $SQL_QUERY=”select age,address from student where regdate =”; $SQL_QUERY .= “DATE_SUB(CURRENT_DATE,Interval 2)”;
- $SQL_QUERY=”select age,address from student where regdate =”; $SQL_QUERY .= “CURRENT_DATE-2”;
- $SQL_QUERY=”select age,address from student where regdate =”; $SQL_QUERY .= “Year(CURRENT_DATE)-Year(CURRENT_DATE-2)”;
Employee
———
Empno
Employeename
Salary
Deptno
Department
———
Deptno
Departname
Mike wants to see the departments that have more than 100 employees. Which of the following queries returns the required result?
Answers:
- Select departname from department where deptno in (select deptno from employee group by deptno having count(*) > 100);
- Select departname from department where deptno in (select count(*) from employee group by deptno where count(*) > 100);
- Select departname from department where count(deptno) > 100;
- Select departname from department where deptno in (select count(*) from employee where count(*) > 100);
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:
- Statement 1 is true but statement 2 is false
- Statement 1 is false but statement 2 is true
- Both the statements are true
- Both the statements are false
Answers:
- etc
- sbin
- proc
- lib
- None of the above
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:
- True
- False
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:
- All the statements are true
- All the statements are false
- Only Statement 1 is true
- Only statement 2 is true
$resultSet=mysql_query(“UPDATE mytable set myprice = 20 where myprice < 20”);
$num=mysql_affected_rows();
Answers:
- 0
- 1
- 5
- 10
- 15
- 20
Answers:
- <Directory “/www/mysite/htdocs/parsed”> Options +Includes SetFilter INCLUDES </Directory>
- <Directory “/www/mysite/htdocs/parsed”> SetOutputFilter INCLUDES </Directory>
- <Directory “/www/mysite/htdocs/parsed”> Options Included </Directory>
- <Directory “/www/mysite/htdocs/parsed”> Options +Includes SetOutputFilter INCLUDES </Directory>
- None of the above
Answers:
- __construct
- __construct and __destruct
- __constructor and __destructor
- __constructor
Answers:
- Change the employee’s account password
- Set an expiration date on the employee’s account
- Disable the employee’s account
- Change the root password
Answers:
- The minimum length of a password should be at least six characters
- The characters cannot be in alphabetical order
- Capital letters in a password cannot be used
- The password is already in use by another user
Answers:
- –cache-file=file
- –help-file
- –exec-prefix=eprefix
- –libexecdir=dir
- None of the above
<?php
function Expenses()
{
function Salary()
{
}
function Loan()
{
function Balance()
{ }
}
}
?>
Answers:
- Expenses();Salary();Loan();Balance();
- Salary();Expenses();Loan();Balance();
- Expenses();Salary();Balance();Loan();
- Balance();Loan();Salary();Expenses();
Answers:
- function GetDiscount($Type = “Special”) { . . . }
- function GetDiscount(Type := “Special”) { . . . }
- function GetDiscount($Type := “Special”) { . . . }
- function GetDiscount($Type : “Special”) { . . . }
$var1=”a”;
$$var1=”b”;
echo “$var1 $a”;
Answers:
- a b
- $var1 $a
- Error: $a is undefined
- Error: Parse error in line 2 ($$var1 = “b”)
Answers:
- relativename
- basename
- firstname
- None of the above
Answers:
- set_time_limit(60);
- set_time_out(60);
- set_time_limit(150);
- set_time_out(150);
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
Which of the following is correct?
Answers:
- Query 1 is true but Query 2 is false
- Query 1 is false but Query 2 is true
- Both the queries are true
- Both the queries are false
Answers:
- select * from articles (body) match against (‘database’)
- select * from pages where page_text like “%buffy%”
- select last_name from phone_book where last_name rlike “(son|ith)$”
- select * from articles where body = “%database%”
- All of the above
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
What does ‘-f’ in line 2 mean?
Answers:
- It stores a file name in the memory
- It tests all the items in the current file
- It tests all the items in the current working directory
- None of the above
Answers:
- It creates a swap area in RAM
- It activates a created swap partition
- It creates a swap partition
- It creates and activates a swap partition
Answers:
- Primary boot loader has been started
- Secondary boot loader has been loaded
- Tertiary boot loader has been loaded
- Secondary boot loader signals it has been loaded
$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 $nIndexn”;
continue;
}
if(!($row = mysql_fetch_object($resultSet)))
continue;
echo “$row->fname $row->lname<br />n”;
}
Answers:
- The fnames and lnames of all the customers will be printed
- The lnames and fnames of all the customers will be printed
- The fnames and lnames of all the customers will be printed in the reverse order
- Only the fname and lname of the first customer will be printed
- Only the fname and lname of the last customer will be printed
Answers:
- It is the place to find system executables
- Programs in sbin directories pertain to system management
- Regular users usually do not have sbin components in their command paths
- All of the above
Answers:
- mysql> SET buffer=50M;
- mysql> SET key_buffer=50M;
- mysql> SET GLOBAL key_buffer=50M;
- mysql> SET DEFAULT key_buffer=50M;
- None of the above
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:
- Statement 1 is true but statement 2 is false
- Statement 1 is false but statement 2 is true
- Both the statements are true
- Both the statements are false
Answers:
- mail($to,$subject,$body)
- sendmail($to,$subject,$body)
- mail(to,subject,body)
- sendmail(to,subject,body)
1 <input type=”hidden” name=”MAX_FILE_SIZE” value=”30000″ />
2 Send this file:
3
4 <input type=”submit” value=”Send File” />
Answers:
- <input name=”SalesFile” type=”file” />
- <input name=”SalesFile” Upload=”true” />
- <input filename=”SalesFile” type=”Upload” />
- <input filename=”SalesFile” Upload=”true” />
Answers:
- Master Boot Region
- First sector of the NTFS partition
- Last sector of the boot partition
- First sector of the boot partition
Answers:
- Read
- SUID
- Write
- SSH
1 class Insurance
2 {
3 function clsName()
4 {
5 echo get_class($this);
6 }
7 }
8 $cl = new Insurance();
9 $cl->clsName();
10 Insurance::clsName();
Answers:
- Line 8 and 9
- Line 10
- Line 9 and 10
- All the three lines 8,9, and 10 should be left as it is
$x = 0xFFFE;
$y = 2;
$z = $x && $y;
What will be the value of $z?
Answers:
- 0
- 1
- 2
- 3
- 4
Answers:
- ANSI C Compiler
- Perl 5 Interpreter
- Dynamic Shared Object support
- None of the above
abstract class BaseCls{
protected abstract function getName();
}
class ChildCls extends BaseCls{
}
Which of the following implementations of getName() is invalid in ChildCls?
Answers:
- protected function getName(){}
- function getName(){}
- private function getName(){}
- public function getName(){}
Answers:
- include()
- require()
- nowarn()
- getFile(false)
Answers:
- require usergroup <group name>
- require group <group name>
- require users <group name>
- require <group name>
Answers:
- MetaExt
- MetaFileType
- MetaExtension
- MetaSuffix
Answers:
- User
- ServerName
- Remove indexes from configuration file
- DocumentRoot
Answers:
- $~
- $*
- $#
- $@
Answers:
- 0
- 1
- 13
- 108
- None of the above
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:
- Statement 1 is true but statement 2 is false
- Statement 1 is false but statement 2 is true
- Both the statements are true
- Both the statements are false
Answers:
- mkbds4
- mke2fs
- mksdef
- mkcntd
- None of the above
Answers:
- A class can implement multiple interfaces
- An abstract class cannot implement multiple interfaces
- An interface can extend multiple interfaces
- Methods with the same name, arguments and sequence can exist in the different interfaces implemented by a class
Answers:
- one to many, one to one
- one to one, one to many
- many to one, many to many
- many to one, many to one
Answers:
- Select * from A.Sales join B.Sales
- Select * from A.Sales union all B.Sales
- select * from A.Sales,B.Sales
- None of the above
Select CustomerName, AccountNumber from Customers where AccountNumber in(select AccountNumber from Transactions where TransactionDate=#12/12/2005#)
Which of the following is correct?
Answers:
- In the sub query, * should be used instead of AccountNumber
- The sub query can return only one row, so “in” should be replaced with “=in” the prime query
- The sub query should be used first
- None of the above
No comments:
Post a Comment