Java
Networking Concepts
Interview Questions With Answers
Networking Concepts
Q: 1) The API doesn't list any constructors for InetAddress- How do I create
an InetAddress instance?
Ans : In case of InetAddress the three methods getLocalHost, getByName,
getByAllName can be used to create instances.
E.g.
InetAddress add1;
InetAddress add2;
try{
add1 = InetAddress.getByName("java.sun.com");
add2 = InetAddress.getByName("199.22.22.22");
}catch(UnknownHostException e){}
Q: 2) Is it possible to get the Local host IP?
Ans : Yes. Use InetAddress's getLocalHost method.
Q: 3) What's the Factory Method?
Ans : Factory methods are merely a convention whereby static methods in
a class return an instance of that class. The InetAddress class has no
visible constructors. To create an InetAddress object, you have to use one
of the available factory methods. In InetAddress the three methods
getLocalHost, getByName, getByAllName can be used to create instances of
InetAddress.
Q: 4) What’s the difference between TCP and UDP?
Ans : These two protocols differ in the way they carry out the action
of communicating. A TCP protocol establishes a two way connection between
a pair of computers, while the UDP protocol is a one-way message sender.
The common analogy is that TCP is like making a phone call and carrying on
a two-way communication, while UDP is like mailing a letter.
Q: 5) What is the Proxy Server?
Ans : A proxy server speaks the client side of a protocol to another
server. This is often required when clients have certain restrictions on
which servers they can connect to. And when several users are hitting a
popular web site, a proxy server can get the contents of the web server's
popular pages once, saving expensive internetwork transfers while
providing faster access to those pages to the clients.
Also, we can get multiple connections for a single server.
Q: 6) What are the seven layers of OSI model?
Ans : Application, Presentation, Session, Transport, Network, DataLink,
Physical Layer.
Q: 7) What Transport Layer does?
Ans : It ensures that the mail gets to its destination. If a packet
fails to get its destination, it handles the process of notifying the
sender and requesting that another packet be sent.
Q: 8) What is DHCP?
Ans : Dynamic Host Configuration Protocol, a piece of the TCP/IP
protocol suite that handles the automatic assignment of IP addresses to
clients.
Q: 9) What is SMTP?
Ans : Simple Mail Transmission Protocol, the TCP/IP Standard for
Internet mails. SMTP exchanges mail between servers; contrast this with
POP, which transmits mail between a server and a client.
Q: 10) In OSI N/w architecture, the dialogue control and token management are
responsibilities of...
a) Network b) Session c) Application d) DataLink
Ans : b) Session Layer.
Q: 11) In OSI N/W Architecture, the routing is performed by ______
a) Network b) Session c) Application d) DataLink
Ans : Network Layer.
<<<Previous Next>>>
Tolal:0 Click:
Show All Comments