From martial arts novels to programmer interviews

From martial arts novels to programmer interviews

[[140576]]

summary

Inspired by The Sword Stained with Royal Flowers and The Legend of the Condor Heroes, this article uses characters and events in martial arts novels to analogize and analyze the shortcomings of current programmer interviews, and attempts to provide a better programmer interview solution.

You may think I'm talking nonsense. How can programmer interviews and Huanhua Xijianlu be related? But they are indeed related, and it's an interesting relationship:

Two stories

Gu Long's mid-term work "The Sword Stained with Royal Flowers" tells a story like this: A man in white from Japan, in pursuit of martial arts, traveled across the ocean to the Central Plains to challenge various masters, killing anyone he saw and even a Buddha. It was not until the Central Plains' top master, Marquis Ziyi, took action that he narrowly defeated the man in white with one move, but Marquis Ziyi was also seriously injured and died soon after. Marquis Ziyi's descendant (the protagonist) learned peerless martial arts under the guidance of his senior brother Marquis Ziyi and through various adventures, and defeated the man in white when he visited the Central Plains for the second time.

Compared to the Chu Liuxiang series and the Lu Xiaofeng series, the storyline of The Sword Washing with Huanhua is not outstanding, but I find it very interesting that the white-robed man challenges all the masters when he first arrives in the Central Plains - a piece of dead branch:

The white-robed man showed disdain in his eyes, and suddenly took a few steps back. With a flash of sword light, he immediately sheathed the sword, drew the sword, swung the sword, and thrust the sword. The three actions were completed in the blink of an eye. When the eight disciples of Qingping Sect looked closely, he had a dead branch in his hand. It turned out that he had cut off the dead branch when he drew the sword just now.

He just said slowly: "Take it and show it to your master!" Then he turned and walked away, sitting on a blue stone under the tree, without saying a word or moving, as if he had entered a state of meditation.

The Qingping Sect disciples present did not realize the specialness of this dead branch, but their master was shocked by it:

Bai Sankong frowned, took the dead branch, glanced at it casually at first, and then his eyes suddenly fixed on the cut of the dead branch, and he was stunned.

Later, Hu Buchou, a disciple of Qingping Sect, managed to send this dead branch to Zi Yi Hou, a famous martial arts master in Central Plains, in order to encourage him to save the Central Plains martial arts world. Zi Yi Hou had a high opinion of himself all his life, but he was also impressed by this dead branch:

No one knew what was so beautiful about the dead branch, and why Marquis Zi Yi was so absorbed in looking at it. After three or four cups of tea, Marquis Zi Yi finally sighed and said, "What a brilliant sword technique! What a fast sword technique! What a profound sword technique..."

Others did not understand why a dead branch was so beautiful, and Zi Yi Hou explained that it was because your skills were not good enough:

Ling'er couldn't help but ask, "Could it be that the Marquis can tell the level of that person's swordsmanship just by looking at this dead branch?"

Purple-Robed Marquis said, "That's right!"

Ling'er asked, "How did you know that?"

Purple-Robed Marquis sighed and said, "Your swordsmanship has reached my level of attainment, as you can tell from the cut of this dead branch. Otherwise, even if I explain it to you for three days and three nights, you still won't understand."

Ling'er was stunned for a moment, then smiled bitterly and said, "It looks like I will never understand it in my lifetime."

Then the Purple-Robed Marquis stabbed the man in seven major acupuncture points with a sword, and sent this man to the White-Robed Man as a declaration of war:

The man in white asked, "What kind of declaration of war is this?" Although he could remain calm no matter what surprising things he saw, he couldn't help but reveal surprise in his voice.

Wang Banxia opened his hands and tore open Cen Zou's clothes. He saw seven sword marks on his shoulders and chest. The wounds had already scarred. At first glance, they were no different from ordinary scars, but these sword marks were on the Jianjing and Ruquan acupoints. They were vertical and horizontal, and the paths were clear. There was a faint red line between the sword marks. A closer look showed that it was also drawn by the sword. The man in white did not wait for Wang Banxia to speak. His eyes were immediately attracted by the sword marks. He began to move and walked towards Cen Zou step by step.

Similarly, others couldn't understand what was so special about the scar, but the man in white was extremely excited:

The man in white no longer looked at him, and swung his sword, the tip of the sword pointing to the sky, trembling slightly. The man in white also trembled slightly, and said to the sky: "The sky and the earth are infinite, and finally there is someone who can be my opponent..." Suddenly he bowed his head and knelt, his long hair scattered, as if he was grateful to the heaven for finally giving him an opponent, and seemed to admire the ability of the heaven to create a hero who could be his opponent!

Another story comes from the part in Jin Yong's The Legend of the Condor Heroes where Guo Jing and Huang Rong go to Lujia Village. Qiu Qianzhang (but everyone thinks he is Qiu Qianren) uses "unique skills" such as smoke coming out of his mouth and crushing bricks with his bare hands to make everyone think that he has extraordinary martial arts skills:

Smoke coming out of mouth

Manor Master Lu was afraid that if he didn't go, this girl would get angry and would definitely alarm Qiu Qianren, so he ordered the farmhand to walk lightly and help him over. He leaned over to look at the window paper and peeked inside through the small hole made by Huang Rong. He was surprised to see Qiu Qianren sitting cross-legged with his eyes slightly closed, and wisps of smoke were blowing out of his mouth continuously.

Brick rolling with meat palm

Qiu Qianren stood up and walked to the courtyard. When he returned to his seat, he held a brick in each hand. He didn't use much strength in his hands, but heard a continuous crackling sound. The two bricks broke into small pieces. After squeezing them for a while, the broken pieces turned into powder and fell on the table. The four people at the table were all shocked.

But "unique skills" are not real skills. Even Guo Jing, who was just starting out at the time, could send Qiu Qianzhang flying with one palm strike:

Qiu Qianren saw his left arm sweeping towards him, but he said "Take my palm" and thought to himself: "Who doesn't know that you have a set of fists in your arms?" He crossed his arms and hit his left arm. However, Guo Jing's move "Dragon Fighting in the Wild" was a very mysterious skill among the Eighteen Palms of the Dragon Subduing. The left arm and the right palm can be real or virtual, and there is no limit to the style. Seeing the enemy blocking his left arm, he suddenly raised his right palm, and with a bang, it hit his right arm and chest. Qiu Qianren's body flew out of the door like a kite with a broken string.

Later, everyone discovered that this "Qiu Qianren" was a fake: the green smoke coming out of his mouth was from burning grass hidden in his sleeves, inhaling and exhaling; the bricks he ground with his bare hands were made of flour; and his light skill of floating on water was from having hidden stakes driven in advance under the water.

Programmer Interview

You may wonder what these two stories have to do with programmer interviews. Let’s take the man in white as an example:

  1. Practicing unique martial arts in Japan (studying techniques hard at school);
  2. Go to Central Plains to challenge the heroes (will graduate and start job hunting soon);
  3. Drawing the Sword and Cutting the Dead Branches (Writing a Resume for an Interview);
  4. Alarmed the Central Plains *** master (resume/interview was appreciated);
  5. The decisive battle at sea became famous all over the world (get an offer and get a job).

At this point, you probably know why I mentioned Qiu Qianzhang, a slightly funny character in Jin Yong's novels. For programmers, this would probably be a person who has a gorgeous resume, is very talkative during interviews, can answer some common interview questions very fluently (because he has brushed the question bank), but makes a lot of mistakes when actually working.

There is no doubt that no company wants to recruit a "master" like Qiu Qianzhang, while a real master like the man in white is what every company dreams of. So the question is - how to identify a person who is a real master like the man in white, rather than a "master" like Qiu Qianzhang?

You will never understand

There is such a detail in Huanhua Xijianlu:

Ling'er couldn't help but ask, "Could it be that the Marquis can tell the level of that person's swordsmanship just by looking at this dead branch?"

Purple-Robed Marquis said, "That's right!"

Ling'er asked, "How did you know that?"

Purple-Robed Marquis sighed and said, "Your swordsmanship has reached my level of attainment, as you can tell from the cut of this dead branch. Otherwise, even if I explain it to you for three days and three nights, you still won't understand."

Ling'er was stunned for a moment, then smiled bitterly and said, "It looks like I will never understand it in my lifetime."

As far as I know, some companies leave the decision of programmer recruitment to HR, which is undoubtedly the stupidest decision - HR and headhunters can determine the background of programmers and infer the ability of programmers through the previous experience of job seekers, but just like a bell cannot see the mystery of a dead branch, HR and headhunters cannot identify the ability of programmers (unless they were also excellent programmers in the past). The work of identifying programmers' abilities is best left to programmers. And excellent programmers often need at least equally excellent programmers to discover them.

But even if programmers themselves go to interview programmers, there are still problems, just like Qiu Qianzhang fooling the heroes in The Legend of the Condor Heroes.

Light Kung Fu Water Floating

In The Legend of the Condor Heroes, Qiu Qianzhang "performed" such "unique skills" as floating on water, smoking from his mouth, scratching wine glasses with his fingers, and crushing bricks with his bare palms. No one present (including masters like Lu Guanying) could figure out what they were doing. If it weren't for the idiot Guo Jing who foolishly rushed up to show him how to do it, I'm afraid everyone would have been fooled further.

Back to programmer interviews, most written test/interview questions can be found online, and some companies even search for questions online to save time when recruiting, which makes the seemingly high threshold for programmer interviews actually very low - getting a decent job does not require one or two years of systematic computer technology learning, but only one or two months of practicing questions on leetcode, CareerCup, and Weiming job search boards. The algorithm questions that were originally very discriminating have become worthless - who knows whether you came up with it yourself or memorized it. Just like floating on water with light kung fu, who knows whether you are really skilled or have planted hidden stakes under the water in advance.

Therefore, algorithm questions are a very embarrassing existence - in order to test the level of programmers, it is impossible not to test algorithm questions, but once algorithm questions are tested, job seekers can answer them by memorizing them, making the test meaningless. The interviewer will then find more difficult questions, but the number of interview questions cannot be compared with the number of job seekers, so the interviewer will still fall into this vicious cycle of setting questions and memorizing questions. The direct consequence of this vicious cycle is that the company recruits a lot of "Qiu Qianzhang", while some programmers with good level but who did not memorize questions are rejected.

Is there no solution? I don’t think so. Let’s go back to the dead branch in The Sword Washing and the Flowers:

#p#

Dead Branches

In The Sword Washing and Huanhua, the man in white traveled to the Central Plains to challenge the heroes. He did not perform any fancy "stunts" such as floating on water or smoking, but simply cut off a dead branch as a declaration of war. This dead branch, which seemed ordinary to everyone, shocked the most powerful master in the Central Plains, Zi Yi Hou:

No one knew what was so beautiful about the dead branch, and why Marquis Zi Yi was so absorbed in looking at it. After three or four cups of tea, Marquis Zi Yi finally sighed and said, "What a brilliant sword technique! What a fast sword technique! What a profound sword technique..."

A heavy sword has no edge, and great skill is not perfect. The same is true for programming. Programming ability does not necessarily need to be demonstrated through complex algorithms. Programmer interviews need to examine depth, which refers to the programmer's understanding of programming and programming languages, as well as the insights gained from years of programming experience.

This is still a bit cryptic, so let me give you an example:

I'm afraid this question will be the easiest interview question you have ever seen - use C language to convert letters into uppercase, and you cannot use library functions.

So many interviewers' first reaction when hearing this question is:

[[140579]]

But I'm not kidding, try writing an uppercase conversion in C and then continue reading this article.

What’s more interesting is that some interviewees gave answers similar to this:

  1. #include int main() {
  2. char c = 'a' ;
  3. printf( "The uppercase letter of a is %c\n" , c - 32 );
  4. return   0 ;
  5. }

In fact, if it is written like this, there is no need to ask further questions–_–#

Of course, many interviewers are still quite reliable:

  1. char daxie( char c) {
  2. return c - 32 ;
  3. }

At this time, I would advise the interviewee not to use pinyin naming, and would prompt what would happen if the input letter is not lowercase. Generally speaking, the interviewee will introduce range checks at this time, but some people will write like this:

  1. char to_upper( char c) {
  2. if (c >= 'a' && c <= 'z' ) {
  3. return c - 32 ;
  4. } else {
  5. printf( 'Input error!' );
  6. return   0 ;
  7. }
  8. }

If it is written like this, there is no need to ask further (I personally suspect that you learned C from watching Tan Haoqiang) –_–#

The relatively reliable interviewees will give such answers:

  1. char to_upper( char c) {
  2. if (c >= 'a' && c <= 'z' ) {
  3. return c - 32 ;
  4. }
  5. return c;
  6. }

This is very close to my passing requirement. Next, I will ask the interviewee if they can improve its readability. Some interviewees will play around with naming (for example, renaming parameter c to input):

  1. char to_upper( char input) {
  2. int offset = 32 ;
  3. if (input >= 'a' && input <= 'z' ) {
  4. return input - offset;
  5. }
  6. return input;
  7. }

At this point I will ask if I can remove the weird 32. Generally speaking, interviewees who can get to this point can react:

  1. char to_upper( char input) {
  2. if (input >= 'a' && input <= 'z' ) {
  3. return input - 'a' + 'A' ;
  4. }
  5. return input;
  6. }

This is my passing requirement. I usually prompt the interviewee to see if they can continue to improve readability, but unfortunately, no interviewee has been able to give me a satisfactory answer at this step:

  1. char to_upper( char input) {
  2. if ( 'a' <= input && input <= 'z' ) {
  3. return input - 'a' + 'A' ;
  4. }
  5. return input;
  6. }

In fact, it is to use 'a' <= input && input <= input="">= 'a' && input <= 'z' - this technique comes from the code book, which has a special section on how to write readable Boolean expressions. From this, I can see that these interviewees have not read the code book. Considering that the code book is almost a must-read book for programming, I can infer that these interviewees probably don't have the habit of reading, and programmers who don't read are generally not very good.

As mentioned earlier, this step is just a passing grade (if you can write a readable Boolean expression, I will give you an excellent score in advance). Next, I will ask if the performance can be further improved. A few interviewees will think of using arrays when prompted:

  1. char to_upper( char input) {
  2. static   char convert_table[] = { ... };
  3. return convert_table[input];
  4. }

10 points if the candidate mentions that he learned this trick from the C standard library :–)

Some interviewers may think of using macros:

  1. static   char convert_table[] = {...};
  2. #define TO_UPPER(input) convert_table[input]

At this point I would ask about the pros and cons of macros, and whether there would be mistakes in using macros here. In short, I want to make sure that the interviewee really understands macros, and not just memorized an answer from somewhere (such as an interview book like The Beauty of Programming).

Some interviewers will directly give the best solution using arrays + macros at the beginning (I can almost be sure that he has memorized the question), then I will ask him to give a function + non-array implementation. If he can't write this function well, he still won't pass.

You may think that this is the end, but it is not. Consider the EOF (i.e. -1) of C language and the application scenario of to_upper. What problems will occur in the following code?

  1. char c = to_upper(getchar());

If getchar() returns EOF, since to_upper receives a char, if the system's char is unsigned, there will be a conversion problem, which is why the toupper function signature in the C standard library (ctype.h) is int toupper(int c) rather than char toupper(char c).

Next, let's review what this simple question examines:

  1. The concept of a function (rather than writing it in main);
  2. Indentation and naming (rather than phonetic);
  3. Use readable literals ('a' - 'A' instead of 32);
  4. API design (what should to_upper return when it receives a non-lowercase character? 0? Error? Or return the original value? Considering that the application scenario of to_upper is to convert lowercase letters in a string to uppercase, returning the original value is obviously more reasonable);
  5. Do you have a reading habit? (At least it can show whether you have read the code seriously.)
  6. Have you read the C standard library source code (point out the source of toupper array implementation);
  7. Working with arrays (using conversion tables);
  8. Understand macros and the dangers of macros (use macros);
  9. Have you memorized this question (give the best solution using array + macro in the best time);
  10. EOF and C standard library style.

Next, I will ask the interviewee to test this function and provide the test code, which I will not go into details here.

This question is very much like the dead branch in Huanhua Xijianlu - it looks very simple, but it is actually not - everyone can carve a branch, but how it is cut is another matter; every programmer can write uppercase and lowercase conversion, but to what extent is another matter.

I think this kind of question is the best for programmer interviews:

  1. It seems very simple, but it is very difficult to do well;
  2. It can reveal many problems - for example, the question of converting uppercase and lowercase letters reveals at least 10 of them.
  3. Unlike complex algorithm questions, it will not make the interviewer stuck (or unable to start), thus avoiding some programmers with good level of experience from being mistakenly rejected;
  4. There is no standard answer - so even if the interviewer posts the question on the Internet, it will not have any impact, because the interviewer's evaluation criteria are not transparent to the interviewee;
  5. Memorizing questions is ineffective - thus ensuring that test-taking programmers like "Qiu Qianzhang" will not be recruited;

Some people may ask, if there are so many benefits, why do these companies still use complex algorithm questions as interview questions?

My answer is to exclude the blind worship of algorithms, because such questions are very difficult to come up with, and the requirements for interviewers are very high, so most interviewers choose to search for questions online instead of coming up with questions themselves. Little do they know that this shortcut is the source of failed talent recruitment - excellent programmers are rejected because they did not memorize the questions, while mediocre "Qiu Qianzhang" are hired because they have memorized the questions. These hired "Qiu Qianzhang" will use the same method to recruit the next batch of even worse "Qiu Qianzhang", which is extremely ironic.

in conclusion

  1. The decision on programmer recruitment should be in the hands of programmers, not HR;
  2. Good programmers often need programmers at least as good to discover;
  3. Complex algorithm questions are a terrible way to test programmers;
  4. Interviewers should come up with their own questions instead of searching for ready-made questions online;
  5. Interviewers (and companies) should invest a lot of time in programmer interview questions to eliminate fakes and ensure the quality of recruitment.

above.

<<:  【Practical】Basic knowledge you should know about game IP

>>:  Microsoft CEO: If OEMs don't make Lumia phones, we'll do it ourselves

Recommend

From Weibo to Toutiao to Zhihu, where are the three content giants going?

Weibo's market value today has reached 10 bil...

Hua Luogeng: There is a way to become a self-taught person

November 12th is the 111th birthday of Hua Luogen...

"I am an asymptomatic infected person, and my experience may help many people"

What would you do if the nucleic acid test result...

Live streaming + marketing, far more than just Wei Ya and Li Jiaqi

"At link No. 39, (everyone) remember to leav...

Source Code|Cloud Tags

Source code introduction: cloud tag deletion, add...

Is Print Media Really Over? The Death of Computerworld…

At the end of this month, a new paper media will a...

Strategy for building a massive Qianchuan investment plan!

1. What is Juliang Qianchuan ? Bytedance Qianchua...