Http://www.cnblogs.com/tuyile006/archive/2007/03/20/681154.html
After several interviews, I made several interview questions. Even though I have passed the interview, I still feel sorry. I still feel that I should sort out frequently-encountered Interview Questions and answers for an emergency ~~
1: A = 10, B = 15. The values of A and B are exchanged without third-party variables.
2: The Int [] Max = {6, 5, 4, 0} array is known.AlgorithmSort them in descending order and return an array
3: Briefly describe the Characteristics and Significance of object-oriented polymorphism!
4: sessions tend to lose value and occupy memory. cookis is insecure. How can I replace these two original methods?
5: How to handle data concurrency is better.
6: it is known that the Oracle database has two databases: Gd and Zs. When the v_s table of the GD database has data written, the latest data is extracted from the v_s table to the d_e table of the Zs database. How can I solve this problem? What measures should be taken to solve the problem of mutual access failure?
7. Known Oracle databases A and B
Now, with the permission of user A, the SQL statement used to access database B is select a. * from B a. Correct the SQL statement.
8: When sea-level data is inserted into the database, an error is reported in the database. What are the possible causes of the error? In your experience, let's talk about your solution.
9: algorithm analysis
Ah 20060625 12 44 01 cad001
Ah 20060625 12 44 01 cad001
Ah 20060625 13 44 02 cad001
Ah 20060625 14 44 03 cad001
Note: The second column indicates the date, the third column indicates the temperature, the fourth column indicates the water level, the fifth column indicates the traffic, and the fifth column indicates the watermark station encoding. Each column indicates a field.
Obviously, the first data repeat with the second data. However, the data table has primary key and foreign key constraints. Duplicate data is not allowed. Please build an algorithm to Del the duplicate data.
10: javascript Algorithm
A and B are known. Now, clicking a will move toward B. When the mouse stops, a will stop.
Please implement "Running algorithm"
==========================================================Answer:
1.
A = A + B;
B = A-B;
A = A-B;
It is also said that we can: A ^ = B ^ (B ^ = a ^ B); I don't know what the principle is.
2.
Public class testquicksort {
Private int [] array = NULL;
Private void quicksort (INT lowest, int highest ){
If (array = NULL | lowest <0 | lowest> = highest
| Highest> = array. Length ){
Return;
}
Int low = lowest;
Int high = highest;
Int key = low ++;
For (; low <= high ;){
If (Key If (array [Key]> array [High]) {
Array [High] = array [Key] + (array [Key] = array [High]) * 0;
Key = high;
}
High --;
}
If (Key> LOW ){
If (array [Key] <array [low]) {
Array [low] = array [Key] + (array [Key] = array [low]) * 0;
Key = low;
}
Low ++;
}
}
Quicksort (lowest, key-1 );
Quicksort (Key + 1, highest );
}
/**
* @ Param ARGs
*/
Public static void main (string [] ARGs ){
Testquicksort test = new testquicksort ();
Int [] array = {6, 5, 2, 9, 7, 4, 0 };
Test. array = array;
Test. quicksort (0, array. Length-1 );
Int length = test. array. length;
For (INT I = 0; I <length; I ++ ){
System. Out. println (test. array [I]);
}
}
}
Quick sorting is the best internal Sorting Algorithm with comprehensive performance!
3. Polymorphism: object-oriented languages use virtual methods to express polymorphism. This means that the derived class can have the same signature as the parent class, and the parent class can call the method of the derived class. In C #, you must use the virtual keyword to make the method called by the parent class. This allows an object to have different action forms in different environments.
4. Use viewstate/profile/to implement cache5 on the server. Answer: You can control the number of connections in the connection pool.
Load Balancing can be used if conditions are good.
6. 7. Oracle database does not understand
8. Split Database
9.
Alter table table add ID int identity (1, 1)
Delete table
Where Newfield not in
(
Select top 1 ID from Table group by date, temperature, water level, flow, Water Level Test Station Code
)
Alter table table drop column ID
10. No