Internship interview with the system pa

Source: Internet
Author: User

I really don't know the answer to these things because I was abused by the blood of impaired glucose. I was told with knowledge:

I went to the interview today. I went into the exam and asked my questions first. The questions are not difficult. Some basic questions include tcpudp protocol differences, hierarchical models, implementation of strcpy, and extra large data groups.

After the test is completed, go to the interview and introduce yourself in English to describe the most familiar project.

Then the tragedy began:


1: Yes. What's wrong with strcpy you wrote? How to design a test case when writing a test case?

Strcpy I wrote:

char * strcpy(char* des,const char* src){if(des==null||src=null) throw "invalid argument";char* strdes = des;while((des++=src++)!='\0');return strcpy;

Test Case, input, just a little simpler. The two strings are:

A: null B: null

A: null B: 'abc'

A 'AB' B 'abc'

A 'abc' B 'AB'

In short, there are several types of questions, the interviewer said, no, there is a problem, think again

What should I do if the parameter is too large? Why is char * returned *?

I don't know what it is called. What are the parameters that are very large? What is the overflow of special large replication?


2: how to determine whether a program reads and writes, the bottleneck is on the hard disk or on the cpu or memory.

What I want to control variables is to let them do the same. Anyone who has learned this knows it... I have never done it, so I am not sure.

Tip: ask how the operating system is connected to the hardware through the operating system process?

A: Through system calls and driver Interfaces

Q: Yes. Think about it again.

A: I don't know.

The answer is that something like system counter keeps recording this.

I really don't know this...


3: A super large array to find the tenth largest number.

A: load the memory. If the memory cannot be loaded, you need to split it, create a heap, and discard the first nine heap headers.

Q: How can I discard it?

A: You can assign a value to a leaf node on the top of the team to adjust the heap.

Q: How to partition?

Answer: by memory capacity

Q: How do I know which film is the tenth largest?

A: it cannot be determined directly. After the parts are split, the heap is created separately. Since the top of the heap is the largest part of the film, you can take two layers and compare the parts to reduce the number of times.

Q: What is the data structure of the heap?

A: (I am disconnected. The heap is not a binary tree in nature, and the parent node is greater than the child node.) After that, the heap is not satisfied.

Q: The heap is a binary sorting tree.

My workshop ....

Afterwards, the answer is not satisfactory...


4: simple. Add two numbers. Write test cases in all cases.

A: First, we need to overload different methods. Because it is determined to be a number, there are only a few types of methods. We can detect illegal input and the number is too large.

Q: (obviously he is not satisfied at this time)

How to overload? What if the number is too big?

I: heavy-load long double int and so on. If it is too large to intercept, an error is returned if the input is invalid.

Q: (he means not to let me return an error. He must add something. Then he says that if it is bigger than double, I don't know what to do, because he wants to return instead of output, in fact, no variable can take over. I don't think two values can be returned. If the output is used, I want to use strings to segment and add)

It said that I did not take into account any problems on 32-bit 64-bit machines, as did strcpy. (I don't know how to judge machines in C language. I only know that there is such a thing in assembly, but I forgot it)

Later, he said how to add two strings. I said that illegal characters should be checked first and then converted in hexadecimal form. After the string is split, it is added and split into int values. If the value is high, you want to add a carry value.

It is not satisfied... Smile and say you go back and try it...

Then I know that it's gone... There is no other problem. I just quit after talking a bunch of nonsense... Really do not understand ah... It's too bad to learn...

It's too late to write it again tomorrow ,,,

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.