1. 首頁
  2. 面試

技術性英文口語面試題

技術性英文口語面試題

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.Whats the diffrence betweent array and vector?

Their primary diffrence is that arrays sizeis const and the vectors 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 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 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 know if itll get there, it could get lost on the way.

Not ordered

- If you send two messages out, you don know what order theyll arrive in.

Lightweight

- No ordering of messages, no tracking connections, etc. Its just fire and forget! This means its a lot quicker, and the network card / OS have to do very little work to translate the data back from the packets.