Ali 2016 school recruit Research and development pen questions PHP

Source: Internet
Author: User

A Select 40 minutes:
1. An operating system uses paging storage management, and gives the page table structure of process A and process B. If the size of the physical page is 512 bytes, then a total of __ bytes is used for process A and process B's physical memory.
Process a page table: Process b Page Table:
Logical page Physical page 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. The following functions, and other functions that do not belong to the class are __.
Fwrite
Putc
Pwrite
Putchar
Getline
scanf

3. In the communication mechanism between the following threads, there is no system call on the critical path to reduce the user-state to the kernel state of the context switch is __.
Pthread_spin_lock
Pthread_mutex
Signal Volume
Pthread_rwlock
Pipeline
Message Queuing

4. Using the KMP algorithm to find the pattern string p in the text string s is a common method. Suppose S=p={xyxyyxxyx}, that is, to match s to itself, the correct next array in the matching process is __.
0,1,1,2,2,1,2,2,3
0,1,2,2,3,1,2,2,3
0,1,1,2,3,1,2,2,3
0,1,1,2,3,1,1,2,3
0,1,2,2,3,1,1,2,3
0,1,2,2,2,1,1,2,3

5. Two people in an n-point of the non-complete picture of the game, each time you can choose the two endpoints in the current image of the same degree of parity of the same side delete, who can not operate who lose , then in the n=1,2,3,......, 9,10, there is a figure to win strategy.
2
3
4
5
6
7

6. The following data structure can support random insert and delete operations, and has good performance is __.
Arrays and Linked lists
Linked lists and hash tables
Hash tables and queues
Queues and stacks
Stacks and bidirectional queues
Bidirectional queue and Array

7. A stack of banknotes in the bag, of which 5 yuan of banknotes 6, 10 yuan of banknotes 5 sheets, 20 yuan of banknotes 4, from the bag of any 4 banknotes, then each face value at least one of the probability is __.
8/91
25/91
48/91
53/91
60/91
63/91

8. A machine to sort 200 words took 200 seconds (using bubble sort), then spent 800 seconds, probably can sort __ words.
400
500
600
700
800
900

9. A hero base damage of 100, carried three pieces of critical weapon, weapon a 40% of the probability of a twice-fold attack, weapon B has 20% probability to play 4 times times the attack, the weapon C has 10% probability to play 6 times times the attack, each critical hit effect triggered by an independent event, However, when multiple crit effects are triggered at the same time in an attack, only the critical strike of the weapon in the back will actually take effect, such as when weapon A is not critical in a single attack, and weapon B and weapon C all trigger critical strikes, the attack is actually 600 attack. Then the mathematical expectation of the hero's attack is __.
186.6
200
232.8
256.8
320
332.6

10. One Class B inherits from Class A, and their data members are as follows:
Class A {
...
Private
int A;
};
Class B:public A {
...
Private
int A;
Public
const int B;
A &c;
static const char* D;
b* e;
}
In the constructor, the member variable must be initialized by the initialization list to be __.
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. is used in the __ binary representation.
11
12
13
14
15
None of these are right.

12. The function F1 is defined as follows:
void _CDEC1 F1 (const int& v1, cont int& v2)
{
Std::cout << v1 << ";
Std::cout << v2 << ";
}
The following code outputs the result of __.
int main (int argc, char* argv[])
{
int i=0;
Func (++i,i++);
return 0;
}
0 1
0 S
2 1
2 0
1 S
1 0

13. Set up a binary tree with 3 leaf nodes, with 8 degrees 1 nodes, the total number of nodes in the two fork tree is __.
12
13
14
15
16
17

14. In the matrix of the following 8*6, calculate the move from a to B altogether there are __ methods. Requires only one cell to move up or to the right at a time, and cannot go through p.

456
492
568
626
680
702

15. A, B, c Three employees are responsible for the front end, back end, data, algorithms, testing, operation and maintenance. Each person is responsible for two items. Known:
Data and front end live together
A is the youngest of the three.
The front and the C are free to play chess together
The back-end algorithm is older and younger than B
The oldest of the three is the farthest.
So, the three are responsible for __respectively.
A-front end & test; b-algorithm & operations; C-Backend & Data
A-backend & algorithm; b-front & operations; C-Test & Data
A-front & operation; b-Test & algorithm; C-Backend & Data
A-algorithms & data; b-Test & front end; C-Backend & operations
A-front end & algorithm; B-backend & operations; C-Test & Data
A-front end & algorithm; b-Test & operations; C-Backend & Data

16. In the,..... 1000, there is a number of __ the product is 0.
100
101
172
181
190
191

    1. A is an array of integers, n is the length of an array of a, please execute the following code, the worst case of 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)
      Cannot be determined

    2. The four-dimensional space has two angles 60 degrees of vectors A and B, randomly generated a vector c with a and b to calculate the inner product, then two inner product sign the same probability of __.
      1/4
      1/3
      1/2
      2/3
      3/4
      None of these are right.

    3. A person to D in xx buy n sets of "three", D is a positive integer, of which two sets of his cost half to friends, the rest of each set above the original price of 8 yuan to sell, plus to give a friend of the two sets, if the total profit is 72 yuan, then n the smallest may be __.
      18
      17
      15
      13
      12
      10

    4. Assuming that the base value is a quick sort of the first element of the array, the following data distribution results in the lowest efficiency of the fast algorithm , to make the arrays satisfy the non-descending arrangement.
      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

Two Additional Big questions:

1. In the process of PHP development, it is unavoidable to deal with a variety of program errors, which PHP functions you used to deal with the error, please give a few examples and explain its usage.

What are the commonly used web data fetching methods in 2.PHP?

What are the 3.mysql storage engines, and what are the differences, and what are the scenarios? The concept of federated indexes, prefix indexes, overriding indexes, and the use of SQL statements to represent three of indexes?

4.PHP implementation of four basic sorting algorithms (bubble sort, insert sort, select sort, quick sort)
$array = Array (1,43,54,62,21,66,32,78,36,76,39);

5. How do I prevent SQL injection?

6. Write out your familiar design patterns and write out the application scenarios and pseudo-code (at least 3)

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Ali 2016 school recruit Research and development pen questions PHP

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.