Alibaba 2016 school R & D pen questions php-php Tutorial

Source: Internet
Author: User
Tags how to prevent sql injection how to use sql
Alibaba 2016 school R & D pen questions php I. multiple choice questions 40 minutes:
1. an operating system uses paging storage management to provide the page table structure of process A and process B. If the size of the physical page is 512 bytes, process A and process B use A total of _ bytes of physical memory.
Process A page table: Process B page table:
Logical page physical page
0 9 0 1
1 2 1 3
2 4 2 4
3 6 3 7
4 4 2
5 5

4608
3584
4096
5120
2560
2048

2. in the following functions, _ is not the same as other functions __.
Fwrite
Putc
Pwrite
Putchar
Getline
Scanf

3. in the following inter-thread communication mechanism, system calls are not generated on the key path, which reduces the context switching from the user state to the kernel state __.
Pthread_spin_lock
Pthread_mutex
Semaphores
Pthread_rwlock
MPs queue
Message Queue

4. Using the KMP algorithm to find the mode string P in text string S is a common method. Suppose S = P = {xyxyyxxyx}, and S matches itself. the correct next array during the matching process is __.
0, 1, 1, 2, 1, 2, 3
0, 1, 2, 2, 3, 1, 2, 3
0, 1, 1, 3, 1, 2, 3
0, 1, 2, 3, 1, 2, 3
0, 1, 2, 3, 1, 2, 3
0, 1, 2, 2, 1, 2, 3

5. the two players play the game on a completely undirected graph with n points. each time they can choose to delete the sides with the same degree of parity between the two endpoints in the current graph, who cannot operate or lose, in n = 1, 2, 3 ,......, In 9 and 10, there are _ first-hand graph winning strategies.
2
3
4
5
6
7

6. the following data structure supports random insert and delete operations and has good performance __.
Array and linked list
Linked list and hash table
Hash table and queue
Queue and stack
Stack and bidirectional queue
Bidirectional queues and arrays

7. there are a pile of banknotes in the bag, of which 6 are 5 yuan worth of paper money, 5 are 10 yuan worth of paper money, and 4 are 20 yuan worth of paper money, if four banknotes are taken from the bag, the probability of obtaining at least one banknote for each nominal value is __.
8/91
25/91
48/91
53/91
60/91
63/91

8. it takes 200 seconds for a single machine to sort 200 words (using bubble sorting), so it takes 800 seconds to sort the _ words.
400
500
600
700
800
900

9. A hero has A base attack power of 100 and carries three violent weapons. weapon A has A probability of 2 times attack at 40%, and weapon B has A probability of 4 times attack at 20%, weapon C has a 10% probability of making six times of attacks. Each violent attack effect is triggered as an independent event. However, when multiple violent attacks are triggered at the same time, only the violent attacks of the following weapons take effect, for example, in an attack, if both weapon A and weapon C are determined to trigger A violent attack, the attack is actually 600 attacking power. Then the mathematical expectation of the hero's attack power is __.
186.6
200
232.8
256.8
320
332.6

10. there is A Class B inherited from Class A. Their Data members are as follows:
Class {
...
Private:
Int;
};
Class B: public {
...
Private:
Int;
Public:
Const int B;
A & c;
Static const char * d;
B * e;
}
In the constructor, the member variables must be initialized through the initialization list __.
A B c
B c e
B c d e
C e
B d
B c

11. if the following formula is true: 78 + 78 = 123. It uses the _ hexadecimal representation.
11
12
13
14
15
None of the above

12. the f1 function is defined as follows:
Void _ cdec1 f1 (const int & v1, cont int & v2)
{
Std: cout <v1 <'';
Std: cout <v2 <'';
}
The output result of the following code is __.
Int main (int argc, char * argv [])
{
Int I = 0;
Func (++ I, I ++ );
Return 0;
}
0 1
1 2
2 1
2 0
0 2
1 0

13. if a binary tree has three leaf nodes and eight nodes with a degree of 1, the total number of nodes in the binary tree is __.
12
13
14
15
16
17

14. in the following 8*6 matrix, calculate the _ walk from A to B. It is required that only one cell can be moved up or to the right at a time and cannot pass through P.

456
492
568
626
680
702

15. employees a, B, and C are responsible for front-end, backend, data, algorithms, testing, and O & M. Each person is responsible for two items. Known:
Data and front-end together
A is the youngest of the three
Front-end and Bing are free to play chess together
The backend is older than the algorithm and younger than B.
The oldest of three lives the farthest
Then, the three are respectively responsible __.
A-front-end & Test; B-algorithm & O & M; C-backend & Data
A-backend & algorithm; B-front-end & O & M; C-test & Data
A-front-end & O & M; B-test & algorithm; C-backend & Data
A-algorithm & data; B-test & front-end; C-backend & O & M
A-front-end & algorithm; B-backend & O & M; C-test & Data
A-front-end & algorithm; B-test & O & M; C-backend & Data

16. in 1, 2, 3 ,..... In 1000, the product of _ numbers is 0.
100
101
172
181
190
191

  1. A is an integer array, and N is the length of an array. run the following code. in the worst case, the time complexity is __.
    Void fun (int A [], int n ){
    For (int I = n-1; I> = 1; I ?) {
    For (int j = 0; j <I; j ++ ){
    If (A [j]> A [j + 1]) {
    Int tmp = A [j + 1];
    A [j + 1] = A [j];
    A [j] = tmp;
    }
    }
    }
    }
    O (N)
    O (N ^ 2)
    O (Nlog (N ))
    O (log (N ))
    O (N ^ 3)
    Uncertain

  2. In A four-dimensional space, there are two 60-degree vectors A and B. A random vector C is generated to calculate the inner product with A and B respectively. then the probability of the two inner product symbols being the same is __.
    1/4
    1/3
    1/2
    2/3
    3/4
    None of the above

  3. One person buys n sets of three bodies at XX with d yuan, and d is a positive integer. two sets of three are sent to his friends at half the cost, and each set is sold at a price higher than the original price of 8 yuan, add two sets for friends. if the total profit is 72 yuan, the minimum n value may be __.
    18
    17
    15
    13
    12
    10

  4. Suppose that the reference value is the fast sorting of the first element of the array. to make the array meet the non-descending order, the following data distribution results in the lowest efficiency of the fast sorting algorithm __.
    2-6-3-7-5-1-4
    6-2-3-5-4-1-7
    7-5-3-2-4-1-6
    1-5-7-2-4-6-3
    1-2-3-4-5-6-7
    4-1-3-7-5-6-2

II. Additional questions:

1. during PHP development, it is inevitable to handle various program errors. which PHP functions have you used to deal with errors? please give a few examples and describe their usage.

2. what are common network data capturing methods for PHP?

3. What are the storage engines of mysql? what are the differences and applicable scenarios? What are the concepts of joint index, prefix index, and covered index, and how to use SQL statements to demonstrate the usage of three indexes?

4. PHP implements four basic sorting algorithms (bubble sorting, insert sorting, select sorting, and fast sorting)
$ Array = array (, 78, 39 );

5. how to prevent SQL injection?

6. write the design patterns you are familiar with, and write application scenarios and pseudocode (at least 3)

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.