This interview is not only a chance to start a new journey and learn more about the world, but also a process to discover my own shortcomings and a chance to determine the direction of future development (learning).
Interview preparation
A resume that shows the interviewer you are, a resume that shows you are confident in yourself, and off you go
PHP
PHP is the best language in the world!
basis
- The difference between session and cookie
Session is a data structure stored on the server to track user status. The data can be stored in clusters, databases, and files. Cookies are a mechanism for the client to save user information, which is used to record some user information and a way to realize Session.Copy the code
- Have you used PHP7? Check out the new features
PHP7 leapfrog ascension in performance, the new operator, unified variable syntax and so on Reference [PHP7 article] (https://blog.csdn.net/u011957758/article/details/73320083)Copy the code
- Magic variables
Asked the __dir__ representative meaning, this is the answer file directory reference [of the PHP manual magic constant] (http://php.net/manual/zh/language.constants.predefined.php)Copy the code
- Magic methods
__construct(), __destruct(), __call(), __callStatic(), __get(), __set(), __unset __isset (), (), __sleep (), __wakeup (), __toString (), the __invoke (), __set_state (), Reference [and __debugInfo __clone () () of the PHP manual magic methods] (http://www.php.net/manual/zh/language.oop5.magic.php)Copy the code
Data structures and algorithms
- Stack data structure
As long as can use the code implements a stack data structure can be reference [article] stack data structure (http://www.jb51.net/article/130272.htm)Copy the code
- Bubble sort
As long as can use the code implements a bubble sort can refer to the bubble sort [article] (http://www.jb51.net/article/24497.htm)Copy the code
- The difference between complete and full binary trees
Only the bottom two nodes can have a degree less than two, A binary tree with h depth and 2^ H-1 nodes is a full binary tree. Fully binary tree and binary tree completion] (https://blog.csdn.net/HaoDaWang/article/details/78065162)Copy the code
The architecture
- What’s the difference between Laravel and ThinkPHP
I from routing, middleware to the controller, data access, view and so on different level, this paper introduces the speech may relative to some projects, Laravel is a bit "heavy" reference [tp3.2 and tp5, as well as the difference between laravel] (https://blog.csdn.net/qq1690194137/article/details/79794944)Copy the code
- [Have you published your own package for composer](Modular PHP development based on Composer)
I answered no, but after knowing the interviewers, I said their framework was secondary development based on Discuz by myself. On the basis of his excellent the composer rely on management are also introduced blabla reference [composer based modular PHP development] (https://zhuanlan.zhihu.com/p/27943241)Copy the code
- Talk about your understanding of MVC
Combined with the project specification template, the view, the relationship between the controller and the basic composition of the reference (MVC) (https://baike.sogou.com/v25227.htm)Copy the code
protective
- XSS cross-site scripting attacks
- DDOS Traffic Attacks
- CSRF cross-site request forgery attack
- SQL injection
Controls the user input in the front-end form or filters the parameters and data passed in the back-end CSRF SQL injection, XSS, and flow of DDOS attack] (https://blog.csdn.net/echo_laodong/article/details/79254552)Copy the code
project
- How can concurrency be addressed in a project
My solution first front-end control effectively the request, such as normal request only once in a minute Then the back-end also blocking invalid request, then operation in the queue to achieve a the interviewer asks, do you this queue is blocked, if two users to buy at the same time, two users wait for completion, they still use the same thread to complete, Did you think about doing it any other way and when I said no, he said you could use a lock mechanism, the second one waits for the first one to complete, One by one reference [PHP high concurrency to solve point] (https://blog.csdn.net/mkbug/article/details/71455725) and related swoole extensions, can understandCopy the code
- Wechat pay specific implementation process
1. H5 page initiates a payment request and generates payment orders. 2. Generate payment parameters of JSAPI page call and sign 4. Wechat browser automatically invokes payment JSAPI interface payment 5. 6. Asynchronously inform the merchant of the payment result, and the merchant returns the confirmation information upon receipt of the notice. Return to pay as a result, show the payment information for user reference [WeChat payment sequence diagram] (https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_4)Copy the code
- Simple implementation of login registration function
Each framework considers different aspects, so it's good to write your own understanding of the codeCopy the code
- How to design a mall
I first limit a B2C mall to myself, and then start from the data table, and then briefly introduce the front-end and back-end implementation of the logic reference [PHP online mall website design and implementation](http://www.docin.com/p-190062065.html)Copy the code
MYSQL
Mysql optimization is basically a top priority, especially the test of technology
basis
- What is the difference between InnoDB and MyISAM
InnoDB provides transaction, row-level locking, support for foreign keys, support for a variety of row formats MyISAM only supports table-level locking, full-text indexing, Heap table reference [MyISAM and InnoDB distinction] (https://blog.csdn.net/xifeijian/article/details/20316775)Copy the code
- What are the characteristics of transactions
Atomicity, consistency, isolation, persistenceCopy the code
- The isolation level of the transaction
Uncommitted read and submitted, repeatable read, serializable reference [the relations between transaction isolation level and lock in the Innodb] (https://tech.meituan.com/innodb-lock.html)Copy the code
- There is a table field O_Id, OrderDate, OrderPrice, Customer, we want to find customers whose total order amount is less than 2000
SELECT Customer,SUM(OrderPrice) FROM Orders
GROUP BY Customer
HAVING SUM(OrderPrice)<2000
Copy the code
- Query student table data, more than 60 for pass, vice versa fail
Select Case WHEN score >=60 THEN'pass'
ELSE 'Fail'END from grade tableCopy the code
- Select student id, student name from student who did not complete all courses
SELECT a.SNO ,a.SNAME
FROM student a
WHERE a.`SNO` NOT IN
( SELECT b.`SNO` FROM SC b
GROUP BY b.`SNO` HAVING COUNT(*) =
( SELECT COUNT(*) FROM course)
);
Copy the code
To optimize the
- Select * from student where name=’red’,”select * from student where name=’blue'”
select name from student where name='red'
union
select name from student where name='blue'If the or condition is used, myISAM tables can be used with indexes, innoDB cannot. Innodb replaces OR with UNION (for index columns)Copy the code
- How do you tune your database
Query cache, EXPLAIN, static table (joint) index, using a fixed length This problem can write a book, reference [MySQL performance optimization best 21 experience] (https://blog.csdn.net/kaka1121/article/details/53395587)Copy the code
The server
protective
How to protect the server
Only limited open ports, limiting the login IP, limiting the login account Also can settle the problem of a book, can answer according to the project, reference [server protection knowledge summary] (https://blog.csdn.net/Sasoritattoo/article/details/9324149)Copy the code
agreement
What’s the difference between Get and Post
The parameters of Get are contained in the URL. The Get request is actively cached by the browser. It is URL-encoded and has ASCII character limitsCopy the code
NginX
What are PHP script requests handled when setting up nginx
The default configuration is to forward to FastCGI processingCopy the code
Redis
- What data do you cache with Redis
I cache some frequently used data with the data projectCopy the code
- How does Redis persist and what refresh rate is configured
Configuration aof the persistence in a second, and use the default refresh aof file reference [two persistence mode and principle of the redis] (https://blog.csdn.net/yinxiangbing/article/details/48627997)Copy the code
- Is Redis multi-threaded
Single thread (233) I should answer is multithreaded, reference [Redis single process] (http://www.cnblogs.com/syyong/p/6231326.html)Copy the code
- How does Redis configure one master with many slaves, and how long does it take
Official can use Redis cluster solution, concrete without practice, it may take a few weeks time to complete the reference solution] [Redis cluster (https://www.zhihu.com/question/21419897)Copy the code
Code management
Have you ever used Git? What happens when two people submit an error code
Used git commit code, can happen to a remote code git pull to the local, then the code will be the conflict or git tag content change correctly, and then resubmit code reference [git use experience] (https://zhuanlan.zhihu.com/p/22666153)Copy the code
other
Why you left your job
Answer tactfully, mentioning a few things about the company or yourself </del>Copy the code
Your ideal team
Passion for technology, and actively solve the problem, the common cooperation team] [an ideal reference (https://zhuanlan.zhihu.com/p/19968752)Copy the code
Career planning
Front-end in-depth, back-end in-depth, data optimization analysis and collection, server penetration of BlabLACopy the code
Question to ask
What projects does the company have, technical architecture, profitability and so onCopy the code
Technology stack is different, different companies concerned point is different, a little will be on the issue of queue to ask specific blocking solution, some pay more attention to the efficiency of project, some will also focus on server set up, have set up framework and knowledge of popular frameworks, perhaps can find what you want in the process of development direction
Afterword.
9 7 offers in 5 days, I feel ok, most companies will ask detailed questions according to the project on the resume during the interview, During the interview, I can see the breadth of technology (how many projects or skills I have experienced) and the depth of technology (data optimization, framework understanding and production, server penetration). I hope that everyone can also practice and learn technology with the development of the project. \(•ㅂ•)/♥ ~