GRILE ENGLEZA TEST What annotations from the following do you use within your JUnit Test class in JUnit 4?Alegeți o opțiune: a. @TestClass, @TestMethod b. @Before, @After, @Test c. @TestTest, @TestThis d. @BeforeTest, @AfterTest What is test - driven development (TDD)? Alegeți o opțiune: a. TDD does not require unit tests to be written b. First the code is implemented and then tests are written. c. Software testers do the development in TDD d. The Tests are normally written before the Code Which of the following patterns are Structural (choose one or more right answers) ? Alegeți una sau mai multe opțiuni: a. Proxy b. Adapter c. Factory d. State e. Decorator f. Builder g. Singleton h. Facade To implement a universal compression / decompres sion system, that will support different formats, which design pattern can be used ? Alegeți o opțiune: a. Adaptor b. Decorator c. Façade d. Singleton e. Strategy ?? If you want to implement a solution that generates expensive objects (creation time and used memory), which pattern offers the optimal solution so that the repetitive creation processes are minimized? Alegeți o opțiune: a. Builder b. Factory c. Prototype d. Flyweight ??? e. Singleton To add new functionalities to an object without chang ing the implementation/definition of the class, which design pattern will you use ? Alegeți o opțiune: a. Facade b. Builder c. Decorator d. Adapter e. Prototype If you want to create a solution that allows you to use a single instance for a class so that the resource / event is managed centrally, the most appropriate GoF pattern is ? Alegeți o opțiune: a. Singleton b. State c. Memento d. Proxy e. Prototype A smart - home system, with different sensors installed in the house, requires the implementation of a mobile solution, for different platforms, that will receive messages from available sensors and trigger different notifications on the client GUI. What is the right design pattern for this functionality: Alegeți o opțiune: a. Façade ??? b. Singleton c. State d. Observer ??? e. Adaptor f. Strategy ??????????? What are some of the benefits of unit testing? Alegeți una sau mai multe opțiuni: a. Can improve the design of code, especially if using Test Driven Development(TDD) b. Makes it easier to change/refactor code. c. Reduces the level of bugs in production code. d. Simplifies integration testing e. Unit tests are a form of documentation. What's the correct difference between an Adapter pattern and a Decorator ? Alegeți o opțiune: a . The Adapter is Structural, and Decorator is Creational b. There are no differences between the two concepts, Decorator being an alias for the Adapter c. Adapter is used to modify the functionality of an existing class and Decorator adds new properties d. The Adapter does not add new functionality, but Decorator extends the functionality of the object An image viewer application that supports various formats (jpeg, gif, bmp, etc.) is required. The application can be extended to generate other formats in the future. What is the right pattern design that will help you manage efficiently the future development: Factory A pattern design represents Alegeți o opțiune: a. An universal solution to most problems in OOP b. A data structure used in OOP c. An algorithm used in OOP d. A solution to a common problem in OOP e. A scheme for a particular type of class Select one or more options that represent the differences between Prototype and Flyweight Alegeți una sau mai multe opțiuni: a . Prototype is used to optimize object creation b. through Prototype, the creation of objects is done by cloning, and in Flyweight, objects are reused c. Prototype type is Creational and Flyweight is Structural d. Prototype is about optimizing the speed of creating objects and Flyweight is about optimizing the memory necessary to store objects e. Prototype is Structural and Flyweight is Creational f. Flyweight helps the client to clone initial objects and Prototype handles the creation of those objects The following scenario is considered. You develop an online solution for a company that offers for rent to its customers different vehicles categories: cars, motorcycles and vans. Fleet structure data is stored uniquely at solution level and can be queried by clients. Clients ca n check the details for each vehicle. The component that delivers this description presents for each selected vehicle details depending the state in which it may be: defective, available or rented. What design patterns (one or more) are suitable to be used to implement the presented scenario. Alegeți una sau mai multe opțiuni: a. Composite b. Strategy c. Builder d. Factory e. Flyweight f. State g. Singleton If you want to create a solution that allows you to use a single instance for a class so that the resource / event is managed centrally, the most appropriate GoF pattern is ? Alegeți o opțiune: a. State b. Proxy c. Prototype d. Memento e. Singleton The following scenario is considered. A company produces shirts and sell them online. Following a customer survey, the company decided to add additional items such as the customer's monogram, color, size, branding, etc. What design pattern should be implem ented to allow customers to customize their shirts design before ordering them ? Alegeți o opțiune: a. Builder b. Strategy c. Façade d . Decorator ???? e. Adapter If you want to implement a solution where all clients that use Class A will have access t o the same type A instance, what GoF pattern will you use? Alegeți o opțiune: a. There is no need for pattern because the solution is implemented by marking Class A as final b. Memento is implemented for Class A c. Flyweight is implemented for Class A d. Singleton is implemented for Class A e. There is no need for pattern because the solution is implemented by defining class A as abstract For the security of a cloud application, it is wanted that when a user logs on, on the server side is generated one instance of the component, so that it has only one active session. What is the right pattern design? Alegeți o opțiune: a. Singleton b. Façade c. Factory d. Observer e. Adaptor f. Proxy What pattern allows you to extend/change the object functionality at run - time? Alegeți o opțiune: a. Adapter b. Strategy c. Decorator d. State e. Facade f. Composite An image viewer application that supports various formats (jpeg, gif, bmp, etc.) is required. The application can be extended to generate ot her formats in the future. What is the right pattern design that will help you manage efficiently the future development: Alegeți o opțiune: a. Singleton b. Façade c. Adaptor d. Factory e. Observer ???? A web hosting company offers different plans for server rental (standard, professional and premium). Different hosting services (cloud, SSL, 24/7 support, backup, databases, etc.) can be added to each plan after the contract has been signed and the service started. What is the design pattern for impl ementing an IT solution for order management: Alegeți o opțiune: a. Adaptor b. Factory c. Façade d. Singleton e. Decorator Which of the following concepts is NOT a mandatory component used in defining a design pattern ? Alegeți o opțiune: a. Pattern name b. The solution provided by the pattern described by diagrams or pseudo - code c. Implementing the pattern in Java d. The advantages and disadvantages of the pattern e. The problem for which the pattern offers a solution ???? What GoF pattern must be implemented if you want to implement a solution that allows the client to choose at run - time the algorithm / function needed to process a data set. The solution must allow the modification of the function library but not of the class that manages the data Alegeți o opțiune: a. Decorator b. Facade c. Strategy d. Adapter e. State f. Wrapper Which of the following patterns are Structural (choose one or more right answers) ? Alegeți una sau mai multe opțiuni: a. Adapter b. Proxy c. Builder d. State e. Decorator f. Singleton g. Facade h. Factory What is a DISADVANTAGE for the Singleton pattern? Alegeți o opțiune: a. In some situations, a bottleneck for communication or access to resources b. Centralized management of a resource through a single instanc e c. Does not allow duplication of instances d. Strict control of instancing a class - only once ? e. Allows the creation of a single object The following scenario is considered. A printing company makes wedding invitations . The company owns a set of a number of templates used to make subsequent personalized invitations. What design pattern is recommended to use to optimize the consumption of resources on memory storage of used objects ? Alegeți o opțiune: a. Builder b. Prototype c. Strategy d. Flyweight e. Composite f. Singleton g. Abstract factory The following scenario is considered: ACME Inc. develops a software solution for a restaurant so that the waiter can take orders directly on the mobile phone. The orders are taken from the client an d they are created on the spot, being automatically assigned the specialized chef on that dish, the ingredients used and other special requirements of the client. These details are provided by the application, without the need for the intervention of the w aiter who only selects the required dish. The orders are sent to the chefs at the end of the order for the respective table, and will be executed according to the degree of load of each chef. What pattern offers a solution to this problem? Alegeți o opțiu ne: a. State b. Composite c. Command d. Memento e. Chain of Responsibility If you want to implement a solution where complex objects are built by a mechanism independent of the actual object making process, so that the client does not know the internal d etails of the object, the most suitable GoF pattern is Alegeți o opțiune: a. Builder b. Factory c. Decorator d. Singleton e. Adapter Your domain contains 3 classes: Enemy, BigEnemy, SmallEnemy. They have same public methods. If you create just a SmallEnem y AND NO OTHER TYPE OF ENEMY, how will you name a variable which stores a reference to a new instance? Alegeți o opțiune: a. smlEmy b. e c. smallEnemy d. enemy Given the next implementation. What Clean Code principles (choose one or more) have been used here ? Alegeți una sau mai multe opțiuni: a. KISS b. DRY c. Single Responsability d. Open - Closed e. WET f. Liskov g. One Screen function Which lines contain "Magic Numbers"?(Multiple choice) Alegeți una sau mai multe opțiuni: a. there are no "magic numbers" in the given source code b. 33 - not sure what is 1 c. 32 - not sure what: 1, 5, 6, 7, 10 is for. d. 35 - loop counter 5 ?? e. 37 - sum * i ???? What means "technical debt" in software development Alegeți o opțiune: a. The level of technical knowledge that software developers lack b. The future cost of fixing bugs created now c. The value that exceeds the project budget d. The difference between different technologies used in the development phase e. The value that the clien t should pay for new features, which are added before release 1. What design pattern allows you to build an object in steps? a) Command b) Builder c) Adapter d) Composite e) Memento f) Façade g) Chain of responsibility h) Prototype i) Decorator j) Proxy k) Flyweight l) Singleton m) Strategy n) Factory(all types) o) State p) Observer 2. Given the following diagram that represents a solution that implements a Design Pattern, indicate which one it is? a) Template b) Command c) Strategy d) Flyweight e) Adapter f) State g) Chain of responsibility h) Composite 3. Function DoSomething(...) takes 10 arguments. What could be done to reduce their number. (multiple choice) a) Encapsulate logically related parameters b) Use the Builder pattern to manage it more efficiently c) Use a class and constructor instead d) Split the function and take result of subpart as input e) Keep the method and wri te comments explaining the meaning of each argument 4. You develop a software solution that allows the management of different email clients. Email clients must be able to send and receive emails for a specific email address but also they can be used to ma nage email groups composed of several email addresses. Users should be able to manage this structure from their solution. Users have the ability to modify/customize the email client during use. The proposed solution must allow clients to modify/customize t he solution by adding filters or email sorting criteria. Also, the transmission function of a message can be modified by adding an additional confirmation or by delaying the sending or specifying specific hours. What are the 2 design patterns that solve op timally? These 2 problems? a) Proxy b) Observer c) Decorator d) Adapter e) Strategy f) Memento g) Builder h) Factory i) Flyweight j) Composite k) Template l) Prototype FACADE 5. You have to test a function that determines the minimum of an array of values received as a parameter of type int[ ] values. To perform unit tests(different from each other) of type Cardinality = 2 and Ordering. What test data would you use? Choose one or more options. a) {9,10,8} b) {10} c) {7,9,5} d) {7,8,9,10} e) {9,10} f) {10,9,10,9,9} g) {10,9,6,4} 6. What design pattern encapsulates a request/task as an object, that will be executed later? a) Composite b) Flyweight c) Strategy d) Memento e) Factory(toate tipurile) f) Proxy g) Observer h) Prototype i) Adapter j) Façade k) Decorator l) State m) Command n) Builder o) Chain of responsibility p) Singleton 7. You develop a software solution for an equipment,from a medical laboratory, equipment that is used to completely automate the process of conducting blood tests. The equipment has a display that shows its current status and is able to manage the complete analysis of a bl ood sample without the involvement of laboratory employess. The display permanently displays messages specific to the status of the medical equipment(waiting for the sample,loading the test tube,processing the data,displaying the results,etc.). At start - up ,the equipment is on standby, but from the moment a test tube is loaded, the equipment goes through all the phases on its own until the result is displayed. The display also shows the equipment name. Messages are displayed as soon as the equipment changes to a new state. Implement the module that allows the efficient management of medical equipment, given that it is autonomous and goes through several states/phases to display the final result. It is also desired that the device software can efficiently mana ge different types of medical tests, which derive from the MdecicalAnalysis family of classes. The solution must efficiently generate different types of analysis(Test - COVID, Cholesterol, Vitamins) being decouped from the details of creating these types. Ov er time,the details of these types of medical tests may change,but this solution should not be affected. What are the 2 design patterns that optimally solve these 2 problems? a) Chain of responsibility b) Decorator c) Flyweight d) State e) Prototype f) Proxy g) Strategy h) Command i) Factory( toate tipurile) j) Façade k) Composite l) Singleton 8. What design pattern allows a client to create families of objects without specifying the concrete classes in them? a) Prototype b) Command c) Flyweight d) Proxy e) Chain of responsibility f) Factory(toa te tipurile) g) Memento h) Decorator i) Builder j) Adapter k) Observer l) Composite m) Façade n) Singleton o) State p) Strategy 9. What is the smallest Unit you test/target in your Unit Testing? a) Constants and variables b) Modules and components c) Package d) Method and functions e) Class 10. For the following method,which statements is correct to ensure 100% code coverage by testing it? a) 100% code coverage cannot be provided for this method, because the switch has many branches b) 100% code coverage can be provided if tested with values 1 an d 5 c) 100% code coverage can be provided of tested with the values 1,5,10 and 20 d) 100% code coverage can be provided if tested with the values 1,5 and 10 e) 100% code coverage cannot be provided for this method, as it generates an exception 11. Given the functio n for calculating the price of a ticket, indicate the minimum number of unit tests(with different combinations of values) that must be implemented to ensure a 100% code coverage? a) 2 b) 5 c) 6 d) 1 e) 4 f) 3 12. Who is expected to write Unit Tests? a) Software tester b) Designer c) Software architect d) Client e) Developer 13. Given the next class, select the statements (one or more) that describe it correctly a) It is a correct implementation of prototype b) It is a correct implementation of singleton c) It is a wrong implementation of singleton d) It is an example of lazy instantiation e) To be a singleton implementation, a getInstance() method is required f) It cannot be considered an implementation of a design pattern g) It is a correct implementation of simple factory 14. What design pattern all ows the definition of dependicies between objects, so that when an object changes its state,all its dependencies are notified and updated automatically? a) Composite b) Chain of responsibility c) Adapter d) Flyweight e) Decorator f) Façade g) Command h) Singleton i) Prototype j) Observ er k) Memento l) Proxy m) Factory(toate tipurile) n) State o) Strategy p) Builder 15. What design pattern encapsulates state - dependent behaviors and uses delegation to switch between them? a) Builder b) Chain of responsibility c) Observer d) Prototype e) Decorator f) Flyweight g) Memento h) Composite i) Strategy j) Command k) Façade l) State m) Factory (toate tipurile) n) Adapter o) Singleton p) Proxy 16. “Identify the aspects of your application that vary and separate them from what stays the same” results in: a) All of these b) More flexibility in your systems c) Less clas ses in your systems d) Less interfaces in your systems e) Tighter coupling of your system 17. When should Unit Tests be written in Development Cycle(based on TDD)? a) Unit Tests are written after the code during development in order to help coders test the code b) Both of the above c) Unit tests are to be written before the code during development in order to help coders write the best code d) None of the above 18. Which of the following class is a Composite of Tests? a) TestCase b) TestResult c) TestRunner d) Assert e) None of the se answers f) TestSuite 19. In Liskov substitution principle, “objects in a program should be replaceable with instances of their.......” a) Codes b) Parent types c) Subtypes d) Programs e) Command 20. What statements best describe the “spaghetti - code” concept? a) Is describing so lutions with complex inter dependency relations b) Is also known as a “big ball of mud” c) Can be avoided by using design patterns d) Can be avoided by writing small functions(with 1 or 2 arguments) e) This concept does not exist in programming 21. You develop a software solution that allows customers to order food through similar Glovo/FoodPanda services. Customers generate an order with the respective products. The order will be taken over by a courier available in the system. The order will be delivered in the future but the delivery time depends on several external factors( traffic,congestion in the store,etc.). Orders registered in the system can no longer be canceled and are not lost. At this moment each customer can include in the order any king of products but the solution must allow the addition of filters/rules in the future(does not allow orders less than a certain amount,does not allow orders for certain products, adds the cost of transport to order or increases restaurant prices by an amount) that limits/controls customer options. These changes must be included in the back - end services when the customers adds a product. What are the 2 design patters that optimally solve these problems? a) Composite b) Prototype c) State d) Adapter e) Singleton f) Factory g) Decorator h) Builder i) Memento j) Template k) Chain of responsibility l) Strategy m) ?? 22. You develop a software solution used by a medical laboratory to handle different requests for analysis of samples of biological material(blood tests). The laboratory receives from different medical offices the requests,and saves them in a queue. The analyzes are performed by different medical departments that have special equipment for each type of analysis. Laboratories request these tests indicating their type and the patient’s na me. When a request for analysis is registered in the system, it is associated with the department specialized in that type of analysis. Once the result of the analysis is obtained,the department that processed it will send the result to the patient’s email (the patient’s email and name are recorded in the request). It is also desired that in the laboratory software solution,the manager instance in charge of the orders queue or the customer list should be unique,so as not to generate problems related to the w ay customers or medical tests are managed. What are the 2 design patterns that solve these 2 problems? a) Memento b) State c) Proxy d) Singleton e) Strategy f) Prototype g) Factory(toate tipurile) h) Composite i) Flyweight j) Command k) Decorator l) Adapter m) Observer n) Chain of responsibility GRILE CTS 1. Termenul de “zombie code” se refera la: a. Codul sursa ce contine multe comentarii de tip TODO b. Legacy code(cod sursavechi) c. Codul sursa ce contine bucati de cod comentate d. Codul sursa folosit 2. O modalitate de a evita update-uri(noi versiuni) dese pentru aplicatia dezvoltata este: a. Mutarea constantelor din cod in baza de date b. Scrierea de metode scurte c. Folosirea de enumeratii in detrimental sirurilor de caractere d. Stabilirea unor date fixe la care se lanseaza update-uri 3. Proiectarea pe baza de contract(Design by contract) este amintita de urmatorul pricipiu: a. Liskov Substitution b. Interface segregation c. Single responsibility d. Open closed 4. Litera “ I ” din principiul SOLID provine de la: a. Iskov Substitution b. Inversion Dependency c. Interface Dependency d. Interface Segregation 5. Sistemul Hungarion Notation face referire la: a. Scrierea denumirilor de clase cu litere capital b. Folosirea tipului de data in denumirea variabilei c. Folosirea underscore in denumirea variabilelor d. Folosirea vizibilitatii in denumirea atributelor 6. Copierea si alipirea unei bucati de cod(Copy/Paste) duce la incalcarea urmatorului principiu: a. YAGNI b. SOLID c. KISS d. DRY 7. Urmatorea secventa de cod incalca principiul: Class Prelucrari{ Public void afiseazaUtilizatori(){ //....} Public void prelucrareDate(){ //...} Pulib void salveazaConstanteleInDb(){ //..} }; a. Interface segregation b. Liskov substitution c. Open-closed d. Single responsibility 8. Urmatoarea secventa de cod face referire la: Class View extends...{ Public View(DataService _dataService, LoginService _loginService){ _dataService = super.dataService; _loginService = super.loginService; } }; a. Liskov substitution b. Interface segregation c. KISS d. Dependency inversion 9. Urmatorea ierarhie de clase aplica principiul: Interface Redimensionabil{ //..} Class EcranMare implements Redimensionabil{ //..} Class EcranMic implements Redimensionabil{ //..} a. KISS b. Interface segregation c. Single responsibility d. Design by contract 10. Urmatoareasecventa de cod incalcaprincipiul: a. KISS b. YAGNI