PHP Senior development or architect must know---many questions asked in the interview!

Source: Internet
Author: User

Copyright Notice: This article for Bo Master original article, without Bo Master permission not reproduced. Recently interviewed several companies, some important questions to record, urging themselves to improve learning, and hope to give friends some help. Content a lot, a little perfect, step by step learning. Some of the interviews are asked, some are recruitment requirements, some are self-organized add. First, MySQL related knowledge1MySQL optimization method MySQL optimization common methods MySQL performance optimization scheme2, how to sub-table reference: http://blog.sina.com.cn/s/blog_6e322ce70100zs9a.htmlhttp//www.jb51.net/article/29771.htm   3, mysql+How to do two-machine hot-standby and load-balanced http://www.dewen.org/q/51/Mysql+ How to do two-machine hot standby and load balancing      4, data table types have MyISAM, InnoDB, HEAP, Bob,archive,csv and other MyISAM: mature, stable, easy to manage, fast read.       Some features do not support (transactions, etc.), table-level locks. InnoDB: Supports transactions, foreign keys and other features, data row locking.       Large space consumption, full-text indexing is not supported, etc.   Main features of the MyISAM and InnoDB engines What is the difference between MySQL's storage engine MyISAM and InnoDB? 5, anti-SQL injection method mysql_escape_string (Strip_tags ($arr ["$val"])); 6, MySQL How to solve the problem of cross-table query efficiency after splitting a large table into multiple tables [PHP] View plain copy on code to view the snippet derivation to my Code slice/** * Function Name: Post_check () * Function: Processing of submitted edits * parameters: $post: What to submit * return value: $post: Returns the filtered content*/function Post_check ($post) {if(!GET_MAGIC_QUOTES_GPC ()) {//determine if the MAGIC_QUOTES_GPC is open$post = Addslashes ($post);//To filter the submission data without opening the MAGIC_QUOTES_GPC} $post= Str_replace ("_","\_", $post);//filter out the ' _ '$post = Str_replace ("%","\%", $post);//filter out the '% '$post = NL2BR ($post);//Carriage return Conversion$post = Htmlspecialchars ($post);//HTML Markup Conversions    return$post; }     7, the index is applied under what circumstances to consider the index what is not appropriate to index whether a statement is used to index how to determine what is often not used in an indexed scene: like'%.....'data type implicit conversion or keyword plus other conditional constraint full-text index: can only be used for MyISAM tables, created on columns of type Char,varchar,text         。 8, MySQL for large table (TENS), how to optimize it?refer to http://www.zhihu.com/question/19719997   9, MySQL slow query problem in fact through the slow query log to analyze is a relatively simple way, if you do not want to read the log, you can use tools to complete, such as Mysqldumpslow, Mysqlsla, Myprofi, MySQL-explain-slow-log, Mysqllogfilter, etc., feel yourself to analyze a need for rich experience, a waste of time. Ten, about user Login status Session,cookie or database or Memcache http://www.dewen.org/q/11504/about User Login status Save session%2Ccookie or the merits of a database or memcache One, transaction application extreme case Processing A, SQL 4 categories please list DDL--Create,drop,alter DML--Insert,update,delete DQL-SELECT DCL--Grant,revoke,commit,rollback Two, PHP Foundation session cross-domain sharing PHP connection MySQL database several ways and differences MySQL: process-oriented mysqli: oriented to Like PDO: High portability Please refer to: PHP Basic series: PHP connection to MySQL database three kinds of API three, PHP advanced long connections and short connections using the socket for the use of payment security issues three major features: encapsulation, inheritance, polymorphism (    Method overrides). Abstract class:Abstract, at least one method is an abstract method that cannot be instantiated and defines a public interface for a subclass. Interface:Interfaceto solve the single inheritance problem of PHP, all methods are abstract methods of public access, and cannot declare variables to declare constants only. Implement multiple interfaces while inheriting a classclassA extends B implements interface 1, interface 2 ..., interface N () {//implement methods in all interfaces} lamp and LNMP Web site architecture Performance differences for the analysis of explanatory and compiled language performance analysis, for example.           Four, regular email,html,js and other matching five, the development of basic process and thread definition, difference and contact. Status of the process: running run, ready to prepare, waiting for wait six, NoSQL database memcached, Redis, MongoDB the difference between 3 scenes completely different things. 1. memcached: A single key value to the memory cache, do object cache no alternative to the distributed cache;2. Redis: Is a collection of algorithms and data structures, and the fast data structure operation is his greatest feature, supporting the persistence of information;3. MongoDB is a bson structure, between an rdb and a nosql, looser and more flexible, but does not support transactions and is used only as a non-critical data store. Can I refer to MongoDB or Redis instead of memcached??Seven, common Linux commands such as soft link eight, the structure of the project before the launch of the stress test, a single server support the number of concurrent, PV number.             The problem of reasonable allocation of server resources Cpu:apache MySQL in high-load environment, disk IO read and write too much, will certainly occupy a lot of resources, it is inevitable that the CPU occupies too high. Memory: Memory library, database software hard disk: file web2.0 architecture Select MongoDB+redis or mysql+Memcached is a better combination, the logic is simple to use NoSQL current main web site architecture LAMP, LNMP, LLMP now there is a lnamp architecture on the network, which is the combination of nginx and Apache advantages, using Apach E Load Php,nginx is responsible for parsing other Web requests, using Nginx rewrite module, but Apache port is not open to the outside, many Apache modules can not load reduce resources. 

PHP Senior development or architect must know---many questions asked in the interview!

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.