Java programmers, written test required

Source: Internet
Author: User

☆★☆★Come on !! October 25 reader meeting ☆★☆★

 

Written by Tsinghua University Press Java programmer at work: bell: 1.2.3:
We have learned the interview skills for meeting people with different roles. Next we will talk about a more frequent "Written Examination" approach for programmers ".
The "written test" is a key level for junior programmers, and it is also the most likely option to be flushed. During an interview, most programmers will not be able to enter the next stage due to the absence of the "written test, only a few programmers have the opportunity to meet the Examiner.
As a beginner programmer, we should be well prepared for the technology. This part of work may take a lot of time to prepare.
How to prepare?
In other words, you should at least read this book, because in addition to "skills", "skills" are more important.

1.2.3.1 purpose of the written examination
(1) To prevent interviews by persons without practical development experience or development skills, you can filter out a group of persons through the "Written Examination;
(2) Evaluate the knowledge proficiency and the ways of thinking in the face of problems. 1.2.3.2 misunderstandings in the written examination, which should be avoided during the written examination
(1) If one question does not exist, the entire test will be abandoned.
Maybe you think this question is difficult, and other competitors will find it difficult.
(2) fail to see the answer in a hurry
This is not an entrance exam. If no one gives you time, you don't have to be in a hurry. You can answer questions at a normal speed.
(3) If the answer is incomplete, the answer is blank.
This is not the same as taking an exam at school. If you cannot give a complete answer, you 'd better write down your ideas, or write what you want to say to the examiner. Sometimes he will give you a chance.
(4) Some conceptual problems that are unclear should be solved with other concepts that are also not clear"
Some concepts are not clear at first, so don't take another question that you don't know as an example. In this way, the examiner may laugh and laugh, but these concepts are not clear at all.
(5) There is no passing 60 points in the written examination.
The "test" for your position is totally different from the "test" for our school. There are no "pass" or "fail" questions. Maybe you have a wonderful answer to a certain question, however, the total score is not ideal and will be hired. 1.2.3.3 test skillsI have selected a few pen-level questions, and I have given some tests to the new programmers. Let's look at how to answer them. Let's look at what needs to be paid attention to. The questions are as follows: 1.2.3.3.1 Example 1: What is the purpose of this program? What is the returned result?Public station (URL Urla ){
Try
{
String A = "", B = "";
Inputstream ins = Urla. openstream ();
Bufferedreader breader = new bufferedreader (New inputstreamreader (INS ));
String info = breader. Readline ();
Int I = 1;
Info = breader. Readline ();
While (info! = NULL ){
A = info. substring (0, info. indexof ("@"));
B = info. substring (info. indexof ("@") + 1, info. Length (); if (I = 1 ){
This. X1 = integer. parseint ();
This. Y1 = integer. parseint (B );
} If (I = 2 ){
This. X2 = integer. parseint ();
This. y2 = integer. parseint (B );
}
If (I = 3 ){
This. X3 = integer. parseint ();
This. Y3 = integer. parseint (B );
}
If (I = 4 ){
This. X4 = integer. parseint ();
This. Y4 = integer. parseint (B );
}
I ++;
Info = breader. Readline ();
}
}
Catch (malformedurlexception e ){
System. Out. println (E );
}
Catch (ioexception e ){
System. Out. println (E );
}
} Explanation:
Second, what is the returned value?
Some people always reply directly and say "no return value", which means they have not figured out the declaration of the constructor. If a common function does not return a value, use "Void" instead of writing nothing. First, what is the purpose of this program?
This program does not quite understand at first glance. In fact, it is examining the imagination and comprehension ability of candidates. At first glance, this program should know that this is a constructor, there are four pairs of variables starting with "x" and "y" in this constructor, which directly associates with coordinates. In addition, the constructor name is station, it indicates that the class name is station. Therefore, we can imagine that this is indeed the coordinates of the four points of the station. It is to use the HTTP protocol to obtain a string from a web, then, calculate each number in the string and assign a value to the corresponding attribute. A Jun's wonderful answer:
This function is a constructor. Its purpose is to construct a station class. Based on its name and attribute, this class may be used to describe the location information of an object, this information can be used to calculate the four variables assigned to different attributes. Question: It is difficult to parse data using the substring and indexof methods. Why does this program not use the string split method? It is easier. In addition, this program uses the openstream () method of the URL class to obtain data on a remote webpage. The webpage may be a JSP and data can be obtained directly from the database, saving a self-built server program, this is the first time I have seen it, I feel that I have learned the knowledge of a new application method. 1.2.3.3.2 Example 2: Write an HTML section to complete the following table. Note: It is a single-line border.
  Explanation:
Trap 1:This question looks very simple at the beginning. It seems that a simple "<Table>" mark is being tested, so many people have drawn a table directly. As for the single-line border, they always use "border =" 1 "to describe the table.
In this case, the figure shown must be like this. A two-line table does not have a single-line border like the same. Trap 2:The text in this table is case-insensitive. Some use lower case letters and some use upper case letters. You must answer questions as required. This mainly describes the ability to complete tasks as required. Correct answer:<Table width = "200" border = "0" cellspacing = "1" bgcolor = "#000000">
<Tr>
<TD bgcolor = "# ffffff"> A </TD>
<TD bgcolor = "# ffffff"> B </TD>
<TD bgcolor = "# ffffff"> C </TD>
</Tr>
<Tr>
<TD bgcolor = "# ffffff"> d </TD>
<TD bgcolor = "# ffffff"> E </TD>
<TD bgcolor = "# ffffff"> F </TD>
</Tr>
</Table> if you have used a table on a webpage, you must know that you should use this method to obtain a single-line border table, because this is a typical single-line table design method. Of course, some people use CSS to answer this question, which can be considered correct, but the method is complicated. 1.2.3.3.3 Example 3: An algorithm questionAnother question is said to be difficult for many people. 50 people have accepted the question, but only three have answered the question correctly. Please try to answer it.
Requirements:There are two arrays, one with n elements and the other with M elements. Some elements in these two arrays are the same. We hope to write a program to find the same elements in the two arrays, please use the minimum number of cycles to fulfill your requirements. How can this problem be solved?
Generally, programmers will immediately think of a program similar to the following: for (Int J = 1; j <m; j ++ ){
For (INT I = 1; I <n; I ++ ){
......
}
} So what is the number of cycles of this method? Answer: M * n. However, you must note that this question requires a minimum number of cycles to complete the task. At this time, you only need to think about several ways to complete the task, and then select the fastest one.
The correct answer is that the hash table method is used. The number of cycles in this method is m + n, and the other is the cycle in which M is loaded into the hash table, one is the number of times that N is dumped one by one in the M hash table.
There are two traps in this question. The first one is "algorithm question". Generally, some programmers just need to hear the word "algorithm" and immediately get dizzy, which affects reasonable thinking. The second trap is "least". It uses the least number of cycles instead of the average one, but these two traps lead many programmers to fall into the trap. 1.2.3.3.4 SummaryYou can see that the above questions are not difficult in terms of technology, but there are many traps. In addition, you need to be able to use your imagination to interact with the problem makers. From these examples, we can see that the Recruitment Unit needs the most people with strong practical ability. Therefore, we need to make more efforts in this aspect, these ways of getting these skills are still to strengthen the daily accumulation. later chapters of this book will also involve more similar experiences. Readers can read them in sequence.
Written by Tsinghua University Press Java programmer at work Java programmers, work ", Preface , Directory Zhuo Yue network sales Link
China-Pub sales Link
Dangdang sales Link Commemorative post on "Java programmer, work day"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.