Analysis of real questions and answers in the morning for software designers in the first half of 2021 (3)

21. In the process of translating C/C++ source programs by compilation, the main task of the ( ) stage is to analyze the legality of the structure of each statement.
A. Lexical analysis
B. Semantic analysis
C. Syntax analysis
D. Object code generation

Reference answer: C
answer analysis:

  • The lexical analysis stage scans the source program character by character according to the lexical rules of the language, and recognizes the "word" symbols one by one, mainly for vocabulary checks.

  • The task of grammatical analysis is to decompose the sequence of word symbols into various grammatical units, such as "expression", "statement" and "program" according to the grammatical rules of the language on the basis of lexical analysis. Grammatical rules are the composition rules of various grammatical units, mainly for structural inspection.

  • The semantic analysis stage analyzes the meaning of each grammatical structure, checks whether the source program contains semantic errors, and mainly checks the meaning of sentences.

22. The characteristics of the Java language are ( ) and automatic garbage collection.
① Use just-in-time compilation
② Use static optimization to compile
③ Objects are allocated in heap space
④ Objects are allocated in stack space

A.①③
B.①④
C.②③
D.②④

Reference answer: A
Answer analysis:

  • JAVA is an interpreted language, which can generate intermediate code and then interpret it into object code and execute it, that is, just-in-time compilation.
  • The code can be optimized according to the running machine, using dynamic optimization compilation.
  • Java programs are initially interpreted and executed through an interpreter (Interpreter). When the virtual machine finds that a certain method or code block runs particularly frequently, it will identify these codes as "hot spot codes" (Hot Spot Code). Execution efficiency of hot codes. At runtime, the virtual machine will compile these codes into local machine codes, and optimize the codes as much as possible by various means. This process is called just-in-time compilation. The backend that completes this task at runtime Compilers are known as just-in-time compilers.
  • The stack space of JAVA only stores basic types, reference type variables and methods, while instance objects are stored in the heap.

23. Cloud computing has multiple deployment models (Deployment Models). If the cloud infrastructure is built for a customer's sole use, then the deployment model belongs to ( ).
A. Public cloud
B. Private cloud
C. Community cloud
D. Hybrid cloud

Reference answer: B
Answer analysis:

  • Public cloud usually refers to the available cloud provided by third-party providers for users. Public cloud is generally available through the Internet, and may be free or low-cost. The core attribute of public cloud is shared resource service.
  • Private Clouds are built for the sole use of one customer, thus providing the most effective control over data, security and quality of service. The company owns the infrastructure and can control how applications are deployed on this infrastructure. This question is only used by a certain customer and belongs to the private cloud of option B.
  • Community cloud generally refers to community cloud. Community cloud, also known as community cloud, is a cloud infrastructure shared by several organizations that support specific communities and share common concerns, such as mission tasks, security requirements, policy and compliance considerations, etc. .
  • Hybrid cloud integrates public cloud and private cloud, and is the main model and development direction of cloud computing in recent years. We already know that private cloud is mainly for enterprise users. For security reasons, enterprises are more willing to store data in private cloud, but at the same time hope to obtain computing resources of public cloud. In this case, hybrid cloud is becoming more and more popular. It will mix and match public cloud and private cloud to get the best results. This kind of personalized solution achieves the purpose of saving money and security.

24. If the word length of the computer system is 128 bits, the capacity of the disk is 2048GB, and the size of the physical block is 8MB, assuming that the file management system uses the bitmap method to record the use of the computer system disk, then the bitmap The size of requires ( ) characters.
A.1024
B.2048
C.4096
D.8192

Reference answer: B
answer analysis:
the disk capacity is 2048G, and the physical block size is 8MB, so the disk has a total of 2048GB/8MB=256x2 10 ^{10}10 physical blocks.
Use a bitmap to record disk usage, each disk block occupies 1 bit, and a total of 256x210 ^{10}10 to record.
Every 128 bits is 1 word, and a total of 256x210 ^{10}10 /128 words, that is 2048 words.

25. Process P has 5 pages, page numbers are 0-4. The meanings of the page conversion table and status bits, access bits and modification bits are shown in the figure below. If the system allocates 3 storage blocks to process P, when the accessed When page 3 is not in memory, the page with page number ( ) in the table should be eliminated.
insert image description here
A.0
B.1
C.2
D.4
Reference answer: A
Answer analysis:

  • The pages to be eliminated must first be selected in memory, that is, pages 0, 2, and 4.
  • The pages whose access bit is 0 are preferentially eliminated. At this time, the access bits of pages 0, 2, and 4 are all 1, which cannot be judged.
  • The page whose modification bit is 0 is further eliminated. At this time, the page 0 that meets the requirements is eliminated, and option A is selected.

26, 27, 28, and the predecessor diagrams of processes P1, P2, P3, P4, P5, and P6 are as follows:
insert image description here
If you use PV operations to control the development and execution of processes P1, P2, P3, P4, P5, and P6, you need to set 6 semaphore S1, S2, S3, S4, S5 and S6, and the sum of semaphore S1~S6 is equal to zero. In the process execution diagram below, fill in ( ) at a and b respectively, fill in ( ) at c and d respectively, and fill in ( ) at e and f respectively.
(1)
AV(S1) and P(S2)V(S3)

BP(S1) and P(S2) V(S3)

CV(S1) and V(S2)V(S3)

DP(S1) and V(S2)V(S3)

(2)
AP (S2) and P (S4)

BV(S4) and P(S3)

CP(S2) and V(S4)

DV (S2) and V (S4)

(3)
A.P(S4)V(S5)和V(S6)

BP(S4)V(S5) and P(S6)

CP(S4)P(S5) and V(S6)

DP (S4) P (S5) and P (S6)
reference answer: DBC
answer analysis:
This question is a conventional examination question type combining predecessor graph and PV operation.
For the predecessor graph, the arrow represents the relationship between the predecessor and the successor. The successor process needs to be notified when the predecessor process is completed (notified by the V() operation), and it is necessary to check whether the predecessor process is completed before the successor process starts (check by the P() operation) . That is to say, in the predecessor graph, each arrow pointing to the successor process will have a V() operation to notify the successor. The inflow of each arrow starts from the predecessor process, and it is necessary to check whether the predecessor process is completed. Use P() operation process check. Identified as follows:
insert image description here
fill in the blanks according to the missing position:

  • P2 has 1 predecessor process, there is 1 P() operation in position a before execution, P2 has 2 successor processes, there are 2 V() operations in position b after execution, and option D is selected for the first space.

  • P3 has 1 successor process, there is 1 V() operation at position c after execution, P4 has 1 predecessor process, 1 P() operation at position d before execution, and option B is selected for the second space.

  • P5 has 2 predecessor processes, there are 2 P() operations at position e before execution, P5 has 1 successor process, and there is 1 V() operation at position f after execution, and option C is selected for the third space.

29, 30. Regarding the spiral model, which of the following statements is incorrect is ()().

(1)
A. Add risk analysis to waterfall model

B. Divide the development process into several spiral cycles, and each spiral cycle roughly corresponds to the waterfall model

C. Suitable for large-scale, complex and high-risk projects

D. Can quickly provide an initial version for users to test

(2)
A. Support dynamic changes in user needs

B. Require developers to have risk analysis capabilities

C. Based on this model for software development, the development cost is low

D. Excessive iterations may increase development costs and delay submission time

Reference answer: DC
answer analysis:

  • The spiral model is an evolutionary software development process model, which takes into account the iterative characteristics of rapid prototyping and the systematic and strict monitoring of the waterfall model.
  • The biggest feature of the spiral model is that it introduces risk analysis that other models do not have, so that the software has the opportunity to stop when major risks cannot be ruled out, so as to reduce losses. At the same time, building a prototype at each iteration stage is the way the spiral model is used to reduce risk.
  • The spiral model is more suitable for large and expensive system-level software applications.
  • Each cycle of the spiral model includes four stages: requirement definition, risk analysis, project realization and review, and iterates through these four stages. Every time the software development process is iterated, the software development advances to a higher level.
  • The basic approach of the spiral model is to introduce a very strict risk identification, risk analysis and risk control before each development stage of the "waterfall model". It decomposes a software project into sub-items, each of which identifies one or more major risks, until all major risk factors are identified.
  • Compared with the waterfall model, the spiral model supports the dynamic changes of user needs, provides convenience for users to participate in all key decisions of software development, helps to improve the adaptability of target software, and provides convenience for project managers to adjust management decisions in a timely manner. Thereby reducing software development risk.

However, it cannot be said that the spiral model is absolutely superior to other models. In fact, the spiral model also has its own disadvantages:

  • Adopting the spiral model requires considerable experience and expertise in risk assessment. In the development of risky projects, if the risks are not identified in time, it is bound to cause heavy losses.

  • Excessive iterations increase development costs and delay commit time.

  • In the first empty option, it is an incremental model rather than a spiral model that can quickly provide an initial version to users, and the description of option D is wrong.

  • In the second empty option, too many iterations in the spiral model will increase the development cost, and the description of the low development cost of option C is wrong.

Guess you like

Origin blog.csdn.net/johnWcheung/article/details/127373297