Second half of 2022 Software Designer Morning Exam Paper (41-75 questions)

UML activity diagram is used for modeling (41) . In the following activity diagram, after activity A1, the possible activity execution sequence is  (42) .

(41) A. Externally visible services provided by the system in the context of its surrounding environment

B. A set of objects and the relationships between them at a certain moment

C. The process from one activity to another within the system

D. A certain condition or state in the life cycle of the object

(42) A. A2, A3, A4 and A5 B. A3, A4 and A5, or A2, A4 or A5

C. A2, A4 sum A5 D. A2or A< a i=4>3, A4sum A5

UML activity diagram is a diagram type in Unified Modeling Language (UML), which is used to describe business processes, operation sequences or workflows in the system.


UML component diagram shows the organization and dependencies between a set of components, focusing on the statics of the system (43) Diagrams usually include components, interfaces, and various relationships.

(43) A. 关联 B. 实现 C. 结组 D. 行为

In a component diagram, a component represents a module, component, or other deployable unit in the system. Interfaces represent points of interaction or agreements between components. By showing the implementation relationship between components and interfaces, component diagrams emphasize how components implement the methods and behaviors defined by the interface.


In a certain system, different levels of log information are recorded in different ways. The log processing objects of each level are recorded in different ways according to the level of information. Each log processing object checks the level of the message, logs it if its level is reached, otherwise does not log it; then passes the message to its next log processing object. In response to this requirement, the class diagram shown below is designed. This design pattern uses the (44) pattern to make multiple connected Objects have the opportunity to handle requests, thereby avoiding coupling between the sender and receiver of the request. This mode belongs to the(45) mode, which is suitable for45 a>. )46(      

(44) A. 责任链Chain of Responsibility B. 策略(Strategy)

C. Filter D. Memento

(45) A. Behavioral classB. Behavioral object C. Structural class D. Structural objects

(46) A. Different criteria filter a set of objects and link them in a decoupled manner through logical operations

B. The set of objects that can handle a request should be dynamically specified

C. The state of an object at a certain moment must be saved so that it can be restored to its previous state when needed.

D. A class defines multiple behaviors and appears in the form of multiple conditional statements

(44) The answer is A. Chain of Responsibility.

According to the title description, different levels of log information need to be recorded in different ways. The log processing objects of each level are recorded in different ways according to the level of information. At the same time, each log processing object checks the level of the message and logs it if its level is reached, otherwise it passes the message to its next log processing object. This requirement can be achieved using the chain of responsibility model. The chain of responsibility model allows multiple connected objects to have the opportunity to process requests, thereby avoiding the coupling relationship between the sender and receiver of the request.

(45) The answer is B. Behavioral objects.

The chain of responsibility pattern is a behavioral design pattern.

(46) The answer is B, the collection of objects that can handle a request should bedynamically specified.

From the question stem" adopts the (44) mode Enable multiple connected objects to have the opportunity to process requests“It can be seen  


When driving the engine of a new energy vehicle, electric energy and light energy vehicles use different driving methods respectively. If the client wants to use a unified driving method, it needs to define a unified driving interface to shield different driving methods. This requirement is suitable for use (47) mode.   

(47) A. Mediator B. Visitor

C. Observer D. Distributor(Adapter)

The adapter pattern can convert the interface of a class into another interface expected by the client, so that originally incompatible classes can be used together.

Here we can define a unified driver interface, and then implement corresponding adapter classes for electric vehicles and light energy vehicles, so that they all conform to the unified driver interface. In this way, the client can drive different types of vehicles through a unified driving interface, realizing a unified driving method.


In Python3,  (48) is not a legal exception handling structure.

(48) A. try...except... B. try...except...finally

C. try...catch... D. raise

Python syntax regulations.


In Python3, the value of the expression list(range(11))[10:0:-2] is  (49) .

(49) A. [10, 8, 6, 4, 2, 0] B. [10, 8, 6, 4, 2]

C. [0, 2, 4, 6, 8, 10] D. [0, 2, 4, 6, 8]

range(11) is [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

The subsequent [10:0:-2]☞ operation range is [10, 0), the subscript 10 element (inclusive) to the subscript 0 element (exclusive), -2 is the step size, 2 is one step, and is from Take it from the back to the front. So the result is B. 【10,8,6,4,2】


In Python3, execute the statement x = input(). If you enter 123 from the keyboard and press the Enter key, the value of x is  (50) < a i=2>.

  1. A. 123 B. 1,2,3 C. 1 2 3 D. '123'

input() receives the value data type entered by the user as string str


When the E-R model is converted to a relational model, the many-to-many relationship R between the two entities E1 and E2 should be converted into an independent relational schema, and the keyword of the relational schema is 51) composed.   

In the E-R model, many-to-many relationships are usually represented by diamonds. When converting an E-R model to a relational model, the many-to-many relationship R needs to be converted into a separate relational schema.

For this relational schema, its keys consist of the primary keys of E1 and E2. This is because in a many-to-many relationship, there is a many-to-many relationship between E1 and E2, and their primary keys need to be used to uniquely identify each entity.

Concern about D: For the independent relationship model converted into a many-to-many relationship R, it only needs to contain two foreign keys, corresponding to the primary keys of E1 and E2 respectively. This is becausethe many-to-many relationship R itself does not contain any attributes. It just represents a certain association between E1 and E2. Therefore, when converting to independent relationship mode, there is no need to add any corresponding relationship attributes.


In the database of a university’s human resources management system,

The teacher relationship model is T (teacher number, name, department number, position, contact address, salary),

Functional dependency set F={teacher number → (name, department number, position, contact address), position → salary}.

Main key of the system model T(52) , Function dependence collection F(53)< a i=9>.     

(52) A. Teacher number, T There are problems with redundancy and insertion and deletion exceptions

B. Teacher ID, T does not have redundancy, insertion exceptions and deletion exceptions

C. (teacher number, position), T has redundancy and insertion and deletion exceptions.

D. (teacher number, position), T does not have redundancy, insertion exceptions and deletion exceptions

(53) A. There is transitive dependency, so the relationship mode T reaches up to 1NF.

B. There is transitive dependence, so the relationship model T reaches up to 2NF

C. There is no transitive dependency, so the relationship mode T reaches up to 3NF.

D. There is no transitive dependency, so the relational model T reaches up to 4NF.

(52) Option A. Teacher number, T has redundancy and insertion and deletion exceptions. According to the given functional dependency set F, the teacher number is the primary key of the relational model T, but attributes such as position, contact address, salary, etc. are very important to the teacher. There are partial dependencies in the number, resulting in the existence of redundant data. In addition, these partial dependencies may also cause insertion exceptions and deletion exceptions when inserting and deleting data.

(53) Option B. There is a transitive dependency, so the relationship mode T can reach up to 2NF. According to the given functional dependency set F, position → salary, the existence of non-primary attribute position determines the transitive dependence of the non-primary attribute salary. Therefore, relational pattern T reaches up to 2NF, not 3NF or 4NF.


Given the employee relationship E (employee number, employee name, department name, phone number, home address), project relationship P (project number, project name, early project number), and participation relationship EP (employee number, project number, workload). The relational algebra expression of querying the employee name, department name, project name, and workload of employee "005" who participated in the "Hutoushan Tunnel" project is as follows:

First of all, it must be satisfied that employee 005 participated, so 1 must be satisfied in E, that is, employee number = 005

Secondly, according to the project name, you need to locate the 2 project names in P which are equal to the Hutoushan Tunnel to lock the project number and associate the workload in EP


Assume the expression x/y in transaction program A. If y takes a value of 0, a fault will occur when calculating the expression. The fault belongs to  (56) .

(56) A. System failureB. Transaction failure C. Media failure D. Crash

A. System failure: System failure usually refers to a situation where the entire computer system or related hardware and software has problems that prevent it from working properly or providing services. The fault here is more likely to be a problem in the specific calculation process rather than a fault in the entire system. C. Media failure: Media failure usually refers to the physical damage of storage media (such as hard disks, tapes, etc.) or the inability to read/write data. Failures in expression evaluation are not directly related to media failures. D. Crash: Crash means that the computer system cannot continue to work normally due to abnormalities or errors and needs to be restarted or reset. Failures in expression evaluation do not fall into the category of crashes.

Therefore, the correct answer is option B. Transaction failure.


Assume that the stack is initially empty. For the push sequence 1, 2, 3, ..., n, after these elements pass through the stack, the pop sequence P1, P2, P3,,,,,Pn is obtained. If P3=4, then the impossible values ​​of P1 and P2 are (57).   

  1. A. 6,5 B. 2,3 C. 31 D. 3,5

Just do some math on the scratch paper and you'll know.


Suppose m and n are two nodes on a certain binary tree. During in-order traversal, the condition for n to be ranked before m is  (58) .

(58) A. m is the ancestor node of n B. m is the descendant node of n

C. m is on the left of n D. m is on the right of n

The in-order traversal rule is left, center, and right, so if you want n to be ranked before m, m must be to the right of n.


If the undirected graph G has n vertices and e edges, then when G is stored using an adjacency matrix, the size of the matrix is ​​ (59 ) .   

The adjacency matrix records the graph, i and j represent all vertices, and the value is whether there are edges, so the matrix size is only related to the number of vertices, so the matrix size is n^2


Among the following statements about m-order B-trees, the wrong one is  (60) .

(60) A. The root node has at most m subtrees B. All leaf nodes are at the same level

C. The keywords in the node are arranged in order D. The leaf nodes are linked into an ordered list through pointers

I have doubts, I don’t know much about B0 trees.


Among the following sorting algorithms, the one that takes up the most auxiliary storage space is  (61) .

(61) A. Merge sort B. Quick sort C. Heap sort D. Risk bubble sort

Merge sort is a divide-and-conquer sorting algorithm that requires the use of additional auxiliary arrays to merge subarrays during the sorting process. Specifically, merge sort recursively divides the array to be sorted into smaller sub-arrays, and then performs sorting by comparing and merging the sub-arrays. During this process, an auxiliary array with the same size as the original array needs to be used to temporarily store the merged results.

Unlike merge sort, quick sort and heap sort are both in-place sorting algorithms. They can perform in-place operations on the input array without using additional auxiliary storage space. Bubble sort is also an in-place sort and only requires a constant level of extra space for element exchange operations.


Half search finds a specific record K in the ordered array A: compare K with the middle element A[mid] in the array. If they are equal, the algorithm ends; if K is less than A[mid], Then perform a binary search on the first half of the array; otherwise, perform a binary search on the second half of the array. According to the above description, the binary search adopts  (62) algorithm design strategy. For ordered arrays (3, 14, 27, 39, 42, 55, 70, 85, 93, 98), the average number of comparisons required for successful search and failed search are  (63 ) (assuming the probability of finding each element is the same).

(62) A. discipline B. 芨态规划 C. 贪心 D. RETURN< /span>

(63) A. 29/10 and 29/11 B. 30/10 and 30/11

C. 29/10sum D. 30/10 sum 40/1111/39

The binary search adopts the divide-and-conquer algorithm design strategy.

63 Q. I still don’t quite understand.


The Dijkstra algorithm is used to solve the shortest path from point A to point E in the figure below. The algorithm design strategy adopted is  (64) . The length of the shortest path is  (65) .

(64) A. Divide and conquer method B. Dynamic programmingC. Greedy algorithm D. Backtracking

(65) A. 5 B. 6 C. 7 D. 9

It's very simple, you can do it if you understand Dijkstra's algorithm.


VLAN tag is implemented in  (66) of the OSI reference model.

(66) A. .Physics layer

VLAN (Virtual Local Area Network) is a logical network division technology that can divide a physical LAN into multiple virtual LANs. VLAN tag is the information used to mark the VLAN to which the data frame belongs. It is located in the frame header of the data link layer Department. By adding a VLAN tag to the frame header, logical isolation and segmentation can be achieved between devices sharing the same physical network.


Telnet protocol is a  (67) remote login protocol.

(67) A. Safety B. B/S model C. BasicTCP D. Distribution formula

The Telnet protocol uses TCP as the transport layer protocol and is used to remotely log in to other computers or devices on the network. It provides a way to access and control remote hosts through a network terminal, allowing users to enter commands and perform operations in text mode on the local computer as if they were operating directly on the remote host.


In the following description of HTTPS and HTTP protocols, the error is (68) .  

(68) A. HTTPS protocol uses encrypted transmission

B. The default service port number of HTTPS protocol is 443

C. The default service port number of HTTP protocol is 80

D. Electronic payment websites should use HTTP protocol

The HTTPS protocol uses encrypted transmission and is more secure, so electronic payment websites must use the HTTPS protocol.


Convert a URL to an IP address using the  (69) protocol.

(69) A. Domain name resolution B. IP address resolution C. Routing selection D. Transport Control

To resolve a website address into an IP address, the domain name needs to be parsed to obtain the IP address, so the domain name resolution protocol needs to be used.


The following statements about IP addresses and MAC addresses are incorrect (70) .  

(70) A. The length of the IP address is 32 or 128 bits, and the length of the MAC address is 48 bits.

B. The IP address works at the network layer, and the MAC address works at the data link layer.

C. IP address allocation is based on network topology, and MAC address allocation is based on manufacturer

D. IP addresses are unique, but MAC addresses are not.

The MAC address is also unique. It is assigned to each network adapter by the network adapter manufacturer during the production process to ensure global uniqueness. Every network adapter has a unique MAC address.


We initially described SOA without mentioning Web services, and vice versa. This is because they are orthogonal: service-orientation is an architectural (71) , while Web services are an implementation (72) . The two can be used together, and they frequently are, but they are not mutually dependent.

For example, although it is widely considered to be a distributed-computing solution, SOA can be applied to advantage in a single system, where services might be individual processes with well-defined (73) that communicate using local channels, or in self-contained cluster, where they might communicate across a high-speed interconnect.

Similarly, while Web services are (74) as the basis for a service-oriented environment, there is nothing in their definition that requires them to embody the SOA principles. While (75) is often held up as a key characteristic of Web services, there is no technical reason that they should be stateless—that would be a design choice of the developer, which may be dictated by the architectural style of the environment in which the service is intended to participate.

71) A. design B. style C. technology D. structure

72) A. structure B. style C. technology D. method

73) A. interfaces B. functions      C. logiccs D. formats

74) A. regarded B. well-suited C. worked D. used

75) A. distribution B. interconnection  C. dependence D. statelessness

translate:

We did not mention Web services when we originally described SOA, and vice versa. This is because they are orthogonal: service orientation is an architecturalstyle, while Web services is an implementationTechnology. The two can be used together, and they often are, but they are not dependent on each other.

For example, although SOA is widely considered a distributed computing solution, it can be applied within a single system where services may be interfaces A single process of a> communicates using local channels, or in a self-contained cluster they may communicate over a high-speed interconnect.

Similarly, although Web services are well suited as the basis for a service-oriented environment, there is nothing in their definition that requires them to embody SOA principles. While statelessness is often considered a key feature of web services, technically there is no reason why they should be stateless - this would is a design choice by the developer, which may be dictated by the architectural style of the environment in which the service is intended to participate.

Guess you like

Origin blog.csdn.net/m0_62742402/article/details/133935369