I.
1.
DATA STRUCTURES
Define Data Structures ?
Data Structures is defined as the way of organizing all data items that consider not only
the elements stored but also stores the relationship between the elements.
2.
Define Linked Lists ?
Linked list consists of a series of structures, which are not necessarily adjacent in
memory. Each structure contains the element and a pointer to a structure containing its
successor. We call this theNext Pointer. The last cell’sNext pointer points to NULL.
3.
List the basic operations carried out in a linked list ?
The basic operations carried out in a linked list include:
•
Creation of a list
•
Insertion of a node
•
Deletion of a node
•
Modification of a node
•
Traversal of the list
4.
Define an Abstract Data Type (ADT) ?
An abstract data type is a set of operations. ADTs are mathematical abstractions;
nowhere in an ADT’s definition is there any mention of how the set of operations is
implemented. Objects such as lists, sets and graphs, along with their operations can be
viewed as abstract data types.
1
5.
What are the types of queues?
•
Linear Queues – The queue has two ends, the front end and the rear end. The rear
end is where we insert elements and front end is where we delete elements. We can
traverse in a linear queue in only one direction ie) from front to rear.
•
Circular Queues – Another form of linear queue in which the last position is
connected to the first position of the list. The circular queue is similar to linear queue
has two ends, the front end and the rear end. The rear end is where we insert elements
and front end is where we delete elements. We can traverse in a circular queue in only
one direction ie) from front to rear.
•
Double-Ended-Queue – Another form of queue in which insertions and deletions
are made at both the front and rear ends of the queue.
6.
State the rules to be followed during infix to postfix conversions ?
•
Fully parenthesize the expression starting from left to right. During
parenthesizing, the operators having higher precedence are first parenthesized
•
Move the operators one by one to their right, such that each operator replaces
their corresponding right parenthesis
•
The part of the expression, which has been converted into postfix is to be treated
as single operand.
7.
Define a priority queue?
Priority queue is a collection of elements, each containing a key referred as the priority
for that element. Elements can be inserted in any order (i.e., of alternating priority), but
are arranged in order of their priority value in the queue. The elements are deleted from
the queue in the order of their priority (i.e., the elements with the highest priority is
deleted first). The elements with the same priority are given equal importance and
processed accordingly.
2
8.
Define a binary search tree ?
A binary search tree is a special binary tree, which is either empty or it should satisfy
the following characteristics: Every node has a value and no two nodes should have the
same value i.e) the values in the binary search tree are distinct
• The values in any left sub-tree is less than the value of its parent node
• The values in any right sub-tree is greater than the value of its parent node
• The left and right sub-trees of each node are again binary search trees
9.
Define AVL Tree?
An empty tree is height balanced. If T is a non-empty binary tree with TL and TR as its
left and right subtrees, then T is height balanced if i) TL and TR are height balanced and
ii) │hL - hR│≤ 1 Where hL and hR are the heights of TL and TR respectively.
10.
What do you mean by balanced trees?
Balanced trees have the structure of binary trees and obey binary search tree properties.
Apart from these properties, they have some special constraints, which differ from one
data structure to another. However, these constraints are aimed only at reducing the
height of the tree, because this factor determines the time complexity. Eg: AVL trees,
Splay trees.
11.
What are the categories of AVL rotations?
Let A be the nearest ancestor of the newly inserted nod which has the balancing factor
±2. Then the rotations can be classified into the following four categories:
Left-Left: The newly inserted node is in the left subtree of the left child of A.
Right-Right: The newly inserted node is in the right subtree of the right child of A.
Left-Right: The newly inserted node is in the right subtree of the left child of A.
3
Right-Left: The newly inserted node is in the left subtree of the right child of A.
12.
Define Graph.?
A graph G consist of a nonempty set V which is a set of nodes of the graph, a set E
which is the set of edges of the graph, and a mapping from the set for edge E to a set of
pairs of elements of V. It can also be represented as G=(V, E).
13.
What do you mean by internal and external sorting?
An internal sort is any data sorting process that takes place entirely within the main
memory of a computer. This is possible whenever the data to be sorted is small enough
to all be held in the main memory.
External sorting is a term for a class of sorting algorithms that can handle massive
amounts of data. External sorting is required when the data being sorted do not fit into
the main memory of a computing device (usually RAM) and instead they must reside in
the slower external memory (usually a hard drive)
14.
Define searching?
Searching refers to determining whether an element is present in a given list of
elements or not. If the element is present, the search is considered as successful,
otherwise it is considered as an unsuccessful search. The choice of a searching
technique is based on the following factors
a. Order of elements in the list i.e., random or sorted
b. Size of the list.
15.
Define hashing function ?
A hashing function is a key-to-transformation, which acts upon a given key to compute
the relative position of the key in an array. A simple hash function
HASH(KEY_Value)= (KEY_Value)mod(Table-size)
4
16.How to implement a queue using stack?
A queue can be implemented using two stacks. Let q be the queue andstack1 and stack2
be the 2 stacks for implementing q. We know that stack supports push, pop, and peek
operations and using these operations, we need to emulate the operations of the queue enqueue and dequeue. Hence, queue q can be implemented in two methods (Both the
methods use auxillary space complexity of O(n)):
17. What is an asymptotic analysis of an algorithm?
Asymptotic analysis of an algorithm defines the run-time performance as per its
mathematical boundations. Asymptotic analysis helps us articulate the best case(Omega
Notation, Ω), average case(Theta Notation, θ), and worst case(Big Oh Notation, Ο)
performance of an algorithm.
18. What is hashmap in data structure?
Hashmap is a data structure that uses an implementation of a hash table data structure
which allows access to data in constant time (O(1)) complexity if you have the key.
19. What is the requirement for an object to be used as key or value in HashMap?
•
The key or value object that gets used in the hashmap must implement equals()
and hashcode() method.
•
The hash code is used when inserting the key object into the map and the equals
method is used when trying to retrieve a value from the map.
20. How does HashMap handle collisions in Java?
•
The java.util.HashMap class in Java uses the approach of chaining to handle
collisions. In chaining, if the new values with the same key are attempted to be pushed,
then these values are stored in a linked list stored in a bucket of the key as a chain along
with the existing value.
5
•
In the worst-case scenario, it can happen that all keys might have the same
hashcode, which will result in the hash table turning into a linked list. In this case,
searching a value will take O(n) complexity as opposed to O(1) time due to the nature of
the linked list. Hence, care has to be taken while selecting hashing algorithm.
21. What is the time complexity of basic operations get() and put() in HashMap
class?
The time complexity is O(1) assuming that the hash function used in the hash map
distributes elements uniformly among the buckets.
22.What is merge sort?
Merge sort is a method of sorting, which is based on the divide and conquer technique.
Here, data entities adjacent to each other are first merged and sorted in every iteration to
create sorted lists. These smaller sorted lists are combined at the end to form the
completely sorted list.
23. Why should heap be used over a stack?
The heap data structure is more efficient to work with when compared to stack in a way
that memory allocation in a head is dynamic and can be allocated and removed as per
the requirement. The memory structure and access time of a stack are comparatively
slow.
24. What are the minimum nodes binary trees can have?
Binary trees can have zero nodes or a minimum of 1 or 2 as well. It can be zero in a case
where all of the nodes have a NULL value.
25. What Data Structures make use of pointers?
Pointers are used in a variety of data structures. They are majorly used in the following
data structures:
6
•
Binary trees
•
Linked lists
•
Queues
•
Stacks
26. What are the minimum nodes binary trees can have?
Binary trees can have zero nodes or a minimum of 1 or 2 as well. It can be zero in a case
where all of the nodes have a NULL value.
27. What are recursive algorithms?
Recursive algorithms are algorithms that solve a problem by breaking it down into
simpler sub-problems and then solving them iteratively. The output of one recursion
operation is usually the direct input for the next iteration operation, and this process
goes on.
28. How does bubble sort work?
Bubble sort is one of the most used sorting techniques out there. It is applied to arrays
where elements adjacent to each other are compared and values are exchanged based on
the order of arrangement. It’s called bubble sort because of the concept of exchanging
elements like a bubble floating to the top of the water and larger entities sinking down to
the bottom end.
29.Which is the fastest sorting algorithm available?
Among the many types of algorithms such as bubble sort, quick sort, merge sort, and
more, it is not right to put one method on the podium for performance as this greatly
varies based on data, the reaction after the algorithm processes the data, and how it’s
stored. The concept of time complexity is considered here.
7
30. Define primary data structures.
Primary data structures are the basic data structures that directly operate upon the
machine instructions. All the basic constants (integers, floating-point numbers, character
constants, string constants) and pointers are considered as primary data structures
8
II.
1.
OBJECT ORIENTED PROGRAMMING
Define object-oriented programming?
Object oriented programming is an approach that provides a way of modularizing
programs by creating partitioned memory area for both data and functions that can be
used as templates for creating such modules on demand.
2.
Define function?
The process of splitting a large program into small manageable tasks and designing
them independently is popularly called modular programming or divide and conquer
technique. A repeated group of instructions in a program can be organized as a function.
A function is a set of program statements that can be processed independently.
3.
What are the Special Characteristics of Friend Function?
•
The function definition does not use friend keyword
•
It is not in the scope of the class which is declared as friend
•
It can be called like normal function without the help of any object
•
Friend function acts as a Bridge between 2 classes
4.
Define Constructor?
A constructor is a special member function whose task is to initialize the objects of its
class. It is special because its name is the same as the class name. The constructor is
invoked whenever an object of its associated class is created. It is called constructor
because it constructs the values f data members of the class.
5.
what are the characteristics of a constructor ?
•
They should be declared in the public section.
9
•
They are invoked automatically when the objects are created.
•
They do not have return types, not even void and therefore, they cannot return
values.
6.
What is a parameterized constructor ?
The constructors that can take arguments are called parameterized
Integer ( int x, int y )
{
m=x;
n=y;
}
7.
what is Dynamic constructors
The constructors can also be used to allocate memory while creating objects. This will
enable the system to allocate the right amount of memory for each object when the
objects are not of the same size thus resulting in the saving of memory. Allocation of
memory to objects at the time of their construction is known as dynamic constructors.
The memory is allocated with the help of the new operator.
8.
List out the operators that cannot be overloaded.
Class member access operator (. , .*)
Scope resolution operator (::)
Size operator ( sizeof )
Conditional operator (?:)
10
9.
What are the types of exception ?
They are classified into synchronous and asynchronous exceptions.
Synchronous exception :
The exception which occur during program execution , due to some fault in the input
data or technique that is not suitable to handle the current class of data, within the
program are known as synchronous exception. For instance errors such as out-of-range,
overflow, underflow and so on.
Asynchronous exception :
The exceptions caused by events or faults unrelated to the program and beyond the
control of the program are called asynchronous exception. For instance, errors such as
keyboard interrupts, hardware malfunctions, disk failure, and so on.
10.
What is a template ?
Templates support generic programming , which allows to develop reusable software
components such as functions, classes etc., supporting different data types in a single
framework
11.
What is function template ?
The templates declared for functions are called function templates. They perform
appropriate operations depending on the data type of the parameters passed to them.
12.
What is a class template ?
The templates declared for classes are called function templates. They perform
appropriate operations depending on the data type of the parameters passed to them.
11
13.
Define inheritance ?
Inheritance is the process of creating new classes from the existing classes. The new
classes are called derived classes. The existing classes are called base classes. The
derived classes inherit all the properties of the base class plus its own properties. The
properties of inheritance does not affect the base classes.
14.
What are the types of inheritance ?
o
Single inheritance
o
Multiple inheritance
o
Hierarchical inheritance
o
Multilevel inheritance.
o
Hybrid inheritance
15.
What is an virtual function ?
A member function whose definition can be changed during run time is called virtual
function. The class which contains virtual function is called polymorphic class and it
should be a base class. Different versions for the virtual function should be present in
different derived classes with same name as virtual function name
16.What are the characteristics of an abstract class?
An abstract class is a class that is declared as abstract. It cannot be instantiated and is
always used as a base class. The characteristics of an abstract class are as follows:
o
Instantiation of an abstract class is not allowed. It must be inherited.
o
An abstract class can have both abstract and non-abstract methods.
o
An abstract class must have at least one abstract method.
12
o
You must declare at least one abstract method in the abstract class.
o
It is always public.
o
It is declared using the abstract
The purpose of an abstract class is to provide a common definition of the base class that
multiple derived classes can share.
17. Is it possible for a class to inherit the constructor of its base class?
No, a class cannot inherit the constructor of its base class.
18. Identify which OOPs concept should be used in the following scenario?
A group of 5 friends, one boy never gives any contribution when the group goes for the
outing. Suddenly a beautiful girl joins the same group. The boy who never contributes is
now spending a lot of money for the group.
Runtime Polymorphism
19. What is composition?
Composition is one of the vital concepts in OOP. It describes a class that references one
or more objects of other classes in instance variables. It allows us to model a has-a
association between objects. We can find such relationships in the real world. For
example, a car has an engine. the following figure depicts the same
The main benefits of composition are:
o
Reuse existing code
o
Design clean APIs
13
o
Change the implementation of a class used in a composition without adapting any
external clients.
20. What are the differences between copy constructor and assignment operator?
The copy constructor and the assignment operator (=) both are used to initialize one
object using another object. The main difference between the two is that the copy
constructor allocates separate memory to both objects i.e. existing object and newly
created object while the assignment operator does not allocate new memory for the
newly created object. It uses the reference variable that points to the previous memory
block (where an old object is located).
21.What are the limitations of inheritance?
o
The main disadvantage of using inheritance is two classes get tightly coupled.
That means one cannot be used independently of the other. If a method or aggregate is
deleted in the Super Class, we have to refactor using that method in SubClass.
o
Inherited functions work slower compared to normal functions.
o
Need careful implementation otherwise leads to improper solutions.
22.Name the operators that cannot be overload.
1.
Scope Resolution Operator (::)
2.
Ternary Operator (? :)
3.
Member Access or Dot Operator (.)
4.
Pointer to Member Operator (.*)
5.
sizeof operator
14
23. What is the difference between new and override?
The new modifier instructs the compiler to use the new implementation instead of the
base class function. Whereas, Override modifier helps to override the base class
function.
virtual: indicates that a method may be overridden by an inheritor
override: Overrides the functionality of a virtual method in a base class, providing
different functionality.
new: Hides the original method (which doesn't have to be virtual), providing different
functionality. This should only be used where it is absolutely necessary.
When you hide a method, you can still access the original method by upcasting to the
base class. This is useful in some scenarios, but dangerous.
24. Is it possible to overload a constructor?
Yes, the constructors can be overloaded by changing the number of arguments accepted
by the constructor or by changing the data type of the parameters.
25.What is an interface?
An interface refers to a special type of class, which contains methods, but not their
definition. Only the declaration of methods is allowed inside an interface. To use an
interface, you cannot create objects. Instead, you need to implement that interface and
define the methods for their implementation.
26. What is meant by static polymorphism?
Static Polymorphism is commonly known as the Compile time polymorphism. Static
polymorphism is the feature by which an object is linked with the respective function or
15
operator based on the values during the compile time. Static or Compile time
Polymorphism can be achieved through Method overloading or operator overloading.
27. What is meant by dynamic polymorphism?
Dynamic Polymorphism or Runtime polymorphism refers to the type of Polymorphism
in OOPs, by which the actual implementation of the function is decided during the
runtime or execution. The dynamic or runtime polymorphism can be achieved with the
help of method overriding.
28. What is an exception?
An exception can be considered as a special event, which is raised during the execution
of a program at runtime, that brings the execution to a halt. The reason for the exception
is mainly due to a position in the program, where the user wants to do something for
which the program is not specified, like undesirable input.
29. What is meant by exception handling?
No one wants its software to fail or crash. Exceptions are the major reason for software
failure. The exceptions can be handled in the program beforehand and prevent the
execution from stopping. This is known as exception handling.
So exception handling is the mechanism for identifying the undesirable states that the
program can reach and specifying the desirable outcomes of such states.
Try-catch is the most common method used for handling exceptions in the program.
30. What is meant by Garbage Collection in OOPs world?
Object-oriented programming revolves around entities like objects. Each object
consumes memory and there can be multiple objects of a class. So if these objects and
their memories are not handled properly, then it might lead to certain memory-related
errors and the system might fail.
16
III.
1.
SYSTEM SOFTWARE
Define system software.
It consists of variety of programs that supports the operation of the computer. This
software makes it possible for the user to focus on the other problems to be solved
without needing to know how the machine works internally.
Eg: operating system, assembler, loader.
2.
List out the Types of System Software.
•
Compiler
•
Assembler
•
Loader and Linker
•
Debugger
•
Text Editor
3.
Give some applications of OS.
•
to make the computer easier to use
•
to manage the resources in computer
•
process management
•
data and memory management
•
to provide security to the user.
Operating system acts as an interface between the user and the system
Eg:windows,linux,unix,dos
17
4.
Define compiler and interpreter.
Compiler is a set of program which converts the whole high level language program to
machine language program.
Interpreter is a set of programs which converts high level language program to
machine language program line by line.
5.
State the differences between system software and application software?
6.
Define immediate addressing.
In this addressing mode the operand value is given directly.There is no need to refer
memory.The immediate addressing is indicated by the prefix „#‟.
Eg: ADD #5
In this instruction one operand is in accumulator and the second operand is a immediate
value the value 5 is directly added with the accumulator content and the result is stored
in accumulator.
7.
Define indirect addressing.
In the case of immediate addressing the operand field gives the memory location.The
word from the given address is fetched and it gives the address of the operand.
18
Eg:ADD R5, [600]
Here the second operand is given in indirect addressing mode.First the word in memory
location 600 is fetched and which will give the address of the operand.
8.
Differentiate trailing numeric and leading separate numeric.
The numeric format is used to represent numeric values with one digit per byte. In the
numeric format if the sign appears in the last byte it is known as the trailing numeric. If
the sign appears in a separate byte preceding the first digit then it is called as leading
separate numeric.
9.
Define automatic library search.
In many linking loaders the subroutines called by the program being loaded are
automatically fetched from the library, linked with the main program and loaded.This
feature is referred to as automatic library search.
10.
List the loader options INCLUDE &DELETE. The general format of
INCLUDE is
INCLUDE program_name (library name).This command direct the loader to read the
designated object program from a library and treat it as the primary loader input. The
general format of DELETE command is DELETE Csect-name .It instructs the loader to
delete the named control sections from the sets of programs loaded.
11.
Give the functions of the linking loader.
The linking loader performs the process of linking and relocation. It includes the
operation of automatic library search and the linked programs are directly loaded.
12.
Define dynamic linking.
If the subroutine is loaded and linked to the program during its first call(run time),then
it is called as dynamic loading or dynamic linking.
19
13.
Define interactive editor?
An interactive editor is a computer program that allows a user to create and revise a
target document. The term document includes objects such as computer programs, text,
equations, tables, diagrams, line art, and photographs any thing that one might find on a
printed page.
14.
What is the function performed in voice input device?
Voice-input devices, which translate spoken words to their textual equivalents, may
prove to be the text input devices of the future. Voice recognizers are currently available
for command input on some systems.
15.
What are called tokens?
The lexical analyzer tracks the source program one character at a time by making the
source program into sequence of atomic units is called tokens.
16. What is XPath?
XPath also called as XML Path is a language to query XML documents. It is an
important strategy to locate elements in selenium. It consists of a path expression along
with some conditions. Here, you can easily write XPath script/query to locate any
element in the webpage. It is designed to allow the navigation of XML documents, with
the purpose of selecting individual elements, attributes, or some other part of an XML
document for specific processing. It also produces reliable locators.
17. What is the difference between Absolute and Relative Path?
Absolute XPath
It is the direct way to find the element, but the disadvantage of the absolute XPath is
that, if there are any changes made in the path of the element then that XPath gets failed.
For example: /html/body/div[1]/section/div[1]/div
20
Relative XPath
For Relative XPath, the path starts from the middle of the HTML DOM structure. It
begins with the double forward slash (//), which means it can search the element
anywhere at the webpage. For example: //input[@id=‘ap_email’]
18. What are the different exceptions in Selenium WebDriver?
Exceptions in Selenium are similar to exceptions in other programming languages. The
most common exceptions in Selenium are:
•
TimeoutException
•
NoSuchElementException
•
ElementNotVisibleException
•
StaleElementException
19. When should I use Selenium Grid?
Selenium Grid can be used to execute same or different test scripts on multiple
platforms and browsers concurrently so as to achieve distributed test execution, testing
under different environments and saving execution time remarkably.
20. How do I launch the browser using WebDriver?
The following syntax can be used to launch the Browser:
WebDriver driver = new FirefoxDriver();
WebDriver driver = new ChromeDriver();
WebDriver driver = new InternetExplorerDriver();
21
21. Should testing be done only after the build and execution phases are complete?
Testing is always done after the build and execution phases Earlier we catch a defect,
the more cost effective it is. For example, fixing a defect in maintenance is ten times
more costly than fixing it during execution.
22. What’s the relationship between environment reality and test phases?
As test phases start moving ahead environment reality becomes more important. For
example, while unit testing, you need the environment to be partly real, but at the
acceptance phase you should have a 100% real environment, or we can say it should be
the actual real environment.
23. A defect which could have been removed during the initial stage is removed in a
later stage. How does this affect the cost?
If at the initial stage a defect is identified, then it should be removed during that
stage/phase itself rather than at some later stage. It’s a fact that if a defect is delayed for
later phases it becomes more costly. The following figure shows how a defect is costly
as the phases move forward.
24. What do you mean by regression and confirmation testing?
Regression Testing: It is defined as a type of software testing to confirm that a recent
code change has not adversely affected existing features.
Confirmation Testing: When a test fails because of the defect, the defect is reported.
Then a new version of the software is submitted whose defect is fixed. This is called as
confirmation testing or re-testing.
25. What do you mean by boundary value analysis?
Boundary Value Analysis (BVA) is a black box test design technique which is applied
to see if there are any bugs at the boundary of the input domain.
22
26. What is Random testing?
Usually, in Random testing, data is generated randomly often using a tool. For example,
the following figure shows how randomly-generated data is sent to the system.
27. On what basis you can arrive at an estimation for your project?
1.
To estimate your project, you have to consider the following points:
2.
Divide the whole project into the smallest tasks
3.
Allocate each task to team members
4.
Estimate the effort required to complete each task
5.
Validate the estimation
28. Which test cases are written first: white boxes or black boxes?
Usually, black box test cases are written first and white box test cases later. To write
black box test cases we need the requirement document and, design or project plan.
These documents are easily available at the initial start of the project. White box test
cases cannot be started in the initial phase of the project because they need more
architecture clarity which is not available at the start of the project. So normally white
box test cases are written after black box test cases are written.
29. Mention the basic components of defect report format.
The basic components of defect report format include:
1.
Project Name
2.
Module Name
3.
Defect detected on
4.
Defect detected by
5.
Defect ID and Name
6.
Snapshot of the defect
7.
Priority and Severity status
23
8.
Defect resolved by
9.
Defect resolved on
30. Is Automation testing in agile methodology useful?
Automation testing is very useful in agile methodology and helps in achieving
maximum test coverage in a lesser time of the sprint.
24
IV.
1.
COMPUTER ORGANIZATION
What is an interrupt?
An interrupt is an event that causes the execution of one program to be suspended and
another program to be executed.
2.
What are the steps in executing a program?
•
Fetch
•
Decode
•
Execute
•
Store
3.
Define various addressing modes?
The various addressing modes are
•
Absolute addressing mode
•
Register addressing mode
•
Indirect addressing mode
•
Index addressing mode
•
Immediate addressing mode
•
Relative addressing mode
•
Auto-increment addressing mode
•
Auto-decrement addressing mode
25
4.
Explain MDR and MAR?
The data and address lines of the external memory bus connected to the internal
processor bus via the memory data register, MDR, and the memory address register,
MAR, respectively. Register MDR has two inputs and two outputs. Data may be loaded
into MDR either from the memory bus or from the internal processor bus. The data
stored in MDR may be placed on either bus. The input of MAR is connected to the
internal bus, and its output is connected to the external bus.
5.
Explain hardwired control?
The control hardwire can be viewed as a state machine that changes from one state to
another in every clock cycle, depending on the contents of the instruction register, the
condition codes, and the external inputs. The outputs of the state machine are the control
signals. The sequence of operations carried out by this machine is determined by the
wiring of the logic elements, hence the name “hardwired”.
6.
Define microroutine and microinstruction?
A sequence of control words corresponding to the control sequence of a machine
instruction constitutes the microroutine for that instruction, and the individual control
words in this microroutine are referred to as microinstructions.
7.
What are the uses of interrupts?
• Recovery from errors
• Debugging
• Communication between programs
8.
Explain the various classifications of parallel structures.
• SISD (single instruction stream single data stream
• SIMD(single instruction stream multiple data stream
• MIMD(multiple instruction stream multiple data stream
• MISD(multiple instruction stream single data stream
26
9.
Distinguish between asynchronies DRAM and synchronous RAM.
The specialized memory controller circuit provides the necessary control signals, RAS
And CAS ,that govern the timing. The processor must take into account the delay in the
response of the memory. Such memories are referred to as asynchronous DRAMS. The
DRAM whose operations is directly synchronized with a clock signal. Such Memories
are known as synchronous DRAM
10.
what are the various units in the computer?
1.
input unit
2.
output unit
3.
control unit
4.
memory unit
5.
arithmetic and logical unit
11.
Define memory access time.
The time required to access one word is called memory access time.
12.
What is instruction register (IR) and program counter (PC) used for ?
The instruction register (IR) holds the instruction that is currently being
executed .Its output is available to the control circuits which generate the timing
signals
that
control
the
various
processing
elements.
The program counter PC) is used to keep track of the execution of the program. It
contains the memory address of the next instruction to be fetched and executed.
13.
Explain the concept of pipelining?
Pipelining is the means of executing machine instructions concurrently. It is the
effective way of organizing concurrent activity in a computer system. It is a process of
27
substantial improvement in the performance by overlapping the execution of successive
instructions.
14.
What are the two techniques used to increase the clock rate R?
The two techniques used to increase the clock rate R are:
1. The integrated – circuit (IC) technology can be increased which reduces the time
needed to complete a basic step.
2. We can reduce the amount of processing done in one basic step.
15.
What is Big – Endian and Little- Endian representations?
The Big- endian is used when lower byte addresses are used for the more significant
bytes (The leftmost bytes) of the word. The little-endian is used for the opposite
ordering, where the lower byte addresses are used for the less significant bytes ( the
rightmost bytes) of the word.
16.
How Computer Architecture is characterized?
The computer architecture is characterized into three categories
System Design: It includes all the hardware component in the system, including data
processor aside from the CPU like direct memory access and graphic processing unit
Instruction Set Architecture (ISA): It is the embedded programming language of the
central processing unit. It determines the CPU’s functions and capabilities based on
programming it can process.
Microarchitecture: It defines the data path, storage element, and data processing as well
as how they should be implemented in the ISA.
17.
Mention important steps for computer design?
A CPU architecture is defined by the set of machine language which can be defined as a
a.
Set of registers and their functions (capabilities)
28
b.
Sequence of micro-operations performed on the data stored in registers
2.
Control signals that initiate the sequence
18.
Mention what are the different types of fields that are part of an instruction?
The different types of fields that are parts of an instruction are
Operation Code Field or OP Code field: This field is used to determine the operation to
be performed for the instruction
Address Field: This field is used to determine various addresses such as memory address
and register address
Mode Field: This field determines how operand is to perform or how effective address is
derived
19.
Mention what are the basic components of a Microprocessor?
The basic components of a Microprocessor are
•
Address lines to refer to the address of a block
•
Data lines for data transfer
•
IC chips for processing data
•
Computer Architecture Interview Questions
•
Computer Architecture Interview Questions
20.
Mention what are different types of interrupts in a microprocessor system?
Explain?
There are three types of interrupts that can cause a break.
External Interrupts:
29
From external input/output devices such types of interrupt comes.
Internal Interrupts:
These types of interrupts are caused due to any exception caused by the program itself.
For example, division by zero or an invalid opcode, etc.
Software Interrupts:
Only during the execution of an instruction such type of interruption can occur. The
primary purpose of such interrupts is to switch from user mode to supervisor mode.
21.
Mention what are the common components of a microprocessor are?
The common components of a microprocessor include
•
I/O Units
•
Control Unit
•
Arithmetic Logic Unit (ALU)
•
Registers
•
Cache
22.
Explain what is Snooping Cache?
Snooping Cache is the process where individual caches monitor address lines for
accesses to memory locations that they have cached.
23.
Mention what is the simplest way to determine cache locations in which to
store memory blocks?
Direct Mapping is the simplest way to define cache locations in which to store memory
blocks. Associative memories are expensive in comparison to random-access memories
due to the added logic associated with each cell.
30
24.
What digital functions should be used to convert the octal code to binary
code?
To convert the octal code to binary code multiplexers is used. It is also referred as Data
Selector, where dynamic memory uses the same address lines for both row and column.
25.
What technique is used to automatically move program and data blocks into
the physical main memory when they are required for execution?
Virtual Memory technique is used. It provides a mechanism for translating program
generated address into correct main memory locations. By means of mapping table
translation or mapping is handled.
26.
Mention what is the use of RAID system?
The use of RAID system is to increase the disk storage capacity and availability.
27.
Explain what type of memory that can be erased with the electric discharge?
With the passage of electric discharge, EEPROM is the type of memory whose content
is erased.
28.
Explain what is horizontal micro code?
The horizontal micro code contains the control signal without any intermediary. It
contains a lot of signals and hence due to that the number of bits also increases.
29.
Explain what is direct mapping?
In direct mapping, the RAM is used to store data and some of the data is stored in the
Cache. The address space is divided into two parts index field and tag field. The tag
field is used to store the tag field whereas the rest is stored in the main memory.
30.
What does DMA stands for?
DMA stands for Direct Memory Access.
31
V. OPERATING SYSTEMS
1.
What is an operating system?
An operating system is a program that manages the computer hardware. It also provides
a basis for application program and acts as an intermediary between a user of a
computer and the computer hardware.
2.
What are the components of a computer system?
A computer system can be divided into four components namely:
a. hardware
b. operating system
c. application programs
d. users
3.
Write short notes on command-line interpreter?
Many commands are given to the operating system by control statements. When a new
job is started in a batch system, or when a user logs on to a time-shared system, a
program that reads and interprets control statements is executed automatically. This
program is sometimes called the control-card interpreter or the command-line
interpreter, and is often known as the shell.
4.
What are system calls?
System calls provide the interface between a process and the operating system. These
calls are generally available as assembly-language instructions, and they are usually
listed in various manuals used by the assembly-language programmers. Certain systems
allow system calls to be made directly from a higher level language program, in which
case the calls normally resemble predefines function or subroutine calls.
32
5.
What is a process?
A process is a program in execution. A process is more than the program code, which is
sometimes known as the text section. It also includes the current activity, as represented
by the value of the program counter and the contents of the processors registers.
6.
What are the various states of process?
As a process executes, it changes state. The state of a process is defined in part by the
current activity of that process. Each process may be in one of the following states:
a. New: The process being created.
b. Running: Instructions are being executed.
c. Waiting: The process is waiting for some event to occur (such as an I/O completion or
reception of a signal).
d. Ready: The process is waiting to be assigned to a processor.
e. Terminated: The process has finished execution.
7.
What is a process control block?
Each process is represented in the operating system by a process control block (PCB) –
also called a task control block. It contains many pieces of information associated with a
specific process, including these:
a.
Process state
b.
Program counter
c.
CPU registers
d.
CPU-scheduling information
e.
Memory-management information
33
f.
Accounting information
g.
I/O status information
8.
What is meant by inter process communication?
IPC provides a mechanism to allow processes to communicate and to synchronize their
actions without sharing the same address space. IPC is particularly useful in a
distributed environment where the communicating processes may reside on different
computers connected with a network.
9.
Write notes on buffering in IPC.
Whether the communication is direct or indirect, messages exchanged by
communicating processes reside in a temporary queue. Basically, such a queue can be
implemented in three ways:
a. Zero capacity: The queue has maximum length 0; thus the link cannot have any
messages waiting in it. In this case, the sender must block until the recipient receives the
message.
b. Bounded capacity: The queue has finite length n; thus, at most n messages can
reside in it. If the queue is not full when a new message is sent, the latter is placed in the
queue (either the message is copied or a pointer to the message is kept), and the sender
can continue execution without waiting. The link has a finite capacity, however. If the
link is full, the sender must block until space is available in the queue.
c. Unbounded capacity: The queue has potentially infinite length; thus, any number of
messaged can wait in it. The sender never blocks.
10.
What is meant by thread?
A thread, sometimes called a lightweight process (LWP), is a basic unit of CPU
utilization; it comprises a thread ID, a program counter, a register set, and a stack. It
34
shares with other threads belonging to the same process its code section, data section,
and other operating-system resources, such as open files and signals.
11.
Define spooling.
A spool is a buffer that holds output for a device, such as printer, that cannot accept
interleaved data streams. When an application finishes printing, the spooling system
queues the corresponding spool file for output to the printer. The spooling system copies
the queued spool files to the printer one at a time.
12.
What are the two types of scheduling? Explain.
The two types of scheduling are:
a. Preemptive scheduling
b. Non preemptive scheduling
Preemptive scheduling is the process of scheduling in which, a process can run for a
maximum of fixed time. Once the end of time interval is reached, it is suspended and the
next process runs.
Non preemptive scheduling is the process of scheduling in which, a process runs until
it completes its operation or it voluntarily releases the CPU.
13.
What is a dispatcher?
The dispatcher is the module that gives control of the CPU to the process selected by the
short-term-scheduler. This function involves:
a. Switching context
b. Switching to user mode
c. Jumping to proper location in the user program to restart that program.
35
14.
List the various scheduling criterions.
The scheduling criterions include the following:
a. CPU utilization
b. Throughput
c. Turnaround time
d. Waiting time
e. Response time
15.
Name some CPU scheduling algorithms.
Some of the CPU scheduling algorithms are as follows:
a. First-Come, First-Served scheduling
b. Shortest-Job-First scheduling
c. Priority scheduling
d. Round-Robin scheduling
e. Multilevel queue scheduling
f. Multilevel feedback queue scheduling
16. What are the process states in Linux?
The process states are as follows:
•
Ready: The process is created and is ready to run
•
Running: The process is being executed
•
Blocked or wait: Process is waiting for input from the user
36
•
Terminated or Completed: Process completed execution, or was terminated by
the Operating System
•
Zombie: Process terminated, but the information still exists in the process table.
17. Explain grep command.
Grep stands for Global Regular Expression Print. The grep command is used to
search for a text in a file by pattern matching based on regular expression.
Syntax: grep [options] pattern [files]
Example:
$ grep -c "linux" interview.txt
This command will print the count of the word “linux” in the “interview.txt” file.
18. Explain Process Management System Calls in Linux
The System Calls to manage the process are:
•
fork () : Used to create a new process
•
exec() : Execute a new program
•
wait() : Wait until the process finishes execution
•
exit() : Exit from the process
And the System Calls used to get Process ID are:
•
getpid():- get the unique process id of the process
•
getppid():- get the parent process unique id
19. Explain the ‘ls’ command in Linux
The ls command is used to list the files in a specified directory. The general syntax is:
37
$ ls <options> <directory>
For example, if you want to list all the files in the Example directory, then the
command will be as follows:
$ ls Example/
There are different options that can be used with the ls command. These options give
additional information about the file/ folder. For example:
-l
lists long format (shows the permissions of the file)
-a
lists all files including hidden files
-i
lists files with their inode number
-s
lists files with their size
-S
lists files with their size and sorts the list by file size
-t
sorts the listed files by time and date
20. Explain the redirection operator.
The redirection operator is used to redirect the output of a particular command as an
input to another command or file.
There are two ways of using this:
‘>’ overwrites the existing content of the file or creates a new file.
‘>>’ appends the new content to the end of the file or creates a new file.
Suppose the content of the file is as follows:
38
Now when you use the ‘>’ redirection operator, the contents of the file are overwritten.
and when you use ‘>>’, the contents are appended:
21. Why is the tar command used?
The tar command is used to extract or create an archived file.
Suppose you want to extract all the files from the archive named sample.tar.gz, then the
command will be:
$ tar -xvzf sample.tar.gz
Suppose you want to create an archive of all the files stored in the path /home/linux/,
then the command will be:
$ tar -cvzf filename.tar.gz
where c: create archive, x: extract, v: verbose, f: file
39
22. What is a Latch?
A Latch is a temporary storage device controlled by timing signal which can either store
0 or 1. A Latch has two stable states (high-output or 1, and low-output or 0) and is
mainly used to store state information. A Latch can store one bit of data as long as it is
powered on.
23. What is a Microprocessor?
A Microprocessor is a device that executes instructions. It is a single-chip device that
fetches the instruction from the memory, decodes it and executes it. A Microprocessor
can carry out 3 basic functions:
1.
Mathematical operations like addition, subtraction, multiplication, and division
2.
Move data from one memory location to another
3.
Make decisions based on conditions and jump to new different instructions based
on the decision.
24. Explain Regular Expressions and Grep
Regular Expressions are used to search for data having a particular pattern. Some of the
commands used with Regular Patterns are: tr, sed, vi and grep.
Some of the common symbols used in Regular Expressions are:
.
Match any character
^
Match the beginning of the String
$
Match the end of the String
*
Match zero or more characters
Represents special characters
?
Match exactly one character
Suppose the content of a file is as follows:
40
If you want to list the entries that start with the character ‘a’, then the command would
be:
$ cat linux.txt | grep ^a
If you want to list the entries that start has the character ‘n’, then the command would
be:
$ cat linux.txt | grep n
41
25. What is the minimum number of disk partitions required to install Linux?
The minimum number of partitions required is 2.
One partition is used as the local file system where all the files are stored. This includes
files of the OS, files of applications and services, and files of the user. And the other
partition is used as Swap Space which acts as an extended memory for RAM.
26. How to copy a file in Linux?
You can use the cp command to copy a file in Linux. The general syntax is:
$ cp <source> <destination>
Suppose
you
want
to
copy
a
file
named questions.txt from
directory /new/linux to /linux/interview, then the command will be:
$ cp questions.txt /new/linux /linux/interview
27. How to terminate a running process in Linux?
Every process has a unique process id. To terminate the process, we first need to find
the process id. The ps command will list all the running processes along with the
process id. And then we use the kill command to terminate the process.
42
the
VI. COMPUTER NETWORKS
1. What is mean by data communication?
Data communication is the exchange of data (in the form of 1s and 0s) between two
devices via some form of transmission medium (such as a wire cable).
2.What are the three criteria necessary for an effective and efficient network?
The most important criteria are performance, reliability and security. Performance of the
network depends on number of users, type of transmission medium, the capabilities of
the connected h/w and the efficiency of the s/w. Reliability is measured by frequency of
failure, the time it takes a link to recover from the failure and the network’s robustness
in a catastrophe. Security issues include protecting data from unauthorized access and
viruses.
3.Why are protocols needed?
In networks, communication occurs between the entities in different systems. Two
entities cannot just send bit streams to each other and expect to be understood. For
communication, the entities must agree on a protocol. A protocol is a set of rules that
govern data communication
4. What is the difference between a passive and an active hub?
An active hub contains a repeater that regenerates the received bit patterns before
sending them out. A passive hub provides a simple physical connection between the
attached devices.
5.What are the responsibilities of data link layer?
Specific responsibilities of data link layer include the following. a) Framing
b) Physical addressing c) Flow control
d) Error control
43
e) Access control
6.Mention the types of errors?
There are 2 types of errors a) Single-bit error.
b) Burst-bit error.
7.Define the following terms.
a) Single bit error: The term single bit error means that only one bit of a given data unit
(such as byte character/data unit or packet) is changed from 1 to 0 or from 0 to 1.
b) Burst error:Means that 2 or more bits in the data unit have changed from 1 to 0 or
from
0 to 1.
8.What is redundancy?
It is the error detecting mechanism, which means a shorter group of bits or extra bits
may be appended at the destination of each unit.
9.Write short notes on VRC.
The most common and least expensive mechanism for error detection is the vertical
redundancy check (VRC) often called a parity check. In this technique a redundant bit
called a parity bit, is appended to every data unit so, that the total number of 0’s in the
unit (including the parity bit) becomes even.
10.Write short notes on LRC.
In longitudinal redundancy check (LRC), a block of bits is divided into rows and a
redundant row of bits is added to the whole block.
44
11.Write short notes on CRC.
The third and most powerful of the redundancy checking techniques is the cyclic
redundancy checks (CRC) CRC is based on binary division. Here a sequence of
redundant bits, called the CRC remainder is appended to the end of data unit.
12.Define ARQ
Error control in the data link layer is based on Automatic repeat request (ARQ), which
means retransmission of data in 3 cases.
a) Damaged frame b) Lost frame
c) Lost acknowledgment.
13.Mention the function of go-back N-ARQ.
It is the popular mechanism for continuous transmission error control. In this method, if
our frame is lost or damaged, all frames sent since the last frame acknowledged are
retransmitted.
14.What is selective reject ARQ?
In selective reject ARQ only the specific damaged or lost frame is retransmitted. If a
frame is corrupted in transit, a NAK is returned and the frame is resent out of sequence.
15.Mention the various architecture in a LAN
LAN is dominated by 4 architectures. a) Ethernet
b) Token bus c) Token ring
d) Fiber distributed data interface (FDDI)
45
16. What is a UTP cable?
A UTP cable is a 100 ohms cable made up of copper. It consists of 2-1800 unshielded
twisted pairs that are surrounded by a non-metallic case. These twists provide immunity
to electrical noise and EMI.
17. What is the maximum length allowed for a UTP cable?
The maximum length allowed for a UTP cable is 100m. This includes 90 m of solid
cabling and 10m of standard patch cable.
18. Explain what is HTTP and which port does it use?
HTTP or HyperText Transfer Protocol allows communication over the Internet. This
protocol basically defines how messages are to be transmitted and formatted over the
world wide web. HTTP is a TCP/ IP protocol and it uses the port number 80.
Features of HTTP Protocol:
•
It is connection-less
•
Does not depend on the type of connecting media
•
Stateless
19. What is NAT?
NAT stands for Network Address Translation. It deals with remapping one IP Address
space with another by changing the IP headers of the packets that are being transmitted
across a traffic routing device.
20. What is TCP?
TCP or Transmission Control Protocol is a connection-oriented protocol that establishes
and maintains a connection between communicating devices until both of them are done
exchanging messages. This protocol determines how application data can be broken
46
down into packets that can be delivered over a network. It also sends and receives
packets to and from the network layer and is in charge of flow control, etc.
21. Give a brief explanation about UDP?
UDP or the User Datagram Protocol is used to create a low-latency and loss-tolerating
communications between applications connected over the internet. UDP enables
process-to-process communication and communicates via datagrams or messages.
22. What is RIP?
RIP (Routing Information Protocol) is a dynamic routing protocol. It makes use of hop
count as its primary metric to find the best path between the source and the destination.
It works in the application layer and has an AD (Administrative Distance) value of 120.
23. Explain what is a firewall?
A firewall is a network security system which is used to monitor and control the
network traffic based on some predefined rules. Firewalls are the first line of defense
and establish barriers between the internal and external networks in order to avoid attack
from untrusted external networks. Firewalls can be either hardware, software or
sometimes both.
24. Explain what is NOS?
A Network Operating System (NOS) is an Operating System that is designed to support
workstations, databases, personal computers, etc over a network. Some examples of
NOS are MAC OS X, Linux, Windows Server 2008, etc. These Operating Systems
provide various functionalities such as processor support, multiprocessing support,
authentication, Web services, etc.
25. Explain what is Denial of Service (DoS)?
Denial of Service (DoS) is a kind of attack that prevents a legitimate user from
accessing data over a network by a hacker or an attacker. The attacker floods the server
47
with unnecessary requests in order to overload the server thereby preventing the
legitimate users from accessing its services.
26. What is the full form of ASCII?
ASCII stands for American Standard Code for Information Interchange. It is a character
encoding standard used in the electronic communication field. The ASCII codes
basically represent text.
27. What is IEEE?
IEEE stands for Institute of Electrical and Electronics Engineer. It is the world’s largest
technical professional society and is devoted to advancing innovation and technological
excellence.
28. What is a MAC address and why is it required?
MAC or Media Access Control address is a computer’s unique number assigned to a
Network Interface Controller (NIC). It is a 48-bit number that identifies each device on
a network and is also referred to as the physical address. MAC addresses are used as a
network address for communications within a network such as an Ethernet, Wi-Fi, etc.
29. What is piggybacking?
During transmission of data packets in two-way communication, the receiver sends an
acknowledgment (control frame or ACK) to the receiver after receiving the data packets.
However, the receiver does not send the acknowledgment immediately, but, waits until
its network layer passes in the next data packet. Then, the ACK is attached to the
outgoing data frame. This process of delaying the ACK and attaching it to the next
outgoing data frame is known as piggybacking.
48
VI.
WEB TECHNOLOGY
1. Define Internet?
The internet is the world’s largest IP-based network. It is an amorphous group of
computers in many different countries on all seven continents that talk to each other
using the IP protocol.
2. Define Protocol?
A protocol is a precise set of rules defining how components communicate, the format
of addresses, how data is split into packets
3. Write the expansion for the following.
ARPA – Advanced Research Projects Agency UDP – User Datagram Protocol
POP3 – Post Office Protocol version 3
MIME – Multimedia Internet Message Extension Protocol
IMAP – Internet Message Access Protocol
4.Define HTTP Protocol.
HTTP is a form of stateless communication protocol which gives a detailed
specification of how web client and server should communicate and the basic structure
followed is known as Request-Response model.
5. What is the structure of HTTP Request Message?
Start line (Request method, Request URI portion of web address, HTTP version) Header
field Blank line, Message Body
49
6.What is Cache?
Browsers often cache (save on disk) web pages so they can quickly reload the pages. If
there are no changes between the last version stored in the cache and the current version
on the Web, this helps speed up your browsing experience.
7. Define Web Clients.
A Web Client is software that accesses a web server by sending an HTTP request
message and processing the resulting HTTP response.
8. What are Web Servers?
A Web Server is software that accepts HTTP requests from web clients and returns an
appropriate resource in the HTTP response.
9. What are Secure Servers?
The standard means of indicating to a browser that it should encrypt an HTTP request is
to
use
the https scheme
on
the
URL
for
the
request.
For
e.g. https://www.example.org will cause the browser to attempt to send an encrypted
HTTP GET request.
10. What is HTML?
Hypertext is ordinary text that has been designed with extra features such as formatting,
images, multimedia and links to other documents. Markup is the process of taking
ordinary text and adding extra symbols. Each of the symbols used for markup in HTML
is a command that tells a browser how to display the text. HTML is the technical term
for the format used to create normal web pages.
11.What is DOM?
DOM (Document Object Model) is an API that defines how JavaScript programs can
access and manipulate the HTML document currently displayed by a browser. It
50
includes the definition of the properties of document object, many of which are
themselves objects with their own properties.
12. List out some of the HTML intrinsic event attributes.
onload, onclick, ondblclick, onmousedown, onmouseup, onmousemove, onfocus,
onblur, onkeypress, onkeydown, onselect, onchange, onsubmit, onreset etc.
13.What is DHTML?
The combination of HTML plus JavaScript and the DOM is referred to as Dynamic
HTML (DHTML), and an HTML document that contains scripting is called
a dynamic document.
14. Define servlet.
A servlet is a java class that a web server instantiates when the server is started. A
particular method is called in this instance when the server receives certain HTTP
requests.
15.Define cookie.
A cookie is a name-value pair that a web server sends to a client machine as part of an
HTTP response, specifically through the Set-cookie header field.
16. What is a marquee?
Marquee is used for the scrolling text on a web page. It scrolls the image or text up,
down, left or right automatically. You should put the text which you want to scroll
within the <marquee>……</marquee> tag.
17. What are the tags used to separate a section of texts?
There are three tags that can be used to separate the texts:
51
•
<br> tag – Usually <br> tag is used to separate the line of text. It breaks the
current line and conveys the flow to the next line
•
<p> tag – This contains the text in the form of a new paragraph.
•
<blockquote> tag – It is used to define a large quoted section. If you have a large
quotation, then put the entire text within <blockquote>……….</blockquote> tag.
18. What is the difference between DIV and SPAN in HTML?
The difference between span and div is that a span element is in-line and usually used
for a small chunk of HTML inside a line,such as inside a paragraph. Whereas, a div or
division element is block-line which is equivalent to having a line-break before and
after it and used to group larger chunks of code.
Example:
1 <div id="HTML">
2 This is <span class="Web Dev">interview</span>
3 </div>
19. What is the purpose of using alternative texts in images?
The purpose of using alternative texts is to define what the image is about. During an
image mapping, it can be confusing and difficult to understand what hotspots
correspond to a particular link. These alternative texts come in action here and put a
description at each link which makes it easy for users to understand the hotspot links
easily.
20. How to create a new HTML element?
You can create new elements for the document in the following way:
52
1 <script>
2 document.createElement﴾"myElement"﴿
3 </script>
It can be also be used in the HTML as:
1 <myElement>hello edureka!</myElement>
21. Is the <!DOCTYPE html> tag considered as a HTML tag?
No, the <!DOCTYPE html> declaration is not an HTML tag.
There are many type of HTML, such as, HTML 4.01 Strict, HTML 4.01 Transitional,
HTML 4.01 Frameset, XHTML 1.0 Strict, XHTML 1.0 Transitional, XHTML 1.0
Frameset, XHTML 1.1 etc. So, <!DOCTYPE html> is used to instruct the web browser
about the HTML page.
22. Why is a URL encoded in HTML?
An URL is encoded to convert non-ASCII characters into a format that can be used over
the Internet because a URL is sent over the Internet by using the ASCII character-set
only. If a URL contains characters outside the ASCII set, the URL has to be converted.
The non-ASCII characters are replaced with a “%” followed by hexadecimal digits.
23. What is the use of an iframe tag?
An iframe is used to display a web page within a web page.
Syntax:
1 <iframe src="URL"></iframe>
53
Example:
1 <iframe src="demo_iframe.html" width="200px" height="200px"></iframe>
Target to a link:
1 <iframe src="http://www.edureka.co" name="iframe_a"></iframe>
24. What are the entities in HTML?
The HTML character entities are used as a replacement for reserved characters in
HTML. You can also replace characters that are not present on your keyboard by
entities. These characters are replaced because some characters are reserved in HTML.
25. Can you create a multi-colored text on a web page?
Yes, we can create a multi-colored text on a web page. To create a multicolor text, you
can use <font color =”color”> </font> for the specific texts that you want to color.
26. How to make a picture of a background image of a web page?
To make a picture a background image on a web page, you should put the following tag
code after the </head> tag.
1 <body background = "image.gif">
Here, replace the “image.gif” with the name of your image file which you want to
display on your web page.
27. What is the use of a span tag? Explain with example.
The span tag is used for following things:
54
•
For adding color on text
•
To add background on text
•
Highlight any color text
Example:
1 <span style="color:#ffffff;">
2 In this page we use span.
3 </span>
28. What is the advantage of collapsing white space?
White spaces are a blank sequence of space characters, which is treated as a single space
character in HTML. Because the browser collapses multiple spaces into a single space,
you can indent lines of text without worrying about multiple spaces. This enables you to
organize the HTML code into a much more readable format.
29. Is there any way to keep list elements straight in an HTML file?
By using indents, you can keep the list elements straight. If you indent each sub nested
list in further than the parent list, you can easily determine the various lists and the
elements that it contains.
30. When is it appropriate to use frames?
Frames can make navigating a site much easier. If the main links to the site are located
in a frame that appears at the top or along the edge of the browser, the content for those
links can be displayed in the remainder of the browser window.
55
VIII. CRYPTOGRAPHY AND NETWORK SECURITY
1.What are the two approaches to attacking a cipher?
The two approaches to attack a cipher are:
•
Cryptanalysis
•
Brute-force attack
2.What is the difference between an unconditionally secure cipher and a
computationally secure cipher?
An unconditionally secure cipher is a scheme such that if the cipher text
generated by the scheme does not contain enough information to determine uniquely
the corresponding plain text, no matter how much cipher text is available.
A computationally secure scheme is such that the cost of breaking the cipher exceeds
the value of the encrypted information and the time required to break the cipher exceeds
the useful lifetime of the information.
3.What is the difference between a block cipher and a stream cipher?
✓
A block cipher processes the input one block of elements at a time,
producing an output block for each input block.
✓
A stream cipher processes the input elements continuously, producing
output one element at a time, as it goes along.
4.What are the essential ingredients of a symmetric cipher?
A symmetric cipher encryption has five ingredients. They are:
•
Plaintext
•
Encryption algorithm
56
•
Secret key
•
Cipher text
•
Decryption algorithm
5.What is Steganography?
✓
In stenography the plain text is hidden. The existence of the message
is concealed. For example the sequence of first letters of each word of the overall
message in the hidden message.
6.Explain the avalanche effect.
✓
It is that a small change in either the plaintext or the key should
produce a significant change in the cipher text. A change in one of the bit of the
plaintext or one bit of the key should produce a change in many bits of the cipher text.
7.What is the difference between a mono alphabetic cipher and a poly alphabetic
cipher
✓
✓
Mono alphabetic cipher: Here a single cipher alphabet is used.
Poly alphabetic cipher: Here a set of related mono alphabetic
substitution rules is used.
8.What are the aspects of information security?
There are three aspects of the information security.
•
•
•
Security attack
Security mechanism
Security Service
9.What is meant by attack?
An attack on system security that derives from an intelligent threat: that is an
57
intelligent act that is a deliberate attempt (especially in the sense of a method or
technique) to evade security services and violate the security policy of a system.
10.What are the essential ingredients of a symmetric cipher?
A symmetric encryption scheme has five ingredients:
✓
Plaintext: This is the original intelligible message or data that is fed
into the algorithm as input.
✓
Encryption algorithm: The encryption algorithm performs various
substitutions and transformations on the plaintext.
✓
Secret Key: The secret key is also input to the encryption algorithm.
The key is the value independent of the plaintext. The algorithm will produce a
different output depending on the specific key being used at the time. The exact
substitutions and transformations performed by the algorithm depend on the key.
✓
Cipher text: This is the scrambled message produced as output. It
depends on the plaintext and the key.
✓
Decryption algorithm: This is essentially the encryption algorithm in
reverse. It takes the cipher text and the secret key and produces the original plaintext.
11.What is Euler’s totient function?
Euler’s totient function Φ(n) defined as the number of positive integers less than n and
Relatively prime to n. by conversion Φ(1)=1.
12.Why random numbers are used in network security?
➢
Nonces in authentication protocols to prevent replay
➢
Session keys
58
➢
Public key generation
➢
Key stream for a one‐time pad
13.Describe in general terms an efficient procedure for picking a prime number?
The procedure for picking a prime number is as follows:
1.
Pick an odd integer n at random (eg., using a pseudorandom
number generator).
2.
Pick an integer a<n at random.
3.
Perform the probabilistic primality test, such as Miller-Rabin.
If n fails the test,reject the value n and go to step 1.
4.
If n has passed a sufficient number of tests, accept n;
otherwise , go to step 2.
14.How is the S-box constructed?
•
The S-box is constructed in the following fashion:
•
Initialize the S-box with the byte values in ascending sequence row
by row.The first row contains {00}, {01}, {02}... {0F}; the second row
contains {10},{11},etc; and so on. Thus, the value of the byte at row x, columny
is {xy}.
•
Map each byte in the S-box to its multiplicative inverse in the
finite field GF (28); the value{00} is mapped to itself. Consider that each byte
in the S-box consists of8bits labeled (b7, b6, b5, b4, b3, b2, b1,b0).Apply the
following transformation to each bit of each byte in the S-box.
15.Briefly describe ShiftRows.
•
In shift row, a row shift moves an individual byte from one column
59
to another, which is a linear distance of a multiple of 4 bytes.
•
In Forward Shift Row, each row perform circular left shift.
•
Second Row a1-bytecircularleft shift is performed.
•
Third Rowa2-byte circular left shift is performed.
•
For the Fourth Row a3-byte circular left shift is performed.
•
In Inverse Shift Row, each row perform circular right shift.
Implementations Attacks on Implementations Encryption vs. Decryption, Key
Agility, Other Versatility and Flexibility
16. What are some of the common Cyberattacks?
Following are some common cyber attacks that could adversely affect your system.
1.
Malware
2.
Phishing
3.
Password Attacks
4.
DDoS
5.
Man in the Middle
6.
Drive-By Downloads
7.
Malvertising
8.
Rogue Software
17. What is a Brute Force Attack? How can you prevent it?
Brute Force is a way of finding out the right credentials by repetitively trying all the
permutations and combinations of possible credentials. In most cases, brute force attacks
60
are automated where the tool/software automatically tries to login with a list of
credentials. There are various ways to prevent Brute Force attacks. Some of them are:
•
Password Length: You can set a minimum length for password. The lengthier the
password, the harder it is to find.
•
Password Complexity: Including different formats of characters in the password
makes brute force attacks harder. Using alpha-numeric passwords along with special
characters, and upper and lower case characters increase the password complexity
making it difficult to be cracked.
•
Limiting Login Attempts: Set a limit on login failures. For example, you can set
the limit on login failures as 3. So, when there are 3 consecutive login failures, restrict
the user from logging in for some time, or send an Email or OTP to use to log in the
next time. Because brute force is an automated process, limiting login attempts will
break the brute force process.
18. What is Port Scanning?
Port Scanning is the technique used to identify open ports and service available on a
host. Hackers use port scanning to find information that can be helpful to exploit
vulnerabilities. Administrators use Port Scanning to verify the security policies of the
network. Some of the common Port Scanning Techniques are:
1.
Ping Scan
2.
TCP Half-Open
3.
TCP Connect
4.
UDP
5.
Stealth Scanning
61
19. What are the different layers of the OSI model?
An OSI model is a reference model for how applications communicate over a network.
The purpose of an OSI reference is to guide vendors and developers so the digital
communication products and software programs can interoperate.
Following are the OSI layers:
Physical Layer: Responsible for transmission of digital data from sender to receiver
through the communication media,
Data Link Layer: Handles the movement of data to and from the physical link. It is
also responsible for encoding and decoding of data bits.
Network Layer: Responsible for packet forwarding and providing routing paths for
network communication.
Transport Layer: Responsible for end-to-end communication over the network. It
splits the data from the above layer and passes it to the Network Layer and then ensures
that all the data has successfully reached at the receiver’s end.
Session Layer: Controls connection between the sender and the receiver. It is
responsible for starting, ending, and managing the session and establishing, maintaining
and synchronizing interaction between the sender and the receiver.
62
Presentation Layer: It deals with presenting the data in a proper format and data
structure instead of sending raw datagrams or packets.
Application Layer: It provides an interface between the application and the network. It
focuses on process-to-process communication and provides a communication interface.
20. What is a VPN?
Almost all Cybersecurity Interview Questions will have this question
included. VPN stands for Virtual Private Network. It is used to create a safe and
encrypted connection. When you use a VPN, the data from the client is sent to a point in
the VPN where it is encrypted and then sent through the internet to another point. At this
point, the data is decrypted and sent to the server. When the server sends a response, the
response is sent to a point in the VPN where it is encrypted and this encrypted data is
sent to another point in the VPN where it is decrypted. And finally, the decrypted data is
sent to the client. The whole point of using a VPN is to ensure encrypted data transfer.
21. What do you understand by Risk, Vulnerability & Threat in a network?
Threat: Someone with the potential to harm a system or an organization
Vulnerability: Weakness in a system that can be exploited by a potential hacker
Risk: Potential for loss or damage when threat exploits a vulnerability
22. How can identity theft be prevented?
Here’s what you can do to prevent identity theft:
•
o
Ensure strong and unique password
o
Avoid sharing confidential information online, especially on social media
o
Shop from known and trusted websites
o
Use the latest version of the browsers
63
o
Install advanced malware and spyware tools
o
Use specialized security solutions against financial data
o
Always update your system and the software
o
Protect your SSN (Social Security Number)
23. What are black hat, white hat and grey hat hackers?
Black hat hackers are known for having vast knowledge about breaking into computer
networks. They can write malware which can be used to gain access to these systems.
This type of hackers misuse their skills to steal information or use the hacked system for
malicious purpose.
White hat hackers use their powers for good deeds and so they are also called Ethical
Hackers. Look out for our Ethical Hacking Course to learn more about the Ethical
Hacking. These are mostly hired by companies as a security specialist that attempts to
find and fix vulnerabilities and security holes in the systems. They use their skills to
help make the security better.
Anonymity is just a simple thing in Ethical Hacking & CyberSecurity. If you are
interested in this domain, check Edureka’s CompTIA Security+ Certification Training.
Grey hat hackers are an amalgamation of a white hat and black hat hacker. They look
for system vulnerabilities without the owner’s permission. If they find any
vulnerabilities, they report it to the owner. Unlike Black hat hackers, they do not exploit
the vulnerabilities found.
24. How often should you perform Patch management?
Patch management should be done as soon as it is released. For windows, once the patch
is released it should be applied to all machines, not later than one month. Same goes for
network devices, patch it as soon as it is released. Proper patch management should be
followed.
64
25. How would you reset a password-protected BIOS configuration?
Since BIOS is a pre-boot system it has its own storage mechanism for settings and
preferences. A simple way to reset is by popping out the CMOS battery so that the
memory storing the settings lose its power supply and as a result, it will lose its setting.
26. Explain MITM attack and how to prevent it?
A MITM(Man-in-the-Middle) attack is a type of attack where the hacker places
himself in between the communication of two parties and steal the information. Suppose
there are two parties A and B having a communication. Then the hacker joins this
communication. He impersonates as party B to A and impersonates as party A in front
of B. The data from both the parties are sent to the hacker and the hacker redirects the
data to the destination party after stealing the data required. While the two parties think
that they are communicating with each other, in reality, they are communicating with
the hacker.
You can prevent MITM attack by using the following practices:
•
Use VPN
•
Use strong WEP/WPA encryption
•
Use Intrusion Detection Systems
•
Force HTTPS
•
Public Key Pair Based Authentication
27. Explain DDOS attack and how to prevent it?
This again is an important Cybersecurity Interview Question. A DDOS(Distributed
Denial of Service) attack is a cyberattack that causes the servers to refuse to provide
services to genuine clients. DDOS attack can be classified into two types:
65
1.
Flooding attacks: In this type, the hacker sends a huge amount of traffic to the
server which the server can not handle. And hence, the server stops functioning. This
type of attack is usually executed by using automated programs that continuously send
packets to the server.
2.
Crash attacks: In this type, the hackers exploit a bug on the server resulting in
the system to crash and hence the server is not able to provide service to the clients.
You can prevent DDOS attacks by using the following practices:
•
Use Anti-DDOS services
•
Configure Firewalls and Routers
•
Use Front-End Hardware
•
Use Load Balancing
•
Handle Spikes in Traffic
28. Explain XSS attack and how to prevent it?
XSS(Cross-Site Scripting) is a cyberattack that enables hackers to inject malicious
client-side scripts into web pages. XSS can be used to hijack sessions and steal cookies,
modify DOM, remote code execution, crash the server etc.
You can prevent XSS attacks by using the following practices:
•
Validate user inputs
•
Sanitize user inputs
•
Encode special characters
•
Use Anti-XSS services/tools
•
Use XSS HTML Filter
66
29. What is an ARP and how does it work?
Address Resolution Protocol (ARP)is a protocol for mapping an Internet Protocol
address (IP address) to a physical machine address that is recognized in the local
network.
When an incoming packet destined for a host machine on a particular local area network
arrives at a gateway, the gateway asks the ARP program to find a physical host or MAC
address that matches the IP address.
The ARP program looks in the ARP cache and, if it finds the address, provides it so that
the packet can be converted to the right packet length and format and sent to the
machine.
If no entry is found for the IP address, ARP broadcasts a request packet in a special
format to all the machines on the LAN to see if one machine knows that it has that IP
address associated with it.
30. What is port blocking within LAN?
Restricting the users from accessing a set of services within the local area network is
called port blocking.
Stopping the source to not to access the destination node via ports. As the application
works on the ports, so ports are blocked to restricts the access filling up the security
holes in the network infrastructure.
67
IX. ARTIFICIAL INTELLIGENCE
1.Define Agent.?
An Agent is anything that can be viewed as perceiving (i.e.) understanding its
environment through sensors and acting upon that environment through actuators.
2.List the various type of agent program?
•
Simple reflex agent program.
•
Agent that keep track of the world.
•
Goal based agent program.
•
Utility based agent program
3.Give the structure of agent in an environment?
Agent interacts with environment through sensors and actuators. An Agent is anything
that can be viewed as perceiving (i.e.) understanding its environment through sensors
and acting upon that environment through actuators.
4.Define problem solving agent?
Problem solving agent is one kind of goal based agent, where the agent should select
one action from sequence of actions which lead to desirable states.
5.List the steps involved in simple problem solving technique?
i. Goal formulation
ii. Problem formulation
iii. Search
iv. Solution
68
v. Execution phase
6.Distinguish between fuzzy logic and conventional logic?
Fuzzy Logic (FL) is a method of reasoning that resembles human reasoning. The
approach of FL imitates the way of decision making in humans that involves all
intermediate possibilities between digital values YES and NO.
The conventional logic block that a computer can understand takes precise input and
produces a definite output as TRUE or FALSE, which is equivalent to a human’s YES
or NO
7.Mention any two difference between conditional and continuous planning?
Conditional Planning: It deals with the planning by some appropriate conditions. The
agents plan first and then execute the plan that was produced. The agents find out which
part of the plan to execute by including sensing actions in the plan to test for the
appropriate conditions.
Continuous Planning: In this planning, the planner at first achieves the goal and then
only can stop. A continuous planner is designed to persist over a lifetime. It can handle
any unfavorable circumstances in the environment.
8.State Dempster-Shafer theory?
The Dempster-Shafer theory is a mathematical theory of evidence based on belief
functions and plausible reasoning, which is used to combine separate pieces of
information (evidence) to calculate the probability of an event. The theory was
developed by Arthur P. Dempster and Glenn Shafer.
9.What is bayesian network?Give an example?
"A Bayesian network is a probabilistic graphical model which represents a set of
variables and their conditional dependencies using a directed acyclic graph."
69
For example, a Bayesian network could represent the probabilistic relationships
between diseases and symptoms. Given symptoms, the network can be used to compute
the probabilities of the presence of various diseases. Efficient algorithms can perform
inference and learning in Bayesian networks.
10.What is reasoning?
The reasoning is the mental process of deriving logical conclusion and making
predictions from available knowledge, facts, and beliefs. In artificial intelligence, the
reasoning is essential so that the machine can also think rationally as a human brain,
and can perform like a human.
11.What do you meant by rule based system?
A rule-based system is a system that applies human-made rules to store, sort and
manipulate data. In doing so, it mimics human intelligence. To work, rule-based
systems require a set of facts or source of data, and a set of rules for manipulating that
data.
12.What is meant by non monotonic logic?
A non-monotonic logic is a formal logic whose conclusion relation is not monotonic. In
other words, non-monotonic logics are devised to capture and represent defeasible
inferences (cf. defeasible reasoning), i.e., a kind of inference in which reasoners draw
tentative conclusions, enabling reasoners to retract their conclusion(s) based on further
evidence.
13.What is monotonicity?
The definite clause logic is monotonic
in the sense that anything that could be
concluded before a clause is added can still be concluded after it is added; adding
knowledge does not reduce the set of propositions that can be derived.Mathematical
reasoning enjoys a property called monotonicity, that says, “If a conclusion follows
70
from given premises A, B, C... then it also follows from any larger set of premises, as
long as the original premises A, B, C.. included.”
14.How does fuzzy logic differ from set theory?
Fuzzy sets can be considered as an extension and gross oversimplification of classical
sets. It can be best understood in the context of set membership. Basically it allows
partial membership which means that it contain elements that have varying degrees of
membership in the set. From this, we can understand the difference between classical set
and fuzzy set. Classical set contains elements that satisfy precise properties of
membership while fuzzy set contains elements that satisfy imprecise properties of
membership.
15.Define uncertainty.How it is solved?
Though there are various types of uncertainty in various aspects of a reasoning system,
the "reasoning with uncertainty" (or "reasoning under uncertainty") research in AI has
been focused on the uncertainty of truth value, that is, to allow and process truth values
other than "true" and "false".
Probability provides the foundation and tools for quantifying, handling, and harnessing
uncertainty in applied machine learning.
16. Explain the components of Expert Systems.
71
•
Knowledge Base
It contains domain-specific and high-quality knowledge.
•
Inference Engine
It acquires and manipulates the knowledge from the knowledge base to arrive at a
particular solution.
•
User Interface
The user interface provides interaction between the user and the Expert System itself.
17. How is Computer Vision and AI related?
Computer Vision is a field of Artificial Intelligence that is used to obtain information
from images or multi-dimensional data. Machine Learning algorithms such as K-means
is used for Image Segmentation, Support Vector Machine is used for Image
Classification and so on.
Therefore Computer Vision makes use of AI technologies to solve complex problems
such as Object Detection, Image Processing, etc.
18. Which is better for image classification? Supervised or unsupervised
classification? Justify.
•
In supervised classification, the images are manually fed and interpreted by the
Machine Learning expert to create feature classes.
•
In unsupervised classification, the Machine Learning software creates feature
classes based on image pixel values.
Therefore, it is better to choose supervised classification for image classification in
terms of accuracy.
19. Finite difference filters in image processing are very susceptible to noise. To
cope up with this, which method can you use so that there would be minimal
distortions by noise?
72
Image Smoothing is one of the best methods used for reducing noise by forcing pixels to
be more like their neighbors, this reduces any distortions caused by contrasts.
20. How is Game theory and AI related?
“In the context of artificial intelligence(AI) and deep learning systems, game theory is
essential to enable some of the key capabilities required in multi-agent environments in
which different AI programs need to interact or compete in order to accomplish a
goal.”
21. What is the Minimax Algorithm? Explain the terminologies involved in a
Minimax problem.
Minimax is a recursive algorithm used to select an optimal move for a player assuming
that the other player is also playing optimally.
A game can be defined as a search problem with the following components:
•
Game Tree: A tree structure containing all the possible moves.
•
Initial state: The initial position of the board and showing whose move it is.
•
Successor function: It defines the possible legal moves a player can make.
•
Terminal state: It is the position of the board when the game ends.
•
Utility function: It is a function which assigns a numeric value for the outcome of
a game.
22. Show the working of the Minimax algorithm using Tic-Tac-Toe Game.
There are two players involved in a game:
•
MAX: This player tries to get the highest possible score
•
MIN: MIN tries to get the lowest possible score
73
The following approach is taken for a Tic-Tac-Toe game using the Minimax algorithm:
Step 1: First, generate the entire game tree starting with the current position of the game
all the way up to the terminal states.
Tic-Tac-Toe
Step 2: Apply the utility function to get the utility values for all the terminal states.
Step 3: Determine the utilities of the higher nodes with the help of the utilities of the
terminal nodes. For instance, in the diagram below, we have the utilities for the terminal
states written in the squares.
74
Let us calculate the utility for the left node(red) of the layer above the terminal:
MIN{3, 5, 10}, i.e. 3.
Therefore, the utility for the red node is 3.
Similarly, for the green node in the same layer:
MIN{2,2}, i.e. 2.
Tic-Tac-Toe
Step 4: Calculate the utility values.
Step 5: Eventually, all the backed-up values reach to the root of the tree. At that point,
MAX has to choose the highest value:
i.e. MAX{3,2} which is 3.
75
Therefore, the best opening move for MAX is the left node(or the red one).
To summarize,
Minimax Decision = MAX{MIN{3,5,10},MIN{2,2}}
= MAX{3,2}
=3
23. Which method is used for optimizing a Minimax based game?
Alpha-beta Pruning
If we apply alpha-beta pruning to a standard minimax algorithm, it returns the same
move as the standard one, but it removes all the nodes that are possibly not affecting the
final decision.
24. How does Reinforcement Learning work? Explain with an example.
Generally, a Reinforcement Learning (RL) system is comprised of two main
components:
1.
An agent
2.
An environment
76
Reinforcement Learning
•
The environment is the setting that the agent is acting on and the agent represents
the RL algorithm.
•
The RL process starts when the environment sends a state to the agent, which then
based on its observations, takes an action in response to that state.
•
In turn, the environment sends the next state and the respective reward back to the
agent. The agent will update its knowledge with the reward returned by the environment
to evaluate its last action.
•
The loop continues until the environment sends a terminal state, which means the
agent has accomplished all his tasks.
To understand this better, let’s suppose that our agent is learning to play counterstrike.
The RL process can be broken down into the below steps:
1.
The RL Agent (Player1) collects state S⁰ from the environment (Counterstrike
game)
2.
Based on the state S⁰, the RL agent takes an action A⁰, (Action can be anything
that causes a result i.e. if the agent moves left or right in the game). Initially, the action
is random
3.
The environment is now in a new state S¹ (new stage in the game)
77
4.
The RL agent now gets a reward R¹ from the environment. This reward can be
additional points or coins
5.
This RL loop goes on until the RL agent is dead or reaches the destination, and it
continuously outputs a sequence of state, action, and reward.
To learn more about Reinforcement Learning you can go through this video recorded by
our Machine Learning experts.
25. Explain Markov’s decision process with an example.
The mathematical approach for mapping a solution in Reinforcement Learning is called
Markov’s Decision Process (MDP).
The following parameters are used to attain a solution using MDP:
•
Set of actions, A
•
Set of states, S
•
Reward, R
•
Policy, π
•
Value, V
Markov’s Decision Process
78
To briefly sum it up, the agent must take an action (A) to transition from the start state
to the end state (S). While doing so, the agent receives rewards (R) for each action he
takes. The series of actions taken by the agent, define the policy (π) and the rewards
collected define the value (V). The main goal here is to maximize rewards by choosing
the optimum policy.
To better understand the MDP, let’s solve the Shortest Path Problem using the MDP
approach:
Shortest Path Problem
Given the above representation, our goal here is to find the shortest path between ‘A’
and ‘D’. Each edge has a number linked with it, this denotes the cost to traverse that
edge. Now, the task at hand is to traverse from point ‘A’ to ‘D’, with minimum possible
cost.
In this problem,
•
The set of states are denoted by nodes i.e. {A, B, C, D}
•
The action is to traverse from one node to another {A -> B, C -> D}
•
The reward is the cost represented by each edge
•
The policy is the path taken to reach the destination
You start off at node A and take baby steps to your destination. Initially, only the next
possible node is visible to you, thus you randomly start off and then learn as you
traverse through the network. The main goal is to choose the path with the lowest cost.
79
Since this is a very simple problem, I will leave it for you to solve. Make sure you
mention the answer in the comment section.
26. Explain reward maximization in Reinforcement Learning.
The RL agent works based on the theory of reward maximization. This is exactly why the
RL agent must be trained in such a way that, he takes the best action so that the reward
is maximum.
The collective rewards at a particular time with the respective action is written as:
Reward Maximization Equation
The above equation is an ideal representation of rewards. Generally, things don’t work
out like this while summing up the cumulative rewards.
Reward Maximization
Let me explain this with a small game. In the figure you can see a fox, some meat and a
tiger.
•
Our RL agent is the fox and his end goal is to eat the maximum amount of meat
before being eaten by the tiger.
80
•
Since this fox is a clever fellow, he eats the meat that is closer to him, rather than
the meat which is close to the tiger, because the closer he is to the tiger, the higher are
his chances of getting killed.
•
As a result, the rewards near the tiger, even if they are bigger meat chunks, will be
discounted. This is done because of the uncertainty factor, that the tiger might kill the
fox.
The next thing to understand is, how discounting of rewards work?
To do this, we define a discount rate called gamma. The value of gamma is between 0
and 1. The smaller the gamma, the larger the discount and vice versa.
So, our cumulative discounted rewards is:
Reward Maximization with Discount Equation
27. What is exploitation and exploration trade-off?
An important concept in reinforcement learning is the exploration and exploitation
trade-off.
Exploration, like the name suggests, is about exploring and capturing more information
about an environment. On the other hand, exploitation is about using the already known
exploited information to heighten the rewards.
81
Exploitation & Exploration
•
Consider the fox and tiger example, where the fox eats only the meat (small)
chunks close to him but he doesn’t eat the bigger meat chunks at the top, even though
the bigger meat chunks would get him more rewards.
•
If the fox only focuses on the closest reward, he will never reach the big chunks of
meat, this is called exploitation.
•
But if the fox decides to explore a bit, it can find the bigger reward i.e. the big
chunk of meat. This is exploration.
28. What is the difference between parametric & non-parametric models?
82
29. What is the difference between Hyperparameters and model parameters?
30. What are hyperparameters in Deep Neural Networks?
•
Hyperparameters are variables that define the structure of the network. For
example, variables such as the learning rate, define how the network is trained.
•
They are used to define the number of hidden layers that must be present in a
network.
•
More hidden units can increase the accuracy of the network, whereas a lesser
number of units may cause underfitting.
X. DATABASE MANAGEMENT SYSTEMS
1.
Define database management system?
Database management system (DBMS) is a collection of interrelated data and a
set of programs to access those data.
2.
List any eight applications of DBMS.
a) Banking
83
b) Airlines
c) Universities
d) Credit card transactions
e) Tele communication
f) Finance
g) Sales
h) Manufacturing
i) Human resources
3.
What are the disadvantages of file processing system?
The disadvantages of file processing systems are
a) Data redundancy and inconsistency
b) Difficulty in accessing data
c) Data isolation
d) Integrity problems
e) Atomicity problems
f) Concurrent access anomalies
4.
What are the advantages of using a DBMS?
The advantages of using a DBMS are
a) Controlling redundancy
84
b) Restricting unauthorized access
c) Providing multiple user interfaces
d) Enforcing integrity constraints.
e) Providing back up and recovery
5.
Define instance and schema?
Instance: Collection of data stored in the data base at a particular moment is called an
Instance of the database.
Schema: The overall design of the data base is called the data base schema.
6. Define the terms 1) physical schema 2) logical schema.
Physical schema: The physical schema describes the database design at the physical
level, which is the lowest level of abstraction describing how the data are actually
stored.
Logical schema: The logical schema describes the database design at the logical level,
which describes what data are stored in the database and what relationship exists among
the data.
7.What is the purpose of storage manager?
The storage manager is responsible for the following
a) Interaction with he file manager
b) Translation of DML commands in to low level file system commands
c) Storing, retrieving and updating data in the database
85
8. List the data structures implemented by the storage manager.
The storage manager implements the following data structure
a) Data files
b) Data dictionary
c) indices
9. What is a data dictionary?
A data dictionary is a data structure which stores meta data about the structure of the
database ie. the schema of the database.
10. What is an entity relationship model?
The entity relationship model is a collection of basic objects called entities and
relationship among those objects. An entity is a thing or object in the real world that is
distinguishable from other objects.
11. What is the use of Union and intersection operation?
Union: The result of this operation includes all tuples that are either in r1 or in r2 or in
both r1 and r2.Duplicate tuples are automatically eliminated.
Intersection: The result of this relation includes all tuples that are in both r1 and r2.
12. What are aggregate functions? And list the aggregate functions supported by
SQL?
Aggregate functions are functions that take a collection of values as input and return a
single value.
Aggregate functions supported by SQL are
86
Average: avg
Minimum: min
Maximum: max
Total: sumCOUNT:COUNT
13.What are the parts of SQL language?
The SQL language has several parts:
•
data - definitition language
•
Data manipulation language
•
View definition
•
Transaction control
•
Embedded SQL
•
Integrity
•
Authorization
14.What is normalization?
It is a process of analysing the given relation schemas based on their Functional
Dependencies
(FDs)
and
primary
key
to
(1).Minimizing redundancy,
(2). Minimizing insertion, deletion and update anomalies.
87
achieve
the
properties
15. What is Functional Dependency?
•
A Functional dependency is denoted by X Y between two sets of attributes X and
Y that are subsets of R specifies a constraint on the possible tuple that can form a
relation state r of R. The constraint is for any two tuples t1 and t2 in r if t1[X] = t2[X]
then they have t1[Y] = t2[Y]. This means the value of X component of a tuple uniquely
determines the value of component Y.
16. What do you understand by correlated subqueries in DBMS?
A correlated subquery is also a sort of subquery reliant on another query. So, when
subqueries are executed for each of the rows of outer queries, then they are termed as
correlated subqueries. Each subquery is executed a single time for every row of the
outer query.
You can also understand correlated subqueries as those queries, which are used for rowby-row processing by the parent statement. Here, the parent statement can be SELECT,
UPDATE or DELETE statement.
17. Explain Database partitioning and its importance.
Data partitioning is the process of dividing a logical database into independent units for
the betterment of availability, performance, and manageability.
•
Enables you to access large parts of a specific partition
•
Cheap and slower storage can be used to store data
•
Improves query performance
18. What do you understand by functional dependency and transitive dependency
in DBMS?
Functional Dependency: A functional dependency is a constraint that is used in
describing the relationship among different attributes in a relation.
88
Example: Consider a relation “A1” having attributes X and Y. The functional
dependency among these two attributes will be X -> Y, this implies that Y is
functionally dependent on X.
Transitive Dependency: A transitive dependency is a constraint that can only occur in
a relation of three or more attributes.
Example: Consider a relation “A1” having attributes X, Y and Z. Now, X->Z is said to
hold transitive dependency, only if the following functional dependencies holds true:
•
X -> Y
•
Y doesn’t ->X
•
Y -> Z
19. What is the difference between two and three-tier architectures?
Two-tier architecture
This is similar to the client-server
architecture.
Three-tier architecture
This architecture contains an extra layer
between the client and the server.
Clients communicate with an
application(GUI) on the server-side, that
makes the system more secure and
accessible. This application thereafter
communicates with the database system.
Clients directly communicate with the
database at the server-side
20. Mention the differences between Unique Key and Primary Key
Unique Key
Primary Key
Unique Key can have a NULL value
The primary key cannot have a NULL
value
Each table can have more than one unique
key
Each table can have only one primary key
89
21. What is a checkpoint in DBMS and when does it occur?
A checkpoint is a mechanism where all the previous logs are removed from the system
and are permanently stored on the storage disk. So, basically, checkpoints are those
points from where the transaction log record can be used to recover all the committed
data up to the point of crash.
22. Mention the differences between Trigger and Stored Procedures
Triggers
A special kind of stored procedure that is
not called directly by a user. In fact, a
trigger is created and is programmed to
fire when a specific event occurs.
A trigger cannot be called
or execute directly by a user. Only when
the corresponding events are fired,
triggers are created.
Stored Procedures
A group of SQL statements which can be
reused again and again. These statements
are created and stored in the database.
Can execute stored procedures by using the
exec command, whenever we want.
23. What are the differences between Hash join, Merge join and Nested loops?
Hash join
Merge join
Nested loops
The hash join is used when
you have to join large
tables.
Merge join is used when
projections of the joined
tables are sorted on the join
columns.
The nested loop consists of
an outer loop and an inner
loop.
24. What do you understand by Proactive, Retroactive and Simultaneous Update?
•
Proactive Update: These updates are applied to the database before it becomes
effective in the real-world environment.
•
Retroactive Update: These retroactive updates are applied to a database after it
becomes effective in the real-world environment.
•
Simultaneous Update: These updates are applied to the database at the same
instance of time as it becomes effective in a real-world environment.
90
25. What are indexes? Mention the differences between the clustered and nonclustered index
Indexes are data structures responsible for improving the speed of data retrieval
operations on a table. This data structure uses more storage space to maintain extra
copies of data by using additional writes. So, indexes are mainly used for searching
algorithms, where you wish to retrieve data in a quick manner.
The differences between clustered and non-clustered index are as follows:
Clustered Index
A clustered index is faster
Alters the way records are stored in a
database as it sorts out rows by the column
which is set to be clustered index
One table can only have one clustered
index
Non-clustered Index
Non clustered index is relatively slower
Does not alter the way it was stored but it
creates a separate object within a table
which points back to the original table
rows after searching
One table can only have many non
clustered indexes
26. What do you understand by intension and extension?
Intension: Intension or most commonly known as Database schema defines the
description of the database. This is specified during the database design and mostly
remains unchanged.
Extension: Extension is the number of tuples available in the database at any instance
of time. This value keeps changing as and when the tuples are created, updated and
destroyed. So, the data present in the database at a specific instance of time is known as
the extension of the database or most commonly known as the snapshot of the database.
27. What do you understand by cursor? Mention the different types of cursor
A cursor is a database object which helps in manipulating data, row by row and
represents a result set.
The types of cursor are as follows:
91
•
Implicit cursor: This type of cursor is declared automatically as soon as the
execution of SQL takes place. Here, the user is not indicated about the declaration of the
cursor.
•
Explicit cursor: This type of cursor is defined by the PL/ SQL, as it handles a
query in more than a single row.
28. Explain the terms specialization and generalization
•
Specialization: Specialization is a process of defining a set of subclasses of the
entity type. Here, each subclass will contain all the attributes and relationships of the
parent entity. Apart from this, the subclasses may contain additional attributes and
relationships specific to itself.
•
Generalization: Generalization is a process of finding relations, common
attributes for a particular set of entities; and finally defining a common superclass for
them.
29. What do you understand by Data Independence?
When you say an application has data independence, it implies that the application is
independent of the storage structure and data access strategies of data.
30. What are the different integrity rules present in the DBMS?
The different integrity rules present in DBMS are as follows:
•
Entity Integrity: This rule states that the value of the primary key can never be
NULL. So, all the tuples in the column identified as the primary key should have a
value.
•
Referential Integrity: This rule states that either the value of the foreign key is
NULL or it should be the primary key of any other relation.
92
XI. SOFTWARE ENGINEERING
1.What is cardinality?
In the context of databases, cardinality refers to the uniqueness of data values contained
in a column. High cardinality means that the column contains a large percentage of
totally unique values. Low cardinality means that the column contains a lot of “repeats”
in its data range.
2. Define Software Engineering?
a. “A systematic collection of good program development practices and techniques”. b.
Software engineering discusses systematic and cost-effective techniques for software
development. These techniques help develop software using an engineering approach.
3. Define Software prototype?
Software prototyping is the activity of creating prototypes of software applications, i.e.,
incomplete versions of the software program being developed. It is an activity that can
occur in software development and is comparable to prototyping as known from other
fields, such as mechanical engineering or manufacturing.
4. What is CASE?
a. Software systems which are intended to provide automated support for software
process activities. CASE systems are often used for method support.
b. Upper-CASE:
c. Tools to support the early process activities of requirements and design.
d. Lower-CASE: e. Tools to support later activities such as programming, debugging
and testing.
93
5. List out the Software Life Cycle model?
o Waterfall model.
o Prototyping model.
o RAD model.
o Evolutionary model.
o Incremental model.
o Spiral model.
6.What is planning ?
The primary objective of project planning is to ensure that the various development
activities take place at the correct time and no activity is halted due to the want of some
resource. Project planning normally includes preparation of various types of estimates,
resource scheduling, and development of project tracking plans.
7. What are the umbrella activities of a software process?
i. Software project tracking andcontrol.
ii. Riskmanagement.
iii. Software QualityAssurance.
iv. Formal TechnicalReviews.
v. Software ConfigurationManagement
vi. Work product preparation andproduction
vii. Reusabilitymanagement
viii. Measurement
94
8.Name the characteristics of CASE tools?
a. Firstly Quick Installation.
b. Time Saving by reducing coding and testing time.
c. Enrich graphical techniques and data flow.
d. Optimum use of available information.
e. Enhanced analysis and design development.
f. Create and manipulate documentation.
g. Transfer the information between tools efficiently
9.What are the advantages of waterfall model?
In any practical development environment, as the software takes shape, several
iterations through the different waterfall stages become necessary for correction of
errors committed during various phases.Therefore, the classical waterfall model is
hardly usable for software development. Irrespective of the life cycle model that is
actually followed for a product development, the final documents are always written to
reflect a classical waterfall model of development, so that comprehension of the
documents becomes easier for any one reading the document.
10.What are the types of software products?Explain.
Software Products are nothing but software systems delivered to the customer with the
documentation that describes how to install and use the system. In certain cases,
software products may be part of system products where hardware, as well as software,
is delivered to a customer. Software products are produced with the help of the software
process. The software process is a way in which we produce software. Types of
software products: Software products fall into two broad categories: 1. Generic
products: Generic products are stand-alone systems that are developed by a production
95
unit and sold on the open market to any customer who is able to buy them. 2.
Customized Products: Customized products are the systems that are commissioned by a
particular customer. Some contractor develops the software for that customer.
11.List the process maturity levels in SEIs CMM.
Level 1:Initial – Few processes are defined and individual efforts are taken.
Level 2:Repeatable – To track cost schedule and functionality basic project
management processes are established.
Level 3:Defined – The process is standardized, documented and followed.
Level 4:Managed – Both the software process and product are quantitatively
understood and controlled using detailed measures.
Level 5:Optimizing – Establish mechanisms to plan and implement change.
12. What are the steps followed in testing?
i. Unit testing – The individual components are tested in this type of testing.
ii. Module testing – Related collection of independent components are tested.
iii. Sub-system testing – This is a kind of integration testing. Various modules are
integrated into a subsystem and the whole subsystem is tested.
iv. System testing – The whole system is tested in this system.
v. Acceptance testing – This type of testing involves testing of the system with
customer data. If the system behaves as per customer need then it is accepted.
13. What are the various types of traceability in software engineering?
i. Source traceability – These are basically the links from requirement to
stakeholders who propose these requirements.
96
ii. Requirements traceability – These are links between dependant requirements.
iii. Design traceability – These are links from requirements to design.
14. What are the prototyping approaches in software process?
i. Evolutionary prototyping – In this approach of system development, the initial
prototype is prepared and it is then refined through number of stages to final stage.
ii. Throw-away prototyping – Using this approach a rough practical implementation of
the system is produced. The requirement problems can be identified from this
implementation. It is then discarded. System is then developed using some different
engineering paradigm.
15.What are the advantages of evolutionary prototyping?
i. Fast delivery of the working system.
ii. User is involved while developing the system.
iii. More useful system can be delivered.
iv. Specification,design and implementation work in co-ordinated manner.
16. What is a test case?
A test case is nothing but a set of conditions or variables under which a tester will
determine whether a system under test satisfies requirements or works correctly.
17. What is the difference between functional and non-functional testing?
Functional Testing
Performed
testing
before
Non Functional Testing
non-functional
Performed after functional testing
Based on customer requirements
Based on customers expectations
Describes what the product does
Describes how the product works
97
18. What is Verification and Validation in Software Testing?
Verification: It is a static analysis technique. Here, testing is done without executing the
code. Examples include – Reviews, Inspection, and walkthrough.
Validation: It is a dynamic analysis technique where testing is done by executing the
code. Examples include functional and non-functional testing techniques.
In the V model, the development and QA activities are done simultaneously. There is no
discrete phase called Testing, rather testing starts right from the requirement phase. The
verification and validation activities go hand in hand.
19. What is usability testing?
It is a testing methodology where the end customer is asked to use the software to see if
the product is easy to use, to see the customer’s perception and task time. An accurate
way to finalize the customer point of view for usability is by using prototype or mockup software during the initial stages.
20. What are the categories of defects?
▪
Wrong: It implies that requirements have been implemented incorrectly. It is a
variance from the given specification.
▪
Missing: This is a variance from the specifications, an indication that a
specification was not implemented, or a requirement of the customer was not noted
properly.
▪
Extra: It is a requirement incorporated into the product that was not given by the
end customer. It is always a variance from the specification but may be an attribute
desired by the user of the product.
21. On what basis the acceptance plan is prepared?
Basically, the acceptance document is prepared using the following inputs.
98
•
Requirement document: It specifies what exactly is needed in the project from
the customers perspective.
•
Input from the customer: This can be discussions, informal talks, emails, etc.
•
Project plan: The project plan prepared by the project manager also serves as
good input to finalize your acceptance test.
22. What is coverage and what are the different types of coverage techniques?
The parameter used in software testing to describe the extent to which the source code is
tested is known as coverage. There are three basic types of coverage techniques and they
are:
1.
Statement coverage: It ensures that each line of source code has been executed
and tested.
2.
Decision coverage: It assures that every decision (true/false) in the source code
has been executed and tested.
3.
Path coverage: Here we ensure that every possible route through a given part of
the code is executed and tested.
23. What are the benefits of Automation testing?
Benefits of Automation testing are:
1.
Supports execution of repeated test cases
2.
Aids in testing a large test matrix
3.
Enables parallel execution
4.
Encourages unattended execution
5.
Improves accuracy thereby reducing human-generated errors
99
6.
Saves time and money
24. Why Selenium is a preferred tool for Automation testing?
Selenium is an open source tool which is used for automating the tests carried out
on web browsers. Since Selenium is open-source, there is no licensing cost involved,
which is a major advantage over other testing tools. Other reasons behind Selenium’s
ever-growing popularity are:
•
Test
scripts
can
be
written
in
any
of
these
programming
languages: Java, Python, C#, PHP, Ruby, Perl &.Net
•
Tests can be carried out in any of these OS: Windows, Mac or Linux
•
Tests can be carried out using any browser: Mozilla Firefox, Internet
Explorer, Google Chrome, Safari or Opera
•
It can be integrated with tools such as TestNG & JUnit for managing test cases
and generating reports
•
It can be integrated with Maven, Jenkins & Docker to achieve Continuous
Testing
25. What are the various components of Selenium?
Different components of Selenium are:
•
Selenium Integrated Development Environment (IDE)
•
Selenium Remote Control (RC)
•
Selenium WebDriver
•
Selenium Grid
100
26. What are the different types of locators in Selenium?
The locator is nothing but an address that identifies a web element uniquely within the
webpage. Thus, to identify web elements accurately and precisely we have different
types of locators in Selenium as follows:
•
ID
•
ClassName
•
Name
•
TagName
•
linkText
•
PartialLinkText
•
Xpath
•
CSS Selector
•
DOM
27. What is XPath?
XPath also called as XML Path is a language to query XML documents. It is an
important strategy to locate elements in selenium. It consists of a path expression along
with some conditions. Here, you can easily write XPath script/query to locate any
element in the webpage. It is designed to allow the navigation of XML documents, with
the purpose of selecting individual elements, attributes, or some other part of an XML
document for specific processing. It also produces reliable locators.
28. What is the difference between Absolute and Relative Path?
•
Absolute XPath
It is the direct way to find the element, but the disadvantage of the absolute XPath is
that, if there are any changes made in the path of the element then that XPath gets
failed. For example: /html/body/div[1]/section/div[1]/div
101
Relative XPath
For Relative XPath, the path starts from the middle of the HTML DOM structure. It
begins with the double forward slash (//), which means it can search the element
anywhere at the webpage. For example: //input[@id=‘ap_email’]
29. What are the different exceptions in Selenium WebDriver?
Exceptions in Selenium are similar to exceptions in other programming languages. The
most common exceptions in Selenium are:
•
TimeoutException
•
NoSuchElementException
•
ElementNotVisibleException
•
StaleElementException
30. When should I use Selenium Grid?
Selenium Grid can be used to execute same or different test scripts on multiple
platforms and browsers concurrently so as to achieve distributed test execution, testing
under different environments and saving execution time remarkably.
102
XII. DIGITAL SYSTEM DESIGN
1.
Define digital system.
Digital system is a system that manipulates discrete elements of information which is
represented.
2.
List the number systems.
a) Binary Number system (Base : 2) (Numbers : 0,1)
b) Decimal Number system (Base : 10) (Numbers : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
c) Octal Number system (Base : 8) (Numbers : 0, 1, 2, 3, 4, 5, 6, 7)
d) Hexadecimal Number system (Base : 16) (Numbers : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
A, B, C, D, E, F)
3.
What is decimal number system?
The decimal number system is said to be of base, or radix, 10 because it uses 10
digits. They are 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.
4.
Define binary number system.
The binary system is a different number system. The coefficients of the binary
number system have only two possible values: 0 and 1.
5.
What is octal number system?
The octal number system has a base of eight, meaning that it has eight possible
digits: 0, 1, 2, 3, 4, 5, 6, 7.
6.
Define hexadecimal number system.
The hexadecimal system uses base 16. Thus, it has 16 possible digit symbols. It
uses the digits 0 through 9 and the letters A, B, C, D, E, and F to represent 10, 11, 12,
13, 14, and 15 respectively.
103
7.
Define - Binary Logic?
Binary logic consists of binary variables and logical operations. The variables
are designated by the alphabets (either lowercase or uppercase) such as A, B, C, m, n, o
etc., Each variable will be having only two distinct values: 1(ON) and 0(OFF).
8. How many basic operations are there using Binary Logic?
There are three basic logic operations: AND, OR and NOT.
9. Convert the decimal number (53.625)10 binary.
Step 1 : The integer is 53 and the Fraction is 0.625
Step 2 : Integer part Conversion:
Division
Generated
Remainder
2) 53 -------------------→
1
2) 26 -------------------→
2) 13 -------------------→
2) 6 -------------------→
2) 3 -------------------→
2) 1 -------------------→
0
1
0
1
1
MSB
(53)10 = (110101)2
Step 3 : Fractional Conversion: If the decimal number is a fraction, its binary
equivalent is obtained by multiplying the number continuously by 2, recording a carry in
the integer position each time. The carries in the forward order give the required binary
number.
Multiplication
Generated
integer
0.625 X 2 = 1.25
1
0.250 X 2 = 0.50
0
0.500 X 2 = 1.00
1
0.000 X 2 = 0.00
0
MSB
(We can stop in 4 decimal
places)
Result: (53.625)10 is equal to (110101.1010)2
104
10. Convert (101111.1101)2 into decimal.
Integer Part:
1 0 1 1 1 1
1 X 20 =
1
1 X 21 =
2
1 X 22 =
4
1 X 23 =
8
0 X 24 =
0
1 X 25 =
32
47
Fractional Part :
0 . 1 1 0 1
1 X 2- 4 =
0.0625
1 X 2-3 =
0.0000
1 X 2-2 =
0.2500
1 X 2-1 =
0.5000
0.8125
Result: (101111.1101)2 is equal to (47.8125)10
11. Convert (444.456)10 to an Octal number.
Step 1 : The integer is 444 and the Fraction is 0.456
Step 2 : Integer part Conversion :
Division
Generated
Remainder
8) 444 -------------------→
4
8) 55 -------------------→
7
8) 6 -------------------→
6
MSB
(444)10 = (674)8
Step 3 : Fractional Conversion : If the decimal number is a fraction, its octal
equivalent is obtained by multiplying the number continuously by 8, recording a carry in
the integer position each time. The carries in the forward order give the required octal
number.
105
Multiplication
Generated
integer
0.456 X 8 = 3.648
3
0.648 X 8 = 5.184
5
0.184 X 8 = 1.472
1
0.472 X 8 = 3.776
3
MSB
(We can stop in 4 decimal places)
Result: (444.456)10 is equal to (476.3513)10
12. Convert (238)8 to an Decimal number.
(237)8 = 2 X 82 + 3 X 81 + 7 X 80
= 2 X 64 + 3 X 8 + 7 X 1
(237)8 = (159)10
13. Convert (235)10 to Hexadecimal.
Division
Generated
Remainder
16) 235 -------------------→ 11 -> B
16) 14 -> E
(235)10 = (EB) 16
14. Convert (A3B)16 to Decimal number.
(A3B)16 = A X 162 + 3 X 161 + B X 160
= 10 X 256 + 3 X 16 + 11 X 1
(A3B) 16 = (2619)10
15. Convert (107)8 to Binary number.
Each digit in Octal to be converted to 3 digits binary numbers.
1
0
7
001
000
111
(107)8 = (001000111)2
106
MSB
16. Convert (2D5)16 to Binary number.
Each digit in Hexadecimal to be converted to 4 digits binary numbers.
2
D
5
0010
1101
0101
(2D5)16 = (001011010101)2
17. Convert (2D5)16 to Octal number.
Step 1: Each digit in Hexadecimal to be converted to 4 digits binary numbers.
2
D
5
(0010
1101
0101)2
Step 2: By Selecting 3 digits from the Binary numbers, Octal numbers generated.
(001 011 010 101)2
1
3
2
5
(2D5)16 = (1325)8
18. Convert (1325)8 to Hexadecimal number.
Step 1: Each digit in Octal to be converted to 3 digits binary numbers.
1
3
2
5
(001 011
010
101)2
Step 2: By Selecting 4 digits from the Binary numbers, Hexadecimal numbers
generated.
0010
1101
0101
2
D
5
(1325)8 = (2D5)16
107
19. What is meant by bit?
A binary digit(0, 1) is called bit.
20. Define Byte.
Group of 8 bits is called a byte. Example : 10110010.
1024 byte is a Kilobyte (KB).
1024 Kilo byte is a Megabyte (MB).
1024 Megabyte is a Gigabyte (GB).
1024 Gigabyte is a Terabyte (TB).
21. Mention the advantages of ASCII code.
ASCII – American Standard Code for Information Interchange.
(a) There are 27 = 127 and one 0(zero), so totally 128 possible combinations. Hence, a
large number of symbols, alphabets etc., can be easily represented.
(b) There is a definite order in which the alphabets, etc., are assigned to each code word.
(c) The parity bits can be added for error-detection and correction.
22. Mention the disadvantages of ASCII code.
(a) The length of the code is larger and hence more bandwidth is required for transmission.
(b) With more characters and symbols to represent, this is not completely sufficient.
23. What are the different types of number complements?
(a) r’s complement. Example : 10’s Complement, 2’s Complement.
(b) (r-1)’s complement. Example : 9’s Complement, 1’s Complement.
24. Why complementing a number representation is needed?
Complementing a number becomes as in digital computer for simplifying the
subtraction operation and for logical manipulation complements are used.
108
25. Define binary codes & mention its types.
Binary codes are codes which are represented in binary system with modification from
the original ones.
• Weighted Binary Systems
• Non Weighted Codes
26. Define BCD codes.
The BCD (Binary Coded Decimal) is a straight assignment of the binary equivalent.
It is possible to assign weights to the binary bits according to their positions.
The weights in the BCD code are 8, 4, 2, 1.
Example: The bit assignment 1001, can be seen by its weights to represent the decimal
9 because: 1 X 8 + 0 X 4 + 0 X 2 + 1 X 1 = 9
27. What is Excess 3 code?
Excess-3 is a non weighted code used to express decimal numbers. The code derives its
name from the fact that each binary code is the corresponding 8421 code plus 0011(3).
Example: 1000 of 8421 = 1011 in Excess-3
28. Define gray code or unit distance code.
The gray code belongs to a class of codes called minimum change codes, in which only
one bit in the code changes when moving from one code to the next. The Gray code is
non-weighted code, as the position of bit does not contain any weight. The gray code is
a reflective digital code which has the special property that any two subsequent numbers
codes differ by only one bit. This is also called a unit-distance code. In digital Gray code
has got a special place.
29. What is alphanumeric code?
The binary codes that can be used to represent all the letters of the alphabet, numbers
and mathematical symbols, punctuation marks, are known as alphanumeric codes or
109
character codes. These codes enable us to interface the input-output devices like the
keyboard, printers, video displays with the computer.
30. How to represent a positive and negative sign in computers?
(a) Positive (+) sign by 0
Negative (-) sign by 1
110
XIII. DESIGN AND ANALYSIS OF ALGORITHM
1. What is performance measurement?
Performance measurement is concerned with obtaining the space and the time
requirements of a particular algorithm.
2. What is an algorithm?
An algorithm is a finite set of instructions that, if followed, accomplishes a
particular task. In addition, all algorithms must satisfy the following criteria:
1. input
2. Output
3. Definiteness
4. Finiteness
5. Effectiveness.
3. Define Program.
A program is the expression of an algorithm in a programming language.
Sometimes works such as procedure, function and subroutine are used synonymously
program.
4. Write the For LOOP general format.
The general form of a for Loop
is For variable : = value 1 to value 2
step
Step do
{
statement1
….
….
statement n
}
111
5. What is recursive algorithm?
An algorithm is said to be recursive if the same algorithm is invoked in the
body. An algorithm that calls itself is Direct recursive. Algorithm A is said to be indeed
recursive if it calls another algorithm, which in turn calls A.
6. What is space complexity?
The space complexity of an algorithm is the amount of memory it needs to
run to completion.
7. What is time complexity?
The time complexity of an algorithm is the amount of computer time it needs
to run to completion.
8. Give the two major phases of performance evaluation
Performance evaluation can be loosely divided into two major phases:
(i) a prior estimates (performance analysis)
(ii) a Posterior testing(performance measurement)
9. Define input size.
The input size of any instance of a problem is defined to be the number of
words(or the number of elements) needed to describe that instance.
10. Define best-case step count.
The best-case step count is the minimum number of steps that can be executed
for the given parameters.
11. Define worst-case step count.
The worst-case step count is the maximum number of steps that can be
executed for the given parameters.
112
12. Define average step count.
The average step count is the average number of steps executed an instances
with the given parameters.
13. Define the asymptotic notation “Big on” (0)
The function f(n) = O(g(n)) iff there exist positive constants C and no such
that f(n)≤ C * g(n) for all n, n ≥n0.
14. Define the asymptotic notation “Omega” ( Ω ).
The function f(n) =Ω (g(n)) iff there exist positive constant C and no such that
f(n) C * g(n) for all n, n ≥ n0.
15. Define the asymptotic t\notation “theta” (θ )
The function f(n) =θ (g(n)) iff there exist positive constant C1, C2, and no such
that C1 g(n)≤ f(n) ≤ C2 g(n) for all n, n ≥ n0.
16. Define Little “oh”.
The function f(n) = 0(g(n))
iff
Lim f(n) = 0 n
- 𝖺 g(n)
17. Define Little Omega.
The function f(n) = ω (g(n))
iff
Lim f(n) = 0 n
- 𝖺 g(n)
113
18. Write algorithm using iterative function to fine sum of n numbers.
Algorithm
sum(a,n) { S : =
0.0
For i=1 to n do
S : - S + a[i];
Return S;
}
19. Write an algorithm using Recursive function to fine sum of n numbers,
Algorithm Rsum (a,n)
{
If(n≤ 0) then
Return 0.0;
Else Return Rsum(a, n- 1) + a(n);
20. Define the divide an conquer method.
Given a function to compute on „n‟ inputs the divide-and-comquer strategy
suggests splitting the inputs in to‟k‟ distinct susbsets, 1 k n, yielding „k‟
subproblems. The subproblems must be solved, and then a method must be found to
combine subsolutions into a solution of the whole. If the subproblems are still
relatively large, then the divide-and conquer strategy can possibly be reapplied.
21. Define control abstraction.
A control abstraction we mean a procedure whose flow of control is clear but
whose primary operations are by other procedures whose precise meanings are left
undefined.
114
22. Write the Control abstraction for Divide-and conquer.
Algorithm DAnd(ρ)
{
if small(p) then return
S(ρ); else
{
divide P into smaller instance ρ 1, ρ 2, ρ k, k ≥
1; Apply D and C to each of these
subproblems
Return combine (DAnd C(ρ1) DAnd C(ρ2), --- , DAnd ((ρk));
}
}
23. What is the substitution method?
One of the methods for solving any such recurrence relation is called the
substitution method.
24. What is the binary search?
If „q‟ is always chosen such that „aq‟ is the middle element(that is,
q=[(n+1)/2), then the resulting search algorithm is known as binary search.
25. Give computing time for Binary search?
In conclusion we are now able completely describe the computing time of
binary search by giving formulas that describe the best, average and worst cases.
Successful searches
θ(1) θ(logn) θ(Logn)
best average worst
unsuccessful
searches θ(logn)
best, average, worst
115
26. Define external path length?
The external path length E, is defines analogously as sum of the distance of all
external nodes from the root.
27. Define internal path length.
The internal path length „I‟ is the sum of the distances of all internal nodes
from the root.
28. What is the maximum and minimum problem?
The problem is to find the maximum and minimum items in a set of „n‟ elements.
Though this problem may look so simple as to be contrived, it allows us to
demonstrate divide-and-comquer in simple setting.
29. What is the Quick sort?
n quicksort, the division into subarrays is made so that the sorted subarrays do
not need to be merged later.
30. Write the Analysis for the Quick sot.
In analyzing QUICKSORT, we can only make the number of element
comparisons c(n). It is easy to see that the frequency count of other operations is of
the same order as C(n).
31. Is insertion sort better than the merge sort?
Insertion sort works exceedingly fast on arrays of less then 16 elements,
though for large „n‟ its computing time is O(n2).
116
XIV. JAVA PROGRAMMING
1. Difference between C++ and java ?
C++
Strongly influenced by C syntax, with
Object-Oriented features added, not a
pure object oriented language.
Compatible with C source code,
except for a few corner cases.
Java
Pure object oriented language
because we use
class and object
to compile the program.
Provides the Java Native Interface
and recently Java Native Access as a
way to directly call C/C++ code.
Write once, run anywhere /
everywhere (WORA / WORE).
Allows procedural programming,
functional programming (since Java
8) and generic programming (since
Java 5), but strongly encourages the
object-oriented
programming
paradigm. Includes support for the
creation of scripting languages.
Write once, compile anywhere
(WOCA).
Allows procedural programming,
functional programming, objectoriented
programming,
generic
programming,
and
template
metaprogramming. Favors a mix of
paradigms.
2. Write features or buzzwords in Java?
• Simple
• Secure
• Object-Oriented
• Platform independent
• Secured
• Robust
• Architecture neutral
• Portable
• Dynamic
• Interpreted
• High Performance
• Multithreaded
• Distributed
117
3. Define Java applets
o
An applet is a special kind of java program that is designed to be transmitted over
the internet and automatically executed by a Java-Compatible web browser.
o
It is a intelligent program, not just an animation or media file.
o
It also react to user input and dynamically change.
4. Why Java is important to the Internet?
Because it provides and addressed many facilities
o
Java applets(A special kind of Java program)
o
Security(Provides firewall between application and your computer)
o
Portability(Supporting many platforms)
5. Define Bytecode
o
Bytecode is a highly optimized set of instructions designed to be executed by the
Java run-time system, which is called the Java Virtual Machine (JVM).
o
The original JVM was designed as an interpreter for bytecode.
6. Write advantages of Bytecode
o
Translating a Java program into bytecode makes it much easier to run a program
in a wide variety of environments because only the JVM needs to be implemented for
each platform.
o
A Java program is executed by the JVM also helps to make it secure. Because the
JVM is in control, it can contain the program and prevent it from generating side effects
outside of the system.
7, List out the buzzwords in Java
• Simple
• Secure
• Portable
• Object-oriented
• Robust
118
• Multithreaded
• Architecture-neutral
• Interpreted
• High performance
• Distributed
• Dynamic
8, List out the features of J2SE 5
• Generics
• Annotations
• Autoboxing and auto-unboxing
• Enumerations
• Enhanced, for-each style for loop
• Variable-length arguments (varargs)
• Static import
• Formatted I/O
• Concurrency utilities
9, How Java is a strongly typed language?
o
First, every variable has a type, every expression has a type, and every type is
strictly defined. Second, all assignments, whether explicit or via parameter passing in
method calls, are checked for
type compatibility.
o
There are no automatic coercions or conversions of conflicting types as in some
languages. The Java compiler checks all expressions and parameters to ensure that the
types are compatible.
10, Write the classifications of data types in Java programming language?
The data types in the Java programming language are divided into two categories
and can be explained using the following hierarchy structure :
119
11, List out the primitive data types?
Java defines eight primitive types of data: byte, short, int, long, char, float, double, and
boolean.
12,List out types of literals
o
Integer Literals
o
Floating-Point Literals
o
Boolean Literals
o
Character Literals
o
String Literals
13, Define scope and Lifetime of variables
o
A block defines a scope.
o
A block is begun with an opening curly brace and ended by a closing curly brace.
o
Thus, each time you start a new block, you are creating a new scope. A scope
determines what objects are visible to other parts of your program. It also determines the
lifetime of those objects.
14, Define Type conversion in Java?
o
If the two types are compatible, then Java will perform the conversion
automatically. For example, it is always possible to assign an int value to a long
variable.
o
However, not all types are compatible, and thus, not all type conversions are
implicitly allowed. For instance, there is no automatic conversion defined from double
to byte.
15, List the conditions for Type conversion in Java?
o
The two types are compatible.
o
The destination type is larger than the source type.
120
16, Write the syntax for casting?
The syntax of casting in java is
(target-type) value
Example:
int a;
byte b;
// ...
b = (byte) a;
Here the following fragment casts an int to a byte. If the integer’s value is larger than
the range of a byte, it will be reduced modulo (the remainder of an integer division by
the) byte’s range.
17,Define Arrays
An array is a group of like-typed variables that are referred to by a common name.
Arrays of any type can be created and may have one or more dimensions. A specific
element in an array is accessed by its index. Arrays offer a convenient means of
grouping related information.
Syntax:
type var-name[ ];
Alternative syntax:
type[ ] var-name;
18, Define ternary operator (?)?
Java includes a special ternary (three-way) operator that can replace certain types of ifthen-else statements. This operator is the ?. It can seem somewhat confusing at first, but
the ? can be used very effectively once mastered. The ? has this general form:
expression1 ? expression2 : expression3
121
Here, expression1 can be any expression that evaluates to a Boolean value. If
expression1 is true, then expression2 is evaluated; otherwise, expression3 is evaluated.
The result of the ? operation is that of the expression evaluated.
19, What is mean by operator precedence?
The above table shows the order of precedence for Java operators, from highest to
lowest. Notice that the first row shows items that you may not normally think of as
operators: parentheses, square brackets, and the dot operator. Technically, these are
called separators, but they act like operators in an expression. Parentheses are used to
alter the precedence of an operation. As you know from the previous chapter, the square
brackets provide array indexing. The dot operator is used to dereference objects.
20, Define Class?
The class is at the core of Java. It is the logical construct upon which the entire
Java
language is built because it defines the shape and nature of an object.
A class is a template for an object, and an object is an instance of a class.
Syntax
class classname {
type instance-variable1;
type instance-variable2;
// ...
type instance-variableN;
type methodname1(parameter-list) {
// body of method
}
// ...
type methodnameN(parameter-list) {
// body of method
}
}
122
21,Define Object?
Object is an instance of a class. It has state,behaviour and identity. It is also called
as an instance of a class.
Syntax
Classname Object;
OR
Classname Object= new
Box mybox; // declare reference to object OR
Box mybox = new Box();
Classname();
Object=new Classname();
Example
mybox = new Box(); // allocate a Box object
22, Define Constructor?
o
A constructor initializes an object immediately upon creation. It has the same
name as the class in which it resides and is syntactically similar to a method. Once
defined, the constructor is automatically called immediately after the object is created,
before the new operator completes.
o
It has no return type, not even void.
Example:
class Box {
///
Box(){ // Constructor
//
}}
23,Define this keyword in java?
A this keyword can be used inside any method to refer to the current object. That
is, this is always a reference to the object on which the method was invoked. You can
use this anywhere a reference to an object of the current class’ type is permitted. To
better understand what this refers to, consider the following version of Box( ):
// A redundant use of this.
Box(double w, double h, double d) {
123
this.width = w;
this.height = h;
this.depth = d;
}
This version of Box( ) operates exactly like the earlier version. The use of this is
redundant, but perfectly correct. Inside Box( ), this will always refer to the invoking
object.
24, What is mean by Method Overloading?
Method overloading is one of the ways that Java supports polymorphism. Thus,
overloaded methods must differ in the type and/or number of their parameters. While
overloaded methods may have different return types, the return type alone is insufficient
to distinguish two versions of a method.
Example:
Here is a simple example that illustrates method overloading:
// Demonstrate method overloading.
class OverloadDemo {
void test() {} //No parameters
void test(int a) {} // Single parameters
void test(int a, int b) {} // Two parameters
}
25, Define Destructor?
Destructor is an operation that frees the state of an object and/or destroys the object
itself. In Java, there is noconcept of destructors. Its taken care by the JVM.
26, Define Inheritance
Inheritance is one of the cornerstones of object-oriented programming because it
allows the creation of hierarchical classifications.
124
Using inheritance, you can create a general class that defines traits common to a set of
related items. This class can then be inherited by other, more specific classes, each
adding those things that are unique to it.
In the terminology of Java, a class that is inherited is called a superclass. The class that
does the inheriting is called
a subclass.
27, What is the syntax for inheritance?
class A {} //Declaration of first class
class B extends class A{} //Declaration of second class
28, Define super keyword?
Whenever a subclass needs to refer to its immediate superclass, it can do so by use of
the keyword super. super has two general forms. The first calls the superclass’
constructor. The second is used to access a member of the superclass that has been
hidden by a member of a subclass.
Syntax
super(arg-list);
29, What is mean by Method overriding?
o
It allows a general class to specify methods that will be common to all of its
derivatives, while allowing subclasses to define the specific implementation of some or
all of those methods.
o
It also defines those methods that the derived class must implement on its own.
Example
class Figure {
a(){}////Method declaration
}
class draw extends Figure{
a(){}// overidden
}
125
30,What is mean by Abstract class?
o
A methods be overridden by subclasses by specifying the abstract type modifier.
o
Any class that contains one or more abstract methods must also be declared
abstract. To declare a class abstract, you simply use the abstract keyword in front of the
class keyword at the beginning of the class declaration.
o
There can be no objects of an abstract class. That is, an abstract class cannot be
directly instantiated with the new operator. Such objects would be useless, because an
abstract class is not fully defined.
o
Also, you cannot declare abstract constructors, or abstract static methods.
126
XV. THEORY OF COMPUTATION
1.
Define Finite automaton .
• Finite automation is a mathematical model of a system with discrete inputs and
outputs.
• The system can be in any one of the finite number of states.
• The state of the system summaries the information concerning past inputs that is
needed to determine the behavior of the system on subsequent inputs.
• A finite automaton consists of a finite set of states and set of transitions from state
to state that occur on input symbols chosen from an alphabet ∑.
2.
What is formal language?
• Language is a set of valid strings from some alphabet. The set may be empty,
finite or infinite.
• L (M) is the language defined by machine M and L(G) is the language defined by
context free grammar. The two notations for specifying formal languages are:
• Grammar or regular expression (Generative approach).
• Automaton (Recognition approach).
3.
What are the functions of head pointer and finite control?
• The head examines only one square at a time and can move one square either to
the left or to the right but we restrict the movement of the reading head pointer
only to the right-side.
• Finite Control: The finite control contains the routines that instruct the reading
head pointer to move from one state to the next state by recognizing each symbol
or alphabet.
127
4.
What are the two main types of finite automata?
There are two types of finite automata
i. Deterministic Finite Automata (DFA).
ii. Non deterministic Finite Automata (NFA).
DFA
For each and every state and for each and every input symbol there exists utmost one
transition. The transition mapping for DFA is Qx∑.—> Q.
NFA
For each and every state and for each and every input symbol there exists one
transition. The transition mapping for DFA is Qx(∑ U{€}) —> Q.
5.
What are the two ways of representing an automaton?
The two ways of representation of finite automata are,
i. Transition Diagram.
ii. Transition Table.
Transition Diagram.
The Transition diagram consists of finite set of states, symbols, initial state and final
state. It is a directed graph which shows the transition from one state to another.
Transition Table : The Transition table is the tabular representation of the transition
function "delta(∂)" with the rows denoting states and columns denoting input symbol.
6.
Define a language.
An alphabet is a finite set of symbols. A language is a set of strings of symbols from
someone alphabet.
e.g.
if ∑ = {0,1},then ∑* = {€,0,1,00,01,10,11,000,...}.
128
7.
What is meant by transition and transition diagram?
Transition is the process of moving from one state to another state on reading an input
symbol. It can be represented as ∂ (q, a).
Example:
8.
What is regular expression and regular language?
•
The language accepted by finite automata is described by a simple
expression called as regular expression.
•
9.
The language accepted by regular expression is called regular language.
What are two - ways finite automata?(Nov 2013)
•
The deterministic finite automata as a control unit that reads a tape moving
one square right at each move.
•
We needed non-determinism to the model which allowed many "copies"
of the control unit to exist and scan the tape simultaneously.
•
Next we added € - transitions, which allowed change of state without
reading the input symbol or moving the tape head.
•
Next interesting extension is to allow the tape head with the ability to
move left as well as right, such a finite automaton is called two way finite automata
10. What is meant by ε -closure?
The "ε" is a character used to indicate the null string (i.e) the string which is used
simply for transition from one state to the other without any input.
129
The ε - closure is represented as
∂ (q, ε) = - closure (q)
11. State the equivalence theorem of NFA and DFA.
•
Let L be a language accepted by non - deterministic finite automata then there
exist a deterministic finite automaton that accepts the same language "L".
•
It can also be said that the language accepted by NFA is equal to the language
accepted by DFA.(i.e.) L(M) = L(M')
where,
M is the NFA and M' is the DFA.
12. Define the language accepted by NFA with epsilon moves.
The language accepted by NFA with epsilon transition is represented as,
M=(Q, ∑,qo,F)
Where ,
M is the NFA with ε moves.
Q is the finite set of non-empty states.
∑ is the finite set of non-empty symbols.
∂ is the finite set of transitions.
qo is the initial state.
F is the final state.
13. Define regular expression theorem.
➢
Let 'r' be the regular expression then there exists a NFA with ε - transition that
accepts
L (r) (i.e) . L(M) - L(r).
130
➢
Where the regular expression "r" belonging to a language "L” can be accepted by
automata with ε — moves.
14. Write down the rules for defining regular expression.
The rules that define the regular expression over alphabet ∑ are as follows,
•
ᴓ is a regular expression that denotes the empty set.
•
ε is the regular expression that denotes the set { ε }
•
For each 'a' in ∑, then the regular expression of a is denoted as {a}.
•
If r and s are regular expression denoting language R and S respectively then (r +
s), rs and (r*) are regular expression that denote the set RUS, RS, R* respectively.
15. What are the difference between NFA and DFA? (May 2015)
DFA
➢
For each and every state and for
NFA
➢
For each and every state and for each
each and every input symbol there
and every input symbol there exists more
exists at most one transition.
than one transition.
➢
The transition mapping for
DFA is Q x ∑ —> Q.
➢
➢
x (∑ U { ε }) —> 2Q
The language accepted by DFA
The transition mapping for NFA is Q
is denoted as L(M).
➢
Epsilon transition is not
possible.
➢
The language accepted by NFA is
denoted by L(M).
➢
131
Epsilon transition is possible.
16. Write down the operations of the regular expression.
There are main operations that are closed under regular expression,
i. Union,
ii Concatenation.
iii. Kleene closure.
Union:
Let r1 and r2 be the regular expression and the union of these two regular expressions
are denoted as r1 U r2 or r1+ r2 the general form of representation of union operation
given by,
M == (Q1 U Q2 , ∑1 U ∑2, ∂,{q0, f0} ).
Concatenation:
Let r1 and r2 be the regular expressions and then union of these two regular
expressions is denoted as r1. r2 or r1 r2 the general form of representation of
concatenation operation is given by,
M==(Q1UQ2, ∑1 U ∑2, ,q0,{f0}).
Kleene Closure:
Let r1 be the regular expressions and the union of these two regular expressions are
denoted as r1* or the general form of representation of kleene closure is given by,
M== (Q1 U {q0,fo},∑,∂,q0 {f0})
17. State some applications of regular expression.
Some of the basic applications of regular expression are,
➢
Lexical Analysis.
➢
Pattern Searching.
132
18. What are the two types of finite automata with output?
There are two types of finite automata,
➢
Mealy machine.
An automaton in which the output depends on the state as well as on the input at any
instant of time is called a Mealy machine.
➢
Moore machine.
An automaton in which the output depends on the states of the states of the machine is
called Moore machine.
19. State the difference between Mealy and Moore machine.
MEALY MACHINE
➢
MOORE MACHINE
➢
For each and every transition
there will be a output.
➢
For each and every state there will be
a output.
An automaton in which the
output depends on the state as well
➢
as on the input at any instant of time
depends on the states of the states of the
is called a Mealy machine
machine is called Moore machine.
➢
An automaton in which the output
The transition mapping is given
by λ :Q x ∑ —> Δ
➢
The transition mapping is given by
λ :Q —> Δ.
20. State some application of finite automata. (May 2016)
There are varieties of software design problems that are simplified by automatic
conversion of regular expression notation to an efficient computer implementation to
the corresponding finite automaton.
133
Two such application is
➢
Lexical analyzer.
➢
Text Editor.
21. Construct a DFA with for all the set of strings with {0,1} that has even
number of 0's and 1's
The set of all strings that has even number of 0’s and 1’s where the design of the
machine are as follows
22. Construct DFA for set of all string {0,1} with 011 as substring.
The set of all strings with 001 as substring where the design of the machine is as
follows
134
23. Draw the block diagram of finite automata.
24. Explain the six tuples in a Mealy and a Moore machines.
The moore and a mealy machine is being represented by M. Both the machine consists
of 6-tuples.
M= (Q,∑, Δ, 𝛿, λ,q0)
Where,
Q-Set of finite states.
∑- Set of input alphabets.
Δ -set of output alphabets.
𝛿 -set of input transition.
λ -set of output transition.
q0-initial states.
25. Explain finite automata with € - Moves.
o
The ' ε ' is a character used to indicate the null string (i.e) the string which is used
simply for transition from one state to the other without any input.
▪
The NFA with ε-moves can be shown below:
135
o
26. Explain the transition mapping regarding finite automata with € -Moves.
The transition mapping regarding finite automata with ε- moves is
Q x (∑ U { ε }) —>2 ^Q.
27. Give the transition mapping for Moore and Mealy machine.
For moore machine the transition mapping is :
λ :Q x ∑ —> Δ.
For mealy machine the transition mapping is
λ :Q —> Δ.
28. Define the rules for transition diagram.
Rules for drawing transition diagram are :
1. The transition diagram starts with a arrow pointer.
2. The initial state is being represented by a circle.
3. Each alphabet or symbol is being represented above the edge or arcs.
4. The final state is represented by concentric circle.
29. What is the transition mapping for NFA and DFA?
For NFA :
δ : Q x ∑ —> Q.
For DFA :
δ : Q x ∑ —> Q' or 2 ^ Q
136
30. Give an example for NFA.(April 2013)
Constructing an NFA for the set of all strings over the alphabet {0,1}containing the
string ends with a 1.
Transition Diagram:
NFA tuples are M = (Q,
,
, q0, F)
where
Q = {p, q}, Σ = {0, 1}, q0 = p, F = {q}, and
δ is defined by the following state transition table
Transition Table:
→ 2Q
Qx
0
1
p
{p}
{p,q}
q
∅
∅
137
XVI. INFORMATION CODING TECHNIQUES
1. What is prefix coding?
Prefix coding is variable length coding algorithm. In assigns binary digits to the messages
as per their probabilities of occurrence. Prefix of the codeword means any sequence
which is initial part of the codeword. In prefix code, no codeword is the prefix of any
other codeword.
2. State the channel coding theorem for a discrete memoryless channel.
Given a source of „M‟ equally likely messages, with M>>1, which is generating
information t a rate R. Given channel with capacity C. Then if,
R≤C
There exists a coding technique such that the output of the source may be transmitted
over the channel with probability of error in the received message which may be made
arbitrarily small.
3. Explain channel capacity theorem.
The channel capacity of the discrete memory less channel is given as maximum average
mutual information. The maximization is taken with respect to input probabilities P(xi)
C = B log2(1+S/N) bits/sec
Here B is channel bandwidth.
4. Define channel capacity of the discrete memoryless channel.
The channel capacity of the discrete memoryless channel is given as maximum average
mutual information. The maximization is taken with respect to input probabilities
C = max I(X:Y) P(xi)
138
5. Define mutual information.
The mutual information is defined as the amount of information transferred when xi is
transmitted and yi is received.it is represented by I (xi,yi) and given
as, I (xi,yi) = log P (xi/yi) bits
P(xi)
6. state its two properties of mutual information
The mutual information is symmetric.
I(X;Y) = I(X:Y)
The mutual information is always positive
I(X;Y) ≥ 0
7. Define efficiency of the source encoder.
Efficiency of the source encoder is given as,
ή = Entropy (H) .
Avg. no. of bits in codeword(N)
8. Define code redundancy.
It is the measure of redundancy of bits in the encoded message sequence. It is given as,
Redundancy = 1 – code efficiency
=1–
ή It should be as low as possible.
139
9. Define rate of information transmission across the channel.
Rate of information transmission across the channel is given as, Dt = [H(X) – H(X/Y)]r
bits/sec
Here H(X) is the entropy of the source.
H(X/Y) is the conditional entropy.
10. Define bandwidth efficiency.
The ratio of channel capacity to bandwidth is called bandwidth efficiency Bandwidth
efficiency = channel capacity (C)
Bandwidth (B)
11. What is the capacity of the channel having infinite bandwidth?
The capacity of such channel is given as, C = 1.44 (S/N0)
Here S/N0 is signal to noise ratio
12. Define a discrete memoryless channel.
For the discrete memoryless channels, input and output, both are discrete random
variables. The current output depends only upon current input for such channel.
13. Find entropy of a source emitting symbols x, y, z with probabilities of 1/5, 1/2, 1/3
respectively.
p1 = 1/5, p2 = 1/2, p3 = 1/3. H k log 2 (1/pk)
= 1/5 log25 + 1/2 log22 +1/3 log23
= 1.497 bits/symbol
140
14. An alphabet set contains 3 letters A,B, C transmitted with probabilities of 1/3, ¼,
1/4. Find entropy.
p1 = 1/3, p2 = 1/4, p3 = 1/4. H k log 2 (1/pk)
= 1/3 log23 + 1/4 log2 4 +1/4 log24
= 1.52832 bits/symbol
15. Define information
Amount of information : Ik = log2 (1/pk)
16. Write the properties of information
If there is more uncertainty about the message, information carried is also more.
If receiver knows the message being transmitted, the amount of information carried is
zero.
If I1 is the information carried by message m1, and I2 is the in formation carried by m2,
then amount of information carried compontely due to m1 and m2 is I1+I2
17. Calculate the amount of information if pk = ¼
Amount of information : Ik = log2 (1/pk)
= log10 4
Log10 2
= 2 bits
18. Define Nyquist rate.
Let the signal be band limited to „W‟ Hz. Then Nyquist rate is given as,
Nyquist rate = 2W samples/sec
141
Aliasing will not take place if sampling rate is greater than Nyquist rate.
19. What is meant by aliasing effect?
Aliasing effect takes place when sampling frequency is less than nyquist rate. Under such
condition, the spectrum of the sampled signal overlaps with itself. Hence higher
frequencies take the form of lower frequencies. This interference of the frequency
components is called aliasing effect.
20. What is PWM refers.
PWM is basically pulse width modulation. Width of the pulse changes according to
amplitude of the modulating signal, it is also referred as pulse duration modulation or
PDM.
21. State sampling theorem.
Sampling theorem states that, a band limited signal of finite energy, which has no
frequency components higher than W Hz, is completely described by specifying the
values of the signal at instants of time separated by 1/2W seconds and ,
A band limited signal of finite energy, which has no frequency components higher than
W Hz, may be completely recovered from the knowledge of its samples taken at the rate
of 2W samples per second.
22. Mention two merits of DPCM.
Bandwidth requirement of DPCM is less compared to PCM.
Quantization error is reduced because of perdition filter.
23. What is the main difference in DPCM and DM?
DM encodes the input sample by only one bit. It sends the information about +∂ or -∂, ie.
Step rise or fall. DPCM can have more than one bit for encoding the sample, it sends the
information about difference between actual sample value and predicted sample value.
142
24. How the message can be recovered from PAM?
The message can be recovered from PAM by passing the PAM signal through
reconstruction filter. The reconstruction filter integrates amplitudes of PAM pulses.
Amplitude smoothing of the reconstructed signal is done to remove amplitude
discontinuities due to pulses.
25. Write an expressing for bandwidth of binary PCM with N message each with a
maximum frequency of fm Hz.
If „v‟ number of bits are used to code each input sample, then bandwidth of PCM is given
as,
BT ≥ N. v . fm
Here v. fm is the bandwidth required by one message.
26. How is PDM wave converted into PPM systems?
The PDM signal is given as a clock signal to monostable multivibrator. The multivibrator
triggers on falling edge. Hence a PPM pulse of fixed width is produced after falling edge
of PDM pulse. PDM represents the input signal amplitude in the form of width of the
pulse. A PPM pulse is produced after this ‟width‟ of PDM pulse. In other words, the
position of the PPM pulse depends upon input signal amplitude.
27. Mention the use of adaptive quantizer in adaptive digital waveform coding
schemes.
Adaptive quenatizer changes its step size accordion to variance of the input signal. Hence
quantization error is significantly reduces due to adaptive quantization. ADPCM uses
adaptive quantization. The bit rate of such schemes is reduces due to adaptive
quantization.
28. What do you understand from adaptive coding?
In adaptive coding, the quantization step size and prediction filter coefficients are
changed as per properties of input signal. This reduces the quantization error and number
of bits used to represent the sample value. Adaptive coding is used for speech coding at
low bit rates.
143
29. What is meant by quantization?
While converting the signal value from analog to digital, quantization is performed. The
analog value is assigned to the nearest digital level. This is called quantization. The
quantized value is then converted to equivalent binary value. The quantization levels are
fixed depending upon the number of bits. Quantization is performed in every analog to
digital conversion.
30. What is meant by adaptive delta modulation?
In adaptive delta modulation, the step size is adjusted as per the slope of the input signal.
Step size is made high if slope of the input signal is high. This avoids slope overload
distortion.
144
XVII. MOBILE COMPUTING
1. What is wireless communication?
Wireless communication is the transfer of information over a distance without the use
of electrical conductors or wires .The distance involved may be short or long.
2. What are the uses of wireless Technology ?
•
To span a distance beyond the capabilities of typical cabling
•
To avoid obstacles such as physical structures
•
To provide a backup communication link in case of normal network failure
•
To overcome situations where normal cabling is difficult or financially
impractical.
3. What are the limitations in wireless communication?
•
Very limited resources Unstable
•
Channel characteristics Multiuser
•
Interference
•
Line of sight for frequencies
•
Mobility issues
4. List the type of wireless networks
•
Personal area networks
•
Local area networks
•
Metropolitan area networks
•
Wire area networks.
5. Define CDMA
Code Division Multiple Access systems use codes with certain characteristic to
separate different users. To enable access to the shared medium without interference.
The users use the same frequency and time to transmit data. The main problem is to
145
find good codes and to separate this signal from noise. The good code can be found
by two characteristics 1. Orthogonal2. auto
correlation.
6. What is meant by non-persistent CSMA?
In Non-persistent CSMA, stations sense the carrier and start sending immediately if
the medium is idle, if the medium is busy the stations passes a random amount of time
before sensing the medium again and repeating this pattern.
7.What is FDD ?
In FDMA, the base stations and the mobile stations establish a duplex channel. The
two directions, mobile stations to base stations and vice versa are separated using
different frequencies. This scheme is called Frequency Division Duplex.
8.What are the advantages and disadvantages of CDMA?
Advantage
•
All terminals can use the same frequency no planning needed.
•
Huge code space used
•
Interference is not coded.
Disadvantage
•
Higher complexity of a receiver
•
All signals should have the same strength at a receiver
9. What is SDMA ?
Space Division Multiple Access is used for allocating separated spaces to users in
wireless networks. The basis for the SDMA algorithm is formed by cells and sector
zed antennas which constitute the infrastructure implementing space division
multiplexing.
146
10. What is meant by GPRS?
The General Packet Radio Service provides packet mode transfer for applications that
exhibit traffic patterns such as frequent transmission of small volumes.
11. What are the categories of Mobile services?
•
Bearer services
•
Tele services
•
Supplementary services
12.What are the services provided by supplementary services?
•
User identification
•
Call redirection
•
Call forwarding
•
Closed user groups
•
Communication
13. What are types of Handover?
•
Intra-cell handover
•
Inter-cell, intra-BSC handover
•
Inter-BSC, intra-MSC handover
•
Inter MSC handover
14.What are subsystems in GSM system?
•
Radio subsystem(RSS)
•
Network & Switching subsystem(NSS)
•
Operation subsystem
15. What is the information in SIM?
•
Card type, serial no, list of subscribed services
•
Personal Identity Number(PIN)
147
•
Pin Unlocking Key(PUK)
•
An Authentication Key(KI)
16.Define SAMA.
Spread Aloha Multiple Access is a combination of CDMA and TDMA. The CDMA
better suits for connection-oriented services only and not for connection less bursty
data traffic because it requires programming both sender and receiver to access
different users with different codes.
17. What is meant by p-persistent CSMA?
In p-persistent CSMA system nodes also sense the medium, but only transmit with a
probability of p. With the station deferring to the next slot with the probability 1-p, i.e.
access is slotted in addition.
18.What are the 2 sub layers in DLC?
1. Logical Link Control (LLC)
2. Media Access Control (MAC)
19.What is TETRA?
TETRA (Terrestrial Trunked Radio) systems use different radio carrier frequencies,
but they assign a specific carrier frequency for a short period of time according to
demand. TETRAs are highly reliable and extremely cheap.
20. List out the advantages of time division multiplexing.
Only one carrier in the medium at any time throughput high even for many users
21.List out the advantages of GSM
The key advantage of GSM systems to consumers has been higher voice quality and
low cost alternatives to making cells, such as the Short Message Service. The
advantages for network operator have been the ease of deploying equipment’s from
148
any vendors that implement the standard. Like other cellular standards, GSM allows
network operators to offer roaming services so that subscribers can use their phones on
GSM networks all over the world.
22.What are the four types of handover available in GSM?
1. Intra cell Handover
2. Inter cell Intra BSC Handover
3. Inter BSC Intra MSC handover
4. Inter MSC Handover
23. Specification of Nokia 9000 phone? (Nov 3013)
Item Specifications
Memory 8 MB total; 4 MB OS and Applications
2 MB program execution
2 MB usage data storage
Processor Embedded INTAL 386 processor
Operating System
GeOS TM3.0
E-mail protocols SMP, IMAP4, POP3 and MIME1
Dimension 173x64x38
Displays GrayScale 640x200
Weight 397 g
24. What is Wearable computing?
This is the concept of personalizing computing in a fashion that enables computers to
be worn much like eye glasses or clothing. This was originated in MIT as a project
where the system include the components – heads up displays, unobtrusive input
devices, personal wireless LAN communication and context sensing tools. Interaction
is based on the context of the situation.
149
25. What is Wearable Computing Systems?
Wearable computers are tools that integrate user’s mobile processing, information
space, and work space providing automatic, portable access to information, and work
space proving automatic, portable access to information. It is a research project being
funded by DARPA ETO with additional support from Daimler- Benz, Intel and DEC.
26.What are the 3G wireless Standards?
IMT 2000, UMTS and ACTS
27. What are the technology used by 3G Networks
TD- CDMA and W-CDMA and SDMA are used by 3G Networks
28. What is UMTS? (April 2013)
Universal Mobile Telecommunication Systems (UMTS) is
1. An integration of different mobile radio communications wireless- and pagersystems into one common system
2. Provides Speech-, data-, and multimedia- information services independent of
network access
3. Support different carrier services: a. real-time capable / not real-time capable
5b. circuit switched / packet switched
29. List the Advantages of TD- CDMA over tradition GSM?
•
Spectral Efficiency twice that of GSM
•
Reuse of existing GSM network structure
•
Data rate upto 2 Mbps indoor, I Mbit in all environments
•
No soft hand off and fast power control
30.What are the different mobile client application architecture
Mobile Client Application Architecture can be classified into three overlapping
architectures
150
•
Remote Node
•
Client Proxy
•
Replication
31.Explain Remote Node Approach to Mobile Client Application
This approach attempts to create a facsimile of a fixed network client node by hiding
all artifacts introduced by wireless communications. Under this model all client
software which run on a wired network platform would function without change on a
mobile platform. It places most stringent demands on the middleware and other
software to mediate that arise as wireless artifacts
151
XVIII. WEB SERVICE AND XML
1. What is XML?
XML is a set of rules for structuring, storing and transferring information. This language
is used to describe the data which will be passed from one computer application to
another. XML tells a computer what the actual data is, not what it should look like.
2. What is the main disadvantage of HTML?
The main disadvantage was that it was not designed to share information between
computers, and so XML was developed to overcome this limitation.
3. What are the uses of XML?
· Connecting databases to the Web; Exchanging data automatically between different
computer applications;
· Moving the processing from a Web server to the local PC;
· Using the same information in many different ways;
· Changing the presentation of information automatically for different viewing devices.
4. What is the emergence of XML?
· XLINK - a standard designed to hyperlink between XML documents;
· XML Query - a language used to query XML documents;
· XSL - a style sheet language for XML;
· Resource Description Framework (RDF) - a standard for metadata. This will be
similar to library cards and should make searching the Web much faster
5. What are the major XML news formats?
The major XMLNews formats are XMLNews-Story and XMLNews-Meta,
6. What are markup and text in an XML document?
XML documents mix markup and text together into a single file: the markup describes
the structure of the document, while the text is the documents content
152
7. Write the rules of XML declaration
· The XML declaration is case sensitive: it may not begin with “<?XML” or any other
variant;
· If the XML declaration appears at all, it must be the very first thing in the XML
document: not even white space or comments may appear before it; and
· It is legal for a transfer protocol like HTTP to override the encoding value that you put
in the XML declaration, so you cannot guarantee that the document will actually use the
encoding provided in the XML declaration.
8. Write the rules of XML element
Elements may not overlap: an end tag must always have the same name as the most
recent unmatched start tag. The following example is not well-formed XML, because
“</person>” appears when the most recent unmatched start tag was “<function>”:
b. <!-- WRONG! -->
c. <function><person>President</function> Habibe</person>
9. Write on Attributes
XML start tags also provide a place to specify attributes. An attribute specifies a single
property for an element, using a name/value pair. One very well-known example of an
attribute is href in HTML:
<a href=\"http://www.yahoo.com/\">Yahoo!</a>
10. What are the revolutions of XML?
1. Data Revolution
2. Architectural Revolution
3. Software Revolution
11. What is SOA?
SOA is an architectural style whose goal is to achieve loose coupling among interacting
software agents. A service is a unit of work done by a service provider to achieve
153
desired end results for a service consumer. Both provider and consumer are roles played
by software agents on behalf of their owners.
12. Define Stateless service
Each message that a consumer sends to a provider must contain all necessary
information for the provider to process it. This constraint makes a service provider more
scalable because the provider does not have to store state information between requests.
This is effectively service in mass production since each request can be treated as
generic.
13. Define Stateful service
Stateful service is difficult to avoid in a number of situations. One situation is to
establish a session between a consumer and a provider. A session is typically established
for efficiency reasons. For example, sending a security certificate with each request is a
serious burden for both any consumer and provider. It is much quicker to replace the
certificate with a token shared just between the consumer and provider. Another
situation is to provide customized service.
14. What the constraints introduced by the SOAP web services?
A SOAP web service introduces the following constraints:
· Except for binary data attachment, messages must be carried by SOAP.
· The description of a service must be in WSDL
15. Write on Tags and elements?
XML tags begin with the less-than character (“<”) and end with the greater-than
character (“>”). You use tags to mark the start and end of elements, which are the
logical units of information in an XML document, an element consists of a start tag,
possibly followed by text and other complete elements, followed by an end tag.
154
16. What are attribute name and attribute value?
Every attribute assignment consists of two parts: the attribute name (for
example, href), and the attribute value (for example, http://www.yahoo.com/). There
are a few rules to remember about XML attributes:
1. Attribute names in XML (unlike HTML) are case sensitive: HREF and href refer to
two different XML attributes.
2. You may not provide two values for the same attribute in the same start tag. The
following example is not well-formed because the b attribute is specified twice:
17. What are the uses of XML?
XML is used in many aspects of web development, often to simplify data storage and
sharing.
18. What are the various features of XML?
· Security
· Portability
· Scalability
· Reliability
19. Different between XML and HTML
1. XML is not a replacement for HTML.
2. XML and HTML were designed with different goals:
3. XML was designed to transport and store data, with focus on what data is.
1. HTML was designed to display data, with focus on how data looks.
2. HTML is about displaying information, while XML is about carrying information.
20. What are the three waves for XML development?
· Vertical Industry Vocabularies
· Horizontal Industry Applications
· Protocols
155
21. List out the advantages of XML.
· XML files are human - readable
· Widespread industry support
· Relational Databases
· XML support technologies
· More meaningful searches
· Development of flexible web applications
· Data integration from disparate sources
· Local computation and manipulation of data
· Multiple views of the data
· Granular updates
22. List out the XML structure.
· Physical structure
· Logical structure
23. What is physical structure?
The physical structure consists of the contents used in an XML document. It holds the
actual data to be represented in an XML document. This actual data storage can be
called as Entities. These entities are identified by a unique name and may be part of the
XML document or external to the document.
An entity is declared in the XML declaration part and referenced in the document
element. Once declared in the DTD, an entity can be used anywhere.
24. List out the Physical structure.
· Parsed Entity
· Unparsed Entity
· Entity Reference
· Predefines Entities
· Internal and External Entities
· XML Syntax
156
· Attributes
25. What is XML declaration?
It identifies the version of the XML specification to which the document conforms.
Example:
<?xml version=”1.0”?>
An XML declaration can also include an
· Encoding Declaration
· Stand-alone Document Declaration
26. What is Encoding?
· The encoding declaration decides the encoding scheme. The encoding schemes
available are
UTF-8 and EUC-JP.
· The coding schemes map to different character formats or languages.
27. What is standalone declaration?
· The stand-alone document declaration identifies whether any markup declarations
exits that are external to the document.
· This declaration can take in values of yes or no.
28. Define Document Type Declaration
· The document type declaration consists of the markup codes or the DTD according to
which the
XML document has to be written.
· The document type declaration can also point to an external file that contains the DTD.
The document type declaration follows the XML declaration.
Example:
<?xml version=”1.0”?>
<!DOCTYPE lib SYSTEM “lib.dtd”>
157
29. List out the various logical structure of an XML document.
The various logical structures of an XML document are:
· Elements
· Attributes
· Entities
30. Define Elements
Element are the primary means for describing data in XML. The rules for composing
elements are
· Flexible
· Allowing different combinations of text content, attributes and other elements.
158
XIX. DISTRIBUTED COMPUTING
1. What Are Distributed Systems?
Distributed systems are a type of software environment or computer system that has
various components dispersed across several computing devices (or various other
gadgets) over the internet. The work is split up and coordinated by these networks so that
it can be completed more efficiently than if one computer or device had been responsible
for handling everything alone.
In simple words, it means “distributed” as compared to being “centralized” or a single
point of contact for all communications and processing between computing devices. For
example, Distributed file systems allow several physical storage devices, such as disk
drives, to appear as one large storage resource to computer applications. The distributed
operating system manages separate resources but appears from the user’s perspective as a
unified whole with its own namespace (e.g., files are given names independent of their
location).
2. What are distributed systems used for?
Distributed Systems have the potential to deliver high performance and availability by
increasing data locality using distributed resources. Distributed computing allows us to
achieve greater scale than a single computer could provide because it provides concurrent
processing power of all machines involved providing redundancy against machine
failures or scheduled maintenance downtime. A distributed architecture usually implies
distribution across physical hardware which is more complex but has advantages over
sharing one large server such as being able to take advantage of specialized pieces of
hardware designed specifically to improve computational efficiency, reliability and fault
tolerance while also allowing applications to make use of computing resources located
close together (reducing latency).
159
3. How does a distributed system work?
Distributed systems have developed through time, however, the most popular
implementations today are designed to work on the internet and more specifically in the
cloud. A distributed system begins with an input task such as rendering videos or creating
finished products ready for release that can be accessed from anywhere at anytime on any
device through web browsers like Google Chrome etc., laptops/desktops running
Microsoft Windows 10 among other things.
4. What has distributed garbage collection?
A distributed system may need to manage resources that are local only to one of the
machines in the network. Distributed Garbage Collection provides automatic management
for these resources by treating all instances as part of one logical system. This allows
programs running on many different computers within the distributed system to cooperate
using their own private objects without worrying about who has access or how they can
be collected when no longer needed. It also ensures that object references will remain
valid even if some other process on another machine suddenly decides, perhaps due to an
application bug, not to release an object it was holding onto and therefore causes its
memory usage footprint to grow beyond what you expect.
5. What have distributed computing techniques?
Distributed Computing is the science that deals with distributed systems. A distributed
system can be defined as a collection of independent computers that appear to its users as
if they were one single computer. It may sound simple, but designing and building these
kinds of applications requires special expertise because you have to deal with many
different components at once: communication links between machines, processors on
each machine or device, operating systems running locally on every node in the network
etc. Designing fault-tolerant distributed applications brings additional challenges since
there might not always be alternatives for communication paths when some parts go
160
down (e.g., due to maintenance). These types of applications must also take into account
what happens when nodes join or leave the distributed system at runtime.
6. What have distributed algorithms?
Distributed Algorithms are a class of algorithms that solve problems in distributed
computing environments by relying on multiple processes or devices to obtain a solution
that is guaranteed to be identical across all processes or devices. If you want your
application (e.g., web service) to work with some degree of fault tolerance, you need it to
make sure its results don’t depend entirely on any single point of failure and instead rely
on redundant parts. Which may include hardware components, virtual instances etc..
7. Give Some examples of a distributed system?
Following are the main example of distributed systems:
1. The telephone system and cellular networks are excellent examples of a
Distributed System.
2. The World Wide Web is another distributed system that allows people to
connect with each other through computers all over the world which
creates a virtual community where anything can happen.
3. Parallel computation
4. Aircraft control systems employ similar principles by using information
from different sources at once in order for planes not only to know what
direction they’re going but also how fast or slow they should fly according
to wind conditions etc…
5. Peer-to-peer networking apps like BitTorrent (for downloading)
8. What are the types of distributed systems?
Following are some main types of distributed systems:
•
Client-serve Sytems
161
•
Multi-tier distributed systems
•
Peer-to-peer distributed systems
•
Three-tier
•
Middleware
•
Three-tier distributed systems
•
N-tier distributed systems
•
Layered architecture
9. Why we use distributed system? Advantages of the distributed system?
The main advantages of a distributed system is as follows: scalability, fault tolerance and
availability. For example, if one node crashes in a distributed database there are multiple
other nodes available to keep the work running smoothly without any disruption or
downtime for users. That’s why distributed processing has become more popular than
centralised computing where all data was stored on a single server that can be easily
affected by hardware failure or even an attack from hackers etc. Other advantages
include:
•
Hight Performance
•
Reliability
•
Communication
•
Incremental growth
•
Sharing of data & resources
10. What is mobile and ubiquitous computing in distributed systems?
•
“Mobile computing” is the new trend in technology. Mobile devices are
becoming more and more powerful, allowing them to do what desktop
computers could only dream of doing just a few years ago. The ability to
use your mobile device anywhere at any time means that we can now
accomplish things like work remotely while travelling abroad.
162
•
The term ‘ubiquitous Computing’ is an interesting way to think about the
world around us. Small computing devices will eventually become so
prevalent in everyday objects that they are hard-to-notice, even when
you’re looking for them!
11. What are distributed systems in software?
Distributed software is an application on computers that lets components on computers
that are networked collaborate and plan their activities via sending messages. In
distributed software, the component providing decentralization is usually large in size
allowing it to be broken into smaller parts that can run concurrently on different nodes or
machines. This feature makes distributed computing suitable for distributed software. The
distributed system is the combination of multiple computers that performs a certain task
as part of a larger program, which has been designed to solve complex problems by
decomposing them into smaller tasks.
12. what are the main Characteristics of Distributed systems?
In a distributed system, the program executes concurrently and there is no global time.
Components can fail independently as well–so it’s important for these types of systems to
be designed with safety in mind from day one!
13. Why We Need Openness?
The openness of the distributed system is determined primarily by its ability to offer new
resource-sharing services. Open systems are characterized as one in which their key
interfaces for accessing shared resources and information on how they work, who’s using
them at any given time etc., can be made available through publication or broadcasting –
this allows all members without access limitations so long as there is someone present
with permission from administrators acting locally (or otherwise). It could also take form
when diverse hardware/software platforms coexist within an ecosystem where
interactions occur between these separate entities due solely thanks partially because each
163
has something unique that complements another’s design approach well enough allowing
further development opportunities based on what works best.
14. Main Security Concepts of Distributed Systems?
There are two main mechanisms in ensuring communication security, which is to be
safeguarded by encryption and traffic padding. The most important techniques used for
Security are Encryption, Authentication and Authorization.
15. What is the transparency dogma in distributed systems ?
The idea of transparency is common in software systems as it allows for a degree of
independence between clients and implementation. This may be positive because it
prevents the system from dealing correctly with many complex partial failures that arise
when trying to implement services on its own, but Full transparency is unlikely to be a
positive thing as it will prevent the system from dealing correctly with many complex
partial failures that arise in practice.
16. Where is the middleware used?
Middleware, which can include security authentication and transaction management
amongst other things is used for a variety of purposes. It often sits between your web
applications or services to make them more effective by providing capabilities such as
enterprise messaging queues that are durable in nature – this means they don’t go away
when the network connection does. MiddleWare also helps distribute processing across
multiple servers without requiring data to be sent back-and-forth all day long.
Middleware runs better with newer technology because it is built on open standards.
164
17. What Is CAP Theorem?
A CAP theorem on distributed computing says that it is inconceivable to simultaneously
offer more than two of the three security guarantees when using distributed platforms:
availability, consistency, and partition (tolerance) tolerance.
18. What is the difference between Asynchronous and Parallel programming?
When you run something asynchronously it means that is non-blocking, meaning the
program will continue with other tasks even if there is a delay in executing this particular
piece. Whereas in Parallel programming you can run multiple things at once–in parallel!–
which works well when they are broken down into independent pieces of work to
complete them faster without having too many strands connected together which would
slow us down really badly later on for no good reason because all these threads were
doing was slowing each other’s progress! You should use async/callback functions
whenever possible rather than blocking code like Event handlers etc. since event handling
happens outside your application so anyway.
19. What Is Round-Robin Load Balancing?
one of the most simple ways to distribute client requests over a set of servers can be
round-robin load balance. This means that when it comes to handling each request,
instead of going down one list and then back again as we did before with modRNom (and
hated), our program will be making use of only two different groups: workers and clients.
20. What is Reliability?
Reliability is an important measure of a system’s durability and ability to perform in
accordance with its specifications. There are many different factors that can affect the
reliability, such as environmental conditions or user errors during operation but one thing
remains true: if something goes wrong then repairs will be necessary at some point so it’s
best to plan ahead when considering how much downtime your company could
experience without protection from unexpected failures.
165
21. Is distributed systems a cloud computing service?
No, a distributed system is not the same as cloud computing. Cloud computing provides
distributed services but it is different from distributed systems which are designed to run
on multiple machines connected in some way (typically via a network). Distributed
Systems can also be used for parallel/concurrent processing of data using distributed
machines.
22. How a distributed system is different from distributed computing?
Distributed System manages the distributed resources across networked computers, while
Distributed Computing deals with writing software applications that can run in a
distributed environment. The difference between distributed systems and cloud
computing services are described above. It should be noted that there may be overlap
between these two as distributed computing can provide distributed services to run on
distributed systems.
23. Who is a distributed system engineer?
Distributed System Engineer’s role is critical in designing and implementing distributed
software applications, managing the infrastructure of distributed systems or cloud-based
platforms etc. The person has advanced knowledge around processes involved in
developing good distributed system design with practical experience.
24. What Is Distributed Debugging?
Distributed debugging is a way of monitoring the system state in order to ensure that it
remains stable, instead of transitioning into an unchanging transitory pattern. This can be
done by recording what happens on individual nodes throughout your program’s
execution without any downtime or interruptions.
166
25. What is Bully Algorithm?
The Bully algorithm, which is designed to crash during elections if the delivery of
messages between processes becomes unreliable. The system uses timeouts for detecting
crashes and that assumption means there’s no way of knowing when one will happen until
after they’ve occurred.
26. Difference Between Reliable And Unreliable Failure Detector?
•
A reliable failure detector is one that can always identify a process failure
and give it an answer. It does this by either responding with the word
“unknown,” or if it’s not surprised about something failed to happen, then
they’ll say so in response instead of nothing at all like before when there
were no hints available for users who needed help identifying what may
have gone wrong on their own.
•
A process may be unreliable if it produces a value of either ‘unsuspected’
or ‘suspected’. Both values are hints, which means that the result isn’t
always an accurate indication as to whether there was in fact failure.
27. What Is Network Partition?
A network partition is a way to break up replica managers into groups. These partitions
isolate them so that members of different subgroups cannot communicate with each other,
but they can still talk among themselves in their own group thanks for this wonderful
feature!
28. what is Multicast Navigation?
A client can multicast the address to be resolved as well as the object type required to the
name servers. Only the name server that is the one that has the named attributes can
respond on the call.
167
29. Share Different Types Of System Model you know?
There are many different types of system models, and they serve as a way to visualize
how data is interconnected.
•
Fundamental model
•
Architecture model
•
Security model
•
Failure model
•
Interaction model
30. what is Inter-Process Communication in Distributed Systems?
Inter-process communication is the means by which different computer programs and
modules communicate with each other. It can be done both internally, through daemons
or libraries within your own program itself; but also across systems as a whole in order to
send messages between distributed objects such as web services
The Java API for inter-process communications provides both datagram-based messaging
(socket) – where one object sends something on its own behalf then another receives it
without knowing what was sent.
168