Zend Certificate Sample Question

Question No : 1

Fill in the blank with the appropriate PHP function. The_____________ function is used to replace the current session id with the new session id, and to keep information of the current session.
A. session_regenerate_id()

Question No : 2

Celina works as a Database Administrator for Tech Mart Inc. The company uses an Oracle database. The database contains a table named Employees. Following is the structure of the table: EmpID NUMBER (5) PRIMARY KEY EmpName VARCHAR2 (35) NOT NULL Salary NUMBER (9, 2) NOT NULL Commission NUMBER (4, 2) ManagerName VARCHAR2 (25) ManagerID NUMBER (5) Celina wants to display the names of employees and their managers, using a self join. Which of the following SQL statements will she use to accomplish this? Each correct answer represents a complete solution. Choose two.
A. SELECT e.EmpName, m.ManagerName FROM Employees e, Employeesm WHERE e.EmpID = m.ManagerID;
B. SELECT e.EmpName, m.ManagerName FROM Employees e INNER JOIN Employeesm ON e.EmpID = m.ManagerID;
C. SELECT e.EmpName, m.ManagerName FROM Employees e LEFT OUTER JOIN Employees m ON e.EmpID = m.ManagerID;
D. SELECT e.EmpName, m.ManagerName
FROM Employees e SELF JOIN Employeesm ON e.EmpID = m.ManagerID;
Answer: A,B
Question No : 3

Which of the following actions may fail if you have exceeded your quota limit?
A. addTo()
B. send()
C. addBcc()
D. appendMessage()
Answer: D
Question No : 4

Which of the following code snippets will you use to instantiate Zend_XmlRpc_Server?
A. $server = Zend_Xml::Zend_XmlRpc_Server()
B. $server = new Zend_Xml();
C. $server = new Zend_XmlRpc_Server();
D. $server = create_new_Zend_XmlRpc_Server()
Answer: C
Question No : 5

Write the appropriate word to complete the sentence below. ___________is used for logging of multiple backends, formatting messages which are sent to the log, and filtering those messages, which should not be logged.
A. Zend_Log
Answer: A
Question No : 6
Which of the following is used to create a new Memory Manager?
A. Zend_Memory::factory()
B. Zend_Memory->NewMemoryManager()
C. Zend_Memory->factory()
D. Zend_Memory::NewMemoryManager()
Answer: A
Question No : 7

You want a formatted date for an RSS feed. Which of the following code syntaxes will you use to accomplish the task?
A. Zend_Date::RSSFEED
B. Zend_Date::RSS
C. $RSS= new Zend_RSS_Date()
D. Zend_Date->RSS
Answer: B
Question No : 8

Fill in the blank with the appropriate method name. The__________ method is used to send an email in the HTML format.
A. setBodyHTML()
Answer: A
Question No : 9
Which of the following methods will you use to retain the identity across requests according to the PHP session configuration?
A. isValid()
B. getIdentity()
C. Zend_Auth::authenticate()
D. getCode()
Answer: C
Question No : 10

Which of the following code snippets will you use to create an index in Zend_Search_Lucene? 1. <?php 2. ????????????? 3. ????????????? 4. $Search_Doc ->addField(Zend_Search_Lucene_Field::Text(‘url’, $docUrl)); 5. $Search_Doc ->addField( 6. Zend_Search_Lucene_Field::UnStored( 7. ‘contents’, 8. $docContent 9. ) 10. ); 11. $index->addDocument($Search_Doc);
A. $Search_Index = Zend_Search_Lucene::create_Index(‘/data/my-index’); $Search_Doc = new Zend_Search_Lucene_Document();
B. $Search_Index = Zend_Search_Lucene::open_Index(‘/data/my-index’); $Search_Doc = new Zend_Search_Lucene_Document();
C. $Search_Index = Zend_Search_Lucene::create(‘/data/my-index’); $Search_Doc = new Zend_Search_Lucene_Document();
D. $Search_Index = Zend_Search_Lucene::open(‘/data/my-index’); $Search_Doc = new Zend_Search_Lucene_Document();
Answer: C
Question No : 11
Which of the following methods in Zend_Controller_Action can be used for resetting the state when multiple controllers use the same helper in the chained actions?
A. preDispatch()
B. setActionController()
C. postDispatch()
D. init()
Answer: D
Question No : 12

You want to retrieve all the data from any given table. You also want to ensure that no duplicate values are displayed. Which of the following SQL statements will you use to accomplish the task?
A. SELECT…TOP
B. SELECT…WHERE
C. SELECT…DISTINCT
D. SELECT…ALL
Answer: C
Question No : 13

Consider the following code segment: 1. <?php 2. require_once ‘Zend/Mail.php’; 3. ????????????????????????? 4. $mail->setBodyText(‘This is the test email.’);

5. $mail->setFrom(‘somebody@example.com’, ‘Sender’); 6. $mail->addTo(‘somebody_else@example.com’, ‘Recipient’); 7. $mail->setSubject(‘TestSubject’); 8. $mail->send(); 9. ?> Which of the following code snippets will you use at line number 3 to initiate Zend_Mail?
A. $mail = new Zend_Mail();
B. $mail => initialize_Zend_Mail();
C. $mail -> Zend_Mail();
D. $mail => Zend_Mail();
Answer: A
Question No : 14

Which of the following functions sets up start and end element handlers?
A. xml_parse_into_struct()
B. xml_parser_create_ns()
C. xml_set_object()
D. xml_set_element_handler()
Answer: D
Question No : 15

Which of the following functions can be used as a countermeasure to a Shell Injection attack? Each correct answer represents a complete solution. Choose all that apply.
A. mysql_real_escape_string()
B. escapeshellcmd()
C. regenerateid()
D. escapeshellarg()

Answer: B,D
Question No : 16
You have a table created as follows: create table foo (c1 int, c2 char(30), c3 int, c4 char(10)) If column c1 is unique, which of the following indexes would optimize the statement given below? Select distinct (c1), c3 from foo where c1=10
A. create unique index foox on foo (c1) include (c3)
B. create index foox on foo (c1)
C. create index foox on foo (c1,c3)
D. create unique index foox on foo (c1,c3)
Answer: A
Question No : 17

You want to set the form method in post and action to /uc/zend.php when you are using the Zend_Form class. Which of the following code snippets will you use to accomplish the task?
A. <?php $form->setAction(‘/uc/zend.php’) ->setMethod(‘post’);
B. <?php echo “<form action=\”/uc/zend.php \” method=POST>”;
C. <?php $form->(‘/uc/zend.php’) ->(‘post’);
D. <?php $form->Zend::setAction(‘/uc/zend.php’) ->Zend::setMethod(‘post’);
Answer: A

Question No : 18
In which of the following situations will you use the set_exception_handler() function?
A. When you want to restore a previously defined exception handler function.
B. When the try/catch block is unable to catch an exception.
C. When you want to set a user-defined function to handle errors.
D. When you want to generate a user-level error/warning/notice message.
Answer: B
Question No : 19

Which of the following code snippets will you use if you want to connect to a Pop3 server using TLS?
A. <?php $mail = new Zend_Mail_Storage_Pop3(array(‘host’ =’example.com’, ‘user’ =’user_name’, ‘protocol_used’ = ‘tls’)); ?>
B. <?php $mail = new Zend_Mail_Storage_Pop3(array(‘host’ =’example.com’, ‘user’ =’user_name’, ‘connectTo’ = ‘tls’)); ?>
C. <?php $mail = new Zend_Mail_Storage_Pop3(array(‘host’ =’example.com’, ‘user’ =’user_name’, ‘ssl’ = ‘tls’)); ?>
D. <?php $mail = new Zend_Mail_Storage_Pop3(array(‘host’ =’example.com’, ‘user’ =’user_name’, ‘protocol_used’ = ‘ssl/tls’)); ?>
Answer: C
Question No : 20

Which of the following are the configuration files that are used in Zend_Config?
A. Zend_Config_Server
B. Zend_Config_Xml
C. Zend_Config_Db
D. Zend_Config_Ini
Answer: B,D
Question No : 21
Which of the following methods are used by Zend_Controller_Action_Helper_Abstract? Each correct answer represents a complete solution. Choose all that apply.
A. init()
B. preDispatch()
C. setActionController()
D. getResponseId()
Answer: A,B,C
Question No : 22

Which of the following are the valid methods of the Zend_Date class? Each correct answer represents a complete solution. Choose all that apply.
A. set()
B. add()
C. check()
D. get()
E. sub()
Answer: A,B,D,E
Question No : 23

Which of the following is an example of a database connection that needs to be created once at the beginning of a script and then used throughout its code?
A. Model-view-controller
B. Factory pattern
C. ActiveRecord
D. Singleton
Answer: D
Question No : 24
Which of the following clauses is used to specify a column or an array of columns by which to sort?
A. Order By
B. WHERE
C. FROM
D. LIMIT
Answer: A
Question No : 25

John works as a professional Ethical Hacker. He has been assigned a project to test the security of www.we-are-secure.com. On the We-are-secure login page, he enters =’or”=’ as a username and successfully logs in to the user page of the Web site. The We-aresecure login page is vulnerable to a __________.
A. Land attack
B. Replay attack
C. Dictionary attack
D. SQL injection attack
Answer: D
Question No : 26

Fill in the blank with the appropriate method name. The__________ method is used to retrieve headers when the storage has been opened.
A. getHeader()
Answer: A
Question No : 27
Fill in the blank with the appropriate class name. The______ class is used to load files dynamically.
A. Zend_Loader
Answer: A
Question No : 28

Which of the following methods of Zend_XmlRpc_Client can you use to instantiate a server proxy call?
A. call()
B. getLastResponse()
C. getProxy()
D. XMLResponse
Answer: C
Question No : 29

You have given the following XML data in the tasks.XML file: <?xml version=”1.0″ encoding=”ISO-8859-1″?> <tasklist> <note> <tasks>Validate data</tasks> <details>String Validation</details>
12 </note> <note> <tasks>Secure data</tasks> <details>Encryption</details> </note> </tasklist>
Now, you run the following PHP script: <?php $objDOM = new DOMDocument(); $objDOM->load(“tasks.xml”); $note = $objDOM->getElementsByTagName(“note”); foreach( $note as $value )
{ $tasks = $value->getElementsByTagName(“tasks”); $task = $tasks->item(0)->nodeValue; $details = $value->getElementsByTagName(“details”); $detail = $details->item(0)->nodeValue; echo “$task :: $detail <br>”;
} ?> What should be displayed when this script is executed?
A. The contents of the whole XML document
B. The XML of every tasks and details nodes
C. The contents of every tasks and details nodes
D. The XML of whole XML document
Answer: C

Question No : 30
You run the following PHP script: <?php $name = mysql_real_escape_string($_POST[“name”]); $password = mysql_real_escape_string($_POST[“password”]); ?> What is the use of the mysql_real_escape_string() function in the above script. Each correct answer represents a complete solution. Choose all that apply.
A. It can be used as a countermeasure against a SQL injection attack.
B. It escapes all special characters from strings $_POST[“name”] and $_POST[“password”] except ‘ and “.
C. It escapes all special characters from strings $_POST[“name”] and $_POST[“password”].
D. It can be used to mitigate a cross site scripting attack.
Answer: A,C
Question No : 31

Which of the following can be used as a countermeasure against the SQL injection attack? Each correct answer represents a complete solution. Choose two.
A. session_regenerate_id()
B. Prepared statement
C. mysql_escape_string()
D. mysql_real_escape_string()
Answer: B,D
Question No : 32

Which of the following statements correctly explains the behavior of
14 Zend_Controller_Front?
Each correct answer represents a complete solution. Choose all that apply.
A. It registers a plug-in broker with itself.
B. It uses the Singleton pattern.
C. It processes all requests received by the server.
D. The Zend_Controller_Front never loads any plugin by default.
Answer: A,B,C
Question No : 33

Which of the following functions in SimpleXML can be used to return an iterator containing a list of all subnodes of the current node?
A. asXML()
B. attributes()
C. getName()
D. children()
Answer: D
Question No : 34

Fill in the blank with the appropriate method name. ________is a method to create REST server.
A. Zend_Rest_Server
Answer: A
Question No : 35

Which of the following functions is the best choice to retrieve the fingerprint of a string?
A. md5()
B. fingerprint()
C. crypt()
D. hash()
Answer: A
Question No : 36
Which of the following steps will you use to create a multi-lingual Website? Each correct answer represents a complete solution. Choose all that apply.
A. Creating the View and integrate Zend_Translate into the code
B. Deciding which adapter to use
C. Translating the source file to the desired language
D. Putting the Zend_Translate into session
E. Creating the source file from the code
Answer: A,B,C,E
Question No : 37

Which of the following retrieves the request URI, path, $_GET & $_POST parameters, etc. and tracks whether an action has been dispatched via Zend_Controller_Dispatcher?
A. Zend_Controller_Get_Request
B. Zend_Controller_Router
C. Zend_Controller_Request_Abstract
D. Zend_Controller_Response_Abstract
Answer: C
Question No : 38

You are using a database named HumanResource. You have to delete some tables from thedatabase using SQL statements. Which of the following statements will you use to accomplish the task?
A. DELETE TABLE <table_name> FROM DATABASE
B. DELETE TABLE <table_name>
C. DROP TABLE <table_name>
D. DROP TABLE <table_name> FROM DATABASE
Answer: C
Question No : 39

Which of the following joins retrieves all rows from one table and only the matching rows from the joined table?
A. Self join
B. Outer join
C. Equijoin
D. Non-equijoin
Answer: B
Question No : 40

Which of the following statements describes the use of a GROUP BY clause?
A. A GROUP BY clause returns a single row of information for each group of rows.
B. A GROUP BY clause automatically sorts the grouped result in ascending order, if DESC keyword is not defined.
C. A GROUP BY clause returns a single row of information for each group of rows, in addition to all the rows.
D. A GROUP BY clause automatically sorts the grouped result in descending order.
Answer: A
Question No : 41

You want to record the raw log data received in an array exposed as a public property. Which of the following will you use to accomplish the task?
A. Zend_Log_Writer_Mock
B. Zend_Log_Formatter_Xml
C. Zend_Log_Writer_Stream
D. Zend_Log_Formatter_Simple
Answer: A
Question No : 42

Which of the following are the methods that are used by Zend_Controller_Front? Each correct answer represents a complete solution. Choose all that apply.
A. dispatch()
B. objectsetControllerDirectory()
C. getInstance()
D. controller()
Answer: A,B,C
Question No : 43

Which of the following will NOT display the value of $debug_variable? Each correct answer represents a complete solution. Choose all that apply.
A. echo Zend_Debug::dump($debug_variable, ‘debug_variable’, false);
B. print(Zend_Debug::dump($debug_variable, ‘debug_variable’, true));
C. ob_start(); Zend_Debug::dump($debug_variable, ‘debug_variable’, false); ob_end_flush();
D. Zend_Debug::dump($debug_variable, ‘debug_variable’, true);
Answer: A,B,D
Question No : 44

Fill in the blank with the appropriate term.
__________is used to implement a classic Two-Step View pattern that allows a user to wrap the application content within another view.
A. Zend_Layout
Answer: A
Question No : 45

A table named employees is given below: Which of the following statements would return the employees names, in ascending order, based on their last name and first name? Each correct answer represents a complete solution. Choose all that apply.
A. select fname, lname from employees order by lname;
B. select fname, lname from employees order by lname desc;
C. select fname, lname from employees group by lname;
D. select fname, lname from employees order by lname asc;
Answer: A,D
Question No : 46

Which of the following code snippets will you use to destroy a log if the variable $logger contains the log record?
A. <php remove($logger);
B. <php $logger=null;
C. <php delete($logger);
D. <php $logger->null;
Answer: B
Question No : 47
Which of the following methods will you use to get the actual set language in Zend_Translate class?
A. setLocale()
B. getList()
C. getLocale()
D. isAvailable()
Answer: C
Question No : 48

Which of the following joins will you use to display data that do not have an exact match in the column?
A. Self join
B. Outer join
C. Equijoin
D. Non-equijoin
Answer: D
Question No : 49
Which of the following is the method that is used to check whether the version required for running the application exists or not?
A. $var = Zend_Version->compareVersion($version)
B. Zend_compareVersion($version)
C. Zend_Version::VERSION
D. Zend_Version::compareVersion($version)
Answer: D
Question No : 50

Which of the following classes will you use to store objects and values in the application space?
A. zend_Db
B. Zend_Acl
C. Zend_Registry
D. Zend_Config
Answer: C
Question No : 51

Consider the following XML file: <?xml version=”1.0″ encoding=”ISO-8859-1″ ?> <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en” lang=”en”> <head> <title> SimpleXML Example</title> </head> <body> <h1>
Please go <a href=”http://www.PassGuide.com”>http://www.PassGuide.com</a> <br/> </h1> </body> </html> Which of the following statements will display the HREF attribute on the anchor tag if the SimpleXML object is $sxml?
A. $sxml->body->h1->a->href
B. $sxml->body->h1->a<href>
C. $sxml->body->h1->a[‘href’]
D. $sxml->h1->a->href
Answer: C
Question No : 52

Which of the following steps will you take to apply Zend_View? Each correct answer represents a part of the solution. Choose all that apply.
A. Transfer control of the display to the View Script.
B. Render the View.
C. Assign the variables to the View via a Controller Script.
D. Create an instance of the View.
Answer: B,C,D
Question No : 53

Fill in the blank with the appropriate method name. _________is used to make call of the remote methods in the same manner as native methods.
A. Zend_Rest_Clien