Collecting and sorting out multiple-choice questions for the JD 2021 test and development engineer for the programmer’s written test (3)

1. If two queues are used to implement the function of the stack, how many steps are required for n number to complete all stacking?
An^2
Bn(n+1)/2
Cn^2-1/2
D.2n-1

2. There is an abstract class:
public abstract class SubClass{ public void a() { System.out.println("method a."); } abstract void b(); } The following statement is correct: A. This class can be Instantiate B. To call the method b of this class, the method b must be rewritten . C. There is a problem with the definition of the method a() in this class. D. The class cannot be inherited.










3. When searching for an ordered list of N(n+1) elements, what is the most effective search method?
A. Block search
B. Sequential search
C. Binary sort tree
D. Half search

4. Analyze the compilation results of the following program
#include<iostream.h>
template
voidf1(T *t)
{ cout<<"*t="<<"*t"<<endl; } template void f1(T t) { cout<<“t=”<<t<<endl; } void main() { int i=3; f1(i); //A f1(&i); //B } There is an error in AB line BA has an error C. The program is compiled without errors D. The second function template has errors
















5. What is the difference between delete and delete[] in C++?
A.delete is used to delete a single object, and delete[] is used for multiple objects (array/pointer)
B.delete is syntactically correct, but delete[] is wrong, so there will be errors when used in any case
C.delete is used to delete ordinary objects, and delete[] is used to delete pointer objects.
D.delete is a keyword, and delete[] is an identifier

6. Perform performance test on web system, excluding:?
A. Stress test
B. Load test
C. Adaptation test
D. Connection speed test

7. What is the time complexity of the following program?
int num,num2
for(int i=0;i<n;,i++){ num1+=1; for(int j=1;j<n;j*=2){ num2+=num1 } } AO(n2) BO (nlogn) CO(n) DO(logn)








8. The following are not software security tests: ()
A. Data backup and recovery methods
B. User authentication mechanism
C. Database encryption
D. Security protection strategy

9. Compared with Https, the disadvantages of Http do not include:
A. It cannot verify the integrity of the message and may be tampered with.
B. The corresponding speed of http is slower than that of https
. C. It does not verify the identity of the communicating party and may be disguised
. D. The communication does not use plain text. Encrypted, the content may be eavesdropped, that is, captured and analyzed

10. If an address book can enter up to 100 records, the best test case designed in the following options is ()
A. Enter 0,1,50,99,100 records
respectively B.Enter 0,1,50, respectively 99, 100, 101 records
C. Input 0, 1, 99, 100, 101 records
respectively D. Input 1, 50, 100 records respectively

11. If you query table A (with 4 rows of data) and table B (with 6 rows of data), use select * from a, b, and the query result returned has () rows
A.2
B.24
C.0
D.10

12. Women are more likely to suffer from mental illnesses, such as depression, than men, but women are often more imaginative than men, and studies have shown that most people’s memory is affected by imagination. The stronger the imagination, the memory is also Higher. If the above information is correct, the inference it can best support is ().
A. Women’s mental illness is affected by their imagination.
B. A person with high memory is likely to suffer from mental illness
. C. Most women suffer from a certain degree of depression.
D. Among people whose memory is above average , The proportion of women is higher than the proportion of women among people with below-average memory

13. In the shell environment, interrupt and exit the control instruction shift means:
A. Jump out of the current loop body, execute the statement after the
loop body B. Skip the remaining statements in the loop body, re-judge the condition to execute the next loop
C. Used Migrate position variables, move $1~$9 to the left in sequence
D. Exit the script, the default return value is 0

14. In the absence of requirements documents and product specifications, which test method can only be performed
A. Error speculation test
B. Path analysis test
C. Statement coverage test
D. Conditional coverage test

15. Common errors of the unit generally do not appear in which of the following:
A. Unit interface
B. Independent path
C. Internal association
D. Local data structure

16. Define an algorithm skeleton and postpone the steps to subclasses, so that the steps can be redefined without changing the structure of the algorithm. Which mode feature is this?
A. Decorator mode
B. Template mode
C. Factory mode
D. Appearance mode

17. Which of the following operations can be used to copy files from another machine to the local machine?
A.copy
B.scp
C.mv
D.telnet

18. Now there are multiple gays who share apples. There are 100 big and small gays, 100 apples are divided, each big gay eats three apples, and three small gays eat one apple. May I ask whether there are big gays and small gays. How many each? The most reasonable range for the number of big and small gays below is: () (The range determines the start and end values ​​of the loop)
A. Big gay: 1 to 33, small gay: 1 to 99;
B. Big gay: 1 to 33, small gay: 3 to 99;
C. big gay: 1 to 33, small gay: 1 to 291;
D. big gay: 1 to 33, small gay: 3 to 291;

19. The following code snippet output?
def foo():
try:
return 1
finally:
return 2
k=foo()
print(k)
A.error
B.1
C.2
D.3

20. Integration testing is also called assembly testing or joint testing. The following are not integration tests:
A. Whether there is a problem with the global data structure
B. Check the new defects and determine which ones need to be corrected
C. Connecting the various modules At the time, whether the data passing through the module interface will be lost
D. The combination of various sub-functions can achieve the expected parent function

21. The following methods are not integration test strategies:
A. Sandwich integration
B. Top-down integration
C. Bottom-up integration
D. Hierarchical integration

22. A complete binary tree has a total of 2020 nodes, then the depth of the binary tree is ()
A.12
B.9
C.10
D.11

23. In the process of interface testing with HttpClient, we initiate a get/post request and then respond to the analysis. The code "EntityUtils.toString(entity);" refers to
A. Get the response content
B. Disconnect
C. Release resources
D. Get response entity

24. The following description of the data structure test method in unit test is correct:
A. Mainly check whether the data can pass the module correctly
B. Mainly do a good coverage test
C. The main point of the test is that an error occurs in the work, and the error handling Is it effective
D. The purpose of the test is to maintain the integrity of the internal data of the program

Guess you like

Origin blog.csdn.net/qq_34124009/article/details/107865391