Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Interview Questions on Socket Programming and Multi-Threading [closed]

Tags:

Please anybody can tell me the questions, that can be asked in an interview for below topics

  • Socket Programming
  • Multi-Threading

An advance thanks goes to everybody who provide their time

like image 357
Santhosh Avatar asked Oct 07 '08 03:10

Santhosh


People also ask

What is multithreading in socket programming?

A thread is a sub-program within a program that can be executed independently of other section of the code. A thread executes in the same context sharing program's runnable resources like memory. When in a single process, we are executing multiple threads simultaneously, it is called multithreading.

Why does a typical socket program need multi threading?

A multi-threaded program contains two or more process that can run concurrently and each process can handle a different task at the same time making optimal use of the available resources specially when your computer has multiple CPUs.

Does socket programming support multi programming?

@asma, yes. Both clients can run on the same machine. Many clients can run on a single machine or multiple machines.


1 Answers

As a hiring manager, my favorite networking question to ask was this:

Imagine a user sitting at an Ethernet-connected PC. He has a browser open. He types "www.google.com" in the address bar and hits enter.

Now tell me what the first packet to appear on the Ethernet is.

Possible answers (of varying correctness) include:

  • I don't know.
  • An HTTP request packet.
  • A TCP syn packet.
  • A DNS request packet.
  • An ARP packet.
  • It depends.

Each of the answers reveals something about the person's understanding of networking in general, and IP and TCP in particular. The subsequent discussion can reveal volumes about their understanding. (Assuming, of course, that the questioner has some expertise in this area).

like image 78
Robᵩ Avatar answered Sep 29 '22 02:09

Robᵩ