Sockets Interview Questions And Answers

Sockets Interview Questions list for experienced

  1. What Is Socket?
  2. How does the race condition occur?
  3. What is multiprogramming?
  4. Name the seven layers of the OSI Model and describe them briefly?
  5. What is the difference between TCP and UDP?
  6. What does a socket consists of?
  7. What is a JavaBean?
  8. What are the seven layers(OSI model) of networking?
  9. What are some advantages and disadvantages of Java Sockets?
  10. What is the difference between a NULL pointer and a void pointer?
  11. How do I open a socket?
  12. How do I create an input stream?
  13. How do I create an output stream?
  14. What is encapsulation technique?
  15. How do I close sockets?
  16. Explain simple mail transfer protocol?
  17. Explain simple Echo server?
  18. What this function socketpair() does?
  19. What this function socket() does?
  20. What this function bind() does?
  21. What this function connect() does?
  22. What this function sendto() does?
  23. What this function recvfrom() does?
  24. How to disposing of a Socket?
  25. How Sockets can be used to write client-server applications using a connection-oriented client-server technique?
  26. How to make a Socket a Listen-only Connection Endpoint - listen()?
  27. Explain Connection Establishment by Server - accept()?
  28. Explain Data Transfer over Connected Sockets - send() and recv()?
  29. Explain with a Connection-Oriented Example - listen(), accept()?
  30. What is the IP Address?
  31. What is Network Host Names?
  32. What is the /etc/hosts File?
  33. How to Selecte a Service Port?
  34. How to Put a Host Program Address Together?
  35. How to finding a Machine Address?
  36. Explain Routines for converting data between a hosts internal representation and Network Byte Order?
  37. Explain Network Address Conversion Routines?
  38. Socket Programming in C using TCP with Code?
  39. RMI vs. Sockets and Object Serialization?
  40. Explain How to transport your own custom objects?
  41. Explain How does the client receives the object and prints the date?
  42. Explain A multi-threaded DateServe that listens on port 3000 and waits for requests from clients?
  43. How to write a class that reads the objects that have been saved, and invokes a method?
  44. How to create a class that creates a instance of the UserInfo class and writes the object to an output stream?
  45. How to serialize a custom class?
  46. Shows how to read a serialized object and print its information?
  47. Shows how to save a Date object to a file?
  48. Overview of Object Serialization
  49. Explain How do sockets work?
  50. Explain what is a socket?
  51. What are basic functions of network programming interface?
  52. What is Whois Client?
  53. How to run the WHOIS Daemon?
  54. What is Whois Daemon?
  55. What is Inetd Services?
  56. How do we get a process bound behind a port?
  57. What is Socket Addressing?
  58. What is File Descriptors and Sockets?
  59. What is Server Applications?

Sockets interview questions and answers on advance and basic Sockets with example so this page for both freshers and experienced condidate. Fill the form below we will send the all interview questions on Sockets also add your Questions if any you have to ask and for apply in Sockets Tutorials and Training course just send a mail on info@pcds.co.in in detail about your self.

Top Sockets interview questions and answers for freshers and experienced

What is Sockets ?

Answer : An endpoint of a bidirectional inter-process communication flow. This often refers to a process flow over a network connection, but by no means is limited to such

Questions : 1 :: What Is Socket?

A socket is one end-point of a two-way communication link between two programs running on the network. Socket classes are used to represent the connection between a client program and a...View answers

Questions : 2 :: How does the race condition occur?

It occurs when two or more processes are reading or writing some shared data and the final result depends on who runs precisely...View answers

Questions : 3 :: What is multiprogramming?


Multiprogramming is a rapid switching of the CPU back and forth between...View answers

Questions : 4 :: Name the seven layers of the OSI Model and describe them briefly?

Physical Layer - covers the physical interface between devices and the rules by which bits are passed from one to another.Data Link Layer - attempts o make the physical link reliable and...View answers

Questions : 5 :: What is the difference between TCP and UDP?

TCP and UDP are both transport-level protocols. TCP is designed to provide reliablecommunication across a variety of reliable and unreliable networks and internets.UDP provides a...View answers

Questions : 6 :: What does a socket consists of?


The combination of an IP address and a port number is called a...View answers

Questions : 7 :: What is a JavaBean?

JavaBeans are reusable software components written in the Java programming language, designed to be manipulated visually by a software develpoment environment, like JBuilder or VisualAge for...View answers

Questions : 8 :: What are the seven layers(OSI model) of networking?

1.Physical, 2.Data Link, 3.Network, 4.Transport, 5.Session, 6.Presentation and 7.Application...View answers

Questions : 9 :: What are some advantages and disadvantages of Java Sockets?


Advantages of Java Sockets:Sockets are flexible and sufficient. Efficient socket based programming can be easily implemented for general communications.Sockets cause low network traffic....View answers

Questions : 10 :: What is the difference between a NULL pointer and a void pointer?

A NULL pointer is a pointer of any type whose value is zero. A void pointer is a pointer to an object of an unknown type, and is guaranteed to have enough bits to hold a pointer to any...View answers

Questions : 11 :: How do I open a socket?

If you are programming a client, then you would open a socket like this:Socket MyClient;MyClient = new Socket("Machine name", PortNumber);Where Machine name is the machine you are trying to...View answers

Questions : 12 :: How do I create an input stream?

On the client side, you can use the DataInputStream class to create an input stream to receive response from the server:DataInputStream input;try {input = new...View answers

Questions : 13 :: How do I create an output stream?

On the client side, you can create an output stream to send information to the server socket using the class PrintStream or DataOutputStream of java.io:PrintStream output;try {output = new...View answers

Questions : 14 :: What is encapsulation technique?

Hiding data within the class and making it available only through the methods. This technique is used to protect your class against accidental changes to fields, which might leave the class...View answers

Questions : 15 :: How do I close sockets?

You should always close the output and input stream before you close the socket.On the client side:try {output.close();input.close();MyClient.close();}catch (IOException e)...View answers

Questions : 16 :: Explain simple mail transfer protocol?

Write an SMTP (simple mail transfer protocol) client -- one so simple that we have all the data encapsulated within the program. You may change the code around to suit your needs. An...View answers

Questions : 17 :: Explain simple Echo server?

2. Echo serverWrite a server. This server is very similar to the echo server running on port 7. Basically, the echo server receives text from the client and then sends that exact text back to...View answers

Questions : 18 :: What this function socketpair() does?

Socket Creation Using socketpair()#include <sys/types.h>#include <sys/socket.h>int socketpair(int af, int type, int protocol, int sv[2])socketpair() results in the creation of two...View answers

Questions : 19 :: What this function socket() does?

Socket Creation Using socket()#include <sys/types.h>#include <sys/socket.h>int socket(int af, int type, int protocol)socket() is very similar to socketpair() except that only one...View answers

Questions : 20 :: What this function bind() does?

Giving a Socket a Name - bind()#include <sys/types.h>#include <sys/socket.h>int bind(int s, struct sockaddr *name, int namelen)Recall that, using socketpair(), sockets could only...View answers

Questions : 21 :: What this function connect() does?

Specifying a Remote Socket - connect()#include <sys/types.h>#include <sys/socket.h>int connect(int s, struct sockaddr *name, int namelen)The bind() call only allows specification...View answers

Questions : 22 :: What this function sendto() does?

Sending to a Named Socket - sendto()int sendto(int s, char *msg, int len, int flags, struct sockaddr *to, int tolen)This function allows a message msg of length len to be sent on a socket...View answers

Questions : 23 :: What this function recvfrom() does?

Receiving on a Named Socket - recvfrom()#include <sys/types.h>#include <sys/socket.h>int recvfrom(int s, char *msg, int len, int flags,struct sockaddr *from, int *fromlen)This...View answers

Questions : 24 :: How to disposing of a Socket?

Code Sample: How to disposing of a Socket#include <stdio.h>void close(int s)./* The I/O call close() will close the socketdescriptor s just as it closesany open file descriptor.Example...View answers

Questions : 25 :: How Sockets can be used to write client-server applications using a connection-oriented client-server technique?

Sockets can be used to write client-server applications using a connection-oriented client-server technique. Some characteristics of this technique include:* The server can handle multiple...View answers

Questions : 26 :: How to make a Socket a Listen-only Connection Endpoint - listen()?

/*Code Sample: Make a Socket a Listen-onlyConnection Endpoint - listen() by GlobalGuideline.com*/#include <sys/types.h>#include <sys/socket.h>int listen(int s, int...View answers

Questions : 27 :: Explain Connection Establishment by Server - accept()?

#include <sys/types.h>#include <sys/socket.h>int accept(int sockfd, struct sockaddr *name,int *namelen)The accept() call establishes a client-server connection on the server side....View answers

Questions : 28 :: Explain Data Transfer over Connected Sockets - send() and recv()?

Two additional data transfer library calls, namely send() and recv(), are available if the sockets are connected. They correspond very closely to the read() and write() functions used for I/O...View answers

Questions : 29 :: Explain with a Connection-Oriented Example - listen(), accept()?

/* Generic program structure for establishingconnection-oriented client-server environment.*//* server program */#include <stdio.h>#include <errno.h>#include...View answers

Questions : 30 :: What is the IP Address?

The IP host address, or more commonly just IP address, is used to identify hosts connected to the Internet. IP stands for Internet Protocol and refers to the Internet Layer of the overall...View answers

Questions : 31 :: What is Network Host Names?

Using IP addresses to access hosts on a network is fine for the IP software. Most people are more comfortable with names, and procedures for both proper name construction and translation of...View answers

Questions : 32 :: What is the /etc/hosts File?

The correspondence between host names and IP addresses is maintained in a file called hosts in the (top-level) directory /etc. On most systems, any user can read this file. (A word of...View answers

Questions : 33 :: How to Selecte a Service Port?

The protocol specifications of the protocols used in the AF_INET domain require specification of a port. The port number is used to determine which process on the remote machine to talk...View answers

Questions : 34 :: How to Put a Host Program Address Together?

Once a host address and port number are known then the complete process address must be put together in a form that may be used by the system calls already covered. The structures set up to...View answers

Questions : 35 :: How to finding a Machine Address?

Finding an address that can be used to connect to a remote machine is done with either of the following commands:#include <netdb.h>struct hostent *gethostbyname(char *name)struct...View answers

Questions : 36 :: Explain Routines for converting data between a hosts internal representation and Network Byte Order?

Routines for converting data between a host's internal representation and Network Byte Order are:#include <sys/types.h>#include <netinet/in.h>u_long htonl(u_long...View answers

Questions : 37 :: Explain Network Address Conversion Routines?

Network Address Conversion Routines#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h> /* in_addr structure */unsigned long inet_addr(char *ptr)char...View answers

Questions : 38 :: Socket Programming in C using TCP with Code?

To compile :* linux : gcc -Wall -o foo foo.c* solaris :gcc -Wall -o foo foo.c -lsocket -lnsl1. TCP* TCP server : simple TCP server that prints received messages.source : tcpServer.cusage...View answers

Questions : 39 :: RMI vs. Sockets and Object Serialization?

RMI vs. Sockets and Object SerializationThe Remote Method Invocation (RMI) is a Java system that can be used to easily develop distributed object-based applications. RMI, which makes...View answers

Questions : 40 :: Explain How to transport your own custom objects?

In this example, write an array multiplier server. The client sends two objects, each representing an array; the server receives the objects, unpack them by invoking a method and multiplies...View answers

Questions : 41 :: Explain How does the client receives the object and prints the date?

The client, DateClient, does not have to send any messages to the DateServer once a connection has been established. It simply receives a Date object that represents the current day and time...View answers

Questions : 42 :: Explain A multi-threaded DateServe that listens on port 3000 and waits for requests from clients?

Here A multi-threaded DateServer that listens on port 3000 and waits for requests from clients. Whenever there is a request, the server replies by sending a Date object (over sockets) to the...View answers

Questions : 43 :: How to write a class that reads the objects that have been saved, and invokes a method?

Write a class that reads the objects that have been saved, and invokes a method as shown in Code Sample. Again, as with writeObject, the readObject method can be called any number of times to...View answers

Questions : 44 :: How to create a class that creates a instance of the UserInfo class and writes the object to an output stream?

Create a class that creates a instance of the UserInfo class and writes the object to an output stream as shown in Code Sample. The output stream in this example is a file called...View answers

Questions : 45 :: How to serialize a custom class?

In this example, we create a custom class, UserInfo which is shown in Code Sample. To make it serializable, it implements the Serializable interface.Code Sample 3: UserInfo.javamport...View answers

Questions : 46 :: Shows how to read a serialized object and print its information?

Code Sample: ReadDate.javaimport java.io.*;import java.util.Date;public class ReadDate {public static void main(String argv[]) throws Exception{FileInputStream fis = new...View answers

Questions : 47 :: Shows how to save a Date object to a file?

Code Sample 1: SaveDate.javaimport java.io.*;import java.util.Date;public class SaveDate {public static void main(String argv[]) throws Exception {FileOutputStream fos =new...View answers

Questions : 48 :: Overview of Object Serialization

Overview of Object SerializationObject serialization is a mechanism that is useful in any program that wants to save the state of objects to a file and later read those objects to reconstruct...View answers

Questions : 49 :: Explain How do sockets work?

A socket has a typical flow of events. In a connection-oriented client-to-server model, the socket on the server process waits for requests from a client. To do this, the server first...View answers

Questions : 50 :: Explain what is a socket?

A socket is a communications connection point (endpoint) that you can name and address in a network. The processes that use a socket can reside on the same system or on different systems on...View answers

Questions : 51 :: What are basic functions of network programming interface?

Most operating systems provide precompiled programs that communicate across a network. Common examples into the TCP/IP world are web clients(browsers) and web servers, and the FTP and TELNET...View answers

Questions : 52 :: What is Whois Client?

Whois Client: This is whois, a very simple and generic whois client. This client, unlike the classic whois client, does not check for supported flags at the client side, except for -h (whois...View answers

Questions : 53 :: How to run the WHOIS Daemon?

You can run the whois daemon (on the server) tosee what it does:[3:27pm julian] echo reggers | /usr/lib/whois/whoisdThere were 1 matches on your request.Full Name: Quinton, RegDepartment:...View answers

Questions : 54 :: What is Whois Daemon?

Simple WHOIS Daemon, provides the standard Internet whois directory service It is much simpler to setup and administrator than the other whois daemons available, such as RIPE whois or the...View answers

Questions : 55 :: What is Inetd Services?

Not all services are started at boot time by running a server application. Eg. you won't usually see a process running for the finger service like you do for the smtp service. Many are...View answers

Questions : 56 :: How do we get a process bound behind a port?

Server Bind:A Server uses bind(3N) to establish the local host.port assignment -- ie. so it is the process behind that port. That's really only required for servers -- applications which...View answers

Questions : 57 :: What is Socket Addressing?

A Socket Address is a host.port pair (communication is between host.port pairs -- one on the server, the other on the client). We know how to determine host numbers and service numbers so...View answers

Questions : 58 :: What is File Descriptors and Sockets?

File Descriptors:File Descriptors are the fundamental I/O object. You read(2) and write(2) to file descriptors.int cc, fd, nbytes;char *buf;cc = read(fd, buf, nbytes);cc = write(fd, buf,...View answers

Questions : 59 :: What is Server Applications?

Server Applications:A system offers a service by having an application running that is listening at the service port and willing to accept a connection from a client. If there is no...View answers
More Question

Ask your interview questions on Sockets

Write Your comment or Questions if you want the answers on Sockets from Sockets Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---