According to Battlefront, this year’s Facebook interview was ridiculously difficult: it started with two hard questions and took about 10 minutes to copy the answers. If you want to spell an acting, first use violence to solve and then optimize, it is too late.
Let’s take a look at the FB original question of countless people 👇
Design a data structure for the least-Recently-used (LRU) cache policy that should support the following operations: fetching data and writing data.
Get (key) Retrieves data: If a key exists in the cache, it retrieves its data value (usually positive), otherwise -1 is returned.
Set (key, value) Writes data: Writes the value of the key if it is not already in the cache. When the cache is maxed out, it should delete the least recently used data to make free space before writing new data.
Finally, you need to return the data for each get.
This question has been emphasized by linghu Chong, the former senior interviewer of FB, in “Nine Chapters Algorithm Class 2020”.
Through LRU, you can verify the interviewees’ ability of data structure design, linked list operation and sub-function. Even if you have done the original question, you can also ask lots of follow-up questions to test the interviewees’ understanding of data structure.
These 100 questions are enough to prepare for the interview!
Now it is autumn recruitment, everyone’s time is very tight, if according to the conventional method to brush questions, time is certainly not enough!
Therefore, ** “nine Chapter Algorithm class 2020 edition” ** selected 100 of the most representative interview questions, each question is equivalent to biting 3-5 similar questions, you brush 100, better than others brush 300!
If the algorithm is written correctly, be careful about the Coding QualityÂ
Even if the questions are right, the interview may still be a nightmare, and the quality of your code is a key factor in the interview evaluation.
** Because the more senior the interviewer is, the more they care about the quality of your code. ** If the code is poor, the interviewer might even say No Hire.
Linghu teacher emphasized repeatedly in the algorithm class of chapter 9 that the code can not be written to pass the interview. Good Coding Quality must be demonstrated in the interview, otherwise it will be easy to GG. Good code quality is a basic requirement in order to get a “Hire” and “Strong” review from a big company interview.
Therefore, Mr. Ling Hu summed up 12 skills to improve Coding Quality quickly, which will be explained in depth in the audition class!
(1) Coding Style
• Binary operators surrounded by Spaces, unit operators without Spaces • curly braces and for, Spaces between if (Java), Spaces between parentheses and if • Empty lines separating different logical blocks • commas followed by Spaces
(2) the Readability
• Use 1-2 word names for function and variable names • Ensure that no more than 3 levels of indention are inside a function • Use subfunctions to reduce the amount of code in entry functions • Use more continue and less if
(3) the Bug Free
• When accessing a subscript, make sure that the subscript is not out of bounds • When accessing an object property or method, make sure that the object is not empty • Use global variables
Teacher Linghu’s liver was upgraded, and the course capacity was increased by 5 times
In order to deal with the autumn admission, Miss Linghu has been busy for a month, expanding the course from 9 chapters to 43 chapters (18 hours of live courses and 34 hours of interactive courses), and combining with this year’s dachang high frequency interview questions, the goal is to help students rush for dachang offer within one month.
As the first and most classic course of Nine Chapters Algorithm, ** “Nine Chapters Algorithm Class 2020 edition” ** has always enjoyed a good reputation. If you want to sprint for written algorithm in a short time, or want to further consolidate your algorithm foundation, you must not miss this course!
Poke me to try the first three classes for free