Monday, December 21, 2009

STatic in java

Constants
Static variables are quite rare. However, static constants are more common. For example, the Math class defines a static constant:
public class Math
{
. . .
public static final double PI = 3.14159265358979323846;
. . .
}

You can access this constant in your programs as Math.PI.
If the keyword static had been omitted, then PI would have been an instance field of the Math class. That is, you would need an object of the Math class to access PI, and every Math object would have its own copy of PI.
Another static constant that you have used many times is System.out. It is declared in the System class as:
public class System
{
. . .
public static final PrintStream out = . . .;
. . .
}

As we mentioned several times, it is never a good idea to have public fields, because everyone can modify them. However, public constants (that is, final fields) are ok. Because out has been declared as final, you cannot reassign another print stream to it:
System.out = new PrintStream(. . .); // ERROR--out is final

NOTE

If you look at the System class, you will notice a method setOut that lets you set System.out to a different stream. You may wonder how that method can change the value of a final variable. However, the setOut method is a native method, not implemented in the Java programming language. Native methods can bypass the access control mechanisms of the Java language. This is a very unusual workaround that you should not emulate in your own programs.

Static Methods
Static methods are methods that do not operate on objects. For example, the pow method of the Math class is a static method. The expression:
Math.pow(x, a)

computes the power xa. It does not use any Math object to carry out its task. In other words, it has no implicit parameter.
You can think of static methods as methods that don't have a this parameter. (In a non-static method, the this parameter refers to the implicit parameter of the method—see page 112.)
Because static methods don't operate on objects, you cannot access instance fields from a static method. But static methods can access the static fields in their class. Here is an example of such a static method:
public static int getNextId()
{
return nextId; // returns static field
}

To call this method, you supply the name of the class:
int n = Employee.getNextId();

Could you have omitted the keyword static for this method? Yes, but then you would need to have an object reference of type Employee to invoke the method.
NOTE

It is legal to use an object to call a static method. For example, if harry is an Employee object, then you can call harry.getNextId() instead of Employee.getnextId(). However, we find that notation confusing. The getNextId method doesn't look at harry at all to compute the result. We recommend that you use class names, not objects, to invoke static methods.

You use static methods in two situations:
• When a method doesn't need to access the object state because all needed parameters are supplied as explicit parameters (example: Math.pow)
• When a method only needs to access static fields of the class (example: Employee.getNextId)
C++ NOTE

Static fields and methods have the same functionality in Java and C++. However, the syntax is slightly different. In C++, you use the :: operator to access a static field or method outside its scope, such as Math::PI.
The term "static" has a curious history. At first, the keyword static was introduced in C to denote local variables that don't go away when a block is exited. In that context, the term "static" makes sense: the variable stays around and is still there when the block is entered again. Then static got a second meaning in C, to denote global variables and functions that cannot be accessed from other files. The keyword static was simply reused, to avoid introducing a new keyword. Finally, C++ reused the keyword for a third, unrelated, interpretation—to denote variables and functions that belong to a class but not to any particular object of the class. That is the same meaning that the keyword has in Java.

Tuesday, December 15, 2009

Abstract classes

In CPP


A class that contains at least one pure virtual function is said to be abstract. Because an
abstract class contains one or more functions for which there is no definition (that is, a
pure virtual function), no objects of an abstract class may be created. Instead, an
abstract class constitutes an incomplete type that is used as a foundation for derived
classes.
Although you cannot create objects of an abstract class, you can create pointers and
references to an abstract class. This allows abstract classes to support run-time
polymorphism, which relies upon base-class pointers and references to select the
proper virtual function.

JAVA

Saturday, December 12, 2009

Function overloading

Thus, the name abs represents the general action which is being
performed. It is left to the compiler to choose the right specific version for a particular
circumstance. You, the programmer, need only remember the general operation being
performed. Through the application of polymorphism, several names have been
reduced to one.

c program without main

/* prog_without_main.c */
_start()
{
_exit(my_main());
}
int my_main(void)
{
printf(“Hello\n”);
return 42;
}
And use this command (% is command prompt) to compile:
%gcc -O3 -nostartfiles prog_without_main.c

Try compiling this example:
#include
#define decode(s,t,u,m,p,e,d) m##s##u##t
#define begin decode(a,n,i,m,a,t,e)
void begin()
{
printf(“hello”);
}
here is how it works once we say define we need to understand that
#define x y
then ‘x’ ix replaced by ‘y’
similarly in this case
#define begin decode(a,n,i,m,a,t,e)
decode(a,n,i,m,a,t,e) is replaced by m##a##i##n
bcoz s is replaced by a,t by n,u by i and so on
s->a
t->n
u->i
m->m
p->a
e->t
d->e
now the statement becomes
void m##a##i##n
And u must be knowing that ## is used for string concatenation so it becomes
“main”
finally the code crops down to
void main()
{
printf(“hello”);
}

Here we are using preprocessor directive #define with arguments to give an impression that the program runs without main.But in reality it runs with a hidden main function.

The ‘##‘ operator is called the token pasting or token merging operator.That is we can merge two or more characters with it.

NOTE: A Preprocessor is program which processess the source code before compilation.

Look at the 2nd line of program-

#define decode(s,t,u,m,p,e,d) m##s##u##t

What is the preprocessor doing here.The macro decode(s,t,u,m,p,e,d) is being expanded as “msut” (The ## operator merges m,s,u & t into msut).The logic is when you pass (s,t,u,m,p,e,d) as argument it merges the 4th,1st,3rd & the 2nd characters(tokens).

Now look at the third line of the program-

#define begin decode(a,n,i,m,a,t,e)

Here the preprocessor replaces the macro “begin” with the expansion decode(a,n,i,m,a,t,e).According to the macro definition in the previous line the argument must de expanded so that the 4th,1st,3rd & the 2nd characters must be merged.In the argument (a,n,i,m,a,t,e) 4th,1st,3rd & the 2nd characters are ‘m’,'a’,'i’ & ‘n’.

So the third line “int begin” is replaced by “int main” by the preprocessor before the program is passed on for the compiler.That’s it…

The bottom line is there can never exist a C program without a main function.Here we are just playing a gimmick that makes us beleive the program runs without main function, but actually there exista a hidden main function in the program.Here we are using the proprocessor directive to intelligently replace the word begin” by “main” .In simple words int begin=int main.

c program without main

/* prog_without_main.c */
_start()
{
_exit(my_main());
}
int my_main(void)
{
printf(“Hello\n”);
return 42;
}
And use this command (% is command prompt) to compile:
%gcc -O3 -nostartfiles prog_without_main.c

Try compiling this example:
#include
#define decode(s,t,u,m,p,e,d) m##s##u##t
#define begin decode(a,n,i,m,a,t,e)
void begin()
{
printf(“hello”);
}
here is how it works once we say define we need to understand that
#define x y
then ‘x’ ix replaced by ‘y’
similarly in this case
#define begin decode(a,n,i,m,a,t,e)
decode(a,n,i,m,a,t,e) is replaced by m##a##i##n
bcoz s is replaced by a,t by n,u by i and so on
s->a
t->n
u->i
m->m
p->a
e->t
d->e
now the statement becomes
void m##a##i##n
And u must be knowing that ## is used for string concatenation so it becomes
“main”
finally the code crops down to
void main()
{
printf(“hello”);
}

Here we are using preprocessor directive #define with arguments to give an impression that the program runs without main.But in reality it runs with a hidden main function.

The ‘##‘ operator is called the token pasting or token merging operator.That is we can merge two or more characters with it.

NOTE: A Preprocessor is program which processess the source code before compilation.

Look at the 2nd line of program-

#define decode(s,t,u,m,p,e,d) m##s##u##t

What is the preprocessor doing here.The macro decode(s,t,u,m,p,e,d) is being expanded as “msut” (The ## operator merges m,s,u & t into msut).The logic is when you pass (s,t,u,m,p,e,d) as argument it merges the 4th,1st,3rd & the 2nd characters(tokens).

Now look at the third line of the program-

#define begin decode(a,n,i,m,a,t,e)

Here the preprocessor replaces the macro “begin” with the expansion decode(a,n,i,m,a,t,e).According to the macro definition in the previous line the argument must de expanded so that the 4th,1st,3rd & the 2nd characters must be merged.In the argument (a,n,i,m,a,t,e) 4th,1st,3rd & the 2nd characters are ‘m’,'a’,'i’ & ‘n’.

So the third line “int begin” is replaced by “int main” by the preprocessor before the program is passed on for the compiler.That’s it…

The bottom line is there can never exist a C program without a main function.Here we are just playing a gimmick that makes us beleive the program runs without main function, but actually there exista a hidden main function in the program.Here we are using the proprocessor directive to intelligently replace the word begin” by “main” .In simple words int begin=int main.

Wednesday, December 9, 2009

Some basic networking interview questions

1. What are 10Base2, 10Base5 and 10BaseT Ethernet LANs
10Base2—An Ethernet term meaning a maximum transfer rate of 10 Megabits per second that uses
baseband
signaling, with a contiguous cable segment length of 100
meters and a maximum of 2 segments.
10Base5—An Ethernet term meaning a maximum transfer rate of 10 Megabits per second that uses
baseband
signaling, with 5 continuous segments not exceeding 100
meters per segment.
10BaseT—An Ethernet term meaning a maximum transfer rate of 10 Megabits per second that uses
baseband
signaling and twisted pair cabling.
2. Explain the difference between an unspecified passive open and a fully specified passive open
An unspecified passive open has the server waiting for a connection request from a client. A fully
specified passive
open has the server waiting for a connection from a
specific client.
3. Explain the function of Transmission Control Block
A TCB is a complex data structure that contains a considerable amount of information about each
connection.
4. Explain a Management Information Base (MIB)
A Management Information Base is part of every SNMP-managed device. Each SNMP agent has the
MIB database that
contains information about the device's status, its
performance, connections, and configuration. The MIB is queried by SNMP.
5. Explain anonymous FTP and why would you use it
Anonymous FTP enables users to connect to a host without using a valid login and password. Usually,
anonymous FTP
uses a login called anonymous or guest, with the
password usually requesting the user's ID for tracking purposes only. Anonymous FTP is used to
enable a large number
of users to access files on the host without having
to go to the trouble of setting up logins for them all. Anonymous FTP systems usually have strict
controls over the areas
an anonymous user can access.
6. Explain a pseudo tty
A pseudo tty or false terminal enables external machines to connect through Telnet or rlogin. Without
a pseudo tty, no
connection can take place.
7. Explain REX
What advantage does REX offer other similar utilities
8. What does the Mount protocol do
The Mount protocol returns a file handle and the name of the file system in which a requested file
resides. The message
is sent to the client from the server after reception
of a client's request.
9. Explain External Data Representation
External Data Representation is a method of encoding data within an RPC message, used to ensure
that the data is not
system-dependent.
10. Explain the Network Time Protocol ?
11. BOOTP helps a diskless workstation boot. How does it get a message to the network looking for
its IP address and the location of its operating system boot files
BOOTP sends a UDP message with a subnetwork broadcast address and waits for a reply from a
server that gives it the IP address. The same message might contain the name of the machine that has
the boot files on it. If the boot image location is not specified, the workstation sends another UDP
message to query the server.
12. Explain a DNS resource record
A resource record is an entry in a name server's database. There are several types of resource records
used, including name-to-address resolution information. Resource records are maintained as ASCII
files.
13. What protocol is used by DNS name servers
DNS uses UDP for communication between servers. It is a better choice than TCP because of the
improved speed a connectionless protocol offers. Of course, transmission reliability suffers with UDP.
14. Explain the difference between interior and exterior neighbor gateways
Interior gateways connect LANs of one organization, whereas exterior gateways connect the
organization to the outside world.
15. Explain the HELLO protocol used for
The HELLO protocol uses time instead of distance to determine optimal routing. It is an alternative to
the Routing Information Protocol.
16. What are the advantages and disadvantages of the three types of routing tables
The three types of routing tables are fixed, dynamic, and fixed central. The fixed table must be
manually modified every time there is a change. A dynamic table changes its information based on
network traffic, reducing the amount of manual maintenance. A fixed central table lets a manager
modify only one table, which is then read by other devices. The fixed central table reduces the need to
update each machine's table, as with the fixed table. Usually a dynamic table causes the fewest
problems for a network
administrator, although the table's contents can change without the administrator being aware of the
change.
17. Explain a TCP connection table
18. Explain source route
It is a sequence of IP addresses identifying the route a datagram must follow. A source route may
optionally be included in an IP datagram header.
19. Explain RIP (Routing Information Protocol)
It is a simple protocol used to exchange information between the routers.
20. Explain SLIP (Serial Line Interface Protocol)
It is a very simple protocol used for transmission of IP datagrams across a serial line.
21. Explain Proxy ARP
It is using a router to answer ARP requests. This will be done when the originating host believes that a
destination is local, when in fact is lies beyond router.
22. Explain OSPF
It is an Internet routing protocol that scales well, can route traffic along multiple paths, and uses
knowledge of an Internet's topology to make accurate routing decisions.
23. Explain Kerberos
It is an authentication service developed at the Massachusetts Institute of Technology. Kerberos uses
encryption to prevent intruders from discovering passwords and gaining unauthorized access to files.
24. Explain a Multi-homed Host
It is a host that has a multiple network interfaces and that requires multiple IP addresses is called as a
Multi-homed Host.
25. Explain NVT (Network Virtual Terminal)
It is a set of rules defining a very simple virtual terminal interaction. The NVT is used in the start of a
Telnet session.
26. Explain Gateway-to-Gateway protocol
It is a protocol formerly used to exchange routing information between Internet core routers.
27. Explain BGP (Border Gateway Protocol)
It is a protocol used to advertise the set of networks that can be reached with in an autonomous
system. BGP enables this information to be shared with the autonomous system. This is newer than
EGP (Exterior Gateway Protocol).
28. Explain autonomous system
It is a collection of routers under the control of a single administrative authority and that uses a
common Interior Gateway Protocol.
29. Explain EGP (Exterior Gateway Protocol)
It is the protocol the routers in neighboring autonomous systems use to identify the set of networks
that can be reached
within or via each autonomous system.
30. Explain IGP (Interior Gateway Protocol)
It is any routing protocol used within an autonomous system.
31. Explain Mail Gateway
It is a system that performs a protocol translation between different electronic mail delivery protocols.
32. Explain wide-mouth frog
Wide-mouth frog is the simplest known key distribution center (KDC) authentication protocol.
33. What are Digrams and Trigrams
The most common two letter combinations are called as digrams. e.g. th, in, er, re and an. The most
common three letter combinations are called as trigrams. e.g. the, ing, and, and ion.
34. Explain silly window syndrome
It is a problem that can ruin TCP performance. This problem occurs when data are passed to the
sending TCP entity in large blocks, but an interactive application on the receiving side reads 1 byte at
a time.
35. Explain region
When hierarchical routing is used, the routers are divided into what we call regions, with each router
knowing all the details about how to route packets to destinations within its own region, but knowing
nothing about the internal structure of other regions.
36. Explain multicast routing
Sending a message to a group is called multicasting, and its routing algorithm is called multicast
routing.
37. Explain traffic shaping
One of the main causes of congestion is that traffic is often busy. If hosts could be made to transmit at
a uniform rate, congestion would be less common. Another open loop method to help manage
congestion is forcing the packet to be transmitted at a more predictable rate. This is called traffic
shaping.
38. Explain packet filter
Packet filter is a standard router equipped with some extra functionality. The extra functionality allows
every incoming or outgoing packet to be inspected. Packets meeting some criterion are forwarded
normally. Those that fail the test are dropped.
39. Explain virtual path
Along any transmission path from a given source to a given destination, a group of virtual circuits can
be grouped together into what is called path.
40. Explain virtual channel
Virtual channel is normally a connection from one source to one destination, although multicast
connections are also permitted. The other name for virtual channel is virtual circuit.
41. Explain logical link control
One of two sublayers of the data link layer of OSI reference model, as defined by the IEEE 802
standard. This sublayer is responsible for maintaining the link between computers when they are
sending data across the physical network connection.
42. Why should you care about the OSI Reference Model
It provides a framework for discussing network operations and design.
43. Explain the difference between routable and non- routable protocols
Routable protocols can work with a router and can be used to build large networks. Non-Routable
protocols are designed to work on small, local networks and cannot be used with a router
44. Explain MAU
In token Ring , hub is called Multistation Access Unit(MAU).
45. Explain 5-4-3 rule
In a Ethernet network, between any two points on the network, there can be no more than five network
segments or four repeaters, and of those five segments only three of segments can be populated.
46. Explain the difference between TFTP and FTP application layer protocols
The Trivial File Transfer Protocol (TFTP) allows a local host to obtain files from a remote host but
does not provide reliability or security. It uses the fundamental packet delivery services offered by
UDP.
The File Transfer Protocol (FTP) is the standard mechanism provided by TCP / IP for copying a file
from one host to another. It uses the services offered by TCP and so is reliable and secure. It
establishes two connections (virtual circuits) between the hosts, one for data transfer and another for
control information.
47. Explain the range of addresses in the classes of internet addresses
Class A 0.0.0.0 - 127.255.255.255
Class B 128.0.0.0 - 191.255.255.255
Class C 192.0.0.0 - 223.255.255.255
Class D 224.0.0.0 - 239.255.255.255
Class E 240.0.0.0 - 247.255.255.255
48. Explain the minimum and maximum length of the header in the TCP segment and IP datagram
The header should have a minimum length of 20 bytes and can have a maximum length of 60 bytes.
49. Explain difference between ARP and RARP
The address resolution protocol (ARP) is used to associate the 32 bit IP address with the 48 bit
physical address, used by a host or a router to find the physical address of another host on its network
by sending a ARP query packet that includes the IP address of the receiver. The reverse address
resolution protocol (RARP) allows a host to discover its Internet address when it knows only its
physical address.
50. Explain ICMP
ICMP is Internet Control Message Protocol, a network layer protocol of the TCP/IP suite used by
hosts and gateways to send notification of datagram problems back to the sender. It uses the echo test /
reply to test whether a destination is reachable and responding. It also handles both control and error
messages.
51. What are the data units at different layers of the TCP / IP protocol suite
The data unit created at the application layer is called a message, at the transport layer the data unit
created is called either a segment or an user datagram, at the network layer the data unit created is
called the datagram, at the data link layer the datagram is encapsulated in to a frame and
finally transmitted as signals along the transmission media.
52. Explain Project 802
It is a project started by IEEE to set standards that enable intercommunication between equipment
from a variety of manufacturers. It is a way for specifying functions of the physical layer, the data link
layer and to some extent the network layer to allow for interconnectivity of major LAN protocols.
It consists of the following:
802.1 is an internetworking standard for compatibility of different LANs and MANs across protocols.
802.2 Logical link control (LLC) is the upper sublayer of the data link layer which is non-architecturespecific,
that is remains the same for all IEEE-defined LANs.
Media access control (MAC) is the lower sublayer of the data link layer that contains some distinct
modules each carrying proprietary information specific to the LAN product being used. The modules
are Ethernet LAN (802.3), Token ring LAN (802.4), Token bus LAN (802.5).
802.6 is distributed queue dual bus (DQDB) designed to be used in MANs.
53. Explain Bandwidth
Every line has an upper limit and a lower limit on the frequency of signals it can carry. This limited
range is called the bandwidth.
54. Difference between bit rate and baud rate.
Bit rate is the number of bits transmitted during one second whereas baud rate refers to the number of
signal units per second that are required to represent those bits. baud rate = bit rate / N where N is noof-
bits represented by each signal shift.
55. Explain MAC address
The address for a device as it is identified at the Media Access Control (MAC) layer in the network
architecture. MAC address is usually stored in ROM on the network adapter card and is unique.
56. Explain attenuation
The degeneration of a signal over distance on a network cable is called attenuation.
57. Explain cladding
A layer of a glass surrounding the center fiber of glass inside a fiber-optic cable.
58. Explain RAID
A method for providing fault tolerance by using multiple hard disk drives.
59. Explain NETBIOS and NETBEUI
NETBIOS is a programming interface that allows I/O requests to be sent to and received from a
remote computer and it hides the networking hardware from applications. NETBEUI is NetBIOS
extended user interface. A transport protocol designed by microsoft and IBM for the use on small
subnets.
60. Explain redirector
Redirector is software that intercepts file or prints I/O requests and translates them into network
requests. This comes under presentation layer.
61. Explain Beaconing
The process that allows a network to self-repair networks problems. The stations on the network
notify the other stations on the ring when they are not receiving the transmissions. Beaconing is used
in Token ring and FDDI networks.
62. Explain terminal emulation, in which layer it comes
Telnet is also called as terminal emulation. It belongs to application layer.
63. Explain frame relay, in which layer it comes
Frame relay is a packet switching technology. It will operate in the data link layer.
64. What do you meant by "triple X" in Networks
The function of PAD (Packet Assembler Disassembler) is described in a document known as X.3. The
standard protocol has been defined between the terminal and the PAD, called X.28; another standard
protocol exists between hte PAD and the network, called X.29. Together, these three recommendations
are often called "triple X"
65. Explain SAP
Series of interface points that allow other computers to communicate with the other layers of network
protocol stack.
66. Explain subnet
A generic term for section of a large networks usually separated by a bridge or router.
67. Explain Brouter
Hybrid devices that combine the features of both bridges and routers.
68. How Gateway is different from Routers
A gateway operates at the upper levels of the OSI model and translates information between two
completely different network architectures or data formats.
69. What are the different type of networking / internetworking devices
Repeater: Also called a regenerator, it is an electronic device that operates only at physical layer. It
receives the signal in the network before it becomes weak, regenerates the original bit pattern and puts
the refreshed copy back in to the link.
Bridges: These operate both in the physical and data link layers of LANs of same type. They divide a
larger network in to smaller segments. They contain logic that allow them to keep the traffic for each
segment separate and thus are repeaters that relay a frame only the side of the segment containing the
intended recipent and control congestion.
Routers: They relay packets among multiple interconnected networks (i.e. LANs of different type).
They operate in the physical, data link and network layers. They contain software that enable them to
determine which of the several possible paths is the best for a particular transmission.
Gateways:
They relay packets among networks that have different protocols (e.g. between a LAN and a WAN).
They accept a packet formatted for one protocol and convert it to a packet formatted for another
protocol before forwarding it. They operate in all seven layers of the OSI model.
70. Explain mesh network
A network in which there are multiple network links between computers to provide multiple paths for
data to travel.
71. Explain passive topology
When the computers on the network simply listen and receive the signal, they are referred to as
passive because they don’t amplify the signal in any way. Example for passive topology - linear bus.
72. What are the important topologies for networks
BUS topology:
In this each computer is directly connected to primary network cable in a single line.
Advantages:
Inexpensive, easy to install, simple to understand, easy to extend.
STAR topology:
In this all computers are connected using a central hub.
Advantages:
Can be inexpensive, easy to install and reconfigure and easy to trouble shoot physical problems.
RING topology:
In this all computers are connected in loop.
Advantages:
All computers have equal access to network media, installation can be simple, and signal does not
degrade as much as
in other topologies because each computer
regenerates it.
73. What are major types of networks and explain
Server-based network
Peer-to-peer network
Peer-to-peer network, computers can act as both servers sharing resources and as clients using the
resources.
Server-based networks provide centralized control of network resources and rely on server computers
to provide security and network administration
74. Explain Protocol Data Unit
The data unit in the LLC level is called the protocol data unit (PDU). The PDU contains of four fields
a destination service access point (DSAP), a source service access point (SSAP), a control field and an
information field. DSAP, SSAP are addresses used by the LLC to identify the protocol stacks on the
receiving and sending machines that are generating and using the data. The control field specifies
whether the PDU frame is a information frame (I - frame) or a supervisory frame (S - frame) or a
unnumbered frame (U - frame).
75. Explain difference between baseband and broadband transmission
In a baseband transmission, the entire bandwidth of the cable is consumed by a single signal. In
broadband transmission, signals are sent on multiple frequencies, allowing multiple signals to be sent
simultaneously.
76. What are the possible ways of data exchange
(i) Simplex (ii) Half-duplex (iii) Full-duplex.
77. What are the types of Transmission media
Signals are usually transmitted over some transmission media that are broadly classified in to two
categories.
Guided Media:
These are those that provide a conduit from one device to another that include twisted-pair, coaxial
cable and fiber-optic cable. A signal traveling along any of these media is directed and is contained by
the physical limits of the medium. Twisted-pair and coaxial cable use metallic that accept
and transport signals in the form of electrical current. Optical fiber is a glass or plastic cable that
accepts and transports signals in the form of light.
Unguided Media:
This is the wireless media that transport electromagnetic waves without using a physical conductor.
Signals are broadcast either through air. This is done through radio communication, satellite
communication and cellular telephony.
78. Explain point-to-point protocol
A communications protocol used to connect computers to remote networking services including
Internet service providers.
79. What are the two types of transmission technology available
(i) Broadcast and (ii) point-to-point
80. Difference between the communication and transmission.
Transmission is a physical movement of information and concern issues like bit polarity,
synchronization, clock etc. Communication means the meaning full exchange of information between
two communication media.

General terms


Switch
 In a telecommunications network, a switch is a device that channels incoming data from any of multiple input ports to the specific output port that will take the data toward its intended destination. In the traditional circuit-switched telephone network, one or more switches are used to set up a dedicated though temporary connection or circuit for an exchange between two or more parties. On an Ethernet local area network (LAN), a switch determines from the physical device (Media Access Control or MAC) address in each incoming message frame which output port to forward it to and out of. In a wide area packet-switched network such as the Internet, a switch determines from the IP address in each packet which output port to use for the next part of its trip to the intended destination.
In the Open Systems Interconnection (OSI) communications model, a switch performs the layer 2 or Data-Link layer function. That is, it simply looks at each packet or data unit and determines from a physical address (the "MAC address") which device a data unit is intended for and switches it out toward that device. However, in wide area networks such as the Internet, the destination address requires a look-up in a routing table by a device known as a router. Some newer switches also perform routing functions (layer 3 or the Network layer functions in OSI) and are sometimes called IP switches.
On larger networks, the trip from one switch point to another in the network is called a hop. The time a switch takes to figure out where to forward a data unit is called its latency. The price paid for having the flexibility that switches provide in a network is this latency. Switches are found at the backbone and gateway levels of a network where one network connects with another and at the subnetwork level where data is being forwarded close to its destination or origin. The former are often known as core switches and the latter as desktop switches.
In the simplest networks, a switch is not required for messages that are sent and received within the network. For example, a local area network may be organized in a Token Ring or bus arrangement in which each possible destination inspects each message and reads any message with its address.

Circuit-Switching version Packet-Switching

A network's paths can be used exclusively for a certain duration by two or more parties and then switched for use to another set of parties. This type of "switching" is known as circuit-switching and is really a dedicated and continuously connected path for its duration. Today, an ordinary voice phone call generally uses circuit-switching. Most data today is sent, using digital signals, over networks that use packet-switching. Using packet-switching, all network users can share the same paths at the same time and the particular route a data unit travels can be varied as conditions change. In packet-switching, a message is divided into packets, which are units of a certain number of bytes. The network addresses of the sender and of the destination are added to the packet. Each network point looks at the packet to see where to send it next. Packets in the same message may travel different routes and may not arrive in the same order that they were sent. At the destination, the packets in a message are collected and reassembled into the original message.

Router
In packet-switched networks such as the Internet, a router is a device or, in some cases, software in a computer, that determines the next network point to which a packet should be forwarded toward its destination. The router is connected to at least two networks and decides which way to send each information packet based on its current understanding of the state of the networks it is connected to. A router is located at any gateway (where one network meets another), including each point-of-presence on the Internet. A router is often included as part of a network switch.
A router may create or maintain a table of the available routes and their conditions and use this information along with distance and cost algorithms to determine the best route for a given packet. Typically, a packet may travel through a number of network points with routers before arriving at its destination. Routing is a function associated with the Network layer (layer 3) in the standard model of network programming, the Open Systems Interconnection (OSI) model. A layer-3 switch is a switch that can perform routing functions.
An edge router is a router that interfaces with an asynchronous transfer mode (ATM) network. A brouter is a network bridge combined with a router.
For home and business computer users who have high-speed Internet connections such as cable, satellite, or DSL, a router can act as a hardware firewall. This is true even if the home or business has only one computer. Many engineers believe that the use of a router provides better protection against hacking than a software firewall, because no computer Internet Protocol address are directly exposed to the Internet. This makes port scans (a technique for exploring weaknesses) essentially impossible. In addition, a router does not consume computer resources as a software firewall does. Commercially manufactured routers are easy to install, reasonably priced, and available for hard-wired or wireless networks.

Gateway
A gateway is a network point that acts as an entrance to another network. On the Internet, a node or stopping point can be either a gateway node or a host (end-point) node. Both the computers of Internet users and the computers that serve pages to users are host nodes. The computers that control traffic within your company's network or at your local Internet service provider (ISP) are gateway nodes.
In the network for an enterprise, a computer server acting as a gateway node is often also acting as a proxy server and a firewall server. A gateway is often associated with both a router, which knows where to direct a given packet of data that arrives at the gateway, and a switch, which furnishes the actual path in and out of the gateway for a given packet. 


Hub

In general, a hub is the central part of a wheel where the spokes come together. The term is familiar to frequent fliers who travel through airport "hubs" to make connecting flights from one point to another. In data communications, a hub is a place of convergence where data arrives from one or more directions and is forwarded out in one or more other directions. A hub usually includes a switch of some kind. (And a product that is called a "switch" could usually be considered a hub as well.) The distinction seems to be that the hub is the place where data comes together and the switch is what determines how and where data is forwarded from the place where data comes together. Regarded in its switching aspects, a hub can also include a router.
1) In describing network topologies, a hub topology consists of a backbone (main circuit) to which a number of outgoing lines can be attached ("dropped"), each providing one or more connection port for device to attach to. For Internet users not connected to a local area network, this is the general topology used by your access provider. Other common network topologies are the bus network and the ring network. (Either of these could possibly feed into a hub network, using a bridge.)
2) As a network product, a hub may include a group of modem cards for dial-in users, a gateway card for connections to a local area network (for example, an Ethernet or a Token Ring), and a connection to a line (the main line in this example). 


Brouter
A brouter (pronounced BRAU-tuhr or sometimes BEE-rau-tuhr) is a network bridge and a router combined in a single product. A bridge is a device that connects one local area network (LAN) to another local area network that uses the same protocol (for example, Ethernet or Token Ring). If a data unit on one LAN is intended for a destination on an interconnected LAN, the bridge forwards the data unit to that LAN; otherwise, it passes it along on the same LAN. A bridge usually offers only one path to a given interconnected LAN. A router connects a network to one or more other networks that are usually part of a wide area network (WAN) and may offer a number of paths out to destinations on those networks. A router therefore needs to have more information than a bridge about the interconnected networks. It consults a routing table for this information. Since a given outgoing data unit or packet from a computer may be intended for an address on the local network, on an interconnected LAN, or the wide area network, it makes sense to have a single unit that examines all data units and forwards them appropriately.





Basic Interview Questions on networking

What is DHCP?

DHCP stands for Dynamic Host Configuration Technology. The basic purpose of the DHCP is to assign the IP addresses and the other network configuration such as DNS, Gateway and other network settings to the client computers. DHCP reduces the administrative task of manually assigning the IP addresses to the large number of the computers in a network.

What is DNS and how it works?

DNS stands for Domain name system and it translates (converts) the host name into the IP address and IP address into to the host name. Every domain and the computer on the internet is assigned a unique IP address. The communication on the internet and in the network is based on the IP addresses. IP addresses are in this format 10.1.1.100, 220.12.1.22.3, 1.1.1.1 etc. IP addresses can’t be remembered but the host names (e.g. www.networktutorials.info, xyz.com, abc.com) are easy to remember instead of their IP addresses.

What is a Firewall?

Firewall is a protective boundary for a network and it prevents the unauthorized access to a network. Most of the Windows operating system such as Windows XP Professional has built-in firewall utilities. There are the large number of the third party firewall software and the basic purpose of all the firewall software and hardware is same i.e. to block the unauthorized user access to a network.

What is WAN?

WAN stands for wide area network and it covers the broader geographical area. Basically there are three types of a computer network LAN (Local Area Network), MAN (Metropolitan Area Network) and WAN (Wide Area Network). The communication in a WAN is based on the Routers. A WAN network can cover a city, country or continents.

Define VOIP Communication Technology

VOIP stands for Voice over IP and this technology is used for transmitted the voice over the IP based long distance network to make phone calls. VOIP phone calls are very cheap and a large number of the corporate offices and home users are using VOIP technology
to make long distance phone calls.

What is Wi Max Technology?

Wi Max is a wireless broadband technology and it is a advance shape of the Wi Fi (which was a base band technology). Wi Max supports data, video and audio communication at the same time at a very high speed up to 70 Mbps.

Define Network Gateway

Network Gateway can be software or a hardware. A gateway is usually a joining point in a network i.e. it connects two networks. A computer with two LAN cards can act as a gateway.

What is a Router?

A router routes the traffic to its destination based on the source and destination IP addresses, which are placed in the routing software known as routing table.

How Fiber Optic Cable Works

Fiber optics provides the fastest communication medium for data and voice. Data can travel at the speed of light through the fiber optic cables. ISPs and corporate offices are usually connected with each other with the fiber optic cables to provide high speed connectivity.

What is File Server?

A file server is a computer in a network that authenticates the user access in a network such as Windows 2000/2003 Servers.

Define Seven Layers of OSI Model

There are seven layers of the OSI model. The basic purpose of these layers is to understand the communication system and data transmission steps. The seven layers are Application, Presentation, Session, Transport, Network, Data Link and Physical. You can remember the name of these layers by this phrase. “All people seems to need data processing”.

Define GSM Technology

GSM is a short range wireless technology and is usually used in the mobile phones, hand help devices, MP3 players, Laptops, computers and in cars.

Tuesday, December 8, 2009

If it is given that: 25 - 2 = 3 100 x 2 = 20 36 / 3 = 2 What is 144 - 3 = ?
Answer There are 3 possible answers to it. Answer 1 : 9 Simply replace the first number by its square root. (25) 5 - 2 = 3 (100) 10 x 2 = 20 (36) 6 / 3 = 2 (144) 12 - 3 = 9 Answer 2 : 11 Drop the digit in the tens position from the first number. (2) 5 - 2 = 3 1 (0) 0 x 2 = 20 (3) 6 / 3 = 2 1 (4) 4 - 3 = 11 You will get the same answer on removing left and right digit alternatively from the first number i.e remove left digit from first (2), right digit from second (0), left digit from third (3) and right digit from forth (4). (2) 5 - 2 = 3 10 (0) x 2 = 20 (3) 6 / 3 = 2 14 (4) - 3 = 11 Answer 3 : 14
Drop left and right digit alternatively from the actual answer. 25 - 2 = (2) 3 (drop left digit i.e. 2) 100 * 2 = 20 (0) (drop right digit i.e. 0) 36 / 3 = (1) 2 (drop left digit i.e. 1) 144 - 3 = 14 (1) (drop right digit i.e. 1)

Monday, December 7, 2009

math.h

 Mathematics is relatively straightforward library to use again. You must #include and must remember to link in the math library at compilation:
   cc mathprog.c -o mathprog -lm
A common source of error is in forgetting to include the file (and yes experienced programmers make this error also). Unfortunately the C compiler does not help much. Consider:

double x;
x = sqrt(63.9);
Having not seen the prototype for sqrt the compiler (by default) assumes that the function returns an int and converts the value to a double with meaningless results.

Math Functions

Below we list some common math functions. Apart from the note above they should be easy to use and we have already used some in previous examples. We give no further examples here:
double acos(double x) -- Compute arc cosine of x.
double asin(double x) -- Compute arc sine of x.
double atan(double x) -- Compute arc tangent of x.
double atan2(double y, double x) -- Compute arc tangent of y/x.
double ceil(double x) -- Get smallest integral value that exceeds x.
double cos(double x) -- Compute cosine of angle in radians.
double cosh(double x) -- Compute the hyperbolic cosine of x.
div_t div(int number, int denom) -- Divide one integer by another.
double exp(double x -- Compute exponential of x
double fabs (double x ) -- Compute absolute value of x.
double floor(double x) -- Get largest integral value less than x.
double fmod(double x, double y) -- Divide x by y with integral quotient and return remainder.
double frexp(double x, int *expptr) -- Breaks down x into mantissa and exponent of no.
labs(long n) -- Find absolute value of long integer n.
double ldexp(double x, int exp) -- Reconstructs x out of mantissa and exponent of two.
ldiv_t ldiv(long number, long denom) -- Divide one long integer by another.
double log(double x) -- Compute log(x).
double log10 (double x ) -- Compute log to the base 10 of x.
double modf(double x, double *intptr) -- Breaks x into fractional and integer parts.
double pow (double x, double y) -- Compute x raised to the power y.
double sin(double x) -- Compute sine of angle in radians.
double sinh(double x) - Compute the hyperbolic sine of x.
double sqrt(double x) -- Compute the square root of x.
void srand(unsigned seed) -- Set a new seed for the random number generator (rand).
double tan(double x) -- Compute tangent of angle in radians.
double tanh(double x) -- Compute the hyperbolic tangent of x.

Math Constants

The math.h library defines many (often neglected) constants. It is always advisable to use these definitions:

HUGE -- The maximum value of a single-precision floating-point number.
M_E -- The base of natural logarithms (e).
M_LOG2E -- The base-2 logarithm of e.
M_LOG10E - The base-10 logarithm of e.
M_LN2 -- The natural logarithm of 2.
M_LN10 -- The natural logarithm of 10.
M_PI -- $\pi$.
M_PI_2 -- $\pi$/2.
M_PI_4 -- $\pi$/4.
M_1_PI -- 1/$\pi$.
M_2_PI -- 2/$\pi$.
M_2_SQRTPI -- 2/$\sqrt{\pi}$.
M_SQRT2 -- The positive square root of 2.
M_SQRT1_2 -- The positive square root of 1/2.
MAXFLOAT -- The maximum value of a non-infinite single- precision floating point number.
HUGE_VAL -- positive infinity.
There are also a number a machine dependent values defined in #include -- see man value or list value.h for further details.

Focus on word

A man has Ten Horses and nine stables as shown here.
[] [] [] [] [] [] [] [] []
The man wants to fit Ten Horses into nine stables. How can he fit Ten horses into nine stables? Submitted
Answer The answer is simple. It says the man wants to fit "Ten Horses" into nine stables. There are nine letters in the phrase "Ten Horses". So you can put one letter each in all nine stables.
[T] [E] [N] [H] [O] [R] [S] [E] [S]

Questions on various topics


  1. What does static variable mean?
  2. What is a pointer?
  3. What is a structure?
  4. What are the differences between structures and arrays?
  5. In header files whether functions are declared or defined? 
  6. What are the differences between malloc() and calloc()?
  7. What are macros? what are its advantages and disadvantages?
  8. Difference between pass by reference and pass by value?
  9. What is static identifier?
  10. Where are the auto variables stored?
  11. Where does global, static, local, register variables, free memory and C Program instructions get stored?
  12. Difference between arrays and linked list?
  13. What are enumerations?
  14. Describe about storage allocation and scope of global, extern, static, local and register variables?
  15. What are register variables? What are the advantage of using register variables?
  16. What is the use of typedef?
  17. Can we specify variable field width in a scanf() format string? If possible how?
  18. Out of fgets() and gets() which function is safe to use and why?
  19. Difference between strdup and strcpy?
  20. What is recursion?
  21. Differentiate between a for loop and a while loop? What are it uses?
  22. What are the different storage classes in C?
  23. Write down the equivalent pointer expression for referring the same element a[i][j][k][l]?
  24. What is difference between Structure and Unions?
  25. What the advantages of using Unions?
  26. What are the advantages of using pointers in a program?
  27. What is the difference between Strings and Arrays?
  28. In a header file whether functions are declared or defined?
  29. What is a far pointer? where we use it?
  30. How will you declare an array of three function pointers where each function receives two ints and returns a float?
  31. what is a NULL Pointer? Whether it is same as an uninitialized pointer?
  32. What is a NULL Macro? What is the difference between a NULL Pointer and a NULL Macro?
  33. What does the error 'Null Pointer Assignment' mean and what causes this error?
  34. What is near, far and huge pointers? How many bytes are occupied by them?
  35. How would you obtain segment and offset addresses from a far address of a memory location?
  36. Are the expressions arr and &arr same for an array of integers?
  37. Does mentioning the array name gives the base address in all the contexts?
  38. Explain one method to process an entire string as one unit?
  39. What is the similarity between a Structure, Union and enumeration?
  40. Can a Structure contain a Pointer to itself?
  41. How can we check whether the contents of two structure variables are same or not?
  42. How are Structure passing and returning implemented by the complier?
  43. How can we read/write Structures from/to data files?
  44. What is the difference between an enumeration and a set of pre-processor # defines?
  45. what do the 'c' and 'v' in argc and argv stand for?
  46. Are the variables argc and argv are local to main?
  47. What is the maximum combined length of command line arguments including the space between adjacent arguments?
  48. If we want that any wildcard characters in the command line arguments should be appropriately expanded, are we required to make any special provision? If yes, which?
  49. Does there exist any way to make the command line arguments available to other functions without passing them as arguments to the function?
  50. What are bit fields? What is the use of bit fields in a Structure declaration?
  51. To which numbering system can the binary number 1101100100111100 be easily converted to?
  52. Which bit wise operator is suitable for checking whether a particular bit is on or off?
  53. Which bit wise operator is suitable for turning off a particular bit in a number?
  54. Which bit wise operator is suitable for putting on a particular bit in a number?
  55. Which bit wise operator is suitable for checking whether a particular bit is on or off?
  56. which one is equivalent to multiplying by 2:Left shifting a number by 1 or Left shifting an unsigned int or char by 1?
  57. Write a program to compare two strings without using the strcmp() function.
  58. Write a program to concatenate two strings.
  59. Write a program to interchange 2 variables without using the third one.
  60. Write programs for String Reversal & Palindrome check
  61. Write a program to find the Factorial of a number
  62. Write a program to generate the Fibinocci Series
  63. Write a program which employs Recursion
  64. Write a program which uses Command Line Arguments
  65. Write a program which uses functions like strcmp(), strcpy()? etc
  66. What are the advantages of using typedef in a program?
  67. How would you dynamically allocate a one-dimensional and two-dimensional array of integers?
  68. How can you increase the size of a dynamically allocated array?
  69. How can you increase the size of a statically allocated array?
  70. When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?
  71. Which function should be used to free the memory allocated by calloc()?
  72. How much maximum can you allocate in a single call to malloc()?
  73. Can you dynamically allocate arrays in expanded memory?
  74. What is object file? How can you access object file?
  75. Which header file should you include if you are to develop a function which can accept variable number of arguments?
  76. Can you write a function similar to printf()?
  77. How can a called function determine the number of arguments that have been passed to it?
  78. Can there be at least some solution to determine the number of arguments passed to a variable argument list function?
  79. How do you declare the following:
    • An array of three pointers to chars
    • An array of three char pointers
    • A pointer to array of three chars
    • A pointer to function which receives an int pointer and returns a float pointer
    • A pointer to a function which receives nothing and returns nothing
  80. What do the functions atoi(), itoa() and gcvt() do?
  81. Does there exist any other function which can be used to convert an integer or a float to a string?
  82. How would you use qsort() function to sort an array of structures?
  83. How would you use qsort() function to sort the name stored in an array of pointers to string?
  84. How would you use bsearch() function to search a name stored in array of pointers to string?
  85. How would you use the functions sin(), pow(), sqrt()?
  86. How would you use the functions memcpy(), memset(), memmove()?
  87. How would you use the functions fseek(), freed(), fwrite() and ftell()?
  88. How would you obtain the current time and difference between two times?
  89. How would you use the functions randomize() and random()?
  90. How would you implement a substr() function that extracts a sub string from a given string?
  91. What is the difference between the functions rand(), random(), srand() and randomize()?
  92. What is the difference between the functions memmove() and memcpy()?
  93. How do you print a string on the printer?
  94. Can you use the function fprintf() to display the output on the screen?

C++- QUESTIONS                                        Go Up

  1. What is a class?
  2. What is an object?
  3. What is the difference between an object and a class?
  4. What is the difference between class and structure?
  5. What is public, protected, private?
  6. What are virtual functions?
  7. What is friend function?
  8. What is a scope resolution operator?
  9. What do you mean by inheritance?
  10. What is abstraction?
  11. What is polymorphism? Explain with an example.
  12. What is encapsulation?
  13. What do you mean by binding of data and functions?
  14. What is function overloading and operator overloading?
  15. What is virtual class and friend class?
  16. What do you mean by inline function?
  17. What do you mean by public, private, protected and friendly?
  18. When is an object created and what is its lifetime?
  19. What do you mean by multiple inheritance and multilevel inheritance? Differentiate between them.
  20. Difference between realloc() and free?
  21. What is a template?
  22. What are the main differences between procedure oriented languages and object oriented languages?
  23. What is R T T I ?
  24. What are generic functions and generic classes?
  25. What is namespace?
  26. What is the difference between pass by reference and pass by value?
  27. Why do we use virtual functions?
  28. What do you mean by pure virtual functions?
  29. What are virtual classes?
  30. Does c++ support multilevel and multiple inheritance?
  31. What are the advantages of inheritance?
  32. When is a memory allocated to a class?
  33. What is the difference between declaration and definition?
  34. What is virtual constructors/destructors?
  35. In c++ there is only virtual destructors, no constructors. Why?
  36. What is late bound function call and early bound function call? Differentiate.
  37. How is exception handling carried out in c++?
  38. When will a constructor executed?
  39. What is Dynamic Polymorphism?
  40. Write a macro for swapping integers.



  1. What is a data structure?
  2. What does abstract data type means?
  3. Evaluate the following prefix expression  " ++ 26 + - 1324" (Similar types can be asked)
  4. Convert the following infix expression to post fix notation  ((a+2)*(b+4)) -1  (Similar types can be asked)
  5. How is it possible to insert different type of elements in stack?
  6. Stack can be described as a pointer. Explain.
  7. Write a Binary Search program
  8. Write programs for Bubble Sort, Quick sort
  9. Explain about the types of linked lists
  10. How would you sort a linked list?
  11. Write the programs for Linked List (Insertion and Deletion) operations
  12. What data structure would you mostly likely see in a non recursive implementation of a recursive algorithm?
  13. What do you mean by Base case, Recursive case, Binding Time, Run-Time Stack and Tail Recursion?
  14. Explain quick sort and merge sort algorithms and derive the time-constraint relation for these.
  15. Explain binary searching, Fibinocci search.
  16. What is the maximum total number of nodes in a tree that has N levels? Note that the root is level (zero)
  17. How many different binary trees and binary search trees can be made from three nodes that contain the key values 1, 2 & 3?
  18. A list is ordered from smaller to largest when a sort is called. Which sort would take the longest time to execute?
  19. A list is ordered from smaller to largest when a sort is called. Which sort would take the shortest time to execute?
  20. When will you  sort an array of pointers to list elements, rather than sorting the elements themselves?
  21. The element being searched for is not found in an array of 100 elements. What is the average number of comparisons needed in a sequential search to determine that the element is not there, if the elements are completely unordered?
  22. What is the average number of comparisons needed in a sequential search to determine the position of an element in an array of 100 elements, if the elements are ordered from largest to smallest?
  23. Which sort show the best average behavior?
  24. What is the average number of comparisons in a sequential search?
  25. Which data structure is needed to convert infix notations to post fix notations?
  26. What do you mean by:
    • Syntax Error
    • Logical Error
    • Runtime Error
    How can you correct these errors?
  27. In which data structure, elements can be added or removed at either end, but not in the middle?
  28. How will inorder, preorder and postorder traversals print the elements of a tree?
  29. Parenthesis are never needed in prefix or postfix expressions. Why?
  30. Which one is faster? A binary search of an orderd set of elements in an array or a sequential search of the elements.


  1. What is the difference between an Abstract class and Interface?
  2. What is user defined exception?
  3. What do you know about the garbage collector?
  4. What is the difference between java and c++?
  5. In an htm form I have a button which makes us to open another page in 15 seconds. How will you do that?
  6. What is the difference between process and threads?
  7. What is update method called?
  8. Have you ever used HashTable and Directory?
  9. What are statements in Java?
  10. What is a JAR file?
  11. What is JNI?
  12. What is the base class for all swing components?
  13. What is JFC?
  14. What is the difference between AWT and Swing?
  15. Considering notepad/IE or any other thing as process, What will happen if you start notepad or IE 3 times ? Where three processes are started or three threads are started?
  16. How does thread synchronization occur in a monitor?
  17. Is there any tag in htm to upload and download files?
  18. Why do you canvas?
  19. How can you know about drivers and database information ?
  20. What is serialization?
  21. Can you load the server object dynamically? If so what are the 3 major steps involved in it?
  22. What is the layout for toolbar?
  23. What is the difference between Grid and Gridbaglayout?
  24. How will you add panel to a frame?
  25. Where are the card layouts used?
  26. What is the corresponding layout for card in swing?
  27. What is light weight component?
  28. Can you run the product development on all operating systems?
  29. What are the benefits if Swing over AWT?
  30. How can two threads be made to communicate with each other?
  31. What are the files generated after using IDL to java compiler?
  32. What is the protocol used by server and client?
  33. What is the functionability stubs and skeletons?
  34. What is the mapping mechanism used by java to identify IDL language?
  35. What is serializable interface?
  36. What is the use of interface?
  37. Why is java not fully objective oriented?
  38. Why does java not support multiple inheritance?
  39. What is the root class for all java classes?
  40. What is polymorphism?
  41. Suppose if we have a variable 'I' in run method, if I can create one or more thread each thread will occupy a separate copy or same variable will be shared?
  42. What are virtual functions?
  43. Write down how will you create a Binary tree?
  44. What are the traverses in binary tree?
  45. Write a program for recursive traverse?
  46. What are session variable in servlets?
  47. What is client server computing?
  48. What is constructor and virtual function? Can we call a virtual function in a constructor?
  49. Why do we use oops concepts? What is its advantage?
  50. What is middleware? What is the functionality of web server?
  51. Why is java not 100% pure oops?
  52. When will you use an interface and abstract class?
  53. What is the exact difference in between Unicast and Multicast object? Where will it be used?
  54. What is the main functionality of the remote reference layer?
  55. How do you download stubs from Remote place?
  56. I want to store more than 10 objects in a remote server? Which methodology will follow?
  57. What is the main functionality of Prepared Statement?
  58. What is meant by Static query and Dynamic query?
  59. What are Normalization Rules? Define Normalization?
  60. What is meant by Servelet? What are the parameters of service method?
  61. What is meant by Session? Explain something about HTTP Session Class?
  62. In a container there are 5 components. I want to display all the component names, how will you do that?
  63. Why there are some null interface in JAVA? What does it mean? Give some null interface in JAVA?
  64. Tell some latest versions in JAVA related areas?
  65. What is meant by class loader? How many types are there? When will we use them?
  66. What is meant by flickering?
  67. What is meant by distributed application? Why are we using that in our application?
  68. What is the functionality of the stub?
  69. Explain about version control?
  70. Explain 2-tier and 3-tier architecture?
  71. What is the role of Web Server?
  72. How can we do validation of the fields in a project?
  73. What is meant by cookies? Explain the main features?
  74. Why java is considered as platform independent?
  75. What are the advantages of java over C++?
  76. How java can be connected to a database?
  77. What is thread?
  78. What is difference between Process and Thread?
  79. Does java support multiple inheritance? if not, what is the solution?
  80. What are abstract classes?
  81. What is an interface?
  82. What is the difference abstract class and interface?
  83. What are adapter classes?
  84. what is meant wrapper classes?
  85. What are JVM.JRE, J2EE, JNI?
  86. What are swing components?
  87. What do you mean by light weight and heavy weight components?
  88. What is meant by function overloading and function overriding?
  89. Does java support function overloading, pointers, structures, unions or linked lists?
  90. What do you mean by multithreading?
  91. What are byte codes?
  92. What are streams?
  93. What is user defined exception?
  94. In an htm page form I have one button which makes us to open a new page in 15 seconds. How will you do that?        


  1. What is RMI?
  2. Explain about RMI Architecture?
  3. What are Servelets?
  4. What is the use of servlets?
  5. Explain RMI Architecture?
  6. How will you pass values from htm page to the servlet?
  7. How do you load an image in a Servelet?
  8. What is purpose of applet programming?
  9. How will you communicate between two applets?
  10. What IS the difference between Servelets and Applets?
  11. How do you communicate in between Applets and Servlets?
  12. What is the difference between applet and application?
  13. What is the difference between CGI and Servlet?
  14. In the servlets, we are having a web page that is invoking servlets ,username and password? which is checks in database? Suppose the second page also if we want to verify the same information whether it will connect to the database or it will be used previous information?
  15. What are the difference between RMI and Servelets?
  16. How will you call an Applet using Java Script Function?
  17. How can you push data from an Applet to a Servlet?
  18. What are 4 drivers available in JDBC? At what situation are four of the drivers used?
  19. If you are truncated using JDBC , how can you that how much data is truncated?
  20. How will you perform truncation using JDBC?
  21. What is the latest version of JDBC? What are the new features added in that?
  22. What is the difference between RMI registry and OS Agent?
  23. To a server method, the client wants to send a value 20, with this value exceeds to 20 a message should be sent to the client . What will you do for achieving this?
  24. How do you invoke a Servelet? What is the difference between doPost method and doGet method?
  25. What is difference between the HTTP Servelet and Generic Servelet? Explain about their methods and parameters?
  26. Can we use threads in Servelets?
  27. Write a program on RMI and JDBC using Stored Procedure?
  28. How do you swing an applet?
  29. How will you pass parameters in RMI? Why do you serialize?
  30. In RMI ,server object is first loaded into memory and then the stub reference is sent to the client. true or false?
  31. Suppose server object not loaded into the memory and the client request for it. What will happen?
  32. What is the web server used for running the servelets?
  33. What is Servlet API used for connecting database?
  34. What is bean? Where can it be used?
  35. What is the difference between java class and bean?
  36. Can we sent objects using Sockets?
  37. What is the RMI and Socket?
  38. What is CORBA?
  39. Can you modify an object in CORBA?
  40. What is RMI and what are the services in RMI?
  41. What are the difference between RMI and CORBA?
  42. How will you initialize an Applet?
  43. What is the order of method invocation in an Applet?
  44. What is ODBC and JDBC? How do you connect the Database?
  45. What do you mean by Socket Programming?
  46. What is difference between Generic Servlet and HTTP Servelet?
  47. What you mean by COM and DCOM?
  48. what is e-commerce?


  1. What are the basic functions of an operating system?
  2. Explain briefly about, processor, assembler, compiler, loader, linker and the functions executed by them.
  3. What are the difference phases of software development? Explain briefly?
  4. Differentiate between RAM and ROM?
  5. What is DRAM? In which form does it store data?
  6. What is cache memory?
  7. What is hard disk and what is its purpose?
  8. Differentiate between Complier and Interpreter?
  9. What are the different tasks of Lexical analysis?
  10. What are the different functions of Syntax phase, Sheduler?
  11. What are the main difference between Micro-Controller and Micro- Processor?
  12. Describe different job scheduling in operating systems.
  13. What is a Real-Time System ?
  14. What is the difference between Hard and Soft real-time systems ?
  15. What is a mission critical system ?
  16. What is the important aspect of a real-time system ?
  17.  If two processes which shares same system memory and system clock in a distributed system, What is it called?
  18. What is the state of the processor, when a process is waiting for some event to occur?
  19. What do you mean by deadlock?
  20. Explain the difference between microkernel and macro kernel.
  21. Give an example of microkernel.
  22. When would you choose bottom up methodology?
  23. When would you choose top down methodology?
  24. Write a small dc shell script to find number of FF in the design.
  25. Why paging is used ?
  26. Which is the best page replacement algorithm and Why? How much time is spent usually in each phases and why?
  27. Difference between Primary storage and secondary storage?
  28. What is multi tasking, multi programming, multi threading?
  29. Difference between multi threading and multi tasking?
  30. What is software life cycle?
  31. Demand paging, page faults, replacement algorithms, thrashing, etc.
  32. Explain about paged segmentation and segment paging
  33. While running DOS on a PC, which command would be used to duplicate the entire diskette?


  1. Which type of architecture  8085 has?
  2. How many memory locations can be addressed by a microprocessor with 14 address lines?
  3. 8085 is how many bit microprocessor?
  4. Why is data bus bi-directional?
  5. What is the function of accumulator?
  6. What is flag, bus?
  7. What are tri-state devices and why they are essential in a bus oriented system?
  8. Why are program counter and stack pointer 16-bit registers?
  9. What does it mean by embedded system?
  10. What are the different addressing modes in 8085?
  11. What is the difference between MOV and MVI?
  12. What are the functions of RIM, SIM, IN?
  13. What is the immediate addressing mode?
  14. What are the different flags in 8085?
  15. What happens during DMA transfer?
  16. What do you mean by wait state? What is its need?
  17. What is PSW?
  18. What is ALE? Explain the functions of ALE in 8085.
  19. What is a program counter? What is its use?
  20. What is an interrupt?
  21. Which line will be activated when an output device require attention from CPU?


  1. What is meant by D-FF?
  2. What is the basic difference between Latches and Flip flops?
  3. What is a multiplexer?
  4. How can you convert an SR Flip-flop to a JK Flip-flop?
  5. How can you convert an JK Flip-flop to a D Flip-flop?
  6. What is Race-around problem? How can you rectify it?
  7. Which semiconductor device is used as a voltage regulator and why?
  8. What do you mean by an ideal voltage source?
  9. What do you mean by zener breakdown and avalanche breakdown?
  10. What are the different types of filters?
  11. What is the need of filtering ideal response of filters and actual response of filters?
  12. What is sampling theorem?
  13. What is impulse response?
  14. Explain the advantages and disadvantages of FIR filters compared to IIR counterparts.
  15. What is CMRR? Explain briefly.
  16. What do you mean by half-duplex and full-duplex communication? Explain briefly.
  17. Which range of signals are used for terrestrial transmission?
  18. What is the need for modulation?
  19. Which type of modulation is used in TV transmission?
  20. Why we use vestigial side band (VSB-C3F) transmission for picture?
  21. When transmitting digital signals is it necessary to transmit some harmonics in addition to fundamental frequency?
  22. For asynchronous transmission, is it necessary to supply some synchronizing pulses additionally or to supply or to supply start and stop bit?
  23. BPFSK is more efficient than BFSK in presence of noise. Why?
  24. What is meant by pre-emphasis and de-emphasis?
  25. What do you mean by 3 dB cutoff frequency? Why is it 3 dB, not 1 dB?
  26. What do you mean by ASCII, EBCDIC?