In this paper, by Yang Jue into starting in SegmentFault, please do not reprint without permission The original link: segmentfault.com/a/119000002…

0x00 Who is the author

I am a senior student majoring in software engineering at Beijing Institute of Technology. Now I have joined Bytedance. From freshman year to begin before the end of the whole development of stack, independently developed a number of medium and small projects, the guy is the founder of the community of iron | dormitory bazaar applet and independent project director.

When I was at school, I was a restless person. Recently, due to an accidental opportunity, I came into contact with the school recruitment season, and finally set the planning goal of working after graduation.

So I participated in the school recruitment of 9 domestic big factories in one month

Within a month, I got offers from five major companies, including Bytedance

Interest related: I joined Bytedance after this article was published, and bytedance recruitment will be launched on February 24th! Want to push the code of spring recruitment partners directly see here [bytedance] department direct push & resume optimization! First come, first served

0x01 Why write this article

From my sweaty fingers at the beginning to my inability to speak, to my fluency in speaking with the interviewer, I found that the feedback to the interviewer can be quite different in the same ability level and different interview performance.

Therefore, if you want to show your true level to the interviewer, it is necessary to master some appropriate methods.

The body of the vein

The content of the text focuses on the ability required by the recruitment of large factories, and analyzes the specific recruitment strategies of each large factory. Divided into two parts:

  • How to Get into an interview
  • How to Pass an Interview

I hope it can provide reference for the students who go to the workplace for the first time, and also a summary of their busy in the past few weeks.

0x02 How to Enter the interview?

2.1 Pass the preliminary screening of the resume

2.1.0 push

Here must emphasize the internal inference at the beginning, quote zhihu @Tony’s answer:

Internal referrals are likely to speed up your application process, but are unlikely to increase your chances of getting accepted.

Many, many people send their resumes to Google every day. HR sees thousands of resumes submitted online every day and won’t know when they see yours. Besides, are you really sure your resume will stand out among thousands of others?

That’s where the internal push comes in. Internal policy HR must review your resume within one week of receiving your application and must respond within two weeks. In other words, you cut in line.

But it doesn’t improve your chances of getting hired, and those who aren’t good enough just jump the queue and get rejected. The whole interview process is the same as usual. The final decision is always your background, ability, and interview performance.

2.1.1 Layout and Layers

Don’t use fancy templates from the Internet! A good resume should have the most reasonable density of information. Hr needs to see key information in a second. Nothing but text and photos. It should be black and white with little redundancy. Those colorful messages will only reduce the density of your resume.

My advice: Write your resume in Word, not color templates. All hierarchical relationships are distinguished by font size and thickness. Use vertical lines to divide in-line information and horizontal lines to divide block-level content. The top two or three lines give clear personal information, and the right side puts professional photos.

As a front-end, sensitivity to the layout is the most basic requirement. I have applied my experience in my resume. For the protection of personal privacy, please feel free to contact me in private.

2.1.2 Selection and order

Don’t cover your resume with all your positives. This will only confuse the interviewer. Remember, not all strengths are seen as strengths, and not all strengths will be appropriate for the position you are applying for.

First, organize all your resume materials into a text library, and then carefully select the resume content that matches the position according to the different positions you are applying for, with the most relevant experience that can highlight your ability first. Focus on language refinement and accuracy! It’s up to you to choose your highlights.

Don’t write about yourself!

2.2 Pass the written test

There is no trick to the written test, I personally will brush Leetcode. If you can brush 100 basic above questions, you don’t have to worry about it. If you can brush 200 questions, you don’t have to fear the school entrance examination.

I have recorded in Appendix 2 some of the pen tests I have encountered for your reference only.

0x03 How to Pass the interview?

3.1 Overcoming Nervousness

Anyone can be nervous when facing an interviewer for the first time. Even after multiple interviews, there are times when you feel like you can’t control yourself. Overcome this tension and you are already half way ahead of most interviewees.

Interviewers will always love it when you’re able to stay on top of a difficult situation. And for any future occasion.

I offer two tips on how to overcome nervousness

  1. Get as many quality interviews as you can. A good interview will help you further solidify your knowledge system and, most importantly, develop your ability to think on the spot.
  2. Expect the interviewer to judge you as little as possible. Focus on problem solving, don’t rely on the interviewer’s approval, and learn to evaluate yourself.

3.2 Complete logical thinking

Interviewers like to give you a few minutes to solve a complex problem: implement a Vue bidirectional binding yourself, write a fair shuffling algorithm, write a CSS merry-marley style, get the full perarray of a string, write a class polyfill. Or dig deep into your project history and ask for technical details so you can think about how to make it better on the spot.

If you are not prepared, you may lose your train of thought all of a sudden, and then you may not be able to keep up with the rest of your train of thought, which may directly cause you to fail the interview.

At such times, you should realize that the interviewer is testing your logical thinking. The interviewer’s purpose is not to give you an absolutely perfect solution, but to see how you can use a set of systematic logical thinking to call on your knowledge base and finally give you your own thinking path. The most important thing is the thinking in the process, be sure to explain to the interviewer.

3.3 Solid technical reserve and engineering ability

Then comes what you do for 90% of the interview, which is a test of your technical reserves and engineering skills.

Generally speaking, the front-end school recruitment of large factories will pay more attention to the all-round assessment of the candidates than other small and medium-sized enterprises. If you have a training background, the technical assessment of the school recruitment will include but not limited to:

  • Fundamentals of Computer Science (Data structures, algorithms, Computer networks, operating systems, databases)
  • Job related fundamentals (JS/ES knowledge system, browser rendering and caching, front-end and back-end communication, Web security)
  • Engineering experience (performance optimization, dependency management, dependency packaging, modularization, componentization, user authentication, version management, package management, server foundation)
  • Mainstream Framework Understanding (Vue, React)
  • Some of the most demanding companies will also examine your science fundamentals (linear algebra, advanced mathematics).

In addition, different large factories also have different emphases.

While alitao FED, the most technically competent company, will take a hard look at your basic knowledge and skills on your resume, ByteDance is more interested in your practical engineering experience and understanding of software system architecture.

Through the interview strategy of each big factory, you can also observe the technical strength and business development direction of the company.

I organized all of the technical points into a mind map. Suggest a careful review, for any knowledge point that is not 100 percent sure, I suggest that you sort it out into a list, comb through point by point.

PS. Necessary knowledge of stars can be skipped:

For those of you who don’t want to see the picture, I have exported it as an outline, which can be saved in a memo.

Big factory front school recruitment – knowledge system

3.4 Career Planning

If you pass all the tests above, congratulations, you are almost one step away from getting an offer.

At this point, the interviewer will ask you about your career plans.

This problem is also need their own problems, the best in the delivery of resume to think clearly:

  • Why do YOU want to go to this company? What are your strengths (business, technology, platform and prospect)?
  • Why do I want to apply for this position and what expectations do I have for my future development direction (ability, position, technology stack, industry)

Again – front-end programmers who don’t want to be architects are not good programmers (fog).

3.5 Be sure to review and summarize after each end

If the interview is not called back, no amount of interviews you attend will be as good as none. Don’t sigh about how you made a fool of yourself during the interview or curse at the interviewer for being anti-human. Immediately respond to the interview, no matter how hurt.

Write a memo as soon as you walk out of the interview. If it’s a phone interview, tape it and listen to it again. Take a look at the interviewer’s questions and your own answers and see how well you answered them (and if you could have done better).

I have recorded in Appendix 1 the copy of each school enrollment.

0x04 Interview experience of various large factories

Here I wanted to carefully quantify the interview experience in the interview process of various large factories. Unfortunately, some interviews have been over for some time and my impression is not so clear. I am afraid that my evaluation will be biased. So let me briefly tell you some of the things that impressed me during the interview process.

  • Byte will hand out a small gift bag including a Tik Tok hat to everyone who attends the interview, as well as a bag of breakfast and a free lunch buffet at noon, which is very thoughtful
  • When asked why I chose STATION B, the elder brother of station B added, “Except for the feelings of quadratic yuan”.
  • Each round of interview is a surprise phone interview, called in while I am sleeping, flying and eating. Each round lasts an average of 90 minutes, and you will be told the interview catalogue in advance… (See appendix 1 for details# 6.8 Ali school recruitment second interview)
  • Rode mobike to meituan Mobike headquarters building to attend the interview of Mobike applets development
  • In byte met a very funny younger brother and a very cute little sister in charge of flying chat
  • Tencent’s internal push is very important, otherwise the interviewer may not see you
  • The above rule applies to most big factories
  • This does not apply to bytes
  • Very hope Tencent and Ali’s little brother to see here will not hang me

0x05 At the end: What Makes a Good Front-end Engineer

Recently, I read an article called “Front-end deep water Zone” and felt deeply that the ultimate way out for technical posts must be to establish technical barriers and influence business decisions.

During the interview at station B, I also met a question that made me think. The interviewer asked me at that time: “I have a good impression on your career plan, how do you plan to realize it? I’ll give you a minute to think it over.”

I ended with three sentences:



Stay aggressive,

Stay humble,

Explore best practices every day.

With everyone!

Appendix 1: Sorting out interview questions for big factories

6.1 Symbol Conventions

symbol meaning
Square root Correct answer on the spot
x Field answer error
? It was impossible to tell if the answer was correct
ask The questioning of the parent question
(a) My thoughts on how to answer an interview
() the right The most appropriate answer (or supplement to the on-site answer)
supplement Personal additions to the interviewer’s on-the-spot answers
q The question I posed to the interviewer

PS. Not all test questions contain the above symbols, because they are on-site recall records, so there are many incomplete places.

6.2 Ali is an intern

  1. Describe a tree root with js
  2. Nonrecursive traversal tree ×
  3. Detail the js new operation √
  4. The method call pattern this points to ×
    • Follow-up: Function call pattern this points to √
  5. What is the JS closure √
  6. How do I access √ across domains
  7. How do vUE’s parent and child components communicate with each other
  8. Write infinite looping animations with CSS
  9. How responsive layout √
  10. How do I clear float √
  11. Write a json)
  12. Why is cross-domain × forbidden
  13. Osi 7 × missed it
  14. TCP three-way handshake √ Four-way wave x
  15. How can setTimeout execute × asynchronously in a single threaded JS
  16. What’s the difference between a process and a thread?
  17. Write a number to Chinese program √
  18. How does a js function bind this to a new object √
  19. What’s the difference between a bind and a call
  20. Handwriting quick row ×
  21. Let’s talk about the HTTP status code √, where 303, 304 stands for what ×
  22. Deadlock principle and four elements √
  23. The difference between cookie and session √
  24. Definition of homology √

6.3 Bilibili school recruitment

  1. √ (ES5 global + functional, functional closures, ES6 block level)
  2. Enter url to page render complete √ (Domain name resolution -TCP subcontract -IP path Finding – Handshake – Sliding Window Transfer – Persistent connection – Wave – Parse – Build DOM tree and CSSOM – Build Render Tree – Reflux – Redraw – Render)
  3. √ (1 main thread +n task queue, browser async push queue, Loop, one MacroTask followed by all microTasks)
  4. √ (execute after all promises in all)
  5. How to make promise.all valid after an exception is thrown × (correct answer: Active reject)
  6. What is VueX √ (State quantity Management across components)
    • (4) VueX (action) and VueX (mutation)
  7. √ (Syntax sugar, DOM listening + model listening)
  8. Vue’s advantages √ (Virtual DOM, data binding, view-model separation, eliminating redundant DOM operations)
  9. How to achieve SEO optimization? (only server side pseudo static)
  10. √ (Backflow is a change to the physical size, backflow will always redraw, redraw does not necessarily backflow, so minimize the number of backflow, move elements out of the DOM tree and then change)
  11. Detail anti-shake and Throttling optimization √ (State lock/Sync Lock)
  12. √ (block-level scope, variable non-promotion,let, const, arrow function, template string, Promise,async)
  13. Briefly describe the arrow function property x
  14. How does Webpack packaging optimize ×

6.4 Ali’s advice

  1. List the inheritable and uninheritable elements in the CSS √
  2. Select the second item in the list √ with CSS
  3. The difference between pseudo-classes and pseudo-elements √
  4. How does h5 font adapt to screen √
  5. What’s the square root of RPX
    • Follow-up: What is REM?
    • Follow-up: what is vw √
    • Follow-up: The difference between VW and REM × (VW determines font size conversion ratio according to screen width, rem determines font size conversion ratio according to root element)
  6. When does the CSS use GPU acceleration √
  7. What is CSS filter x (visual effects of elements such as blur and saturation)
  8. How do pages fit different widths
  9. Explain the functions of meta tags √
  10. Position Default and all possible values √
  11. What is sass and less √
  12. CSS animation minimum interval √
  13. What is shadow DOM
  14. Concepts and differences between SVG and Canvas √
  15. How do I use x on the canvas layer
  16. What are the performance costs of DOM rendering
  17. How can I efficiently remove 10 div √ out of 1000
  18. How to listen to img load complete √
  19. What can you run in a browser other than JS?
  20. Promise has several states × (Fufilled, Rejected, pending)
  21. How do I catch promise errors √
  22. Can promise be connected? The answer is not clear
  23. What problems can vUE solve in detail √
  24. How does the Virtual DOM diff operation ×
  25. Why is data a function in vue and not an object √
  26. Why deep copy √
  27. What is a brief pointer
  28. Do you know node.js
  29. Difference between process and thread √
  30. How many users and visits do you have on your own platform? √
  31. How do I monitor unhandled exceptions? Listen to console Error
  32. What 5G is and why 5G is used (Open topic)
  33. Imagine the application scenario of 5G (open topic)
  34. The difference between HTTP and HTTPS √
  35. Why is HTTPS not intercepted √
  36. Can quantum computers break and solve asymmetric encryption √ (Plus)
  37. Principle of quantum computer √ (plus)
  38. How do browsers cache? (Bad answer, set HTTP header)
  39. Explain the differences between HTTP 1.0, 1.1, and 2.0
  40. How does TCP ensure transmission integrity √
  41. What is the difference between UDP and TCP
  42. Why don’t you use UDP ×
  43. What protocol is WebSocket based on
  44. Bubble algorithm and quicksort time complexity √
  45. What sort algorithm does distributed system use? A half of
  46. Extensive search and deep search applications √
  47. Search data structure √
  48. What’s the derivative of the chain times
  49. What is the rank of the matrix? A half of
  50. Gradient and derivative, partial square root
  51. The information entropy)
  52. How does compilation work? A half of
  53. How does SQL obtain the current time √
  54. Char differs from varchar by √
  55. The drop, delete, truncate? (Half-pair, TRUNCate can persist)
  56. Have you used Python? Did the crawler

6.5 Phone interview for Xiaomi internship

  1. As a full stack why reported front √
  2. Which version of js is used √
  3. New es6 features √
  4. Promise has several states √
  5. How does a promise satisfy the synchronization order of multiple asynchronous processes √
  6. Promise. Race and promise. All
  7. How to Design a Page Layout (Open topic)
  8. How to use Flex to arrange 8 ICONS in 2 lines × (flex-wrap)
  9. Vertical center and horizontal center ×
  10. Does your page have a set of interface responses of different widths √
  11. How do I tune the front and back API √
  12. What are fetch and Axios in vue
  13. How to solve cross-domain problems
  14. Post × (with iframe)
  15. Git operation √
  16. Hide curly brackets × (V-clock) before loading vue.js
  17. React development mainly uses react, would you like to transfer technology stack (yes)
  18. How long can I practice?

6.6 Bilibili school recruitment second interview

  1. How does pure JS get the scrolltop value √
  2. Explain the js closure principle and meaning √
  3. What is deep copy shallow copy √
  4. How to convert arguments to array √
  5. Why is the mobile and PC click events 300 milliseconds different × (because iPhone can double click zoom)
  6. Flex layout usage √
  7. How to achieve mobile responsive layout √
  8. Scope √ of ES6
  9. What √ is async await
  10. What are the square roots of block-level scopes
  11. Expand on the promise asynchrony √
  12. How to implement cross-domain access √
  13. How to set cache √ for HTTP communication
  14. Details the HTTP status code √
  15. How to implement vUE component communication √
  16. Explain the functions of VueX √
  17. How to implement a swiper √
  18. What’s the square root of a hybrid
  19. How does Hybrid JS call native interface ×
  20. Why do front-end
  21. For their own development plans
  22. How about Shanghai

6.7 netease’s school recruitment

  1. Block element inside element √
  2. What is tag semantics √
  3. The CSS clears float √
  4. What is box model square root
  5. CSS priority √
  6. The position property)
  7. Mobile adaptation? (Media query, Flex, REM) and viewPort
  8. Px to rem em)
  9. The difference between == and === √
  10. What is the square root of prototype and prototype chain
  11. What is deep copy √
  12. What is synchronous and what is asynchronous √
  13. How do I execute 10 asynchronous tasks in sequence? (Incomplete answer)
  14. What is ES6 Proxy? (No understanding, explained the concept of proxy mode)
  15. How do I get the results of all tasks iterating through an arbitrary list of elements and creating asynchronous tasks in turn? (Use promise. All, I feel the interviewer is not satisfied, I should use proxy.)
  16. Sort an array of objects? (Add prototype method)
  17. Sort an out-of-order one-dimensional array
  18. Array deduplication? (map.set, key value object)
  19. How to manage git branches? (Incomplete answer)
  20. What cache does the browser have √
  21. What is cross-domain square root
  22. How to resolve cross-domain √ (JSONP, proxy, whitelist)
  23. I don’t think there’s another way
    • Add local storage, window.name, form.message
  24. Page performance optimization √ (redraw, reflux, anti – shake, throttling
  25. √ (lazy loading, preloading) and Base64, compression, skeleton screen
  26. Browser security handling √ (XSS, database injection) and CSRF, file upload vulnerability
  27. Do you have experience with real browser debug (open questions)

6.8 Ali school recruitment second interview

  1. Tell me about your project experience in one minute
  2. Do you know about the department of FED

I. Basic part

  1. html

    1. How to handle compatibility on the mobile side? (CSS prefix)
      • A similar problem was encountered in the project (SVG)
      • Question: Anything else? And meta ViewPort HTTP-equiv
    2. Vw EM REM differences and usage scenarios √
    3. Differences between different positioning modes √
    4. Fix display problem? (Width collapse) Not complete, there is z-index overlay
    5. How does canvas use layer √
      • How to avoid layer overlay? (Encapsulation of the answer)
  2. css

    1. All absolute middle implementations? (Flex, text, padding: auto) Translate
    2. What’s the difference between sass and less
    3. How to implement responsive layout √ (FLEX media query REM)
      • √ (grid)
    4. Do you know BFC × (No)
  3. js

    1. A three-sentence summary of all value pass types, all reference pass types, and how to pass value types by reference?
    2. Js all base types? (Boolean, number, string) and null and undefined, symbol
      • √ (undefined and null)
      • Ask how to compare ×
    3. Difference between pointer and reference √ (Address and alias)
    4. When to release √ (mark cleanup and reference counting) for variables in different environments
      • When is a variable reclaimed in the case of a non-closure? (Not sure)
    5. How do you understand the scope of js √
    6. √ (call, es6 extend)
      • Is there any more? (Don’t know)

Ii. Engineering

  1. What is the difference between the React and Vue life cycles? React (vue)
  2. How does Vue listen for changes in data √ (defineProperty, subscriber model)
  3. How to communicate between parent and child components in Vue √
  4. Do you know about higher-order components (no)
  5. Have you seen the source code of Vue? (Currently, it is mainly in the understanding principle stage.)
  6. Have you ever built an engineering project using a tool (vue CLI + Webpack)
  7. Webpack compilation and build principles (analysis dependencies, Chunk) have nothing to say about Loader
  8. What tools do YOU use to convert ES6 (Babel)
  9. Babel transcoding process (configuring.babelrc, parsing syntax numbers, changing block-level variable names, etc.)

Third, algorithm part

  1. √ (hash, hash table, hash conflict)
  2. Js how to achieve a number of factorial? (Only for loop)
  3. Design an algorithm to find all pairs of random numbers that add up to the specified value √ (quicksort + two-end query/two-layer for)

6.9 Ali College offers three ways

  1. Introduce your project (medium and large applets, enterprise console, Vue CLI single page Web application, etc.)
  2. What kind of software is your small program (Campus Trading Community)
    • Ask why not sell through idle fish (solve in-building transactions)
  3. Your small program uses OpenID to log in, can you talk about the OAuth process (trusted platform issues tokens to the front-end, and the back-end processes sensitive information)?
    • Ask what advantages OAuth has (avoiding direct front-end access to sensitive information)
  4. What does your small program Websocket communication system do (real-time communication of various types of messages)
    • Ask how your real-time voice communication is done (interface authentication -> gesture state machine -> local Persistence -> Upload server -> Cache Management)
    • Ask whether the recording data returned by wechat is base64 (no, it is TMP protocol path).
    • Ask what the purpose of local persistence is for your recording (reduce server load, reduce redundant resource retransmission)
    • Asking how your local persistence works (using local storage)
    • Ask how long a speech is (tens of k to hundreds of K)
    • Ask how big is the localstorage of the applet (10-20m)
    • Ask your Websocket why it does heartbeats (to avoid communication interruptions due to network environment changes)
    • Ask how your heart beat mechanism works (timer control timeout reconnection network status monitor)
  5. Did you buy your own server (Aliyun)
  6. How do you do your CDN service?
  7. How do you do SSL (configure SSL certificate chain, asymmetric encryption)
  8. Why are you using Elastic Search
    • Ask how your Chinese word segmentation search is done (IK word segmentation)
  9. What engine does your database use (INNODB)
    • Why INNODB engine (foreign key, index type, UTF8MB4)
    • INNODB locks at table level
    • Ask if you know anything about atomicity of transactions (no)
  10. How does your single page Web application work (Vue CLI+Webpack auto-build, Vue Router routing)
  11. How is your user PASSWORD stored in the database (PASSWORD function)
    • Ask the user whether the password is encrypted during front-end transmission (SSL does not need)
  12. Have you done log-in persistence and how (set cookie expiration time)
    • Ask your server how to manage session logins (PHP automatic distribution)
    • Ask how to synchronize session data across multiple servers (database or distributed system)
    • Ask distributed how to do (hbase or ES)
    • How to use PHP to fetch data after storage
  13. Main achievements of internship in AVIC General (independent development of Web system, data console, back-end server)
    • Ask what data your console manages (products, news, jobs, resumes)
    • Did you make your WYSIWYG editor (based on summernote secondary development)
    • Ask what your asynchronous interaction and transaction store is (AJAX+PDO)
  14. What is your plan for your future development (read the source code of the framework – write your own framework – master the deep knowledge of the front and back end – master the whole software architecture)
  15. How to protect against XSS, CSRF, database injection (control front-end rendering, control back-end processing, precompilation)
  16. Explain deep and shallow copies (reference passing and value passing blablabla)
  17. How do I usually pay attention to the front-end domain knowledge (reference books, technical blogs, official documents, communication groups)

6.10 The United States and the school recruitment

  1. Tell me about your project experience
  2. Main factors affecting page loading performance √
  3. How do you do the √ of page data
    • In addition, the data can be viewed using the applets console
  4. Your wechat OAuth login how to do √
  5. How does your wechat template message do √
  6. What is the subcontracting principle of small program × (the corresponding package is loaded when the user clicks)
  7. How can front-end projects be automatically built and deployed? (Webpack + third-party plug-in automation)
  8. Parallax screen principle √
    • Do parallax with absolute and translate which good √
    • Why do you use jquery in your vUE project
  9. What methods do arrays have √
  10. What does bind receive and return √
  11. Which static resources block page rendering, how to resolve it, and what are the differences
  12. How do I access √ across domains
  13. The json principle)
  14. Principle of event proxy √
  15. What are you doing as an intern now
  16. Is overtime acceptable and the number of overtime hours acceptable
  17. Why meituan

6.11 Bytedance correction

  1. Your project experience
  2. What is the base type of js √
  3. What is the square root of a closure
  4. How to output array elements at 1 second interval √
  5. How to implement event listener √ (callback, addEventListener)
    • √ (The latter will be overwritten)
  6. Vue life cycle √
  7. BFC understand? × block-level formatting context
  8. Let me draw a box square root
    • Ask the box – sizing)
  9. Implement a three-column layout √
  10. Websocket principle)
  11. Login cookie how to save √
  12. thewww.toutiao.comtocom.toutiao.wwwSquare root

6.12 Bytedance calibration 2nd interview

  1. Tell me about your project experience
  2. What √ Composer do you use for PHP package management
  3. How is composer autoloader implemented?
  4. What is PHP fast-cgi? Concurrent management
  5. Does PHP set_cookie change the $_COOKIE array √ No
  6. What is your MYSQL Procedure for √ function interaction
  7. How to set the header field √ for cross-domain requests
  8. Vue Router Working √
  9. In what scenarios is VueX applied √
  10. Which Ajax components have been used √ Axios
  11. How does Axios implement intercept √
  12. Js two dimensional array reverse merge √
Input: [1, 2, 3, 4], 5, 6, [7, 8], 9] output: [[3, 4, 1, 2, 5, 6] [7, 8, 9]]Copy the code
  1. Js hump conversion √
Input: contentType Output: content_typeCopy the code

6.13 Three aspects of bytedance calibration

  1. Tell me about your project experience
  2. Show me your mini-program √
    • √ (10px display error in exchange for a performance boost from preloading)
    • Ask what server use √ (Ali cloud Tencent cloud are used)
    • Ask if the server operation and maintenance understand √
    • How to unlock mysql after server downtime?
    • What is the solution to the abnormal increase in CPU usage
  3. Describe your applets development process
  4. What is your websocket √
    • How does your websocket communicate
  5. How do I get messages offline
  6. Vue Router Working √
  7. Your Development Plan (Front-end Engineering – Front-end Architecture – System Architecture)
  8. Your Target Department (C-end)
  • Ask which department it is possible to go to

6.14 Second interview of netease school Recruitment

The pitfall: No headphones, the video interviewer’s voice is low, and the beginning is off the pace

  1. ××× (lazy loading, preloading)
    • Ask under what conditions preload is judged (preload with 150ms delay when clicked)
    • Are there any other cases where preloading is used (not used) are these two the most obvious ones to you ××× (serious errors, forget to mention redraw and reflux and anti-shaking and throttling, browser caching, code compression, asynchronous loading, etc.)
  2. Other aspects like building componentized split

Follow-up questions in sorting out…

6.15 Bilibili school has three aspects

6.16 Tencent school recruitment

6.17 Xiaomi school trick one side

6.18 Millet school recruiting second interview

Appendix 2: Dachang pen test questions

7.1 Tencent School admission written test

1. Decode strings

Xiao Ming and Xiao Hong use string compression to communicate. String compression rule is: if there is a continuous repeated strings such as ABCABCABC is abbreviated to [3] | ABC. Existing compressed string, design a decompression program to restore the string.

Sample:
Input: HG [3 B | | CA [2]] F output: HGBCACABCACABCACAFCopy the code
Pit:

Need to optimize memory, the reason WHY I am 87.5 is because MEMORY is out of MLE and I am thinking of rewriting it with a stack structure.

Ideas (87.5/100 points) :
 string decode(string s) {
    string res = "", ans = "";
    int len, start , end;
    int time, counting;
    time = 0, counting = 1;
    len = s.size();
    for (int i = 0; i < len; i++)
    {
        if (s[i] == '[')
        {
            start = i;
            for(i = len; s[i] ! ='] '; i--);
            end = i;
            res += decode(s.substr(start + 1, end - start - 1));
            i++;
        }
        if (counting && s[i] >= '0' && s[i] <= '9')
        {
            time = time * 10 + (s[i] - '0');
        }
        else if (s[i] == '|')
        {
            counting = 0;
        }
        else
        {
            res += s[i];
        }
    }
    char tmp = res[res.size() - 1];
    if (tmp == '\ 0')
    {
        res = res.substr(0, res.size() - 1);
    }
    if (time > 0)
    {
        for(int i = 0; i < time; i++) { ans.append(res); }}else
    {
        ans = res;
    }
    return ans;
}

int main()
{
    string s;
    cin >> s;
    cout << decode(s) << endl;
    return 0;
} 
Copy the code

2. Identify the IP

The range of known private IP addresses to determine whether an IP address is private is:

10.0.0.0-10.255.255.255 172.16.0.0-172.16.255.255 192.168.0.0-192.168.255.255 127.0.0.0/8# note! Here is a huge pit, 0/8 means the subnet mask 255.255.255.0, that is, the last 8 bits can have a dynamic range, this is a shorthand method, but Tencent did not explain its meaning, may also be a study.
Copy the code

Sample:

Input: 0.0.0.0 Output:false
Copy the code
Ideas (100/100 points) :
function isPrivate(ip){
    // TODO
    let ipVal = ip.split('. ');
    ipVal[0] = Number(ipVal[0]);
    ipVal[1] = Number(ipVal[1]);
    ipVal[2] = Number(ipVal[2]);
    ipVal[3] = Number(ipVal[3]);
    if (ipVal[0] == 10) {
        if (ipVal[1] >= 0 && ipVal[1] <= 255) {
            if (ipVal[2] >= 0 && ipVal[2] <= 255) {
                if (ipVal[3] >= 0 && ipVal[3] <= 255) {
                    return true; }}}}if (ipVal[0] == 172) {
        if (ipVal[1] >= 16 && ipVal[1] <= 31) {
            if (ipVal[2] >= 0 && ipVal[2] <= 255) {
                if (ipVal[3] >= 0 && ipVal[3] <= 255) {
                    return true; }}}}if (ipVal[0] == 192) {
        if (ipVal[1] == 168) {
            if (ipVal[2] >= 0 && ipVal[2] <= 255) {
                if (ipVal[3] >= 0 && ipVal[3] <= 255) {
                    return true; }}}}if (ipVal[0] == 127) {
        if (ipVal[1] == 0) {
            if (ipVal[2] == 0) {
                if (ipVal[3] >= 0 && ipVal[3] <= 8) {
                    return true; }}}}return false;
}
Copy the code

3. Hump conversion

Convert a variable phrase connected by – or _ or @ to a hump

Sample:
Input: content-type Output: contentTypeCopy the code
Ideas (100/100 points) :
function camel(str) {
    // TODO
    let ans = "";
    let upper = false;
    for (let index = 0; index < str.length; index++) {
        const element = str[index];
        if (element == '_' || element == The '-' || element == The '@') {
            upper = true;
        } else {
            if (upper) {
                ans += element.toUpperCase();
            } else {
                ans += element;
            }
            upper = false; }}return ans;
};
Copy the code

4. Planet Meeting

Penguin planet day N (< 200000) hours (time does not contain zero), corresponding to N time zones, when time zone 1 point 2 has two zones, and so on Each time zone have Ai people, each time zone on only in the [u, v) free time, now want to meet as many people as possible to give in the first time at the meeting

Sample:
Input: 3 2 5 6 1 3 Output: 3Copy the code
Pit:

There should be some confusion in the time zone alignment. At the beginning, I understood that the latter time zone was behind the previous time zone, but in fact, it was ahead. Every time the latter time zone was one hour ahead of the previous time zone, so there would be no major problem if we solved this problem. Another thing to think about is the time complexity, my optimization is poor, the worst complexity is O(n ^ 2/2).

Ideas (80/100 points) :
int main() {
    int n, u, v, len, pos;
    long long ans, tmp;
    cin >> n;
    vector<int> a(n, 0);
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    cin >> u >> v;
    u--;
    v--;
    len = v - u;
    pos = 0;
    if (len < n / 2)
    {
        ans = 0;
        for (int i = 0; i < n; i++)
        {
            tmp = 0;
            for (int j = 0; j < len; j++)
            {
                tmp += a[(i + j) % n];
            }
            if(tmp > ans || (tmp == ans && ((n + u - pos) % n < (n + u - pos) % n))) { ans = tmp; pos = i; }}}else
    {
        ans = INF;
        for (int i = 0; i < n; i++)
        {
            tmp = 0;
            for (int j = 0; j < n - len; j++)
            {
                tmp += a[(i + j) % n];
            }
            if (tmp < ans || (tmp == ans && ((n + u - pos) % n < (n + u - pos) % n)))
            {
                ans = tmp;
                pos = i;
            }
        }
    }
    cout << (n + u - pos) % n + 1 << endl;
    return 0;
}
Copy the code

7.2 Netease School recruitment written test

1. The greatest common divisor of a superlarge and a long integer.

The idea of the first problem is relatively simple, that is, toss and turn division, use string to store large numbers, and then divide by section

Division by tossing and turning:

If there are two positive integers p1 and p2, where p1 is greater than p2, then there must be two natural numbers k and b such that p1 is equal to k times p2. If the greatest common divisor of P1 and p2 is p3, then the greatest common divisor of p2 and b is p3. For example GCB (55, 30) = GCB (25, 30) = GCB (25, 5)

2. The minimum value of the maximum value in a subsequence of length 1 to n in an array.

In an array with a maximum length of 200,000, find the minimum of the maximum value in a subsequence of length from 1 to n

Sample:
Input: 6 1 8 7 5 4 2 Output: 1 4 5 7 8 8 8Copy the code

In simple terms, you divide an array into consecutive subsequences, starting with the subsequence of length 1, and finding the maximum value of each subsequence after each subsequence, and then finding the minimum value of all these maxima, all the way to the subsequence of length N (the sequence itself).

This question puzzled me at the beginning. In fact, it was just a standard DP question. However, the last question I did was written after the exam. The written test is basically in accordance with the worst answer order, estimated kneeling.

The state transition equation can be thought of as follows:

Let dp[j][I] be the maximum number of subsequences of length I starting from the JTH digit of the array, when I =0, dp[j][0] = num[j], starting from I =1, The length of dp[j][I] is equal to MAX(dp[j][i-1], dp[j+1][i-1]), which is the maximum of the two adjacent subsequences of length i-1.

This problem requires the minimum value of all the maximum values under the same partition length, so when calculating dp array, we need to calculate whether this value is the minimum value of the current partition length, so define a min array, length 100000, first initialize to the maximum value, each time calculating dp[j][I] compare with min[I] which value is smaller, One trip down and you get the minimum.

Ideas:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <algorithm>
#define MAX(x,y) ((x) > (y) ? (x) : (y))
#define INF 0x7FFFFFFF
using namespace std;
int num[100000] = { 0 };
int (*dp)[100000];
int main()
{
	int n;
	int min[100000] = { 0 };
	scanf("%d", &n);
	dp = (int (*)[100000])malloc(n * 100000 * sizeof(int));
	for (int i = 0; i < n; i++)
	{
		scanf("%d", &num[i]);
		min[i] = INF;
	}
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n - i; j++)
		{
			if (i == 0)
			{
				dp[j][0] = num[j];
			}
			else
			{
				dp[j][i] = MAX(dp[j][i - 1], dp[j + 1][i - 1]);
			}
			if(dp[j][i] < min[i]) { min[i] = dp[j][i]; } i = i; }}for (int i = 0; i < n; i++)
	{
		if (i>0)
		{
			printf("");
		}
		printf("%d", min[i]);
	}
	printf("\n");
	return 0;
}
Copy the code

3. Parity swaps

In an array, odd and even are interchangeable, find the array sequence with the smallest lexicographical order after any interchangeability.

Personal thoughts: No great ideas

4. Subtract one from the array

Given an array of length M (<=100000), enter N(<=100000) integers, subtract all elements in the array greater than or equal to that integer by one at a time, and print out how many elements changed, requiring a time performance of less than 1s.

Personal thoughts:

70% of the results were TLE with binary search results. After analysis, it was found that the operation of subtraction was too time-consuming (O(n^2) complexity) to traverse the number group. Later, we considered using an array to store the updated subscript boundary position to bypass the traversal of the subtraction link, but it was not finished.

Dji college recruitment written examination

1. Play a game

Given the summer vacation time X days (<=1000), N games (<=11), the next N lines are given the number of days each game will take (Ai), and the achievement points (Bi) for completing the game, finding: the highest achievement points that can be achieved in X days of summer vacation.

Personal thoughts:
#include <iostream>
#include <vector>
#include <cassert>
#include <algorithm>using namespace std; Class Knapsack01 {private: vector<vector<int>> Memo; Int bestValue(const vector<int> &w, const vector<int> &v, int index, int c) {if (c <= 0 || index < 0)
            return 0;
 
        if (memo[index][c] != -1)
            return memo[index][c];
 
        int res = bestValue(w, v, index - 1, c);
        if (c >= w[index])
            res = max(res, v[index] + bestValue(w, v, index - 1, c - w[index]));
        memo[index][c] = res;
        return res;
    }
 
public:
    int knapsack01(const vector<int> &w, const vector<int> &v, int C) {
        assert(w.size() == v.size() && C >= 0);
        int n = w.size();
        if (n == 0 || C == 0)
            return 0;
 
        memo.clear();
        for (int i = 0; i < n; i++)
            memo.push_back(vector<int>(C + 1, -1));
        returnbestValue(w, v, n - 1, C); }}; intmain() {// X is the number of summer days, N is the number of games int X, N; cin >> X >> N; int w, v; // vs stores value (achievement points) // WS stores weight per item (days)for (int i = 0; i < N; i++) {
        cin >> w >> v;
        vs.push_back(v);
        ws.push_back(w);
    }
 
    cout << Knapsack01().knapsack01(ws, vs, X) << endl;
 
    return 0;
}
Copy the code

PS. I wrote full backpack, which is actually 01 backpack, which is only 50% correct.

2. Input instructions:

Input the instruction set length M and the instruction operation length N, then input the mapping relation of M instructions (string)= “instruction value (string), then input N instructions randomly, and ask to output the corresponding instruction value.

Personal thoughts:

The simplest use of c++ map container, but forget to write map, delay a lot of time, super regret.

#include <iostream>
#include <string>
#include <map>
using namespace std;

int main()
{
	map<string, string> ops;
	int x, y;
	cin >> x >> y;
	for (int i = 0; i < x; i++)
	{
		string a, b;
		cin >> a >> b;
		ops[a] = b;
	}
	for(int i = 0; i < y; i++) { string op; cin >> op; cout << ops[op] << endl; }}Copy the code

3. Buy fruits

Given N yuan, M kinds of fruits, the price Pi of each fruit, among which X kinds of fruits are particularly liked, given the order of different fruits like, and asked that the number of fruits at the top of the order should not be less than that at the bottom, calculate all the possibility of spending money, the result is modeled 10000007.

Personal thoughts:

Kneel down…

7.4 Bytedance enrollment written test

1. School alarm clock O(nlogn)

Xiao Ming set n alarm clocks, he can only set off to school when the alarm clock rings, each alarm clock time is hi point MI, Xiao Ming’s home to school takes X minutes, school class time a point B (0-24 hours, 0-59 minutes), ask him the latest time to get up

Input: 3 // How many alarm clocks are set 5 0 // Hours and minutes of the first alarm clock 6 0 // Hours and minutes of the second alarm clock 7 0 // Hours and minutes of the third alarm clock 59 // How many minutes does it take to get to school 6 59 // Hours and minutes of the class output: 60 // Latest wake-up timeCopy the code
Ideas (80/100 points) :

Pure mentally retarded mentality, custom structure storage alarm clock time, after all the input for the alarm clock time from late early sorting, then traverse the alarm time back once upon a time, calculated from the current moment to school’s time, the output of the first to reach the school, because the algorithm is very poor, apparently stuck boundary, have no time to tube directly see next question.

Code:
struct Time
{
    int h;
    int m;
    friend bool operator < (Time a, TIme b){
        if(a.h == b.h){
            return a.m > b.m;
        }
        return a.h > b.h;
    }
}
int main()
{
	int n, x, a, b, rest;
	cin >> n;
	Time* time = (Time*)malloc(n * sizeof(Time));
	for (int i = 0; i < n; i++)
	{
		cin >> time[i].h >> time[i].m;
	}
	sort(time, time + n);
	cin >> x;
	cin >> a >> b;
	for (int i = 0; i < n; i++)
	{
		rest = 0;
		if (time[i].h < a || time[i].h == a && time[i].m < b)
		{
			rest = (a - time[i].h) * 60 + b - time[i].m;
			if (rest >= x)
			{
				cout << time[i].h << ' ' << time[i].m << endl;
				break; }}}return 0;
}
Copy the code

2. Encrypted communication O(n)

Xiao Ming and Xiao Hong use password encryption communication, each communication has a fixed plaintext length N and encryption times K. For example, if the cipher binary plaintext is 1001010 and the encryption times is 4, the cipher text is moved 1 bit to the right to perform xOR operations with the plaintext each time, and the total displacement is 3 times (k=4, so k-1 = 3).

Input: 7 4 // n k 1110100110 // Ciphertext output: 1001010 // Plaintext explanation: 1001010--- -1001010-- --1001010- ---1001010Copy the code

The number of encryption times is 4. Therefore, if the plaintext moves 4-1 to the right =3 rounds, each round performs an XOR with the current ciphertext. Therefore, 1001010 corresponds to 1110100110

Ideas (100/100 points) :

A standard different or mathematical problem, do not know how to classify, have a little take an examination of the feeling of mathematics, see a few eyes can see the law directly on the code

Here’s a quick idea:

First of all, ciphertext is the same as the first bit of plaintext, as explained in the above example. Then considering bits 2 through K-1, you can see that each bit of this paragraph is obtained by xOR of the ciphertext of the previous bit and xor of the plaintext of the current bit.

Then consider the k-th to n-1 bits, and observe the rule that each bit of this paragraph is obtained from the result of the previous ciphertext and the i-k bit plaintext xor and the current bit plaintext xor. How to eliminate the xor effect we should be able to understand, so as long as the part of the xor and ciphertext xor can get clear text.

int main() {
	int n, k, tmp;
	string s,ans="";
	cin >> n >> k;
	cin >> s;
	ans += s[0];
	for (int i = 1; i < k; i++)
	{
		tmp = (int)(s[i] - '0') ^ (int)(s[i - 1] - '0');
		ans += tmp + '0';
	}
	for (int i = k; i < n; i++)
	{
		ans += (int)(s[i] - '0') ^ (int)(s[i - 1] - '0') ^ (int)(ans[i - k] - '0') + '0';
	}
	cout << ans;
	return 0;
}
Copy the code

3. Salary O(n)

Wang hammer for staff salary, staff sat in a row from left to right, each staff know each other’s qualifications, each employee know about their employees’ wages, an employee old than the people in the left or right, that he must be higher than the man pay 100 yuan, everyone in the minimum wage of 100 yuan, the king a sledgehammer minimum how much to pay.

The sample
Input: 4 // Several employees 3 9 2 7 // Employee order and corresponding seniority output: 600 //100 yuan, 200 yuan, 100 yuan, 200 yuan 6 1 2 3 4 5 6 2100 //100, 200, 300, 400, 500, 600 5 1 1 1 1 1 500 //100, 100, 100, 100, 100, 100, 100 100 8 12 3 4 3 2 3 4 1800 //100 200 300 400 200 100 200 300 8 3 4 3 4 3 4 1200 //100 200 100 200 100 200 200 200 200 200 5 1 2 3 4 1 1100 //100 200 300 400 500Copy the code
Ideas (100/100 points) :

Breadth-first search, the employee sequence can be regarded as a multi-root tree, each employee with the lowest salary is the root node, and the salary of an employee is actually his depth in the multi-root tree.

Firstly, when inputting, find the employee whose seniority is younger than that of the employee, pop one employee from the queue every time, then judge the minimum salary of the employee, and then judge whether the employee can join the queue until all the employees leave the queue

int main() {
	int n, now;
	long long ans = 0;
	cin >> n;
	if (n == 0)
	{
		cout << 0 << endl;
		return 0;
	}
	vector<int> epy(n, 0), depth(n, 0);
	queue<int> sal;
	for (int i = 0; i < n; i++)
	{
		cin >> epy[i];
		if(i > 1 && epy[i - 1] <= epy[i - 2] && epy[i - 1] <= epy[i]) { depth[i - 1] = 1; sal.push(i - 1); }}if (epy[0] <= epy[1])
	{
		depth[0] = 1;
		sal.push(0);
	}
	if (epy[n - 1] <= epy[n - 2])
	{
		depth[n - 1] = 1;
		sal.push(n - 1);
	}
	while(! sal.empty()) { now = sal.front(); int left = (now > 0 && epy[now-1] < epy[now]) ? depth[now - 1] : 0; int right = (now < n - 1 && epy[now + 1] < epy[now]) ? depth[now + 1] : 0; sal.pop();if (depth[now] == 0)
		{
			depth[now] = max(left, right) + 1;
		}
		//left
		if(now > 0 && depth[now - 1] == 0 && (now == 1 || epy[now - 2] > epy[now - 1] || depth[now - 2] > 0)) { sal.push(now - 1);  } //rightif(now < n - 1 && (depth[now + 1] == 0) && (now == n - 2 || epy[now + 2] > epy[now + 1] || depth[now + 2] > 0)) { sal.push(now + 1); }}for (auto salary : depth) {
		ans += salary;
	}
	cout << ans * 100 << endl;
}
Copy the code