Professional Documents
Culture Documents
Computer Engineering Notes
Computer Engineering Notes
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.
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.
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.
Answer :
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.
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.
Answer :
An object’s message protocol is the exact form of the set of messages to which the object can
respond.
Answer :
Answer :
These represent an object’s private memory. They are defined in an object’s class.
Answer :
These represent a class’s memory which it shares with each of its instances.
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.
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.
As an object oriented language, C++ introduces much of the OOP paradigm while allowing a
mixture of OOP and procedural styles.
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.
Answer :
They are objects corresponding to a program’s default input and output files.
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.
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.
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++.
Answer :
delete this;
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.
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.
Answer :
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.
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.
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.
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 :
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.
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.
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.
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.
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.
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.
Answer :
Answer :
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.
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....
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
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.
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 :
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 :
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.
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.
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.
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.
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
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.
Answer :
Nehalem is Intel's new microprocessor architecture The Core i7 chips were the first processors
ever produced using an architecture called Nehalem.
Answer :
Intel Xeon.
Question 24. Which Is The Processor Suitable From Intel Family Of Processors For
Server And Workstation?
Answer :
Intel Xeon
Answer :
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 :
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.
Answer :
Answer :
Answer :
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.
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.
Answer :
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.
Answer :
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.
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.
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
……………………..
……………..
}
Answer:
Constructor: Used to initialize the instance of a class.
Method: Used to perform some function or operation.
Answer:
An object is first declared then instantiated and at last declared. For example
Abc a= new Abc();
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.
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.
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.
Answer:
Yes
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
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.
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.
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.
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.
Answer:
Below are the difference between Interface and 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.
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.
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
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.
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
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.
#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
^Back to Top
^Back to Top
^Back to Top
^Back to Top
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.
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
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.
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?
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: