InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Inheritance in class diagrams is depicted by________(a) single-headed empty arrow(b) single-headed filled arrow(c) double-headed empty arrow(d) double-headed filled arrowThe question was asked during an interview.My question comes from Object and Design-2 topic in portion Object Tools and Design and Variables in PHP of PHP |
|
Answer» The correct ANSWER is (a) single-headed empty arrow |
|
| 2. |
Which one of the following is displayed in the third section of the class diagram?(a) Operations(b) Inheritance(c) Abstraction(d) CouplingThe question was posed to me during an interview.I need to ask this question from Object and Design-2 in portion Object Tools and Design and Variables in PHP of PHP |
|
Answer» Right answer is (a) OPERATIONS |
|
| 3. |
# is the visibility code for?(a) Private(b) Friendly(c) Protected(d) StaticI had been asked this question during an interview.I need to ask this question from Object and Design-2 topic in division Object Tools and Design and Variables in PHP of PHP |
|
Answer» Correct OPTION is (C) Protected |
|
| 4. |
A bidirectional relationship in class diagrams is described by________(a) double-headed arrow(b) visibility symbols(c) single-headed arrow(d) double diamondThis question was addressed to me in an online interview.This intriguing question originated from Object and Design-2 topic in division Object Tools and Design and Variables in PHP of PHP |
|
Answer» The CORRECT CHOICE is (a) double-headed arrow |
|
| 5. |
Which one of the following statements is true about sequence diagrams?(a) A sequence diagram is class based(b) A sequence diagram presents the participants of a system from right to left(c) The vertical broken lines represent the lifetime of the class in the system(d) A sequence diagram is object basedThe question was posed to me in an online quiz.I need to ask this question from Object and Design-2 topic in division Object Tools and Design and Variables in PHP of PHP |
|
Answer» CORRECT ANSWER is (d) A sequence diagram is OBJECT BASED Best EXPLANATION: A sequence diagram is object based rather than class based. It is used to model a process in a system step by step. |
|
| 6. |
Which relationship is illustrated by a line that begins with an unfilled diamond?(a) Composition(b) Abstraction(c) Aggregation(d) InheritanceThe question was posed to me in class test.My enquiry is from Object and Design-2 in division Object Tools and Design and Variables in PHP of PHP |
|
Answer» Right option is (c) AGGREGATION |
|
| 7. |
+ is the visibility code for?(a) Public(b) Private(c) Protected(d) FriendlyThis question was addressed to me in exam.This interesting question is from Object and Design-2 in division Object Tools and Design and Variables in PHP of PHP |
|
Answer» The correct OPTION is (a) Public |
|
| 8. |
If the diamond is filled it depicts which relationship?(a) Strong Aggregation(b) Composition(c) Abstraction(d) InheritanceI have been asked this question in my homework.This intriguing question originated from Object and Design-2 topic in portion Object Tools and Design and Variables in PHP of PHP |
|
Answer» RIGHT option is (b) Composition For EXPLANATION: In composition, the contained OBJECT can be referenced by its container only. It should be deleted when the container is deleted. |
|
| 9. |
Which one of the following is displayed below the class name in the class diagrams?(a) Functions(b) Methods(c) Attributes(d) ConstraintsThis question was addressed to me during an interview.My question is based upon Object and Design-2 topic in division Object Tools and Design and Variables in PHP of PHP |
|
Answer» The CORRECT ANSWER is (c) Attributes |
|
| 10. |
________ are used in class diagrams to describe the way in which specific elements should be used.(a) Attributes(b) Constraints(c) Constants(d) Class NamesThis question was posed to me in examination.I want to ask this question from Object and Design-2 topic in division Object Tools and Design and Variables in PHP of PHP |
|
Answer» Correct CHOICE is (b) Constraints |
|
| 11. |
In a class diagram the class is divided into three sections, what is displayed in the first section?(a) Class Attributes(b) Class Declaration(c) Class Name(d) Class FunctionsI had been asked this question in an interview for job.This interesting question is from Object and Design-1 in portion Object Tools and Design and Variables in PHP of PHP |
|
Answer» The correct choice is (c) Class NAME |
|
| 12. |
Which one among the following means tight coupling?(a) Code Duplication(b) Inheritance(c) Encapsulation(d) PolymorphismThe question was posed to me in exam.My query is from Object and Design-1 in portion Object Tools and Design and Variables in PHP of PHP |
|
Answer» CORRECT option is (a) Code Duplication For explanation: Duplication is one of the great evils in code. Take a look at the instances of repetition in your system. Perhaps they BELONG together. If you change something fundamental about one ROUTINE, will the similar routines need amendment? If this is the CASE, they probably belong in the same class. |
|
| 13. |
UML stands for?(a) unified mailing language(b) unified modeling logo(c) undefined modeling language(d) unified modeling languageThe question was asked in an interview for internship.I'm obligated to ask this question of Object and Design-1 topic in division Object Tools and Design and Variables in PHP of PHP |
|
Answer» Correct answer is (d) unified modeling language |
|
| 14. |
Which one of the following is known as the key to object-oriented programming?(a) Polymorphism(b) Encapsulation(c) Data Abstraction(d) OrthogonalityI got this question during an interview.The doubt is from Object and Design-1 in section Object Tools and Design and Variables in PHP of PHP |
|
Answer» RIGHT answer is (B) Encapsulation To explain: Encapsulation simply means the hiding of data and FUNCTIONALITY from a CLIENT. |
|
| 15. |
Polymorphism is also known as______(a) switch(b) overact(c) encapsulation(d) class switchingI have been asked this question at a job interview.My doubt is from Object and Design-1 in division Object Tools and Design and Variables in PHP of PHP |
|
Answer» Right CHOICE is (d) class switching |
|
| 16. |
______ occurs when discrete parts of a system’s code are tightly bound up with one another so that a change in one part necessitates changes in the others.(a) Loose Coupling(b) Tight Coupling(c) Co-relation(d) BalancingI got this question in final exam.The question is from Object and Design-1 in portion Object Tools and Design and Variables in PHP of PHP |
|
Answer» Right option is (b) TIGHT Coupling |
|
| 17. |
________ code makes change easier because the impact of altering an implementation will be localized to the component being altered.(a) Orthogonal(b) Cohesion(c) Coupling(d) BalancingI had been asked this question in an online quiz.The doubt is from Object and Design-1 topic in division Object Tools and Design and Variables in PHP of PHP |
|
Answer» The correct option is (a) Orthogonal |
|
| 18. |
The extent to which proximate procedures are related to one another is known as ________(a) Coupling(b) Balancing(c) Cohesion(d) Co-relationThe question was asked during an online exam.This interesting question is from Object and Design-1 in portion Object Tools and Design and Variables in PHP of PHP |
|
Answer» The CORRECT answer is (C) Cohesion |
|
| 19. |
Object-oriented code tries to minimize dependencies by moving responsibility for handling tasks away from ___ and toward the objects in the system.(a) server code(b) client code(c) machine code(d) procedural codeI had been asked this question during an online exam.The origin of the question is Object and Design-1 topic in portion Object Tools and Design and Variables in PHP of PHP |
|
Answer» Right option is (b) CLIENT code |
|
| 20. |
Placing a static method for generating ________ objects in the ____________ class is convenient.(a) child parent(b) parent child(c) final static(d) static finalI had been asked this question in exam.Question is from Object and Design-1 in section Object Tools and Design and Variables in PHP of PHP |
|
Answer» Correct ANSWER is (a) CHILD parent |
|
| 21. |
Which class accepts a class name or an object reference and returns an array of interface name?(a) class_implements()(b) is_subclass()(c) is_subclass_of()(d) class_interface()The question was posed to me in class test.Query is from Object Tools in section Object Tools and Design and Variables in PHP of PHP |
|
Answer» The correct option is (a) class_implements() |
|
| 22. |
Which one of the following function should I use to find the parent class of a class?(a) get_parent_class()(b) parent_class()(c) class_parent()(d) get_class_parent()The question was asked in class test.My question is based upon Object Tools topic in chapter Object Tools and Design and Variables in PHP of PHP |
|
Answer» Right answer is (a) get_parent_class() |
|
| 23. |
What will be the output if a protected method is given as the argument to the function method_exist()?(a) Method does not exist(b) False(c) Error(d) TrueI got this question in an online quiz.I'm obligated to ask this question of Object Tools in portion Object Tools and Design and Variables in PHP of PHP |
|
Answer» The correct choice is (d) True |
|
| 24. |
If you call a method and it doesn’t exist it’ll cause a problem. To check the method which function will you use?(a) _method()(b) methodexists()(c) is_callable()(d) is_method()I got this question in exam.My question is taken from Object Tools in section Object Tools and Design and Variables in PHP of PHP |
|
Answer» Right ANSWER is (C) is_callable() |
|
| 25. |
You use the get_class_methods() function to return the names of all the methods in the class. Which function will you use to print it on the screen?(a) printf()(b) print_ar(c) print_r(d) echoI had been asked this question in an international level competition.This interesting question is from Object Tools in chapter Object Tools and Design and Variables in PHP of PHP |
|
Answer» RIGHT answer is (c) print_r The EXPLANATION is: The function get_class_methods returns an ARRAY THEREFORE we cannot use echo. |
|
| 26. |
PHP 4 did not support instanceof. Instead, which function did it provide?(a) is()(b) get_class()(c) is_a()(d) is_the()I got this question in final exam.The above asked question is from Object Tools topic in chapter Object Tools and Design and Variables in PHP of PHP |
|
Answer» Right ANSWER is (C) is_a() |
|
| 27. |
Which one of the following will you use to check the class of an object?(a) class()(b) _class()(c) class_check()(d) get_class()I had been asked this question in a job interview.I'm obligated to ask this question of Object Tools in portion Object Tools and Design and Variables in PHP of PHP |
|
Answer» The correct option is (d) get_class() |
|
| 28. |
Which one of the following functions will you use to check that the class exists before you work with it?(a) class_exist()(b) class_exists()(c) exist()(d) exists_class()I had been asked this question in an interview for job.I'd like to ask this question from Object Tools in section Object Tools and Design and Variables in PHP of PHP |
|
Answer» Right choice is (b) class_exists() |
|
| 29. |
How many times can you define _________ autoload in a process?(a) once(b) twice(c) thrice(d) as many times as neededThe question was posed to me in an online interview.I'd like to ask this question from Object Tools in portion Object Tools and Design and Variables in PHP of PHP |
|
Answer» The correct option is (a) once |
|
| 30. |
Which function was introduced to help automate the inclusion of class files?(a) __load()(b) __preload()(c) __autoload()(d) __inload()I had been asked this question in an interview for internship.Query is from Object Tools in chapter Object Tools and Design and Variables in PHP of PHP |
|
Answer» Correct choice is (c) __autoload() |
|
| 31. |
Which one of the following statements is true for require() and require_once()?(a) They are functions(b) They are statements(c) They’ll not work if the () is not present(d) They can not be used to require filesThis question was addressed to me in semester exam.The above asked question is from Object Tools-1 topic in portion Object Tools and Design and Variables in PHP of PHP |
|
Answer» CORRECT answer is (b) They are statements Best explanation: require() and require_once() are ACTUALLY statements, not functions. This means that you can omit the BRACKETS when using them. |
|
| 32. |
Which one of the following statements is true for include_once() and require_once()?(a) Both are exactly the same(b) include_once is used for files where as require_once() is not(c) Both Handle the errors in the same way(d) Both do not handle the errors in the same wayThis question was posed to me in an interview for job.I'd like to ask this question from Object Tools-1 topic in section Object Tools and Design and Variables in PHP of PHP |
|
Answer» Right choice is (d) Both do not handle the errors in the same way |
|
| 33. |
Which symbol is used to declare nested namespaces?(a) /(b) \(c) .(d) |I have been asked this question during a job interview.The question is from Object Tools-1 in chapter Object Tools and Design and Variables in PHP of PHP |
|
Answer» CORRECT choice is (B) \ EXPLANATION: EXAMPLE – namespace com\getinstance\util; |
|
| 34. |
Till which version of PHP, developers were forced to name their files in a global context?(a) PHP 4(b) PHP 5(c) PHP 5.2(d) PHP 5.3I had been asked this question in an interview for internship.Question is taken from Object Tools-1 topic in section Object Tools and Design and Variables in PHP of PHP |
|
Answer» RIGHT choice is (d) PHP 5.3 To elaborate: If you NAMED a class ShoppingBasket, it would become instantly AVAILABLE across your system. |
|
| 35. |
Which one of the following is the correct way of declaring a namespace?(a) namespace my;(b) namespace my();(c) my namespace;(d) namespace(my);I had been asked this question in quiz.The question is from Object Tools-1 in section Object Tools and Design and Variables in PHP of PHP |
|
Answer» Correct answer is (a) namespace my; |
|
| 36. |
A package is a set of related _________(a) Objects(b) Classes(c) Programs(d) FunctionsThe question was asked in an online interview.The origin of the question is Object Tools-1 topic in portion Object Tools and Design and Variables in PHP of PHP |
|
Answer» Right choice is (b) Classes |
|