Sie sind auf Seite 1von 4

Networking and protocols interview questions

Q: What are the seven layers of the OSI model?


A: The layers are physical, data link, network, transport, session, presentation, and
application layers.

Q: In the TCP client-servel model, how does the three-way handshake work
in opening connection?
A: The client first sends a packet with sequence "x" to the server. When the server
receives this packet, the server will send back another packet with sequence "y",
acknowledging the request of the client. When the client receives the
acknowledgement from the server, the client will then send an acknowledge back to
the server for acknowledging that sequence "y" has been received.

Q: What is the purpose of exchanging beginning sequence numbers during


the the connection in the TCP client-server model?
A: To ensure that any data lost during data transfer can be retransmitted.

Q: How does Asynchronous Transfer Mode (ATM) work?


A: ATM works by transmitting all traffic in small, fixed-sized cells. These small, fixed-
size cells reduces queuing delay and can be switched quickly. ATM fits into layer 2 of
the OSI model and provides functions for framing and error correction. At the port
interface, ATM switches convert cells into frames, and vice versa. ATM provides
Quality of Service and traffic shaping.

Q: Given a Class B Network with subnet mask of 255.255.248.0 and a packet


addressed to 130.40.32.16, what is the subnet address?
A: Take the 2 addresses, write them in binary form, then AND them. The answer is
130.40.32.

Networking interview questions

Q1. Name of seven layers in Open System Interconnection model.


A. They are Application, Presentation, Session, Transport, Network, Data link, and
Physical.

Q2. What is the time complexity of matrix multiplication ?


void Mult_Matrix(matrix A, matrix B, matrix C)
{
int i, j, k;
for ( i = 1; i < N; i++)
for ( j = 1; j < N; j++ )
{
C[i][j] = 0;
for ( k = 0; k < N; k++ )
C[i][j] = A[i][j]*B[k][j];
}
retrun;
}
A. The time comlexity of matrix mulitiplication is O(N^3)

Q3. What is the null pointer in C++ ?


A. The null pointer is a special C++ pointer value that can be used for any pointer
that doesn’t pointer anywhere. It can be written as the constant NULL form stlib.h

Q4. What is the goal of the shortest distance algorithm ?


A. The goal is to completely fill the distance array so that for each vertex v, the value
of distance[v] is the weight of the shortest path from start to v.

Q5. What is the difference between an abstract class and an interface?


A.
An abstract class may have fields and some implemented methods.
An interface has no implementation; only constants and method declarations

Network programming interview questions

Question 1: 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 when.

Question 2: What is multiprogramming?


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

Question 3: 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 provides the means
to activate, maintain, and deactivate the link.

Network Layer - provides for the transfer of information between end systems across

some sort communications network.

Transport Layer - provides a mechanism for the exchange of data between end
system.

Session Layer - provides the mechanism for controlling the dialogue between
applications

in end systems.
Presentation Layer - defines the format of the data to be exchanged between
applications

and offers application programs a set of data transformation services.

Application Layer - provides a means for application programs to access the OSI
environment.

Question 4: What is the difference between TCP and UDP?

TCP and UDP are both transport-level protocols. TCP is designed to provide reliable

communication across a variety of reliable and unreliable networks and internets.

UDP provides a connectionless service for application-level procedures. Thus, UDP is


basically

an unreliable service; delivery and duplicate protection are not guareented.

Question 5: What does a socket consists of?


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

Networking and Unix interview questions

1. What is UTP?
UTP – Unshielded twisted pair 10BASE-T is the preferred Ethernet medium of
the 90s. It is based on a star topology and provides a number of advantages
over coaxial media:

It uses inexpensive, readily available copper phone wire. UTP wire is much
easier to install and debug than coax. UTP uses RG-45 connectors, which are
cheap and reliable.

What is a router? What is a gateway?


Routers are machines that direct a packet through the maze of etworks that
stand between its source and destination. Normally a router is used for
internal networks while a gateway acts a door for the packet to reach the
‘outside’ of the internal network

What is Semaphore? What is deadlock?


Semaphore is a synchronization tool to solve critical-section problem, can be
used to control access to the critical section for a process or thread. The main
disadvantage (same of mutual-exclusion) is require busy waiting. It will
create problems in a multiprogramming system, where a single CPU is shared
among many processes.

Busy waiting wastes CPU cycles.


Deadlock is a situation when two or more processes are waiting indefinitely
for an event that can be caused by only one of the waiting processes. The
implementation of a semaphore with a waiting queue may result in this
situation.

What is Virtual Memory?


Virtual memory is a technique that allows the execution of processes that
may not be completely in memory. A separation of user logical memory from
physical memory allows an extremely large virtual memory to be provided for
programmers when only a smaller physical memory is available. It is
commonly implemented by demand paging. A demand paging system is
similar to a paging system with swapping. Processes reside on secondary
memory (which is usually a disk). When we want to execute a process, we
swap it into memory.

Explain the layered aspect of a UNIX system. What are the layers?
What does it mean to say they are layers?
A UNIX system has essentially three main layers:

? The hardware

? The operating system kernel

? The user-level programs

The kernel hides the system’s hardware underneath an abstract, high-level


programming interface. It is responsible for implementing many of the
facilities that users and user-level programs take for granted.

The kernel assembles all of the following UNIX concepts from lower-level
hardware features:

? Processes (time-sharing, protected address space)

? Signals and semaphores

? Virtual Memory (swapping, paging, and mapping)

? The filesystem (files, directories, namespace)

? Pipes and network connections (inter-process communication)

Das könnte Ihnen auch gefallen