Home > Backend Development > PHP Tutorial > Brother Fan's interview experience

Brother Fan's interview experience

WBOY
Release: 2016-08-10 08:48:35
Original
992 people have browsed it
Sinaphp splautoloadfile_get_contentsJudge the difference between two arrays $a, $btp and Smartylinux command to view the ports opened by ApacheThe difference between apache and nginx . ..JingdongBig written test question:
  • Input an integer n, find m, m>9, the product of each digit in m = the smallest integer of n; such as n=36, m =49;
  • Non-recursive implementation of pre-order traversal of binary trees (summary of this article)
  • Find the nth number. This sequence satisfies (2^i)*(3^j)*(5^k), the first 7 They are: 2,3,4,5,6,8,10...
  • Overall, it is not particularly difficult. Except for the third additional algorithm question, which I didn’t have time to do, I feel pretty good about the other two and multiple-choice questions
    One side:
  • Does PHP have multiple threads (no, but it can be implemented in other ways), how to understand PHP
  • For static page files, should they be placed on the ngnix side or the server side (ngnix processing Static page performance is more than three times faster than apache, so it is placed directly on ngnix)
  • php writing interface, communication method, socket, http communication implementation
  • How two computers communicate, after the browser enters the url, until the page is rendered, What processes have the intermediate servers gone through? What issues should be paid attention to when using PHP as a client interface (data encryption, json transmission, etc.)? What are the characteristics of json format data (security cannot be guaranteed, and it is a unified key for all languages- value processing specifications)
  • Verification code security, Google cracks other sites
  • How to reverse md5, the encryption and reverse principles of other encryption methods
  • The principle of verification code. The implementation principle of the verification code. If the verification code is stored in the server session, then if the server disconnects from the client and then connects again (the session has expired), how to judge the correctness of the verification code after submission (in the client The same sessionid is constructed in the side js as the server side, and matches the server side sessionid when submitting)
  • How to understand the primary key of the database, is it an index?
  • What should you pay attention to when building a database (table redundancy, primary key, foreign key, index, field ...)
  • What is a database transaction?
  • If the user's bank card status is changed to the in-use status 1 while the order is being placed, what should I do if the network is suddenly disconnected when making the next payment or modifying the order status? (The interviewer is looking forward to the answer: Instead of rolling back immediately, try to retry this place several times. If it still fails, rollback)
  • What aspects should be optimized to improve performance when the request volume is large (caching, page staticization, SQL optimization, table structure, horizontal Split, vertical split)
  • Common Linux commands (file operation commands, vim commands, system commands)
  • The difference between Javascript and jquery
  • School activities, personal personality, work area adjustment, salary, etc...
  • Tencent backend development interface2. What is the .core file and what is it used for? Answer: After the program crashes, the last stack information will be stored in the core file to facilitate programmers to understand the last stack information before the program crashes.

    Follow-up question: If the program is cored, but no core inquiry is generated, what is the reason?

    Answer: The switch for core file generation is not turned on. ulimit -c unlimit

    Further question: Do you know if there is a problem with the program and a signal is generated without using the core file?

    Answer: I was confused at the time, but now that I think about it, it’s just the kernel sending signals to the process. Didn't answer.

    3. Can shared memory be read and written safely without using synchronization?

    Answer: This question was wrongly answered, and somehow it got related to the fork. This question should not work. Shared memory is a critical area and should be synchronized. Otherwise, problems will arise if two processes operate a memory area at the same time. You can use read-write locks to synchronize.

    4. After fork, what does the child process retain from the parent process?

    Answer: The memory area of ​​the child process is a copy of the parent process, and the stack, etc. will be inherited, as well as open file descriptors, etc. In fact, there are many more, such as actual user ID, effective user ID, current working directory, storage mapping, etc.

    5. In addition to file mapping, is there any other way to share memory?

    Answer: Shared memory object mapping.

    Follow-up question: What is the difference between the two?

    Answer: I don’t know.

    6. How does tcp implement flow control?

    Answer: The peer informs the window size. The amount of data passed by the local end is smaller than the window size. (A better way is to tell the peer the size of the local window, and the amount of data transmitted by the peer must be smaller than the window)

    Further question: How to tell the window size?

    Answer: In the ACK message.

    7. Programming question (didn’t figure it out, eh~)

    Q: How to convert a decimal number (greater than 2^32) represented by a very long string into a hexadecimal string?

    Ganji.com interview summary

    Interview channel: Friend@伟Ran Internal Recommendation Technical Internship PositionInterview time: 13:30 pm on August 14th
    First interview:
    Interview method: 2 to 1 (technical leader and front-end person in charge) Process description: The questions asked are very wide, including PHP, algorithm data structure, design pattern, front-end, database, Linux, etc. The content probably includes:
  • When the string is null, the difference between isset and empty
  • The difference between == and ===
  • What are the PHP magic methods and what are their functions?
  • What array functions have been used, and the functions of array_merge and in_array
  • What are the common sorting algorithms and search algorithms? Data structures such as trees, linked lists, heaps, and stacks. Have you implemented it yourself or just seen it?
  • Tell me about the best and worst time complexity of quick sort (nlogn n squared )
  • Briefly describe the principle of quick sort. It is best to familiarize yourself with common algorithms and data structures before the interview. In addition, time complexity cannot be ignored
  • The principle and time complexity of binary search (logn) Time complexity The first answer is wrong
  • What are the design patterns you are familiar with? Write a design pattern by hand (I was writing a singleton at the time)
  • What are the indexes in the database, the difference between database engines (MyIsam and InnoDB)
  • Describe the joint index, and the primary key The difference (confusing primary keys and indexes, 囧...)
  • Database table optimization methods, precautions and principles for table creation, common database field types
  • What are SQL injections, how to effectively prevent
  • What caching technologies have been used , is thinkphp's cache partial cache or complete cache?
  • The difference between Cookie and Session
  • After disabling Cookie, can Session still be used? What are the solutions?
  • Commonly used Linux commands (I answered from both file operations and vim at the time)
  • Do you understand ngnix, which has the same function as apache?
  • Are you familiar with common apache configurations and the role of rewrite in apache?
  • Which compilers have you used during the development of php (eclipse, phpstrom, zend, general sublimeText)?
  • For front-end html , css, js, are you familiar with it, and which front-end frameworks have you used?

  • After the first interview, I asked if I had any questions. I asked about the technical architecture (lnmp) used in the company's development process. Then I waited for a while. I felt relatively relaxed at that time, because I felt that except for the database, the answers were not fluent, but everything else was okay. In the conference room, I was wondering what would happen next. Suddenly, a powerful man with great aura came. The next interview is a bit nervous...
    Second interview:
    Interview method: 1 to 1Process narrative: The questions asked are very deep. I feel that the projects I usually do are too application-oriented and low-level. Knowledge is relatively lacking The content probably includes:
  • Explained why the university is a five-year system (囧, every time I answer this question, I have to start from a very old sad past)
  • The usual learning channels (I said that at the beginning, I basically learned from books, The latter are all project-driven, and then people directly talked about the disadvantages of project-driven...)
  • The leftmost prefix principle of the index (a bit familiar, I think I have seen it somewhere, but I really can’t remember)
  • Why should I use it? ThinkPHP, what are the advantages and disadvantages compared to writing PHP directly? Have you read the source code of tp? Since you are learning thinkphp, please explain the hook mechanism in tp (I only saw it when the new version was updated. I am not familiar with it. I am nervous... .)
  • What is reset ful (uh...what is this, I really don’t know)
  • Explain fastcgi in php, what is cgi, and the difference between cgi and fastcgi (not familiar with it, alas, bite the bullet Come on)
  • I just asked you about design patterns in the first interview, what is shared pattern (oh, there are so many design patterns, I’m so nervous, I can’t remember them)
  • Explain PHP’s namespace
  • What do you usually use for development? What is the php version of (I feel so relaxed at once, 5.5)
  • You have been a product manager before, how do you understand products and technology, do you want to do technology or product (ah, this is better, essay question, look at mine)
  • Can you withstand the relatively high intensity of work in normal times? (Of course, we have normal weekends here)
  • I chatted about some lighter topics, but later I found out that this side was deliberately so difficult, testing the depth of my technical skills. I was really ashamed. Suddenly I felt that there were very few things I knew. Indeed, the review method and time arrangement have been a bit messy recently, and there are some other things that make the whole state more impetuous and nervous. I am no longer in the state, so I will go back and make up for it. Finally, I briefly mentioned that the internship salary was XXXX which was relatively low. I said I didn’t mind, and then said that if everything was OK with me, I would go back and wait for a call from HR.
  • The interview process lasted nearly two hours in total. After the interview, I chatted with my friends for a while. I got home around 4 pm. I didn’t expect that going to the market was very efficient. I was still thinking about how the interview went in the afternoon. Not long after I got home, the HR girl called me. A nice voice said that I passed the interview and asked. When to join. In fact, I didn't plan to work. I also wanted to go to other places after the interview to improve my interview skills. Just agree to it first. I was told when I could start the job next Monday and Wednesday. I said Wednesday, so I could rest for a few days. Next, I responded to the offer, and I was torn about whether to go or not. I thought I had nothing to do now, so I would just do my internship first and then continue preparing for school recruitment. Prepare onboarding materials.

    BaiduWritten test questions

    The written test questions for Baidu technical positions are set by each department themselves. Therefore, there will be several sets of written test questions after the written test every year. Circulated online.

    The inspection areas mainly include:

    1. Basic requirements


    Language (mainly C/C++), programming principles, operating system principles, and computer networks. Such as pointer arithmetic, byte alignment, function call stack frame structure, memory management, process scheduling, seven-layer network protocol model, etc. Usually in the form of quiz questions. 2. Data structures and algorithms
    Search (typically such as binary search), sorting (typically such as quick sort, outer sort), tree (typically such as pre/middle/post-order traversal of a binary tree, trie tree). If you are a good person, the question clearly tells you "Please write the algorithm pseudo code for in-order traversal of a binary tree and analyze the complexity." This kind of question is relatively simple. If you are unlucky, the topic will be relatively abstract, such as "Given a file storing hundreds of millions of integer values, design an algorithm to perform xx processing on these integers while satisfying xx space complexity or xx time complexity." This kind of problem is relatively difficult to deal with. Therefore, everyone must be mentally prepared. This part is usually about writing algorithm pseudocode.
    3. System design question
    The text describes a practical business scenario and requires the design of a system that can realize the xxx function quickly and cost-effectively.
    This kind of question is relatively divergent. Usually, most of the students recruited by the school are unlikely to have any experience in this type of design questions. Basically, you need to rely on your own understanding of the system, especially the principles of computer composition or operating system, to draw conclusions by analogy, to express freely, and to be well-founded and logically rigorous. The test point of this type of question is usually not a standard answer, but your ability to analyze actual problems.

    How to prepare for the written test


    Although the content of the written test is usually the knowledge accumulated in daily life, the importance of "pre-exam surprise" cannot be ignored
    1. c/c++
    Recommended textbook: c programming language (the textbook written by the creator of C language is short and concise, beating Uncle Tan Haoqiang Dozens of streets), c++ primer, effective c++
    2. Computer systems
    I don’t know which textbook is from Jiaotong University. The textbook used by Uncle Xue for self-study:
    "In-depth Understanding of Computer Systems" English name: Computer.Systems: A Programmer's Perspective
    "Modern Operating Systems" English name: Modern Operating Systems
    3. Data Structure and Algorithm
    The textbook used by Jiao Tong University that year was the C language version of "Data Structure" by Professor Yan Weimin of Tsinghua University
    My uncle also used this book before looking for a job For review
    Of course, if there are talented people reading MIT's "Introduction to Algorithms" or "The Art of Computer Programming" by Donald E. Knuth, then there should be no big problem with the knowledge of algorithms
    4. Improvised interview questions
    The information listed in the first three items requires a certain amount of time to digest. If we start from scratch now, there is obviously not enough time. Therefore, Uncle Xue gives some information here to serve as a starting point.
    1) "The Beauty of Programming" Microsoft Technical Interview Experience
    This book summarizes dozens of typical algorithm questions often used by Internet companies. It is definitely worth studying. In contrast, domestic fast food such as Programmer Interview Guide is A bunch of flying. . .
    2) csdn blog - The method of structure, the method of algorithm
    Search "method of structure" on Google or Baidu and click on the 1st search structure. The blogger of this blog is a master of algorithms. It is recommended that interested students take a look at the interview algorithm questions.
    In addition, the Sina Weibo account of this algorithm expert is researcher July. He is currently giving a lecture on interview algorithm questions, so you can pay attention to it. Preparation for school recruitmentAli written test: August 25

    Baidu written test: September 27th or October 12th

    Tencent written test: xxx

    "Sword Pointer Offer"

    "Programmer Interview Guide"

    "Big Talk Design Pattern"

    Before "Learning Algorithms from Zero Basics" Five chapters

    "The Beauty of Programming"

    csdn Blog - The Law of Structure and the Way of Algorithms

    "PHP Job Search Guide"

    "C and Pointers"

    "Getting Started with Redis"


    Copyright Statement: This article is the original article of the blogger and may not be reproduced without the permission of the blogger.

    The above is an introduction to Brother Fan’s interview experience, including various aspects. I hope it will be helpful to friends who are interested in PHP tutorials.

  • Related labels:
    source:php.cn
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template