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. |
_____________ is a programming practice that expects new code to be written only if an automated test has failed and also to eliminate duplication.(a) Object Oriented Testing(b) Test Driven Development(c) Acceptance Testing(d) Lossless DevelopmentThis question was posed to me during a job interview.This intriguing question originated from Limitations of Standard Unit Testing topic in section In-container Testing of JUnit |
|
Answer» The correct ANSWER is (B) TEST Driven Development |
|
| 2. |
_____________ in computer science is a programming technique for converting data between incompatible type systems.(a) Active Record Pattern(b) Inversion Of Control(c) Object Relational Mapping(d) Strategy PatternI had been asked this question in an interview for job.Question is taken from Comparing Stubs, Mock Objects and In-container Testing in chapter In-container Testing of JUnit |
|
Answer» Right CHOICE is (c) Object RELATIONAL Mapping |
|
| 3. |
To create a Jetty context object, we have to import _____________(a) org.mortbay.jetty.Context;(b) org.jetty.Context;(c) org.mortbay.jetty.servlet.Context;(d) org.junit.Server;I have been asked this question in semester exam.I'd like to ask this question from In-container Testing topic in section In-container Testing of JUnit |
|
Answer» CORRECT option is (c) org.mortbay.jetty.servlet.Context; To explain: The Jetty SERVER is FOUND in “org.mortbay.jetty.servlet.Context”. |
|
| 4. |
When unit testing, it’s important to be able to control as much as possible of the environment in which the tests execute.(a) True(b) FalseThis question was addressed to me in a national level competition.This is a very interesting question from In-container Testing topic in chapter In-container Testing of JUnit |
|
Answer» Correct choice is (a) True |
|
| 5. |
The ______________ identifies the decision points and the assignments associated with each flow.(a) Decision Table(b) Flowgraph(c) Testing Design(d) AuditI had been asked this question by my school principal while I was bunking the class.Question is taken from The Mock Objects Solution topic in division In-container Testing of JUnit |
|
Answer» The CORRECT choice is (b) Flowgraph |
|
| 6. |
The intent of using stubs is to replace a _________ behaviour with a simpler one.(a) Unique(b) Complex(c) Redundant(d) AnomalousThe question was asked in an online interview.My question comes from The Mock Objects Solution topic in chapter In-container Testing of JUnit |
|
Answer» Right answer is (B) Complex |
|
| 7. |
The _____________ exercises the application under load and verifies that it scales correctly.(a) Development platform(b) Integration platform(c) Acceptance platform(d) Stress test platformI have been asked this question by my college director while I was bunking the class.Question is from Limitations of Standard Unit Testing in section In-container Testing of JUnit |
|
Answer» Correct OPTION is (d) Stress test platform |
|
| 8. |
A _____________ handler is attached to the root to serve files from the file system.(a) SourceHandler(b) ResourceHandler(c) AttachHandler(d) RootHandlerThis question was addressed to me during a job interview.This interesting question is from In-container Testing topic in division In-container Testing of JUnit |
|
Answer» CORRECT option is (B) ResourceHandler To explain I WOULD say: The ResourceHandler is ATTACHED to serve files from the file system. |
|
| 9. |
___________ is favoured over conditionals to better write testable code.(a) Polymorphism(b) Composition(c) Inheritance(d) OverloadingThe question was asked in final exam.The origin of the question is Limitations of Standard Unit Testing in chapter In-container Testing of JUnit |
|
Answer» RIGHT choice is (a) Polymorphism To explain I WOULD SAY: More CONDITIONALS lead to more complex CODE. |
|
| 10. |
The most important point to consider when writing a mock is that it shouldn’t have any __________.(a) Redundancy(b) Abstraction(c) Matchers(d) Business LogicThis question was posed to me in homework.My enquiry is from Comparing Stubs, Mock Objects and In-container Testing topic in portion In-container Testing of JUnit |
|
Answer» The correct option is (d) BUSINESS Logic |
|
| 11. |
_____________ are empty shells that supply methods to let the tests have control of the behavior of all the business methods of the faked class.(a) Stubs(b) Jetty(c) Mocks(d) InterfacesThis question was posed to me in exam.The doubt is from Comparing Stubs, Mock Objects and In-container Testing in division In-container Testing of JUnit |
|
Answer» The correct option is (c) MOCKS |
|
| 12. |
Jetty was originally called ________________(a) Eclipse(b) Maven(c) Ant(d) IssueTrackerThe question was asked by my school teacher while I was bunking the class.Query is from In-container Testing in division In-container Testing of JUnit |
|
Answer» Right option is (d) ISSUETRACKER |
|
| 13. |
The _______________ is a design pattern that adds behavior to an individual object, either statically or dynamically, without affecting the behavior of other objects from the same class.(a) Adapter Pattern(b) Bridge Pattern(c) Decorator Pattern(d) Composite PatternThis question was addressed to me during an interview.I want to ask this question from Comparing Stubs, Mock Objects and In-container Testing topic in section In-container Testing of JUnit |
|
Answer» Right option is (c) DECORATOR Pattern |
|
| 14. |
The ___________ is a software design pattern that allows the interface of an existing class to be used as another interface.(a) Adapter Pattern(b) Bridge Pattern(c) Decorator Pattern(d) Composite PatternI had been asked this question in an interview.I'd like to ask this question from Comparing Stubs, Mock Objects and In-container Testing in division In-container Testing of JUnit |
|
Answer» Right answer is (a) ADAPTER Pattern |
|
| 15. |
_________ replace the objects with which the methods under test collaborate, offering a layer of isolation.(a) Classes(b) Mocks(c) Unified Stamps(d) InterfacesThe question was asked by my college director while I was bunking the class.My question is taken from Comparing Stubs, Mock Objects and In-container Testing topic in section In-container Testing of JUnit |
|
Answer» The CORRECT ANSWER is (b) Mocks |
|
| 16. |
Applying the _________ pattern to a class means removing the creation of all object instances for which this class isn’t directly responsible and passing any needed instances instead.(a) Message Passing(b) Inversion Of Control(c) Observer Pattern(d) Strategy PatternI have been asked this question by my school principal while I was bunking the class.My question is from Comparing Stubs, Mock Objects and In-container Testing in section In-container Testing of JUnit |
|
Answer» Right CHOICE is (b) Inversion Of Control |
|
| 17. |
Stubs don’t lend themselves well to ____________ unit testing.(a) Fine-grained(b) Coarse-grained(c) Redundant(d) FunctionalThe question was posed to me during an online interview.My question comes from The Mock Objects Solution topic in chapter In-container Testing of JUnit |
|
Answer» Correct OPTION is (a) Fine-grained |
|
| 18. |
____________ is an architectural pattern that stores in-memory object data in relational databases.(a) Active Record Pattern(b) Inversion Of Control(c) Observer Pattern(d) Strategy PatternI got this question during an interview.Asked question is from Comparing Stubs, Mock Objects and In-container Testing topic in section In-container Testing of JUnit |
|
Answer» Correct ANSWER is (a) Active Record Pattern |
|
| 19. |
Stubs usually provide high _____________ in the tested system.(a) Mocking(b) Security(c) Confidence(d) ModularityI had been asked this question by my school teacher while I was bunking the class.My question is from The Mock Objects Solution topic in division In-container Testing of JUnit |
|
Answer» RIGHT answer is (c) Confidence To explain I WOULD say: With stubs, the OBJECTS under test aren’t getting modified. |
|
| 20. |
The ___________ platform is the last staging area before production.(a) Development platform(b) Integration platform(c) Acceptance platform(d) Pre-production platformI have been asked this question in an interview.Query is from Limitations of Standard Unit Testing topic in chapter In-container Testing of JUnit |
|
Answer» CORRECT option is (d) Pre-production platform To ELABORATE: The pre-production platform is an optional platform before the production platform. |
|
| 21. |
________ platform builds the application from its various components.(a) Development platform(b) Integration platform(c) Acceptance platform(d) Stress test platformThe question was asked in an interview.This interesting question is from Limitations of Standard Unit Testing topic in chapter In-container Testing of JUnit |
|
Answer» Correct OPTION is (B) INTEGRATION platform |
|
| 22. |
To implement a custom URL protocol handler, the URL method __________ is called.(a) setURLStreamHandlerFactory(b) setURLStreamFactory(c) setURLStreamHandlerFactorySetting(d) setStreamHandlerFactoryI got this question in a job interview.I would like to ask this question from Comparing Stubs, Mock Objects and In-container Testing in section In-container Testing of JUnit |
|
Answer» Right option is (a) SETURLSTREAMHANDLERFACTORY |
|
| 23. |
To create a Jetty server object, we have to import _____________(a) org.mortbay.jetty.Server;(b) org.jetty.Server;(c) org.junit.jetty.Server;(d) org.junit.Server;I got this question in an interview for job.This key question is from In-container Testing in portion In-container Testing of JUnit |
|
Answer» CORRECT option is (a) org.mortbay.JETTY.SERVER; EASIEST explanation: The Jetty Server is FOUND in “org.mortbay.jetty.Server”. |
|
| 24. |
API stands for _______________(a) Application programming interface(b) Application programming instruction(c) Android programming interface(d) Application performance interfaceThis question was addressed to me during an interview for a job.The query is from Limitations of Standard Unit Testing topic in division In-container Testing of JUnit |
|
Answer» Right answer is (a) Application programming interface |
|
| 25. |
While creating a server object like- Server obj = new Server(8080), 8080 represents the number of connections.(a) True(b) FalseI got this question by my college professor while I was bunking the class.Origin of the question is In-container Testing in chapter In-container Testing of JUnit |
|
Answer» The correct ANSWER is (B) False |
|
| 26. |
In Jetty, ____________ object processes the HTTP requests.(a) Server(b) Context(c) Root(d) HandlerI have been asked this question by my school principal while I was bunking the class.I'd like to ask this question from In-container Testing in section In-container Testing of JUnit |
|
Answer» The correct answer is (b) Context |
|
| 27. |
On the development platform, _________ unit tests are executed.(a) Acceptance(b) Lossless(c) Logic(d) FunctionalThis question was addressed to me in semester exam.I'd like to ask this question from Limitations of Standard Unit Testing topic in division In-container Testing of JUnit |
|
Answer» The correct OPTION is (c) Logic |
|
| 28. |
Using old tests to guard against new changes is a form of ______________(a) Unit Testing(b) Integration Testing(c) Regression Testing(d) Loss TestingThe question was posed to me during an interview.I'm obligated to ask this question of The Mock Objects Solution topic in section In-container Testing of JUnit |
|
Answer» The correct OPTION is (c) Regression Testing |
|
| 29. |
The ______________ method sets the document root from which to serve resources.(a) setResourceBase(b) resourceBase(c) setResource(d) setBaseThe question was asked by my school teacher while I was bunking the class.I'd like to ask this question from In-container Testing in portion In-container Testing of JUnit |
|
Answer» The CORRECT choice is (a) setResourceBase |
|
| 30. |
An implementation that returns a hardcoded value for purposes of testing is known as a __________(a) Stub(b) Mock Object(c) Packet(d) JammerThe question was asked during an interview.My question is from The Mock Objects Solution topic in chapter In-container Testing of JUnit |
|
Answer» RIGHT option is (a) Stub For explanation: A stub implementation can be CREATED DYNAMICALLY USING LAMBDAS. |
|
| 31. |
_______________ is a Java HTTP (Web) server and Java Servlet container.(a) Maven(b) Ant(c) Jetty(d) ZimbraI have been asked this question in a job interview.The above asked question is from In-container Testing in portion In-container Testing of JUnit |
|
Answer» The correct option is (c) Jetty |
|
| 32. |
When the _________ is used as the method’s first client, it becomes easier to focus purely on the API.(a) Object(b) Class(c) Test(d) StubI had been asked this question during an online exam.I want to ask this question from Limitations of Standard Unit Testing in section In-container Testing of JUnit |
|
Answer» Right ANSWER is (C) Test |
|
| 33. |
_____________ is a software testing technique that is useful to help in the generation of test data.(a) Symbolic Execution(b) Stubs(c) Active testing(d) All-pairs testingThis question was addressed to me by my college professor while I was bunking the class.Question is taken from The Mock Objects Solution in chapter In-container Testing of JUnit |
|
Answer» RIGHT option is (a) Symbolic Execution Easiest EXPLANATION: Symbolic Execution is used in PROVING the PROGRAM quality. |
|
| 34. |
A build or developer usually executes tests involving stubs in their _________ environment.(a) Dead(b) Running(c) Production(d) FakeThis question was addressed to me in final exam.My question is from The Mock Objects Solution in chapter In-container Testing of JUnit |
|
Answer» Correct choice is (b) RUNNING |
|
| 35. |
A ________ is a piece of code that’s inserted at runtime in place of the real code.(a) Stub(b) Mock Object(c) Packet(d) JammerThe question was posed to me in an online quiz.This interesting question is from The Mock Objects Solution topic in section In-container Testing of JUnit |
|
Answer» CORRECT ANSWER is (a) Stub Explanation: STUBS are used in order to isolate the CALLER from the real IMPLEMENTATION. |
|