Zend is an open source PHP framework. It is pure object-oriented and built around the MVC design pattern. Zend framework contains collection of PHP packages which can be used to develop web applications and services.
Zend Framework MCQs: This section contains multiple-choice questions and answers on the various topics of Zend Framework. Practice these MCQs to test and enhance your skills on Zend Framework.
List of Zend Framework MCQs
1. Zend is an ____ framework?
Answer: A) PHP
Explanation:
Zend is a PHP framework.
2. Is Zend purely object-oriented?
- Yes
- No
Answer: A) Yes
Explanation:
Zend is a PHP framework and it is purely object-oriented.
3. Zend follows which type of architecture?
- Layered architecture
- MVC
- Microkernel
- None
Answer: B) MVC
Explanation:
Zend is based upon MVC i.e., model, view, and controller design pattern.
4. Which of the following are the correct pre-requisite to learn Zend framework?
- HTML/CSS
- PHP
- OOPS
- All of the above
- Only PHP
Answer: D) All of the above
Explanation:
To learn Zend you should have some knowledge about the OOPS concept, PHP, and basic HTML and CSS.
5. Who developed the Zend framework?
- Rasmus Lerdorf and Andi Gutmans
- Rasmus Lerdorf and Zeev Suraski
- Andi Gutmans and Zeev Suraski
Answer: C) Andi Gutmans and Zeev Suraski
Explanation:
Zend was founded by Andi Gutmans and Zeev Suraski.
ADVERTISEMENT
6. Why do we use the Zend framework? Select the best answer.
- To deploy a web application
- To develop a web application
- To test web application
- To only design web application
Answer: B) To develop a web application
Explanation:
Zend is used in the market to develop a web applications.
7. Is Zend an open-source project?
- Yes
- No
Answer: A) YES
Explanation:
Yes, Zend is an open-source project.
8. Does Zend support multi-databases?
- Yes
- No
Answer: A) Yes
Explanation:
Yes, Zend supports different types of databases, like PostgreSQL, SQLite, etc.
9. Which of the following popular companies uses the Zend framework to develop their website?
- Netflix
- IBM
- All of the above
- None
Answer: C) IBM
Explanation:
IBM’s company website is created using the Zend framework.
10. Zend uses ____ for managing its dependencies.
- Composer
- MVC
- Component
Answer: A) Composer
Explanation:
Zend uses composer for managing its dependencies.
ADVERTISEMENT
11. In how many ways you can install the Zend framework?
- 1
- 2
- 3
- 4
Answer: B) 2
Explanation:
There are two ways in which you can install the Zend framework:
- Manual installation
- Composer based installation
12. How can you host the Zend framework-based web application?
- Using Apache web server
- Using the Zend server
- Using a PHP server
Answer: A) Using Apache web server
Explanation:
Using the Apache web server, you can host the Zend framework-based web application.
13. Which of the following in the MVC component, characterizes the structure of the application data?
- Model
- View
- Controller
Answer: A) Model
Explanation:
Model components in MVC, characterize the structure of the application data.
14. Which of the following in the MVC component, the appearance layer of the MVC Application?
- Model
- View
- Controller
Answer: B) View
Explanation:
View component in MVC, appearance layer of the MVC Application.
15. Which of the following in the MVC component, is the key component of the MVC architecture?
- Model
- View
- Controller
Answer: C) Controller
Explanation:
The controller component in MVC, is the key component of the MVC architecture.
ADVERTISEMENT
16. How do you use the components of the Zend framework?
- Components of the Zend framework can be used as stand-alone components.
- Components of the Zend framework can be used as a group of components.
- Both A and B
Answer: C) Both A and B
Explanation:
In the Zend framework, components can be used as stand-alone components or they can be used as a group of components as a single unit.
17. Which of the following are the most significant components of the Zend framework?
- zend-servicemanager
- zend-eventmanager
- zend-modulemanager
- All of the above
Answer: D) All of the above
Explanation:
There are three most significant components of the Zend framework:
- zend-servicemanager
- zend-eventmanager
- zend-modulemanager
18. Which of the following component of the Zend framework enables the creation of event-based programming and also aids in the creation, injection, and management of new events?
- zend-servicemanager
- zend-eventmanager
- zend-modulemanager
- All of the above
Answer: B) zend-eventmanager
Explanation:
zend-eventmanager component of the Zend framework enables the creation of event-based programming and also aids in the creation, injection, and management of the new event.
19. Which of the following component of the Zend framework allows you to utilize arbitrary services (PHP classes) from anywhere and without effort?
- zend-servicemanager
- zend-eventmanager
- zend-modulemanager
- All of the above
Answer: A) zend-servicemanager
Explanation:
zend- servicemanager component of the Zend framework allows you to utilize arbitrary services (PHP classes) from anywhere and without effort.
20. The capability to merge a group of PHP classes with comparable functionality into a single entity known as a ____?
- Unit
- Module
- Element
- Class
Answer: B) Module
Explanation:
The capability to merge a group of PHP classes with comparable functionality into a single entity known as a module.
ADVERTISEMENT
21. ____ offered a high-level abstraction for the Zend Framework?
- Service manager
- Event manager
- Module manager
Answer: A) Service manager
Explanation:
The service manager offered a high-level abstraction for the Zend Framework.
22. Which method allows you to obtain a stdClass object at any time?
- Build()
- Get_build()
- Get()
Answer: C) Get()
Explanation:
Get() method allows you to obtain a stdClass object at any time.
23. Which of the following method allows you to obtain a unique instance each time?
- Build()
- Get_build()
- Get()
- New()
Answer: A) Build()
Explanation:
Build() method allows you to obtain a unique instance each time.
24. To obtain any class that has no dependencies, the service manager offers a custom factory named ____
- Invoke_call
- Factory
- InvokableFactory
- Callable Factory
Answer: C) InvokableFactory
Explanation:
To obtain any class that has no dependencies, the service manager offers a custom factory named Invokable factory.
25. The ____contains a method for determining whether or not the object may be generated at the specified instance.
- Factory method
- AbstractFactoryInterface
- FactoryInterface
Answer: B) AbstractFactoryInterface
Explanation:
The AbstractFactoryInterface contains a method for determining whether or not the object may be generated at the specified instance.
26. Which of the following method add new dependencies to previously existing services?
- Factory method
- Abstract factory method
- Initializer method
- Delegator factory method
Answer: C) Initializer method
Explanation:
The initializer method adds new dependencies to previously existing services.The initializer method adds new dependencies to previously existing services.
27. A ____is one that won’t be entirely initialized at the time of creation. They are only referenced and only initialized when necessary.
- Factory method Service
- Lazy service
- Delegator factory method
Answer: B) Lazy service
Explanation:
A lazy service is one that won’t be entirely initialized at the time of creation. They are only referenced and only initialized when absolutely necessary.
28. ____enhances the service manager and adds features such as instance validation.
- Plugin manager
- Lazy service
- Configuration
- Alias
Answer: A) Plugin manager
Explanation:
Plugin Manager enhances the service manager and adds features such as instance validation.
29. In Zend event manager, the ____ is randomly referred to as action
- Class
- Interface
- Listener
- Event
Answer: D) Event
Explanation:
The event is randomly referred to as action.
30. In Zend event manager, ____ are tied to events and are called when the event occurs.
- Interface
- Listener
- EventInterface class
- Class
Answer: B) Listener
Explanation:
Listeners are tied to events and are called when the event occurs.
ADVERTISEMENT
31. In Zend event manager, ____ are used to depict the event.
- Interface
- Listener
- EventInterface class
- Class
Answer: C) EventInterface class
Explanation:
EventInterface classes are used to depict the event.
32. How many components does the module system have in the Zend framework?
- 1
- 2
- 3
- 4
Answer: C) 3
Explanation:
There are three components of the module system in the Zend framework:
Module Autoloader, Module manager, Module Manager Listeners.
33. Which of the following component of the module system is responsible to locate and load modules from a number of sources?
- Module Autoloader
- Module Manager
- Module Manager Listeners.
Answer: A) Module Autoloader
Explanation:
The module autoloader component of the module system is responsible to locate and load modules from a number of sources.
34. Which of the following component of the module system fires a series of events, for each module as soon as the modules are located via the Module Autoloader?
- Module Autoloader
- Module Manager
- Module Manager Listeners.
Answer: B) Module Manager
Explanation:
The module Manager component of the module system fires a series of events, for each module as soon as the modules are located via the Module Autoloader.
35. Which of the following component of the module system can be linked to Module Manager events and therefore is responsible for anything ranging from determining and loading modules to completing sophisticated tasks for each module?
- Module Autoloader
- Module Manager
- Module Manager Listeners.
Answer: C) Module Manager Listeners.
Explanation:
The module Manager Listeners component of the module system can be linked to Module Manager events and therefore is responsible for anything ranging from determining and loading modules to completing sophisticated tasks for each module.
36. Which of the following folders/directories contains your application in Zend Framework?
- Module
- Data
- Vendor
- Application
- Public
Answer: D) Application
Explanation:
The application folder/directory contains your application in Zend Framework.
37. Which of the following folders/directory carry an application’s configuration files?
- Module
- Data
- Config
- Application
- Public
Answer: C) Config
Explanation:
The config folder/directory holds an application’s configuration files.
38. Which of the following folders/directory, offers a location to store volatile and maybe transient application data?
- Module
- Data
- Config
- Vendor
- Public
Answer: B) Data
Explanation:
Data folder/directory offers a location to store volatile and maybe transient application data.
39. Which of the following folders/directory, is an application’s document root?
- Module
- Data
- Config
- Vendor
- Public
Answer: E) Public
Explanation:
Public folder/directory is an application’s document root.
40. In which of the following folders/directories, composer dependencies are stored?
- Module
- Data
- Config
- Vendor
- Public
Answer: D) Vendor
Explanation:
In the Vendor folder/directory composer dependencies are stored.
41. How many parts does the configuration file have?
- 2
- 3
- 4
- 5
Answer: B) 3
Explanation:
The configuration file has three parts: Controller, Routing configuration, and View configuration.
42. Which part of the configuration file determines how the module’s controllers should be resolved into URLs?
- Controller configuration
- Routing configuration
- View configuration.
Answer: B) Routing configuration
Explanation:
Routing Configuration, determines how the module’s controllers should be resolved into URLs.
43. Which part of the configuration file set the setup for seeing the engine?
- Controller configuration
- Routing configuration
- View configuration.
Answer: C) View configuration.
Explanation:
View Configuration, and set the setup for seeing the engine.
44. Which of the following controllers includes all of the functionality required to construct a standard web page and is also the most often used controller in the Zend MVC Framework?
- AbstractActionController
- AbstractRestfulCotroller
- AbstractConsoleController
Answer: A) AbstractActionController
Explanation:
AbstractActionController includes all of the functionality required to construct a standard web page and is also the most often used controller in the Zend MVC.
45. Which of the following controllers examines the HTTP method of the user requests and correlates the action (method) by taking the HTTP methods into account?
- AbstractActionController
- AbstractRestfulCotroller
- AbstractConsoleController
Answer: B) AbstractRestfulCotroller
Explanation:
AbstractRestfulController examines the HTTP method of the user requests and correlates the action (method) by taking the HTTP methods into account.
46. How many parts does URI contain?
- 1
- 2
- 3
- 4
Answer: C) 3
Explanation:
In general, any URI has three parts −
- Hostname segment,
- Path segment, and
- Query segment.
47. Which type of route in the Zend framework is used to match a precise URI?
- Hostname
- Literal
- Method
- Regex
Answer: B) Literal
Explanation:
Literal type of route in the Zend framework is used to match a precise URI.
48. Which type of route in the Zend framework matches the HTTP method of the user requests?
- Hostname
- Part
- Method
- Regex
Answer: C) Method
Explanation:
The method type of route in the Zend framework matches the HTTP method of the user requests.
49. Which type of route in the Zend framework matches a URI route, by breaking it into numerous segments?
- Hostname
- Part
- Method
- Regex
- Segment
Answer: E) Segment
Explanation:
The segment type of route in the Zend framework matches a URI route, by breaking it into numerous segments.
50. Routes are queried in a ____ order?
- LIFO
- FIFO
Answer: A) LIFO
Explanation:
Routes are queried in a LIFO order.
51. Which of the following component of the Zend view layer holds the view layer’s data?
- Renderers
- Variable containers
- Resolvers
- View models
Answer: B) Variable containers
Explanation:
Variable containers component of the Zend view layer holds the view layer’s data.
52. How many methods does HelperInterface have?
- 2
- 3
- 4
- 5
Answer: A) 2
Explanation:
A HelperInterface has just two methods: setView(), and getView().
53. Which of the following Zend component, connects the model and the view layer?
- Zend-servicemanager
- Zend-form
- Zend-validation
- Zend-registration
Answer: B) Zend-form
Explanation:
Zend-form connects the model and the view layer.
54. How many methods are provided by InputFilterAwareInterface?
- 3
- 4
- 2
- 5
Answer: C) 2
Explanation:
InputFilterAwareInterface provides two methods, setInputFilter() and getInputFilter().
55. Which of the following Zend framework component provides all the necessary items to upload files?
- Zend-form
- Zend-filter
- Zend-inputfilter
- Both A and B
- Both A and C
- Both B and C
Answer: E) Both B and C
Explanation:
The Zend framework includes everything needed to upload files using the Zend-form and Zend-inputfilter components.
56. Which of the following Zend framework component provides an option to work with the JSON model?
- Zend-form
- Zend-view
- Zend-Json
- Both A and B
- Both A and C
- Both B and C
Answer: F) Both B and C
Explanation:
In the Zend framework, Zend-view and Zend-Json component provides an option to work with the JSON model.
57. A ____ is used to keep the web application’s state.
- Module
- Component
- Cookie
Answer: C) Cookie
Explanation:
A cookie is used to keep the web application’s state.
58. Which of the following Zend framework component provides a cookie module?
- Zend-form
- Zend-view
- Zend-Json
- Zend-HTTP
Answer: D) Zend-HTTP
Explanation:
In Zend framework, the Zend-HTTP component provides a cookie module.
59. Which of the following method will clear all the cookies in the given URI?
- Reset()
- Clear()
- Null()
Answer: A) Reset()
Explanation:
The reset() method will clear all the cookies in the given URI.
60. In which of the following method Cookies are extracted from the response object of the supplied URI?
- addCookie(uri)
- getCookie(cookieName,$cookieForm)
- fromResponse(uri)
Answer: C) fromResponse(uri)
Explanation:
In fromResponse(uri) method, Cookies are extracted from the response object of the supplied URI.
61. Which of the following Zend framework component, is used for handling session data?
- Zend-form
- Zend-view
- Zend-Json
- Zend-HTTP
- Zend-session
Answer: E) Zend-session
Explanation:
Zend framework offers a separate component called Zend-session for handling session data.
62. How many components does the Zend framework offer to handle the session?
- 5
- 6
- 7
- 8
Answer: B) 6
Explanation:
Zend framework offers six components to handle the session:
- Zend\Session\Container,
- Zend\Session\SessionManager
- Zend\Session\Storage
- Zend\Session\SaveHandler
- Zend\Session\Validator
- Zend\Session\Config\SessionConfig
63. Which of the following components of session handling in Zend framework is the core API for reading and writing session information?
- Zend\Session\Container,
- Zend\Session\SessionManager
- Zend\Session\Storage
- Zend\Session\SaveHandler
- Zend\Session\Validator
- Zend\Session\Config\SessionConfig
Answer: A) Zend\Session\Container,
Explanation:
Zend\Session\Container component in the Zend framework is the core API for reading and writing session information.
64. Which of the following components of session handling in the Zend framework specify how session data will be saved in memory?
- Zend\Session\Container,
- Zend\Session\SessionManager
- Zend\Session\Storage
- Zend\Session\SaveHandler
- Zend\Session\Validator
- Zend\Session\Config\SessionConfig
Answer: C) Zend\Session\Storage
Explanation:
Zend\Session\storage component in the Zend framework specifies how session data will be saved in memory.
65. In which of the following components of session handling, the session data is stored and retrieved at a physical place?
- Zend\Session\Container,
- Zend\Session\SessionManager
- Zend\Session\Storage
- Zend\Session\SaveHandler
- Zend\Session\Validator
- Zend\Session\Config\SessionConfig
Answer: D) Zend\Session\SaveHandler
Explanation:
In Zend\Session\SaveHandler component of the Zend framework the session data is stored and retrieved at a physical place.
66. Which of the following components of session handling, prevent session hijacking?
- Zend\Session\Container,
- Zend\Session\SessionManager
- Zend\Session\Storage
- Zend\Session\SaveHandler
- Zend\Session\Validator
- Zend\Session\Config\SessionConfig
Answer: E) Zend\Session\Validator
Explanation:
The Zend\Session\Validator component of the Zend framework is used to prevent session hijacking.
67. Which of the following components of session handling, is used to manage a session’s whole lifespan?
- Zend\Session\Container,
- Zend\Session\SessionManager
- Zend\Session\Storage
- Zend\Session\SaveHandler
- Zend\Session\Validator
- Zend\Session\Config\SessionConfig
Answer: B) Zend\Session\SessionManager
Explanation:
The Zend\Session\SessionManager component of the Zend framework is used to manage a session’s whole lifespan.
68. Which of the following components of session handling, is used to specify how the session should operate?
- Zend\Session\Container,
- Zend\Session\SessionManager
- Zend\Session\Storage
- Zend\Session\SaveHandler
- Zend\Session\Validator
- Zend\Session\Config\SessionConfig
Answer: F) Zend\Session\Config\SessionConfig
Explanation:
The Zend\Session\SessionConfig component of the Zend framework is used to specify how the session should operate.
69. Which of the following Zend framework component, is used to handle authentication?
- Zend-form
- Zend-view
- Zend-authentication
- Zend-HTTP
- Zend-session
Answer: C) Zend-authentication
Explanation:
Zend-authentication is a separate component in the Zend framework that is used to handle authentication.
70. How many classes are provided by Zend to handle authentication in the Zend framework?
- 2
- 3
- 4
- 5
Answer: A) 2
Explanation:
Two classes are provided by Zend to handle authentication in the Zend framework:
- Zend\Authentication\Adaptor\AdaptorInterface
- Zend\Authentication\AuthenticationService
71. The key component is the____, which leverages the already defined adapter for authentic?
- AdaptorInterface
- AuthenticationService
Answer: B) AuthenticationService
Explanation:
The key component is the AuthenticationService, which leverages the already-defined adapter for authentic
72. Which of the following method sees whether an identity is accessible?
- clearIdentity()
- getIdentity()
- hasIdentity()
Answer: C) hasIdentity()
Explanation:
hasIdentity() method sees whether an identity is accessible.
73. Which of the following method obtain the authentication information?
- clearIdentity()
- getIdentity()
- hasIdentity()
- Get()
Answer: B) getIdentity()
Explanation:
getIdentity() method obtains the authentication information.
74. Which of the following method delete the authentication information?
- clearIdentity()
- getIdentity()
- hasIdentity()
- Clear()
- Delete()
Answer: A) clearIdentity()
Explanation:
clearIdentity() method deletes the authentication information.
75. The zend-permissions-acl module is based upon ____?
- Access control list
- Authorization access location
- Authorization Control location
Answer: A) Access control list
Explanation:
The zend-permissions-acl module is based on the Access control list.
76. The zend-permissions-rbac is based upon____?
- Role based authentication control
- Role based access control list
- Role based admission controller
Answer: B) Role based access control list
Explanation:
The zend-permissions-rbac module is based upon the Role Based Access control list.
77. Which of the following Zend framework component, is used to send email messages?
- Zend-form
- Zend-email
- Zend-authentication
- Zend-HTTP
- Zend-mail
Answer: E) Zend-mail
Explanation:
The zend-mail component in the Zend framework is used to send email messages.
78. Which of the following class is used to create a new email message?
- Zend\Mail\Msg
- Zend\Mail\Email
- Zend\Mail\New
- Zend\Mail\Message
Answer: D) Zend\Mail\Message
Explanation:
Zend\Mail\Message class is used to create a new email message.
79. Which of the following class is used to send an email using the SMTP server?
- Zend\Mail\Transport\Smtpemail
- Zend\Mail\Transport\Smtpclass
- Zend\Mail\Transport\Smtp
Answer: B) Zend\Mail\Transport\Smtpclass
Explanation:
Zend\Mail\Transport\Smtpclass is used to send an email using the SMTP server.
80. To develop a unit test for the Zend framework, we must first install the ____?
- TestUnit framework
- Unit framework
- PHPUnit framework
Answer: C) PHPUnit framework
Explanation:
To develop a unit test for the Zend framework, we must first install the PHPUnit framework.