You are on page 1of 33

 Question 1. What Is An Object In C++?

Answer :

An object is a package that contains related data and instructions. The data relates to what the
object represents, while the instructions define how this object relates to other objects and itself.

 Question 2. What Is A Message?

Answer :

A message is a signal from one object to another requesting that a computation take place. It is
roughly equivalent to a function call in other languages.

 Question 3. What Is A Class?

Answer :

A class defines the characteristics of a certain type of object. It defines what its members will
remember, the messages to which they will respond, and what form the response will take.

 Question 4. What Is An Instance?

Answer :

An individual object that is a member of some class.

 Question 5. What Is A Super-class?

Answer :

Given a class, a super-class is the basis of the class under consideration. The given class is
defined as a subset (in some respects) of the super-class. Objects of the given class potentially
posses all the characteristics belonging to objects of the super-class.

 Question 6. What Is Inheritance?

Answer :

Inheritance is property such that a parent (or super) class passes the characteristics of itself to
children (or sub) classes that are derived from it. The sub-class has the option of modifying these
characteristics in order to make a different but fundamentally related class from the super-class.

 Question 7. To What Does Message Protocol Refer?

Answer :
An object’s message protocol is the exact form of the set of messages to which the object can
respond.

 Question 8. What Is Polymorphism?

Answer :

Polymorphism refers to the ability of an object to respond in a logically identical fashion to


messages of the same protocol, containing differing types of objects. Consider 1 + 5 and 1 + 5.1.
In the former, the message “+ 5” is sent to an object of class integer (1). In the later, the message
“+ 5.1” is sent to the same integer object. The form of the message (its protocol) is identical in
both cases. What differs is the type of object on the right-hand side of these messages. The
former is an integer object (5) while the later is a floating point object (5.1). The receiver (1)
appears (to other objects) to respond in the same way to both messages. Internally, however, it
knows that it must treat the two types of objects differently in order to obtain the same overall
response.

 Question 9. What Are Instance Variables?

Answer :

These represent an object’s private memory. They are defined in an object’s class.

 Question 10. What Are Class Variables?

Answer :

These represent a class’s memory which it shares with each of its instances.

 Question 11. What Is A Method?

Answer :

A method is a class’s procedural response to a given message protocol. It is like the definition of
a procedure in other languages.

 Question 12. In C++ What Is A Constructor? A Destructor?

Answer :

A constructors and destructors are methods defined in a class that are invoked automatically
when an object is created or destroyed. They are used to initialize a newly allocated object and to
cleanup behind an object about to be removed.

 Question 13. Compare And Contrast C And C++.?


Answer :

Comparison: C++ is an extension to the C language. When C++ is used as a procedural


language, there are only minor syntactical differences between them.

Contrast: When used as a procedural language, C++ is a better C because:

 It vigorously enforces data typing conventions.


 It allows variables to be defined where they are used.
 It allows the definition of real (semantically significant) constants.
 It allows for automatic pointer dereferencing.
 It supports call-by-reference in addition to call-by-value in functions.
 It supports tentative variable declarations (when the type and location of a variable
cannot be known before hand.

As an object oriented language, C++ introduces much of the OOP paradigm while allowing a
mixture of OOP and procedural styles.

 Question 14. What Is Operator Overloading?

Answer :

It is the process of, and ability to redefine the way an object responds to a C++ operator symbol.
This would be done in the object’s class definition.

 Question 15. What Is Cin And Cout?

Answer :

They are objects corresponding to a program’s default input and output files.

Contrast procedural and object oriented programming.

The procedural paradigm performs computation through a step-by-step manipulation of data


items. Solving problems this way is akin to writing a recipe. ie: All the ingredients (data items)
are defined. Next a series of enumerated steps (statements) are defined to transform the raw
ingredients into a finished meal.

The object oriented model, in contrast, combines related data and procedural information into a
single package called an object. Objects are meant to represent logically separate entities (like
real world objects). Objects are grouped together (and defined by) classes. (This is analogous to
user defined data types in procedural languages.) Classes may pass-on their “makeup” to classes
derived from them. In this way, Objects that are of a similar yet different nature need not be
defined from scratch.
Computation occurs though the intercommunication of objects. Programming this way is like
writing a play. First the characters are defined with their attributes and personalities. Next the
dialog is written so that the personalities interact. The sum total constitutes a drama.

 Question 16. How Do You Link A C++ Program To C Functions?

Answer :

By using the extern “C” linkage specification around the C function declarations.

You should know about mangled function names and type-safe linkages. Then you should
explain how the extern “C” linkage specification statement turns that feature off during
compilation so that the linker properly links function calls to C functions.

 Question 17. Explain The Scope Resolution Operator.?

Answer :

The scope resolution operator permits a program to reference an identifier in the global scope
that has been hidden by another identifier with the same name in the local scope.

The answer can get complicated. It should start with “colon-colon,” however. (Some readers had
not heard the term, “scope resolution operator,” but they knew what :: means. You should know
the formal names of such things so that you can understand all communication about them.) If
you claim to be well into the design or use of classes that employ inheritance, you tend to
address overriding virtual function overrides to explicitly call a function higher in the hierarchy.
That’s good knowledge to demonstrate, but address your comments specifically to global scope
resolution. Describe C++’s ability to override the particular C behavior where identifiers in the
global scope are always hidden by similar identifiers in a local scope.

 Question 18. What Are The Differences Between A C++ Struct And C++ Class?

Answer :

The default member and base class access specifiers are different.

This is one of the commonly misunderstood aspects of C++. Believe it or not, many
programmers think that a C++ struct is just like a C struct, while a C++ class has inheritance,
access specifiers, member functions, overloaded operators, and so on. Some of them have even
written books about C++. Actually, the C++ struct has all the features of the class.

The only differences are that a struct defaults to public member access and public base class
inheritance, and a class defaults to the private access specifier and private base class inheritance.
Getting this question wrong does not necessarily disqualify you because you will be in plenty of
good company. Getting it right is a definite plus.

 Question 19. How Many Ways Are There To Initialize An Int With A Constant?

Answer :

There are two formats for initializers in C++ as shown in Example 1. Example 1(a) uses the
traditional C notation, while Example 1(b) uses constructor notation. Many programmers do not
know about the notation in Example 1(b), although they should certainly know about the first
one. Many old-timer C programmers who made the switch to C++ never use the second idiom,
although some wise heads of C++ profess to prefer it.

A reader wrote to tell me of two other ways, as shown in Examples 2(a) and 2(b), which made
me think that maybe the answer could be extended even further to include the initialization of an
int function parameter with a constant argument from the caller.

 Question 20. How Does Throwing And Catching Exceptions Differ From Using Setjmp
And Longjmp?

Answer :

The throw operation calls the destructors for automatic objects instantiated since entry to the try
block.

Exceptions are in the mainstream of C++ now, so most programmers, if they are familiar with
setjmp and longjmp, should know the difference. Both idioms return a program from the nested
depths of multiple function calls to a defined position higher in the program.

The program stack is “unwound” so that the state of the program with respect to function calls
and pushed arguments is restored as if the calls had not been made. C++ exception handling adds
to that behavior the orderly calls to the destructors of automatic objects that were instantiated as
the program proceeded from within the try block toward where the throw expression is
evaluated.

It’s okay to discuss the notational differences between the two idioms. Explain the syntax of try
blocks, catch exception handlers, and throw expressions. Then specifically address what happens
in a throw that does not happen in a longjmp. Your answer should reflect an understanding of the
behavior described in the answer just given.

One valid reason for not knowing about exception handling is that your experience is exclusively
with older C++ compilers that do not implement exception handling. I would prefer that you
have at least heard of exception handling, though.
It is not unusual for C and C++ programmers to be unfamiliar with setjmp/ longjmp. Those
constructs are not particularly intuitive. A C programmer who has written recursive descent
parsing algorithms will certainly be familiar with setjmp/ longjmp.

Others might not, and that’s acceptable. In that case, you won’t be able to discuss how
setjmp/longjmp differs from C++ exception handling, but let the interview turn into a discussion
of C++ exception handling in general. That conversation will reveal to the interviewer a lot about
your overall understanding of C++.

 Question 21. What Is Your Reaction To This Line Of Code?

Answer :

delete this;

It’s not a good practice.

A good programmer will insist that the statement is never to be used if the class is to be used by
other programmers and instantiated as static, extern, or automatic objects. That much should be
obvious.

The code has two built-in pitfalls. First, if it executes in a member function for an extern, static,
or automatic object, the program will probably crash as soon as the delete statement executes.
There is no portable way for an object to tell that it was instantiated on the heap, so the class
cannot assert that its object is properly instantiated.

Second, when an object commits suicide this way, the using program might not know about its
demise. As far as the instantiating program is concerned, the object remains in scope and
continues to exist even though the object did itself in. Subsequent dereferencing of the pointer
can and usually does lead to disaster.

A reader pointed out that a class can ensure that its objects are instantiated on the heap by
making its destructor private. This idiom necessitates a kludgy DeleteMe kind of function
because the instantiator cannot call the delete operator for objects of the class. The DeleteMe
function would then use “delete this.”

I got a lot of mail about this issue. Many programmers believe that delete this is a valid
construct. In my experience, classes that use delete this when objects are instantiated by users
usually spawn bugs related to the idiom, most often when a program dereferences a pointer to an
object that has already deleted itself.

 Question 22. What Is A Default Constructor?

Answer :
A constructor that has no arguments or one where all the arguments have default argument
values.

If you don’t code a default constructor, the compiler provides one if there are no other
constructors. If you are going to instantiate an array of objects of the class, the class must have a
default constructor.

 Question 23. What Is A Conversion Constructor?

Answer :

A constructor that accepts one argument of a different type.

The compiler uses this idiom as one way to infer conversion rules for a class. A constructor with
more than one argument and with default argument values can be interpreted by the compiler as
a conversion constructor when the compiler is looking for an object of the type and sees an
object of the type of the constructor’s first argument.

 Question 24. What Is The Difference Between A Copy Constructor And An Overloaded
Assignment Operator?

Answer :

A copy constructor constructs a new object by using the content of the argument object. An
overloaded assignment operator assigns the contents of an existing object to another existing
object of the same class.

First, you must know that a copy constructor is one that has only one argument, which is a
reference to the same type as the constructor. The compiler invokes a copy constructor wherever
it needs to make a copy of the object, for example to pass an argument by value. If you do not
provide a copy constructor, the compiler creates a member-by-member copy constructor for you.

You can write overloaded assignment operators that take arguments of other classes, but that
behavior is usually implemented with implicit conversion constructors. If you do not provide an
overloaded assignment operator for the class, the compiler creates a default member-by-member
assignment operator.

This discussion is a good place to get into why classes need copy constructors and overloaded
assignment operators. By discussing the requirements with respect to data member pointers that
point to dynamically allocated resources, you demonstrate a good grasp of the problem.

 Question 25. When Should You Use Multiple Inheritance?

Answer :
There are three acceptable answers: “Never,” “Rarely,” and “When the problem domain cannot
be accurately modeled any other way.”

There are some famous C++ pundits and luminaries who disagree with that third answer, so be
careful.

Let’s digress to consider this issue lest your interview turn into a religious debate. Consider an
Asset class, Building class, Vehicle class, and CompanyCar class. All company cars are vehicles.
Some company cars are assets because the organizations own them. Others might be leased. Not
all assets are vehicles. Money accounts are assets. Real-estate holdings are assets. Some real-
estate holdings are buildings. Not all buildings are assets. Ad infinitum.

When you diagram these relationships, it becomes apparent that multiple inheritance is an
intuitive way to model this common problem domain. You should understand, however, that
multiple inheritance, like a chainsaw, is a useful tool that has its perils, needs respect, and is best
avoided except when nothing else will do. Stress this understanding because your interviewer
might share the common bias against multiple inheritance that many object-oriented designers
hold.

 Question 26. What Is A Virtual Destructor?

Answer :

The simple answer is that a virtual destructor is one that is declared with the virtual attribute.

The behavior of a virtual destructor is what is important. If you destroy an object through a
pointer or reference to a base class, and the base-class destructor is not virtual, the derived-class
destructors are not executed, and the destruction might not be complete.

 Question 27. Explain The Isa And Hasa Class Relationships. How Would You Implement
Each In A Class Design?

Answer :

A specialized class “is a” specialization of another class and, therefore, has the ISA relationship
with the other class. An Employee ISA Person. This relationship is best implemented with
inheritance. Employee is derived from Person.

A class may have an instance of another class. For example, an Employee “has a” Salary,
therefore the Employee class has the HASA relationship with the Salary class. This relationship
is best implemented by embedding an object of the Salary class in the Employee class.

The answer to this question reveals whether you have an understanding of the fundamentals of
object-oriented design, which is important to reliable class design.
There are other relationships. The USESA relationship is when one class uses the services of
another. The Employee class uses an object (cout) of the ostream class to display the employee’s
name onscreen, for example. But if you get ISA and HASA right, you usually don’t need to go
any further.

 Question 28. When Is A Template A Better Solution Than A Base Class?

Answer :

When you are designing a generic class to contain or otherwise manage objects of other types,
when the format and behavior of those other types are unimportant to their containment or
management, and particularly when those other types are unknown (thus the genericity) to the
designer of the container or manager class.

Prior to templates, you had to use inheritance; your design might include a generic List container
class and an application-specific Employee class. To put employees in a list, a ListedEmployee
class is multiply derived (contrived) from the Employee and List classes. These solutions were
unwieldy and error-prone. Templates solved that problem.

 Question 29. What Is The Difference Between C And C++ ? Would You Prefer To Use
One Over The Other ?

Answer :

C is based on structured programming whereas C++ supports the object-oriented programming


paradigm.Due to the advantages inherent in object-oriented programs such as modularity and
reuse, C++ is preferred. However almost anything that can be built using C++ can also be built
using C.

 Question 30. What Are The Access Privileges In C++ ? What Is The Default Access Level
?

Answer :

The access privileges in C++ are private, public and protected. The default access level assigned
to members of a class is private. Private members of a class are accessible only within the class
and by friends of the class. Protected members are accessible by the class itself and it’s sub-
classes. Public members of a class can be accessed by anyone.

 Question 31. What Is Data Encapsulation ?

Answer :

Data Encapsulation is also known as data hiding. The most important advantage of encapsulation
is that it lets the programmer create an object and then provide an interface to the object that
other objects can use to call the methods provided by the object.
The programmer can change the internal workings of an object but this transparent to other
interfacing programs as long as the interface remains unchanged.

 Question 32. What Is Inheritance ?

Answer :

Inheritance is the process of deriving classes from other classes. In such a case, the sub-class has
an ‘is-a’ relationship with the super class. For e.g. vehicle can be a super-class and car can be a
sub-class derived from vehicle. In this case a car is a vehicle.

The super class ‘is not a’ sub-class as the sub- class is more specialized and may contain
additional members as compared to the super class. The greatest advantage of inheritance is that
it promotes generic design and code reuse.

 Question 33. What Is Multiple Inheritance ? What Are It’s Advantages And
Disadvantages ?

Answer :

Multiple Inheritance is the process whereby a sub-class can be derived from more than one super
class. The advantage of multiple inheritance is that it allows a class to inherit the functionality of
more than one base class thus allowing for modeling of complex relationships.

The disadvantage of multiple inheritance is that it can lead to a lot of confusion when two base
classes implement a method with the same name.

 Question 34. What Do The Keyword Static And Const Signify?

Answer :

When a class member is declared to be of a static type, it means that the member is not an
instance variable but a class variable. Such a member is accessed using Classname.Membername
(as opposed to Object.Membername). Const is a keyword used in C++ to specify that an object’s
value cannot be changed.

 Question 35. How Is Memory Allocated/deallocated In C ? How About C++ ?

Answer :

Memory is allocated in C using malloc() and freed using free(). In C++ the new() operator is
used to allocate memory to an object and the delete() operator is used to free the memory taken
up by an object.

 Question 36. What Is Uml?


Answer :

UML refers to Unified Modeling Language. It is a language used to model OO problem spaces
and solutions.

 Question 37. What Is The Difference Between A Shallow Copy And A Deep Copy?

Answer :

A shallow copy simply creates a new object and inserts in it references to the members of the
original object. A deep copy constructs a new object and then creates in it copies of each of the
members of the original object.

 Question 1. What Is A Computer?

Answer :

Computer is a programmable machine. It the integral part of everyday life.

 Question 2. What Are The Different Functions Of A Computer?

Answer :

A computer does the following functions;


a) Accepting data
b) Processing Data
c) Storing Data
d) Displaying Data

 Question 3. How A Minicomputer Different From A Mainframe?

Answer :

Minicomputer is a midsized multiprocessing and multi user computer. It is also called mid-range
server. But mainframes are huge computers, most commonly occupying entire rooms or floor. It
is highly costly.

 Question 4. What Is Super Computer?

Answer :

The fastest type of computer. Supercomputers are very expensive and are employed for
specialized applications that require immense amounts of mathematical calculations. For
example, weather forecasting requires a supercomputer. Other uses of supercomputers include
animated graphics, fluid dynamic calculations, nuclear energy research, and petroleum
exploration.
 Question 5. Differentiate Input And Output Device?

Answer :

Input devices are used for giving input to the computer. But output devices are used to get the
result back from the computer. The examples of input devices are keyboard, mouse, scanner,
digital camera atc...whereas output devices include monitor, printer, projector etc....

 Question 6. What Is A Storage Device? What Is The Common Classification?

Answer :

Storage devices are used to store data in the computer. The different types of storage devices are:
a) Magnetic Devices.
b) Optical Devices.
c) Solid-State Storage Devices.

 Question 7. What Do You Mean By A Processing Device? What Are The Various Types
Of Processing Devices?

Answer :

The main function of a computer is to process data. The various types of processing device in a
computer are:
a) Microprocessor
b) Chipset
c) BIOS

 Question 8. Differentiates Serial And Parallel Port?

Answer :

Serial port and parallel port are used for transferring data in/out of the computer. In serial port
transmission only 1 bit is transmitted at a time. Most serial ports on personal computers conform
to the RS-232C or RS-422 standards. A parallel interface for connecting an external device such
as a printer. On PCs, the parallel port uses a 25-pin connector (type DB-25) and is used to
connect printers, computers and other devices that need relatively high bandwidth. It uses
parallel transmission of data.

 Question 9. What Is An Interface?

Answer :

These are the communication channel that enables your computer to exchange information with
various devices.
 Question 10. What Is A Microprocessor?

Answer :

The most important electronic component on the computer. It is a programmable logical device
for processing data. In the world of personal computers, the terms MICROPROCESSOR and
CPU are used interchangeably.

 Question 11. What Are The Factors Affecting The Speed Of The Microprocessor?

Answer :

The following are the factors affecting the speed of the microprocessor.
a) Number of instructions build in the processor.
b) Bandwidth
c) Clock Speed
d) Number of transistors inside the processor

 Question 12. What Are The Differences Between Multitasking And Multiprocessing?

Answer :

Multitasking: Enables the processor to do multiple programs simultaneously by fast switching


through the programs. Here doesn't have the involvement of multiple processors.

Multiprocessing: Enables the processor to do multiple programs simultaneously by the use of


multiple processors.

 Question 13. What The Difference Between Fsb And Bsb?

Answer :

Front Side Bus. Another name for the system bus. The Front Side Bus connects the CPU to main
memory. A microprocessor bus that connects the CPU to aLevel 2 cache is called Back Side Bus.
Typically, a backside bus runs at a faster clock speed than the Front Side Bus.

 Question 14. What Is Packaging A Microprocessor? What Are The Different Packaging
Available?

Answer :

Packaging is the process of connecting a microprocessor with a computers motherboard. The


types of microprocessor packaging are:
a) PGA
b) SPGA
c) SECC
d) LGA

 Question 15. What Is Lga ?

Answer :

An LGA socket is the connection point for a central processing unit (CPU) to fit into a
motherboard. The LGA stands for Land Grid Array.

 Question 16. What Is Cisc And Risc?

Answer :

Reduced Instruction Set Computer (RISC) and Complex Instruction Set Computer (CISC) are
two philosophies by which computer chips are designed. RISC became a popular technology
buzzword in the 1990s, and many processors used in the enterprise business segment were RISC-
based.

 Question 17. What Is Intel Pentium?

Answer :

The Intel Pentium is a series of microprocessors first developed by the Intel Corporation. These
types of processors have been found in many personal computers since 1993.

 Question 18. Any Difference Between Pentium Iii And Iv?

Answer :

There have been a number of Pentium processor lines starting with the base Pentium in 1993.The
of the recent Pentium entries are Pentium III and Pentium 4.

a) In a Pentium III processor, the bus speed is generally 133 MHz (although there were a few
with 100 MHz). The lowest bus speed on a Pentium IV is 400 MHz, and there are versions with
much higher speeds (topping at 1066 MHz for the "extreme edition").
b) The Pentium 4s are smaller than the Pentium IIIs
c) Pentium III processors had (for the most part) about 512 KB of cache. Pentium 4 processors,
on the other hand, start at 512 KB.

 Question 19. What Are The Differences Between Intel Celeron And Pentium Family Of
Processors?

Answer :

Celeron
 According to Build Gaming Computers, Celeron processors are the low-end processor
intended for standard home computer use. SciNet reports the best Celeron processor has
an L2 Cache of 128kb, a clock speed limit of about 2.0 GHz and runs at a core voltage of
1.75V. These are useful numbers for comparison.

Pentium

 The top Pentium processor is the Pentium 4 Prescott. CPU Scorecard reports it has an L2
cache of 1MB (1024kb), a potential 3.0 GHz clock speed and runs at about 1.4V. The
lowest performing Pentium 4 processor, the Willamette, has an L2 cache of 256kb, a
potential 2.0 GHz clock speed and runs at about 1.7V.

 Question 20. What Is Hyper Threading? What Is The Use Of It?

Answer :

A thread of execution, or simply a "thread," is one series of instructions sent to the CPU. Hyper-
threading is a technology developed to help make better use of spare processing cycles. Hyper-
threaded processors have a duplicate set of registers, small spaces of high-speed memory storage
used to hold the data that is currently needed to execute a thread.

When a CPU core is delayed, waiting for data to be retrieved from another place in memory, it
can use these duplicate registers to spend the spare computation cycles executing a different
thread. The second set of registers will be pre-loaded with the data needed to execute the second
thread, so the CPU core can begin work immediately

 Question 21. What Is Intel Atom Processor?

Answer :

The Intel Atom family of processors are extremely small central processing units (CPU) found
mostly in ultraportable devices, such as netbooks, cell phones and tablet PCs, according to Intel.
While small and light on energy use, Atom processors can handle the most common tasks, such
as email and instant messaging.

 Question 22. What Is Nehalem Architecture?

Answer :

Nehalem is Intel's new microprocessor architecture The Core i7 chips were the first processors
ever produced using an architecture called Nehalem.

 Question 23. Which Is A Heavy-duty Microprocessor Of Intel?

Answer :
Intel Xeon.

 Question 24. Which Is The Processor Suitable From Intel Family Of Processors For
Server And Workstation?

Answer :

Intel Xeon

 Question 25. What Is Full Name Of Amd?

Answer :

Advanced Micro Devices.

 Question 26. What Are The Latest Processor Of Intel And Amd?

Answer :

For intel it is Intel Core i7 and AMD Opteron 6200 Series processor.

 Question 27. Write Socket Lga 775 Is Apt For Which Type Of Intel Processors?

Answer :

The top of the line for the LGA775 series CPU socket was the Core 2 processor series, with the
Core 2 Duo E8600, Core 2 Extreme QX9770 and Core 2 Quad Q9650 being the three top
performers.

 Question 28. Socket 939 Is Developed By Amd. It Supports A Maximum Of How Many
Bits Of Computing? What Are The The Different Processors Of Amd Is Suitable For This
Socket?

Answer :

AMD Athlon 64, AMD Athlon 64FX and AMD Athlon 64 X2.

 Question 29. Which Type Of Socket Is Needed To Connect A Dual Core Processor Of
Intel?

Answer :

Socket LGA 775.

 Question 30. What Is Heat Sink? What Is Its Use? If It Is Not In The System What Will
Happen?
Answer :

A heat sink is a component used to lower the temperature of a device.It is most commonly there
on the microprocessor. If it is not properly fixed the system, the system will shutdown
automatically to prevent further damage to the processor.

 Question 31. A Cpu Fan Should Be Placed In System. Why?

Answer :

To make the system cool and more functioning.

 Question 32. What Are The Causes Of Overheating Of Microprocessor?

Answer :

a) Processor fan may not be properly connected.


b) Heat sink may be not contacted with the processor.
c) Jumpers may be configured to over clock the CPU.
d) Voltage supply incompatible

 Question 33. No Display. What Is The Problem?

Answer :

a) CPU fan problem


b) Heat sink related issue
c) Power related issues
d) Improper Jumper settings

 Question 34. What Is The Use Of Conventional Memory In The System?

Answer :

The size of conventional memory is 640KB. It is also called DOS memory or Base memory. This
memory is used by some small programs like Word star, Lotus etc…DOS cannot use more than
640KB.

 Question 35. What Is Main Memory In A Computer?

Answer :

The main memory in a computer is called Random Access Memory. It is also known as RAM.
This is the part of the computer that stores operating system software, software applications and
other information for the central processing unit (CPU) to have fast and direct access when
needed to perform tasks.
 Question 36. What Is Cache Memory? What Is The Advantage If A Processor With
More Cache Memory You Are Using?

Answer :

Cache memory is the memory area between RAM and Processor. If cache memory increases the
speed of the system will also improved.

 Question 37. What Are The Different Types Of Ram?

Answer :

SRAM, DRAM, VRAM, SGRAM, DDR-SDRAM etc….

 Question 38. Differentiate Sram And Dram?

Answer :

SRAM

Static RAM stores each bit of data on six metal oxide semiconductor field effect transistors, or
MOSFETs. SRAM is used in devices that require the fastest possible data access without
requiring a high capacity. Some examples are CPU caches and buses, hard drive and router
buffers and printers.

DRAM

Dynamic RAM stores data using a paired transistor and capacitor for each bit of data. Capacitors
constantly leak electricity, which requires the memory controller to refresh the DRAM several
times a second to maintain the data.

 Question 39. What Are The Different Dram Types?

Answer :

FPMDRAM, EDO DRAM, SDRAM, RDRAM, DDR-SDRAM

 Question 40. What Is The Difference Between Ddr-i And Ddr-ii?

Answer :

DDR2 is the successor to DDR RAM. DDR 2 incorporates several technological upgrades to
computer system memory, as well as an enhanced data rate.DDR 2 is capable of achieving twice
the data transfer rate of DDR-I memory because of its higher clock speed. It operates at a lower
voltage than DDR-I as well: 1.8 volts instead of 2.5
1.What is a file?

Answer:
A file is a named location which stores data or information permanently. A file is always stored
inside a storage device using file name (e.g. STUDENT.MARKS). A file name normally has
primary and secondary name separated by a “.”(DOT).

2.What is a class?

Answer:
A class is a blueprint from which objects are created. A class contains methods and variables
associated with an instance of a class.

3.What is an object?

Answer:
An object is an instance of a class. For example
class Abc{ —– This is a class
int a; —— This is a variable
public Abc(); —- This is contractor
public static void main (String args[]) ——- This is a method
{
Abc a= new Abc(); —— This is object creation where ‘a’ is the reference variable or object
name
}
}

4.What is a constructor?

Answer:
A constructor is methods which are used to create an Object of class. There are two types of
constructor Default & Parameterized constructor.

5.What is the different OOPS principle?

Answer:
The basic OOPS principle are as follows,

 Encapsulation
 Abstraction
 Inheritance
 Polymorphism

6.What is inheritance?
Answer:
Inheritance is property in which the property of a parent class(Superclass) is passed on to child
class(Subclass). For example
class Abc{ —– This is a class
int a; —— This is a variable
public void abc(){} — Methods
}
class Xyz extends Abc —–(Extend is the keyword, Xyz is the subclass which inherits the
properties of ABC parent class.)
{
public static void main (String args[]) ——- This is a method
{
Abc a= new Abc(); —— This is object creation where ‘a’ is the reference variable or object
name
}
}

7.What is polymorphism?

Answer:
Polymorphism is the ability of an object to take on multiple forms. Most commonly
polymorphism is used in OOP when a parent class reference is used to refer to a child class
object.

8.What are instance and class variables?

Answer:
Instance variable belongs to a particular instance of that class whereas Class variable. A class
variable is also known as static variables. For example
public class Abc{
public int a; …….. This is an instance variable
public static int a1;…….. This is a static or class variable
……………………..
……………..
}

9.Compare method and constructor?

Answer:
Constructor: Used to initialize the instance of a class.
Method: Used to perform some function or operation.

Constructor: Doesn’t have a return type.


Method: Has a return type.

10.What is a singleton class?


Answer:
Singleton class limits the number of objects created for a class to one but gives the flexibility of
creating more objects if the situation changes.

11.What are the steps for creating the object?

Answer:
An object is first declared then instantiated and at last declared. For example
Abc a= new Abc();

12.What is the different type of access modifiers?

Answer:
There are four type of access modifiers as given below:-
• Visible to the overall package. No modifier needed.
• Private – Visible to class only.
• Public – Visible to the world.
• Protected – Visible to package and subclass.

13.Which is the highest operator precedence in Java

Answer:
The operator with the highest preference is Postfix operators i.e () [].

14.What is an array?

Answer:
The array is a container which holds the fixed number of similar data types.

15.What is the difference between equals() and method and == operator?

Answer:
The equals() is a method and it matches the content of the strings whereas == is an operator and
matches object or reference of the strings.

16.Is string class final?

Answer:
Yes

17.What is a wrapper class?

Answer:
To access the primitive data type as an object we use wrapper class. They are following:-
Primitive Type Wrapper class
boolean Boolean
char Character
byte Byte
short Short
int Integer
long Long
float Float
double Double

18.Difference between overloading and overriding?

Answer:
Overloading is when two or more methods in the same class have the same method name but
different parameters(i.e different method signatures).
Overriding is when two methods having the same method name and parameters (i.e., method
signature) but one of the methods is in the parent class and the other is in the child class.

19.What are multiple inheritances in Java?

Answer:
Java supports multiple inheritances i.e the ability of a class to implement more than one
interface. A class can implement multiple Interfaces but cannot extends multiple classes.

20.What is a stream?

Answer:
A stream can be defined as the sequence of data. There is two type of streams.
InputStream: Used to read a data from a source.
OutPut Stream: Used to write a data into a destination.

21.What is a Character stream?

Answer:
Java Character stream is basically used to perform input and output for 16 bit Unicode. The main
classes users are FileReader and FileWriter which internally uses FileInputStream and
FileOutputStream so the basic difference is that FileReader and FileWriter read and writes two
bites at a time respectively.

22.What is a Byte stream?

Answer:
Java Byte stream is basically used to perform input and output for 8 bit Unicode.
The main classes related to byte streams are FileInputStream and FileOutputStream.
23.What is an Interface?

Answer:
The interface is a reference type in Java, similar to the class but its collection of abstract
methods. A class can implement multiple interfaces.

24.Difference between class and interface?

Answer:
Below are the difference between Interface and class:-

 The interface cannot be instantiated.


 An interface doesn’t have any constructors.
 Interface only have abstract methods.
 A class implements an interface and extends a class.
 An interface can extend multiple interfaces.

25.What is an abstract class?

Answer:
A class which contains the abstract keyword in a declaration is called abstract class. The
properties of the abstract class are as follows:-

 Abstract classes may or may not contain abstract methods but, if a class has at least one
abstract method, then it must be declared abstract.
 The abstract class cannot be instantiated.
 To use an abstract class, we have to inherit it from another class.
 If we inherit an abstract class, then we have to provide implementations to all the abstract
methods in it.

A typical computer system consists of a computer case, a power supply unit, a motherboard, a central
processing unit (CPU), main memory, and a hard disk drive. Input devices include a keyboard, mouse,
microphone, video camera, and image scanner. Output devices include a monitor, speakers, and a
printer.

Computer hardware is the collection of physical parts of a computer system. This includes the computer
case, monitor, keyboard, and mouse. It also includes all the parts inside the computer case, such as the
hard disk drive, motherboard, video card, and many others.

) What are the basic functions of an operating system?

Operating system controls and coordinates the use of the hardware among the various
applications programs for various uses.

Operating system acts as resource allocator and manager. Since there are many possibly
conflicting requests for resources the operating system must decide which requests are allocated
resources to operating the computer system efficiently and fairly. Also operating system is
control program which controls the user programs to prevent errors and improper use of the
computer. It is especially concerned with the operation and control of I/O devices.

2) Explain briefly about, processor, assembler, compiler, loader, linker and the functions
executed by them.
Processor:--A processor is the part a computer system that executes instructions .It is also called
a CPU Assembler: -- An assembler is a program that takes basic computer instructions and
converts them into a pattern of bits that the computer's processor can use to perform its basic
operations. Some people call these instructions assembler language and others use the term
assembly language.

Compiler: --- A compiler is a special program that processes statements written in a particular
programming language and turns them into machine language or "code" that a computer's
processor uses. Typically, a programmer writes language statements in a language such as Pascal
or C one line at a time using an editor. The file that is created contains what are called the source
statements. The programmer then runs the appropriate language compiler, specifying the name of
the file that contains the source statements.

Loader:--In a computer operating system, a loader is a component that locates a given program
(which can be an application or, in some cases, part of the operating system itself) in offline
storage (such as a hard disk), loads it into main storage (in a personal computer, it's called
random access memory), and gives that program control of the compute

Linker: -- Linker performs the linking of libraries with the object code to make the object code
into an executable machine code.

3) What is a Real-Time System?

A real time process is a process that must respond to the events within a certain time period. A
real time operating system is an operating system that can run real time processes successfully
4) What is the difference between Hard and Soft real-time systems?
A hard real-time system guarantees that critical tasks complete on time. This goal requires that
all delays in the system be bounded from the retrieval of the stored data to the time that it takes
the operating system to finish any request made of it.
A soft real time system where a critical real-time task gets priority over other tasks and retains
that priority until it completes. As in hard real time systems kernel delays need to be bounded

5) What is the important aspect of a real-time system or Mission Critical Systems?

A real time operating system has well defined fixed time constraints. Process must be done
within the defined constraints or the system will fail. An example is the operating system for a
flight control computer or an advanced jet airplane. Often used as a control device in a dedicated
application such as controlling scientific experiments, medical imaging systems, industrial
control systems, and some display systems.Real-Time systems may be either hard or soft real-
time.
Hard real-time:
-> Secondary storage limited or absent, data stored in short term memory, or read-only memory
(ROM)
-> Conflicts with time-sharing systems, not supported by general-purpose operating systems.
Soft real-time:
->Limited utility in industrial control of robotics
->Useful in applications (multimedia, virtual reality) requiring advanced operating-system
features.
6) What is hard disk and what is its purpose?
Hard disk is the secondary storage device, which holds the data in bulk, and it holds the data on
the magnetic medium of the disk.
Hard disks have a hard platter that holds the magnetic medium, the magnetic medium can be
easily erased and rewritten, and a typical desktop machine will have a hard disk with a capacity
of between 10 and 40 gigabytes. Data is stored onto the disk in the form of files.

7) What is virtual memory?

A virtual memory is hardware technique where the system appears to have more memory that it
actually does. This is done by time-sharing, the physical memory and storage parts of the
memory one disk when they are not actively being used.

8) What are the difference phases of software development or software life cycle?

Ans

Specification of the task


Design of algorithms
Implementation (coding)
Testing and debugging
Maintenance and evolution of the system
Obsolescence
9) What is cache memory?

Cache memory is random access memory (RAM) that a computer microprocessor can access
more quickly than it can access regular RAM. As the microprocessor processes data, it looks first
in the cache memory and if it finds the data there (from a previous reading of data), it does not
have to do the more time-consuming reading of data from larger memory.

10) Differentiate between Complier and Interpreter?


An interpreter reads one instruction at a time and carries out the actions implied by that
instruction. It does not perform any translation. But a compiler translates the entire instructions.
11) Describe different job scheduling in operating systems.
Scheduling is the activity of the deciding when process will receive the resources they request.
FCFS: --- FCSFS stands for First Come First Served. In FCFS the job that has been waiting the
longest is served next.
Round Robin Scheduling: ---Round Robin scheduling is a scheduling method where each
process gets a small quantity of time to run and then it is preempted and the next process gets to
run. This is called time-sharing and gives the effect of all the processes running at the same time
Shortest Job First: -- The Shortest job First scheduling algorithm is a nonpreemptive scheduling
algorithm that chooses the job that will execute the shortest amount of time.
Priority Scheduling: ---Priority scheduling is a scheduling method where at all times the highest
priority process is assigned the resource.
12) What are different tasks of Lexical Analysis?
The purpose of the lexical analyzer is to partition the input text, delivering a sequence of
comments and basic symbols. Comments are character sequences to be ignored, while basic
symbols are character sequences that correspond to terminal symbols of the grammar defining
the phrase structure of the input
13) Why paging is used?
Paging is solution to external fragmentation problem which is to permit the logical address space
of a process to be noncontiguous, thus allowing a process to be allocating physical memory
wherever the latter is available.

#include <stdio.h>
#include <string.h>
char* rev(char* str)
{
int end= strlen(str)-1;
int start = 0; while( start<end )
{
str[start] ^= str[end];
str[end] ^= str[start];
str[start]^= str[end];
++start; --end; } return str;
}
int main()
{
char str[50]="Reversing a string using XOR";
puts(rev(str));
}
Source Code for String Reversing

OSPF

Describe OSPF in your own words.


OSPF areas, the purpose of having each of them Types of OSPF LSA, the purpose of each LSA
type What exact LSA type you can see in different areas

How OSPF establishes neighboor relation, what the stages are


If OSPF router is stucked in each stage what the problem is and how to troubleshoot it
OSPF hierarchy in the single or multi areas. Cool OSPF behavior in broadcast and nonbroadcast
Draw the diagram of typical OSPF network and explain generally how it works, DR, BDR,
election, ASBR, ABR, route redistribution and summarization
STP
How it works and the purpose
Diff types (SSTP, MSTP, RSTP) Cisco - PVST/PVST+
root election Diff. port stages and timing for convergence
Draw the typical diagram and explain how diff types of STP work
What ports are blocking or forwarding
How it works if there are topology changes
ACLs
What are they
Diff types Write an example if you want to allow and to deny…
Well-known port numbers (DNS - 53 and etc…)
QOS
What is that
What is the diff b/w L2 and L3 QoS
How it works
Network:
Draw the typical network diagram you have to deal with
explain how it works
What part of it you are responsible
firewall, what is that, how it works, how it is diff from ACLs
What problems with the network you had had and how you solved it.
What are the ways to troubleshoot the network, techniques, commands
network security, ways to achieve it
Switching:
VLANs
STP
How a L2 switch works with broadcast, unicast, multicast, known/unknown traffic
VRRP, GLBP
port monitoring and mirroring
L3 switch, how it works
PIM sparse and dense modes

^Back to Top

Windows admin interview questions


Describe how the DHCP lease is obtained. It’s a four-step process consisting of (a) IP request,
(b) IP offer, © IP selection and (d) acknowledgement.
I can’t seem to access the Internet, don’t have any access to the corporate network and on
ipconfig my address is 169.254.*.*. What happened? The 169.254.*.* netmask is assigned to
Windows machines running 98/2000/XP if the DHCP server is not available. The name for the
technology is APIPA (Automatic Private Internet Protocol Addressing).
We’ve installed a new Windows-based DHCP server, however, the users do not seem to be
getting DHCP leases off of it. The server must be authorized first with the Active Directory.
How can you force the client to give up the dhcp lease if you have access to the client PC?
ipconfig /release
What authentication options do Windows 2000 Servers have for remote clients? PAP, SPAP,
CHAP, MS-CHAP and EAP.
What are the networking protocol options for the Windows clients if for some reason you do not
want to use TCP/IP? NWLink (Novell), NetBEUI, AppleTalk (Apple).
What is data link layer in the OSI reference model responsible for? Data link layer is located
above the physical layer, but below the network layer. Taking raw data bits and packaging them
into frames. The network layer will be responsible for addressing the frames, while the physical
layer is reponsible for retrieving and sending raw data bits.
What is binding order? The order by which the network protocols are used for client-server
communications. The most frequently used protocols should be at the top.
How do cryptography-based keys ensure the validity of data transferred across the
network? Each IP packet is assigned a checksum, so if the checksums do not match on both
receiving and transmitting ends, the data was modified or corrupted.
Should we deploy IPSEC-based security or certificate-based security? They are really two
different technologies. IPSec secures the TCP/IP communication and protects the integrity of the
packets. Certificate-based security ensures the validity of authenticated clients and servers.
What is LMHOSTS file? It’s a file stored on a host machine that is used to resolve NetBIOS to
specific IP addresses.
What’s the difference between forward lookup and reverse lookup in DNS? Forward lookup is
name-to-address, the reverse lookup is address-to-name.
How can you recover a file encrypted using EFS? Use the domain recovery agent.

^Back to Top

Network engineer/architect interview questions


Explain how traceroute, ping, and tcpdump work and what they are used for?
Describe a case where you have used these tools to troubleshoot.
What is the last major networking problem you troubleshot and solved on your own in the last
year?
What LAN analyzer tools are you familiar with and describe how you use them to troubleshoot
and on what media and network types.
Explain the contents of a routing table (default route, next hop, etc.)
What routing protocols have you configured?

Describe the commands to set up a route.


What routing problems have you troubleshot?
How do you display a routing table on a Cisco? On a host?
How do you use a routing table and for what?
What is a route flap?
What is a metric?
When do you use BGP, IGRP, OSPF, Static Routes?
What do you see as current networking security issues (e.g. NFS mounting, spoofing, one time
passwords, etc.)?
Describe a routing filter and what it does.
Describe an access list and what it does.
What is a network management system?
Describe how SNMP works.
Describe the working environment you are currently in, e.g. frequent interruptions, frequent
priority shifting, team or individual.
What do you use to write documentation? Editor? Mail reader?
What platform (s) do you currently work on at your desk?
How do you manage multiple concurrent high level projects?
Describe a recent short term stressful situation and how you managed it.
How do you manage a long term demanding stressful work environment?
Have you worked in an assignment based environment, e.g. work request/trouble ticket system,
and if so, describe that environment.
Describe what network statistics or measurement tools you are familiar with and how you have
used them.
Describe what a VPN is and how it works.
Describe how VoIP works.
Describe methods of QoS.
How does ToS bit work?

^Back to Top

CCNA/Cisco admin interview questions


You need to retrieve a file from the file server for your word processing application, which layer
of the OSI model is responsible for this function?
Presentation layer
Application layer
Session layer
Transport layer
Datalink layer
You are working in a word processing program, which is run from the file server. Your data
comes back to you in an unintelligible manner. Which layer of the OSI model would you
investigate?
Application layer
Presentation layer
Session layer
Network layer
Datalink layer
The IEEE subdivided the datalink layer to provide for environments that need connectionless or
connection-oriented services. What are the two layers called?
Physical
MAC
LLC
Session
IP
You are working with graphic translations. Which layer of the OSI model is responsible for code
formatting and conversion and graphic standards.
Network layer
Session layer
Transport layer
Presentation layer
Which is the best definition of encapsulation?
Each layer of the OSI model uses encryption to put the PDU from the upper layer into its data
field. It adds header and trailer information that is available to its counterpart on the system that
will receive it.
Data always needs to be tunneled to its destination so encapsulation must be used.
Each layer of the OSI model uses compression to put the PDU from the upper layer into its data
field. It adds header and trailer information that is available to its counterpart on the system that
will receive it.
Each layer of the OSI model uses encapsulation to put the PDU from the upper layer into its data
field. It adds header and trailer information that is available to its counterpart on the system that
will receive it.
Routers can be configured using several sources. Select which of the following sources can be
used.
Console Port
Virtual Terminals
TFTP Server
Floppy disk
Removable media
Which memory component on a Cisco router contains the dynamic system configuration?
ROM
NVRAM
Flash
RAM/DRAM
Which combination of keys will allow you to view the previous commands that you typed at the
router?
ESC-P
Ctrl-P
Shift-P
Alt-P
Which commands will display the active configuration parameters?
show running-config
write term
show version
display term
You are configuring a router, which prompt tells you that you are in the privileged EXEC mode?
@
>
!
:
#
What does the command “IP name-server 255.255.255.255? accomplish?
It disables domain name lookup.
It sets the domain name lookup to be a local broadcast.
This is an illegal command.
The command is now defunct and has been replaced by “IP server-name ip any”
The following selections show the command prompt and the configuration of the IP network
mask. Which two are correct?
Router(config-if)#netmask-format { bitcount | decimal | hexadecimal }
Router#term IP netmask-format { bitcount | decimal | hexadecimal }
Router(config-if)#IP netmask-format { bitcount | decimal | hexadecimal }
Router#ip netmask-format { bitcount | decimal | hexadecimal }
Which layer is responsible for flow control with sliding windows and reliability with sequence
numbers and acknowledgments?
Transport
Application
Internet
Network Interface
Which processes does TCP, but not UDP, use?
Windowing
Acknowledgements
Source Port
Destination Port
Select which protocols use distance vector routing?
OSPF
RIP
IGRP
PPP

^Back to Top

Networking and Unix interview questions


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 networks 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)

You might also like