Programmer's questions-Minsheng Bank

Source: Internet
Author: User

The biggest difference between today's test and the past is that it is written on a computer. It feels pretty good.

1. Select multiple choices. It involves data structures, network protocols, software engineering, SQL, and operating systems.

1) How does the TCP/IP protocol identify different processes?

Port number!

2) The URL can correspond to several IP addresses.

I am still searching for this! Leave a message to me!

3) When querying the database, under what circumstances may lead to deadlocks

4) Software Engineering: What are included in the software development phase?


5) black box and white box testing functions

Black box testing
A black box test is also called a function test or a data-driven test. It is a function of a known product. It is tested to check whether each function can be used normally. during testing, taking the program as an unopened hacker, the tester tests the program interface without considering the internal structure and features of the program, it only checks whether the program functions are normally used according to the requirements of the specification, and whether the program can properly receive the input saw to generate the correct output information, and maintain the integrity of external information (such as databases or files. Black box testing methods include equivalence classification, edge value analysis, result graphs, and incorrect speculation. They are mainly used for software validation testing. The black box method focuses on the external structure of the program, does not consider the internal logic structure, and tests the software interface and software functions. The "black box" method is a testing of input. Only when all possible input is used as a test can all errors in the program be detected in this way. In fact, there are infinite number of tests. People should not only test all valid inputs, but also test those illegal but possible inputs.

White box testing
The white-box test is also called the structure test or logic-driven test. It knows the internal working process of the product and can be used to test whether the internal actions of the product are normal according to the specifications, test the program according to the internal structure of the program to check whether each channel in the program can work correctly according to the predefined requirements, regardless of its functions, the main methods of white box testing include logic-driven and baseline testing, which are mainly used for software verification. The "white box" method provides a comprehensive understanding of the internal logic structure of the program and tests all logical paths. The "white box" method is to test the exhaustive path. When using this scheme, the tester must check the internal structure of the program and obtain the test data starting from the logic of the program. The number of independent paths throughout the program is astronomical. However, even if each path is tested, errors may still occur. First, the exhaustive path test cannot identify that the program violates the design specifications, that is, the program itself is a wrong program. Second, the exhaustive path test cannot identify errors caused by missing paths in the program. Third, some data-related errors may not be found in the exhaustive path test. There is also a gray-box test, which is indeed between the two. It can be understood that the gray-box test focuses on the correctness of the output for the input, and also on the internal performance, however, this kind of attention is not as detailed and complete as it is in the white box. It only uses some characterization phenomena, events, and signs to determine the internal running status. Sometimes the output is correct, but it is actually an internal error. This is a lot of cases. If we use a white box test every time, the efficiency will be very low. Therefore, we need to adopt such a gray box method.
The gray-box test combines the elements of the white-box test box black box test, which takes into account the user end, specific system knowledge and operating environment. It evaluates the design of application software in the collaborative environment of system components. The gray-box test consists of methods and tools that are derived from the environment in which the internal knowledge box of the application interacts with it, it can be used for black box testing to improve test efficiency, error discovery, and error analysis efficiency. Gray-box tests involve input and output, but design tests using information about code and program operations that are typically out of the tester's field of view.

6) hafman Encoding


This is a simple question, that is, the length of the question.

7) stable Sorting Algorithm


Stable sorting: Bubble, merge, insert, and base sorting;

Unstable sorting: Fast sorting, heap sorting, selection, and Hill sorting


8) delete a linked list

Delete the linked list quickly because you only need to modify the pointer;

Now I have a question: I don't know a linked list of the header pointer. P points to a point in the linked list. How can I delete the point P now?

In two steps: (1) Replace the value P points to the node with the value p-> next, that is, p-> DATA = p-> next-> data; (2) p-> next = p-> next-next;

9) TCP three-way handshake


2. Answer the question:

1) Create a database table. Requirements: There are three fields: C1 and C2 character types, C3 and C4 are integer, C5 is date type, C2 cannot be blank, C1 is primary key

Create Table tablename (

C1 varchar (20) primary key,

C2varchar (20) not null,

C3 int,

C4 int,

C5 datetime

)

2) query the data that meets the conditions: This is a very simple query operation. It is too simple to write!

3. The first character that appears only once in the output string. Two methods are used.

Different solutions can be written in different languages. The time complexity is O (n), and the space complexity is O (1). How many methods do you know! Stay suspense! Hey

First, let's look at the simplest one:

Java code:

public class GetFirstChar {public static void main(String[] args) {String str="abdsdfsa";int length=str.length();for(int i=0;i<length;i++){char c=str.charAt(i);if(str.indexOf(c)==str.lastIndexOf(c)){System.err.println(c);break;}}}}

To a slightly complex point:

public static void getFirstChar(String str){char hash[] = new char[26];int length =str.length();for(int i=0;i<length;i++){hash[str.charAt(i)-'a']++;}for(int i=0;i<length;i++){if(hash[str.charAt(i)-'a']==1){System.err.println("hah:::"+str.charAt(i));break;}}}

Hey @!

The following is a C/C ++ code.

#include "stdafx.h"#include <iostream>#include <string>using namespace std;int main(int argc, char* argv[]){string s="afasdfc";int size=s.size();for(int i=0;i<size;i++){if(s.find_first_of(s[i])==s.find_last_of(s[i])){cout<<"the first char is : "<<s[i]<<endl;break;}}return 0;}

The answer is almost the same! If you have any objection, please leave a message!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.