"Turn" June 2012 26– Grand PHP Engineers latest Questions

Source: Internet
Author: User
Tags md5 encryption

No written test.

Oral examination: (the first half of the mundane, nothing too difficult problem, are the basic things to be a job post, confined to PHP.) Here are the real questions that go into the state. )

What is the Observer pattern? Main applications.

A: Similar to some of the actions that a server object listens to on an object at all times. The object being monitored will also have this server list, or provide an interface for adding lists. The promotion conditions are based on demand. When triggered, this object will send itself to a method in these server lists, so that the server will get the object passed to listen. The main application is on the plugin.

What is an index? What are the rules for building an index? Watch it.

A: Similar to a directory table, the DBMS will be read and write, MySQL in the query, you can go directly to find this table of contents, will not scan the entire table. What's the point of note? First I will look at this watch, if he was born destined to write much less, try to avoid the establishment of many indexes, because he will take up time, right! In addition I will try to build in the Number field, or similar to the user name, this may, in the requirements of the select time will not have like or other calculations inside. And don't have it! If there is, do not put on the left value ... Be interrupted!

in fact I want to ask what is put in the query statement, select what where what what where?

Answer: Oh, put it on the where field.

how many kinds of engines does MySQL have? or which ones do you often use?

Answer: Innodb,myisam,temporary (when Leng didn't read the word, he spelled it)

What's the difference between InnoDB and MyISAM? Temporary where you often use it.

A: One is a row lock, one is a table lock, so the degree of concurrency is not the same. InnoDB has a log, and then can be real business assurance, he can also implement foreign key functions. MyISAM fast on the query. Document aspects. MyISAM contains three files, and in the same directory, the data is placed on one of the two. The InnoDB data is placed in a idata file outside the directory. InnodB can also implement this idata file size configuration, for example, can be configured to a maximum of 1G, to this size, MySQL will automatically generate another Idata file. Temporary I will be using a session table similar to user login.

Have you ever wondered why innodb the data to a file? Instead of MyISAM to put it in your own file?

Answer: Well ... Maybe it's for the convenience of a query? Or a good diary, a business? The nonsense ...

what is the HTTP message format? Can you tell me about it?

A: Source address IP with port number, destination IP with port number, protocol type. (Just remember these three.) and start talking nonsense! ) Amount ... What else is there? Request data, Request page .... (Interviewer stunned!) ) was interrupted!

What about the TCP three-time handshake?

A: The client sends the connection request message to the server first. The server sends an ACK acknowledgement message to the client after it receives it. The client receives a confirmation message and sends a confirmation message to the server. Complete the three-time handshake.

What is the three-time handshake message about?

Answer: Yes. What about this? The client generates a request serial number itself, and then randomly binds a port number to send it. The other side plus a later ack come .... Omit the n word here! Not really understand! To play with. Be interrupted!

The transmission message in the HTTP protocol could have been stolen by hacker and decrypted. How do you do that?

Answer: (Sun!) The binaries are decrypted! The earth can't stop him! Anyway, I have no way to a side dish! Well, that's right,,,, not much to consider! I think in the transmission time should be the main data encryption and then transfer it, such as user password, user name and so on, so decrypt it does not matter! As for how to encrypt, use MD5 to be good.

Do you know the HTTPS protocol? Tell me about it.

Answer: How to say, stay in the book knowledge, never practiced. It's 443, right? The amount,,, is the encrypted connection protocol for HTTP. Safe and reliable. and start talking nonsense. Not really understand! Be interrupted!

What is the difference between a session and a cookie?

A: One is the client-server retention mechanism, and the other is the client retention mechanism. The place of storage is also different ... Be interrupted!

Yes, yes. These basic I think you all know. So, what do you think about the security of cookies? For example, he will be tampered with on the client side, what do you do?

Answer: Well ... First the password and some important data must not be saved. Also, the data to be stored is encrypted. such as user ID, user name, character, etc... Be interrupted!

MD5 is irreversible, you have to encrypt the user ID, how histograms ah?

Answer: (actually I really did not have the ID encrypted!) No way to bite the bullet down! Well, match it, in comparison, the server also makes a MD5 encryption, to see if it is equal to the line!

What's your experience with encryption? We all know that MD5 declassified the site a lot?

A: Well, important data, do not use a simple MD5 encryption on the line. For example, the user password, we can give each user a immediately 6-bit encryption factor. Do a bit of processing and then do MD5 operations, such as phase or something.

Are you talking about a cryptographic factor like a key? Where do you put it?

A: Well, almost. In the user table, the random 6 character, the user after each landing system will update the field with the actual password field. I'm doing what the system is doing right now. You know, in the middle of it, the most likely person to get is our encrypted password character. It's probably already dead!

so someone else got the real user password?

A: I have thought about this question, then think about it I feel like no way! (The interviewer and I have committed such a silly, hehe)

are you familiar with NoSQL? Ever been useful?

Answer: OK. Most of them are not used very much. But Memcache used, very common, also very easy to use. Mainly in the DB class to make a judgment on the line, if the memory has already had this key value pair, direct memcache_connect, and then get data. Otherwise, go to find MySQL. You think, eventually, the data we interact with must go to this DB Class abstraction layer. Other NoSQL if necessary, I will go to read this book!

have you ever followed Memcache's hit rate? How efficient is it?

Answer: Well ... This has not been followed, oh, only to see some of the great God's blog compared to him and Redis. It looks like Redis is more efficient (irrelevantly replying!) )

What is the maximum amount of data you have ever touched? A maximum of servers?

Answer: Big millions of bar. It's a community. There are 11 too servers.

How do you deal with big data access efficiency?

A: First of all to see if you can build a distributed environment, the master from the database, read and write separation. Let the replication process implement Master-slave synchronization.

Then consider the sub-table. Horizontal and vertical tables are all rows. What algorithm is used to see the specific business of the table. For example, compare the parity of simple primary keys. Also on the table, I suggest using the mysql5.1 version of the logical sub-table function module, first installed partition, simple configuration, do different disk storage, reduce I/O Read and write (in a Japanese-funded enterprise interview learned, and then come back to see, really cool).

In fact, this also does not reduce I/O read and write. (Dare not refute!) In the future to become a colleague, we are slowly discussing it is not too late. Generally we do master and slave synchronization very well, if you find your application in the master write pressure, you need to do multiple master to break down the pressure. How do you achieve synchronization between them?

Answer: This ... I haven't really done many master. I haven't thought about it.

What do you know about the sub-table algorithm?

Answer: The simplest primary key parity, mainly depends on the demand, even by the year, the month can be.

How do you implement the query to locate the specific table?

A: Well, this is because all of your data interaction, to be similar to the DB Class abstraction layer, which I will write a method similar to the Find,select, the table parameters passed to achieve the specific algorithm rules of the transformation. Try not to let the native SQL statements run. Even if I run I will provide a special string similar to the alternative data table, allowing the DB class to implement the substitution. For example, many frameworks would suggest that users use uppercase-like __table__ strings in SQL.

ever been in touch with a CDN?

A: Contact, is to buy a home CDN, the former company is a community, PV is very large. This is a must have.

can you draw a picture of a web frame? Like your previous 11 servers how to structure.

A: The first one is the CDN, and the next one is the load balancer. There are multiple Web servers behind, each with an nginx accept request, and the backend is handled by the agent Apache. If one of them is dropped, the other servers will be served as usual. And then these are the main MySQL servers, and the latter are slave. This is a picture server.

How do you request your image server resources on your Web page?

A: This is a separate picture server, when users upload images, the data table field will put the full path name, so you can request this image server.

How do you achieve the security of this image server? For example, this server hangs up. If you have a backup server, how do you synchronize?

Answer: 2 o'clock in the morning. Oh.

that can only achieve the time period to backup it! For example, in a day before 2 o'clock in the morning server hangs, the day's pictures in addition to the CDN will have temporary storage, the other is not?

Answer: Well ... Yes, that's for sure. Then I can't synchronize with each request. What about this? Omit n words, again to pull the play time ...

are you familiar with Web server? Are you familiar with Linux? Are you familiar with the shell?

A: (practice shows, to this interviewer, do not understand not to nonsense, will take you to ditch!) Apache is OK, can be configured. Nginx, weak point, there is a need I can learn. Linux words, not very good, lack of practical experience, theoretical knowledge is OK. The shell command remembers it.



then the interviewer went away. Here comes another interviewer!

you say your current platform is going to do Java to PHP conversion. Are you going to touch Java? Why did you convert it?

Answer: Java is not accessible. The two systems are used in parallel and will not replace the system at this time. I heard that the CEO is not satisfied with the current Java outsourcing system. So it's going to change.

not satisfied with the CEO? That's not a good reason, is it?

Answer: Well ... I don't know about that, either. I heard the CEO is not satisfied.

What are you doing in this system?

Answer: omit n words.

are you familiar with Linux C? A Linux shell script?

A: Linux C does not! The Linux shell script is OK, but it lacks practice.

The interview is over. More than 2 hours!!! The last HR to say, today's interview is here, this way please. How many rounds are there?!! If the Giants are going to play big!





Excerpt from: http://www.lnmper.net/?p=25

"Turn" June 2012 26– Grand PHP Engineers latest Questions

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.