技术性英文口语面试题

1.       What’s the difference between process and thread?

It’s a complex question.I cannot explain it very clearly in telephone.So I want answer it according textbook.

The Process is unit of resource distribution and the thread is minimum unit of schedule.One process could include multiple thread, but one thread only belong to one process.



That’s all,thanks.



2.       What must be attention in Porting program?

This question come down to two factor. One is hardware architecture and other is os platform.

If we port program in different os platform and same hardware architecture.The primary porting factor is different C runtimes library, of course include correlative header file.

What is this problem caused? I think the mostly reason is that hasn’t standard with C runtimes library.So the following problem will arriving:

(1)    Same behavior function has different name.

(2)    Same function name has different behavior.

(3)    Same function name and same behavior has different implement.Such as memcpy.(memory address overcast)



If we port program in same os platform but different hardware architecture.The primary porting factor is:

(1)    Cache management is different.(Of course, application can ignore this factor)

(2)    Data alignment and memory layout

(3)    Endianness.ect.



Certainly, if we’ll port program to a different platform and different hardware, we should take these factor into account.



3.       Could you tell me the 7 layer of the OSI model?

En, this is simple.I will descript the model from buttom to top.The buttom layer is physical layer, and the following is data link layer, network layer, transport layer, session layer, presatation layer and application layer.



The TCP/IP network model is composed of five layer. They are physical layer, data link layer, network layer, transport layer and application layer. It’s industry standard.



4.       Memory leak, out of bound, double release

Memory leak: You malloc a memory block but forget to release it.This action will bring on memory leak.



Memory out of bound:When write or read a memory block, you access address is out of that block.This lead out of bound.



Double release:If you repeatly release a memory block , this error called memory double release.



5.       What’s the difference between TCP and UDP

TCP and UDP all are transport protocol.But TCP is conecction-oriented transport protocol, and it provide reliable ordered transport mechanism.UDP is connectionless-oriented transport protocol and it provide unreliable not ordered transport mechanism.

TCP is suit of the situation that transport a great deal of data and UDP is suit of transporting a few data.



That’s all. Thanks.



6.       What’s the difference between reload and overwrite?

Reload is that use same function name with different function sign to implement same behavior.

Overwrite is sub-class re-write the function declared in parent-class.



===================================


4.What's the diffrence betweent array and vector?

       Their primary diffrence is that array's size is const and the vector's size is variable.Besides, The array are fast to execute, have implicit type check and easy to handle.But it fail in situations where the size of data is unknown at compile time.In this situation, the vector is a choice(also arraylist).

Attach:

Array vs ArrayList vs Vector

April 11, 2006 at 9:10 pm · Filed under Software Engineer in me, Server Side, Java


I was just browsing through some of my old notes about the ‘research’ I did sometime back on various data structures available in java for handling dynamic data sets. Thought may be this could be helpful to somebody else as well. There are situations in code where you need to handle the data that grows during run time. Usually, as much as possible I prefer arrays to handle any homogeneous collection of elements, as they are fast to execute, have implicit type check and easy to handle. But they fail in situations where the size of data is unknown at compile time. The obvious choices available with java are ArrayLists or Vectors. Or I should say ArrayLists or Vectors?

Most of the time, people use both these data structures interchangeably. Even the documentation say that the ‘only’ difference between an ArrayList and a Vector is just that Vectors are synchronized, and there is no much difference. Here is what I found out

Similarities between ArrayLists and Vectors

Both can grow up during run time.
Both implement List interface.
With both, it is easier to remove or add elements at the end or start, but if you try to add or remove elements somewhere at middle of collection, they suffer performance wise. (Use LinkedLists if your programme need to do that a lot, but LinkList requires more memory and computation)
Now the differences

The major difference, as the documentation says, is just that vectors are synchronized. Now what does that mean, this means that if more than one thread in your code is to use that data, you are in trouble with ArrayList as the data is asynchronous. Though there are ways by which you can make your ArrayLists synchronous, but by default they are not. The obvious downside with vectors is the additional computation to handle threads.
The other difference is that with vectors, you can specify the incremental value, which is the amount with which the data structure will grow during the runtime. But with ArrayLists you have no option but to accept default that is the list will grow up 50% of original size everytime it needs additional space. It is advisable in both the cases to choose the initial size carefully.
My recommendation will be to use Arrays as much as possible, as they are fast and simple; of course you can not do that in cases where data set is completely dynamic. In these cases, go for ArrayList if your code is ‘threadsafe’ else Vectors or synchronous ArrayLists are suitable.

7. Difference between TCP and UDP

附表:tcp协议和udp协议的差别



There are two types of internet protocol (IP) traffic, and both have very different uses.

TCP(Transmission Control Protocol). TCP is a connection-oriented protocol, a connection can be made from client to server, and from then on any data can be sent along that connection.
Reliable - when you send a message along a TCP socket, you know it will get there unless the connection fails completely. If it gets lost along the way, the server will re-request the lost part. This means complete integrity, things don't get corrupted.
Ordered - if you send two messages along a connection, one after the other, you know the first message will get there first. You don't have to worry about data arriving in the wrong order.
Heavyweight - when the low level parts of the TCP "stream" arrive in the wrong order, resend requests have to be sent, and all the out of sequence parts have to be put back together, so requires a bit of work to piece together.
UDP(User Datagram Protocol). A simpler message-based connectionless protocol. With UDP you send messages(packets) across the network in chunks.
Unreliable - When you send a message, you don't know if it'll get there, it could get lost on the way.
Not ordered - If you send two messages out, you don't know what order they'll arrive in.
Lightweight - No ordering of messages, no tracking connections, etc. It's just fire and forget! This means it's a lot quicker, and the network card / OS have to do very little work to translate the data back from the packets.


本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/yyzzbb_yang/archive/2006/07/27/985465.aspx

你可能感兴趣的:(thread,面试,socket,OS,UP)