Will you give me my interview questions?

Source: Internet
Author: User

In the past few months, the manager said that our department had to recruit a few people and asked me to give some interview questions. The requirement for the questions was to evaluate the C # basics. Don't be too difficult to answer questions, it is better to have a unique answer. This interview question is for the personnel department, but they do not understand it.Program. The last requirement is to have one or two questions to distinguish between intermediate and junior programmers.

I used to get questions from others. Now I have the chance to get questions from others. My heart is so excited that I have come up with some questions? Google has been on the Internet for a while. Finally, I came up with 10 questions and gave the manager a look. It is too difficult for the manager to reply, there is no need to make it so difficult, there are too many questions, and it is almost the same to have five questions. Let's see how good our manager is. After a while, I got five questions. The manager added a question at the end.

Today, I flipped out the question, selected one of the questions, and sent it to the group to see if the comrades in the group could make it. The results surprised me. No one can understand the question immediately. Comrades began to doubt my language proficiency and my ability to express myself. Although my language is not very good, it will not lead to such a result. I was so worried that I kept explaining the questions, and even wrote a program to express the meaning of the questions. In the end, no one can make it out of my hopes. However, after I have explained this, I still understand this person in Shandong, but Beijing-wu. Next I will post the question to see if you will or not?

The questions are as follows:

1: A byte array has been defined. For the Information Format of the byte array, see the following table:

Start byte Field Data Type Description
0 Type Number Byte Type number, occupying 1 byte
1 Information Content   Information content. The content format is shown in the table below.

Content format:

Type Number Type description Data Type Description
1 Driver information String The first two bytes indicate the length of the string, followed by the unicode encoded string, occupying n Bytes.
2 Fuel volume DWORD Unit: 1/100l, unsigned 32-bit integer, occupying four bytes. DWORD is at the top, while DWORD is at the bottom.
...... ...... ...... ......

Write a program to parse the driver information and fuel quantity information from the byte array. Note that the information type will be added in the future.

The above question is the only programming question of my question. The main purpose is to distinguish between intermediate programmers and junior programmers. This is what I actually encountered at work.

By the way, we welcome you to exchange ideas and ask questions. You are also welcomed to share your knowledge. Technologies are constantly improving during sharing. Thank you very much for the help of a fish in Guangzhou! If you are a new member of the group, please note that it is displayed in the blog Park. Thank you.

 

The past day has passed. The following describes the driver information.Code:

 Class  Program {  Static   Void Main ( String  [] ARGs ){  Byte [] Array = Getdriverinfo ();  If (Array = Null | Array. Length = 0  )  Return ;  Byte Type = 0  ;  Int Arraylen = Array. length;  Int Index = 0  ;  While (Arraylen> 0  ) {Type = Array [Index];  Switch (Type ){  Case   1  :  Ushort Stringlen = ( Ushort ) (Array [index + 1 ] < 8 ) | (Array [index + 2 ]) < 1  );  String Driverinfo = encoding. Unicode. getstring (array, index +3  , Stringlen); index + = Stringlen + 3  ; Arraylen -= Stringlen + 3  ; Console. writeline (  "  Driver information: {0}  "  , Driverinfo );  Break  ;  Default :  Break  ;}} Console. Readline ();}  Private   Static   Byte  [] Getdriverinfo (){  String Info = "  1234567890: Jerry  "  ;  //  Content Length              Int Len = Info. length;  Byte [] Array = New   Byte [Len * 2 + 3  ]; Array [  0 ] = 1  ;  //  The length of the character. Array [ 1 ] = ( Byte ) (LEN>8  ); Array [  2 ] = ( Byte  ) (LEN );  //  Unicode encoded string              Byte [] Temp = System. Text. encoding. Unicode. getbytes (Info); array. Copy (temp,  0 , Array, 3  , Temp. Length );  Return  Array ;}} 

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.