0% found this document useful (0 votes)
5 views145 pages

Interview Questions

This document provides a comprehensive guide for students at the Oriental College of Technology, Bhopal, to prepare for technical round interviews during campus placements. It includes a detailed list of interview questions and answers across various subjects such as JAVA, PHP, Software Testing, and more, aimed at enhancing students' technical knowledge and interview readiness. The document also outlines the structure of the interview process and the types of skills evaluated by interviewers.

Uploaded by

ayushipali27
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views145 pages

Interview Questions

This document provides a comprehensive guide for students at the Oriental College of Technology, Bhopal, to prepare for technical round interviews during campus placements. It includes a detailed list of interview questions and answers across various subjects such as JAVA, PHP, Software Testing, and more, aimed at enhancing students' technical knowledge and interview readiness. The document also outlines the structure of the interview process and the types of skills evaluated by interviewers.

Uploaded by

ayushipali27
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Oriental College of Technology, Bhopal

Technical round Interview Questions

About Campus Interview:


This interview usually takes 45 minutes to an hour and may have one or two interviewers. One
interviewer may focus on your communication skills, self-management skills and background by
asking behavioral questions. The other will focus on your technical capabilities.
Objective:
The objective of this document is to prepare the students about the technical round interview
questions for their campus placement drive. The documents will help the students to refresh their
knowledge and prepare them for the technical round which are asked by the interviewers of
different companies like TCS,Tech-Mahindra etc.
About the Document
The documents contains comprehensive list of questions with answers. These contains nearly all
the subjects that are relevant to the technical round of interview. It contains 11 sections
Section-1 Contains all topic.
Section-2- JAVA
Section-3 –PHP
Section-4-Software Testing
Section-5 .NET.
Section-6 DBMS
Section-7-Networking
Section-8 Algorithm
Section-9 C# language
Section-10 C language
Section-11 OS Interview
Section-12 Data Structure
Section-13Network
Section-14 C++ and OOPS
Section-15 SQL Queries
SECTION -1(All topic)
[Link] between C and Java?
[Link] is Object-Oriented while C is procedural.
[Link] is an Interpreted language while C is a compiled language.
3.C is a low-level language while JAVA is a high-level language.
4.C uses the top-down approach while JAVA uses the bottom-up approach.
[Link] go backstage in JAVA while C requires explicit handling of pointers.
[Link] Behind-the-scenes Memory Management with JAVA & The User-Based Memory
Management in C.
[Link] supports Method Overloading while C does not support overloading at all.
[Link] C, JAVA does not support Preprocessors, & does not really them.
[Link] standard Input & Output Functions--C uses the printf & scanf functions as its standard
input & output while JAVA uses the [Link] & [Link] functions.
[Link] Handling in JAVA And the errors & crashes in C.
[Link] header files whether functions are declared or defined?
Functions are declared within header file. That is function prototypes exist in a header file,not
function bodies. They are defined in library (lib).
[Link] are the different storage classes in C ?
There are four types of storage classes in C. They are extern, register, auto and static
[Link] does static variable mean?
Static is an access qualifier. If a variable is declared as static inside a function, the scope is
limited to the function,but it will exists for the life time of the program. Values will be persisted
between successive
calls to a function
[Link] do you print an address ?
Use %p in printf to print the address.
[Link] are macros? what are its advantages and disadvantages?
Macros are processor directive which will be replaced at compile time.
The disadvantage with macros is that they just replace the code they are not function calls.
similarly the advantage is they can reduce time for replacing the same values.
[Link] between pass by reference and pass by value?
Pass by value just passes the value from caller to calling function so the called function cannot
modify the values in caller function. But Pass by reference will pass the address to the caller
function instead of value if called function requires to modify any value it can directly modify.
[Link] is an object?
Object is a software bundle of variables and related methods. Objects have state and behavior
[Link] is a class?
Class is a user-defined data type in C++. It can be created to solve a particular kind of problem.
After creation the user need not know the specifics of the working of a class.
[Link] is the difference between class and structure?
Structure: Initially (in C) a structure was used to bundle different type of data types together to
perform a particular functionality. But C++ extended the structure to contain functions also.
The major difference is that all declarations inside a structure are by default public.
Class: Class is a successor of Structure. By default all the members inside the class are private.
11. What is pointer?
Pointer is a variable in a program is something with a name, the value of which can vary. The
way the compiler and linker handles this is that it assigns
a specific block of memory within the computer to hold the value of that variable.
[Link] is the difference between null and void pointer?
A Null pointer has the value 0. void pointer is a generic pointer introduced by ANSI. Generic
pointer can hold the address of any data type.
[Link] is function overloading
Function overloading is a feature of C++ that allows us to create multiple functions with the
same name, so long as they have different [Link] the following function:
int Add(int nX, int nY)
{
return nX + nY;
}
14. What is function overloading and operator overloading?
Function overloading: C++ enables several functions of the same name to be defined, as long as
these functions have different sets of parameters (at least as far as their types are concerned).
This capability is called function overloading. When an overloaded function is called, the C++
compiler selects the proper function by examining the number, types and order of the arguments
in the call. Function overloading is commonly used to create several functions of the same name
that perform similar tasks but on different data types.
Operator overloading allows existing C++ operators to be redefined so that they work on objects
of user-defined classes. Overloaded operators are syntactic sugar for equivalent function calls.
They form a pleasant facade that doesn't add anything fundamental to the language (but they can
improve understandability and reduce maintenance costs).
15. what is friend function?
A friend function for a class is used in object-oriented programming to allow access to public,
private, or protected data in the class from the outside.
Normally, a function that is not a member of a class cannot access such information; neither can
an external class. Occasionally, such access will be advantageous for the programmer. Under
these circumstances, the function or external class can be declared as a friend of the class using
the friend keyword.

16. What do you mean by inline function?


The idea behind inline functions is to insert the code of a called function at the point where the
function is called. If done carefully, this can improve the application's performance in exchange
for increased compile time and possibly (but not always) an increase in the size of the generated
binary executables.
17. Tell me something about abstract classes?
An abstract class is a class which does not fully represent an object. Instead, it represents a broad
range of different classes of objects. However, this representation extends only to the features
that those classes of objects have in common. Thus, an abstract class provides only a partial
description of its objects.
[Link] is the difference between realloc() and free()?
The free subroutine frees a block of memory previously allocated by the malloc subroutine.
Undefined results occur if the Pointer parameter is not a valid pointer. If the Pointer parameter is
a null value, no action will occur. The realloc subroutine changes the size of the block of
memory pointed to by the Pointer parameter to the number of bytes specified by the Size
parameter and returns a new pointer to the block. The pointer specified by the Pointer parameter
must have been created with the malloc, calloc, or realloc subroutines and not been deallocated
with the free or realloc subroutines. Undefined results occur if the Pointer parameter is not a
valid pointer.
[Link] is the difference between an array and a list?
Array is collection of homogeneous elements. List is collection of heterogeneous elements.
For Array memory allocated is static and continuous. For List memory allocated is dynamic and
Random.
Array: User need not have to keep in track of next memory allocation.
List: User has to keep in Track of next location where memory is allocated.
Array uses direct access of stored members, list uses sequential access for members.
[Link] are the differences between structures and arrays?
Arrays is a group of similar data types but Structures can be group of different data types
[Link] is data structure?
A data structure is a way of organizing data that considers not only the items stored, but also
their relationship to each other. Advance knowledge about the relationship between data items
allows designing of efficient algorithms for the manipulation of data.
22. Can you list out the areas in which data structures are applied extensively?
Compiler Design,
Operating System,
Database Management System,
Statistical analysis package,
Numerical Analysis,
Graphics,
Artificial Intelligence,
Simulation
[Link] are the advantages of inheritance?
It permits code reusability. Reusability saves time in program development. It encourages the
reuse of proven and debugged high-quality software, thus reducing problem after a system
becomes functional.
24. what are the two integrity rules used in DBMS?
The two types of integrity rules are referential integrity rules and entity integrity rules.
Referential integrity rules dictate that a database does not contain orphan foreign key values.
This means that
A primary key value cannot be modified if the value is used as a foreign key in a child table.
Entity integrity dictates that the primary key value cannot be Null.
25. Tell something about deadlock and how can we prevent dead lock?
In an operating system, a deadlock is a situation which occurs when a process enters a waiting
state because a resource requested by it is being held by another waiting process, which in turn is
waiting for another resource. If a process is unable to change its state indefinitely because the
resources requested by it are being used by other waiting process, then the system is said to be in
a deadlock.
Mutual Exclusion: At least one resource must be non-shareable.[1] Only one process can use the
resource at any given instant of time.
Hold and Wait or Resource Holding: A process is currently holding at least one resource and
requesting additional resources which are being held by other processes.
No Preemption: The operating system must not de-allocate resources once they have been
allocated; they must be released by the holding process voluntarily.
Circular Wait: A process must be waiting for a resource which is being held by another process,
which in turn is waiting for the first process to release the resource. In general, there is a set of
waiting processes, P = {P1, P2, ..., PN}, such that P1 is waiting for a resource held by P2, P2 is
waiting for a resource held by P3 and so on till PN is waiting for a resource held by P1.[1][7]
Thus prevention of deadlock is possible by ensuring that at least one of the four conditions
cannot hold.
26. What is Insertion sort, selection sort, bubble sort( basic differences among the
functionality of the three sorts and not the exact algorithms)
27. What is Doubly link list?
A doubly linked list is a linked data structure that consists of a set of sequentially linked records
called nodes. Each node contains two fields, called links, that are references to the previous and
to the next node in the sequence of nodes. The beginning and ending nodes' previous and next
links, respectively, point to some kind of terminator, typically a sentinel node or null, to facilitate
traversal of the list. If there is only one sentinel node, then the list is circularly linked via the
sentinel node. It can be conceptualized as two singly linked lists formed from the same data
items, but in opposite sequential orders.
[Link] is data abstraction? what are the three levels of data abstraction with Example?
Abstraction is the process of recognizing and focusing on important characteristics of a situation
or object and leaving/filtering out the un-wanted characteristics of that situation or object.
Lets take a person as example and see how that person is abstracted in various situations
A doctor sees (abstracts) the person as patient. The doctor is interested in name, height, weight,
age, blood group, previous or existing diseases etc of a person
An employer sees (abstracts) a person as Employee. The employer is interested in name, age,
health, degree of study, work experience etc of a person.
Abstraction is the basis for software development. Its through abstraction we define the essential
aspects of a system. The process of identifying the abstractions for a given system is called as
Modeling (or object modeling).
Three levels of data abstraction are:
1. Physical level : how the data is stored physically and where it is stored in database.
2. Logical level : what information or data is stored in the database. eg: Database administrator
[Link] level : end users work on view level. if any amendment is made it can be saved by other
name.

[Link] is command line argument?


Getting the arguments from command prompt in c is known as command line arguments. In c
main function has three [Link] are:
Argument counter
Argument vector
Environment vector
[Link] of a macro over a function?
Macro gets to see the Compilation environment, so it can expand #defines. It is expanded by the
preprocessor.
[Link] are the different storage classes in C?
Auto,register,static,extern
[Link] header file should you include if you are to develop a function which can accept
variable number of arguments?
stdarg.h
[Link] is cache memory ?
Cache Memory is used by the central processing unit of a computer to reduce the average time to
access memory. The cache is a smaller, faster memory
which stores copies of the data from the most frequently used main memory locations. As long
as most memory accesses are cached memory locations, the average
latency of memory accesses will be closer to the cache latency than to the latency of main
memory.
[Link] is debugger?
A debugger or debugging tool is a computer program that is used to test and debug other
programs
36. Const char *p , char const *p What is the difference between the above two?
1) const char *p - Pointer to a Constant char ('p' isn't modifiable but the pointer is)
2) char const *p - Also pointer to a constant Char
However if you had something like:
char * const p - This declares 'p' to be a constant pointer to an char. (Char p is modifiable but the
pointer isn't)

35. What is Memory Alignment?


Data structure alignment is the way data is arranged and accessed in computer memory. It
consists of two separate but related issues: data alignment and data structure padding.
[Link] the difference between 'operator new' and the 'new' operator?
The difference between the two is that operator new just allocates raw memory, nothing else.
The new operator starts by using operator new to allocate memory, but then it invokes the
constructor for the right type of object, so the result is a real live object created in that memory.
If that object contains any other objects (either embedded or as base classes) those constructors
as invoked as well.
37. Difference between delete and delete[]?
The keyword delete is used to destroy the single variable memory created dynamically which is
pointed by single pointer variable.
Eg: int *r=new(int)
the memory pointed by r can be deleted by delete r.
delete [] is used to destroy array of memory pointed by single pointer variable.
Eg:int *r=new(int a[10])
The memory pointed by r can be deleted by delete []r.
38. What is conversion constructor?
A conversion constructor is a single-parameter constructor that is declared without the function
specifier 'explicit'. The compiler uses conversion constructors to convert objects from the type of
the first parameter to the type of the conversion constructor's [Link] define implicit
conversions, C++ uses conversion constructors, constructors that accept a single parameter and
initialize an object to be a copy of that parameter.
[Link] is a spanning Tree?
A spanning tree is a tree associated with a network. All the nodes of the graph appear on the tree
once. A minimum spanning tree is a spanning tree organized so that the total edge weight
between nodes is minimized.
40 Why should we use data ware housing and how can you extract data for analysis with
example?
If you want to get information on all the techniques of designing, maintaining, building and
retrieving data, Data warehousing is the ideal method. A data warehouse is premeditated and
generated for supporting the decision making process within an organization.
Here are some of the benefits of a data warehouse:

o With data warehousing, you can provide a common data model for different interest areas
regardless of data's source. In this way, it becomes easier to report and analyze information.

o Many inconsistencies are identified and resolved before loading of information in data
warehousing. This makes the reporting and analyzing process simpler.

o The best part of data warehousing is that the information is under the control of users, so that in
case the system gets purged over time, information can be easily and safely stored for longer
time period.

o Because of being different from operational systems, a data warehouse helps in retrieving data
without slowing down the operational system.

o Data warehousing enhances the value of operational business applications and customer
relationship management systems.
o Data warehousing also leads to proper functioning of support system applications like trend
reports, exception reports and the actual performance analyzing reports.
Data mining is a powerful new technology to extract data for analysis.
[Link] recursive function & what is the data structures used to perform recursion?
a) A recursive function is a function which calls itself.
b) The speed of a recursive program is slower because of stack overheads. (This attribute is
evident if you run above C program.)
c) A recursive function must have recursive conditions, terminating conditions, and recursive
expressions.
Stack data structure . Because of its LIFO (Last In First Out) property it remembers its caller so
knows whom to return when the function has to return. Recursion makes use of system stack for
storing the return addresses of the function calls. Every recursive function has its equivalent
iterative (non-recursive) function. Even when such equivalent iterative procedures are written,
explicit stack is to be used.
[Link] between Complier and Interpreter?
An interpreter reads one instruction at a time and carries out the actions implied by that
instruction. It does not perform any translation. But a compiler translates the entire instructions
[Link] is scope of a variable?
Scope refers to the visibility of variables. It is very useful to be able to limit a variable's scope to
a single function. In other words, the variable wil have a limited scope
[Link] is an interrupt?
Interrupt is an asynchronous signal informing a program that an event has occurred. When a
program receives an interrupt signal, it takes a specified action.
[Link] is user defined exception in Java?
The keywords used in java application are try, catch and finally are used in implementing used-
defined exceptions. This Exception class inherits all the method from Throwable class.
[Link] is java Applet?
Applet is java program that can be embedded into HTML pages. Java applets runs on the java
enables web browsers such as mozila and internet explorer. Applet is designed to run remotely
on the client browser, so there are some restrictions on it. Applet can't access system resources
on the local computer. Applets are used to make the web site more dynamic and entertaining.
[Link] do you know about the garbage collector?
Garbage collection is the systematic recovery of pooled computer storage that is being used by a
program when that program no longer needs the storage. This frees the storage for use by other
programs
(or processes within a program). It also ensures that a program using increasing amounts of
pooled storage does not reach its quota (in which case it may no longer be able to function).

Garbage collection is an automatic memory management feature in many modern programming


languages, such as Java and languages in the .NET framework. Languages that use garbage
collection are often interpreted or run within a virtual machine like the JVM. In each case, the
environment that runs the code is also responsible for garbage collection.
[Link] a Binary Search program
int binarySearch(int arr[],int size, int item)
{
int left, right, middle;
left = 0;
right = size-1;

while(left <= right)


{
middle = ((left + right)/2);

if(item == arr[middle])
{
return(middle);
}

if(item > arr[middle])


{
left = middle+1;
}
else
{
right = middle-1;
}
}

return(-1);
}

[Link] are enumerations?


An enumeration is a data type, used to declare variable that store list of names. It is act like a
database, which will store list of items in the variable. example: enum shapes{triangle,
rectangle,...
[Link] is static identifier?
The static identifier is used for initializing only once, and the value retains during the life time of
the program / application. A separate memory is allocated for ‘static’ variables. This value can
be used between function calls. The default value of an uninitialized static variable is zero. A
function can also be defined as a static function, which has the same scope of the static variable.
[Link] is Cryptography?
Cryptography is the science of enabling secure communications between a sender and one or
more recipients. This is achieved by the sender scrambling a message (with a computer program
and a secret key) and leaving the recipient to unscramble the message (with the same computer
program and a key, which may or may not be the same as the sender's key).
There are two types of cryptography: Secret/Symmetric Key Cryptography and Public Key
Cryptography
[Link] is encryption?
Encryption is the transformation of information from readable form into some unreadable form.
[Link] is decryption?
Decryption is the reverse of encryption; it's the transformation of encrypted data back into some
intelligible form.
[Link] exactly is a digital signature?
Just as a handwritten signature is affixed to a printed letter for verification that the letter
originated from its purported sender, digital signature performs the same task for an electronic
message. A digital signature is an encrypted version of a message digest, attached together with a
message.
SECTION-2 JAVA INTERVIEW QUESTIONS
[Link] is JVM?
The Java interpreter along with the runtime environment required to run the Java application in
called as Java virtual machine(JVM)
2. What is the most important feature of Java?
Java is a platform independent language.
3. What do you mean by platform independence?
Platform independence means that we can write and compile the java code in one platform (eg
Windows) and can execute the class in any other supported platform eg (Linux,Solaris,etc).
4. What is the difference between a JDK and a JVM?
JDK is Java Development Kit which is for development purpose and it includes execution
environment also. But JVM is purely a run time environment and hence you will not be able to
compile your source files using a JVM.
5. What is the base class of all classes?
[Link]
6. What are the access modifiers in Java?
There are 3 access modifiers. Public, protected and private, and the default one if no identifier is
specified is called friendly, but programmer cannot specify the friendly identifier explicitly.
7. What is are packages?
A package is a collection of related classes and interfaces providing access protection and
namespace management.

8. What is meant by Inheritance and what are its advantages?


Inheritance is the process of inheriting all the features from a class. The advantages of
inheritance are reusability of code and accessibility of variables and methods of the super class
by subclasses.
9. What is the difference between superclass and subclass?
A super class is a class that is inherited whereas sub class is a class that does the inheriting.
10. What is an abstract class?
An abstract class is a class designed with implementation gaps for subclasses to fill in and is
deliberately incomplete.
11. What are the states associated in the thread?
Thread contains ready, running, waiting and dead states.
12. What is synchronization?
Synchronization is the mechanism that ensures that only one thread is accessed the resources at a
time.
13. What is deadlock?
When two threads are waiting each other and can’t precede the program is said to be deadlock.
14. What is an applet?
Applet is a dynamic and interactive program that runs inside a web page displayed by a java
capable browser
15. What is the lifecycle of an applet?
init() method - Can be called when an applet is first loaded
start() method - Can be called each time an applet is started.
paint() method - Can be called when the applet is minimized or maximized.
stop() method - Can be used when the browser moves off the applet’s page.
destroy() method - Can be called when the browser is finished with the applet.
16. How do you set security in applets?
using setSecurityManager() method
17. What is a layout manager and what are different types of layout managers available in
java AWT?
A layout manager is an object that is used to organize components in a container. The different
layouts are available are FlowLayout, BorderLayout, CardLayout, GridLayout and
GridBagLayout
18. What is JDBC?
JDBC is a set of Java API for executing SQL statements. This API consists of a set of classes
and interfaces to enable programs to write pure Java Database applications.
19. What are drivers available?
-a) JDBC-ODBC Bridge driver b) Native API Partly-Java driver
c) JDBC-Net Pure Java driver d) Native-Protocol Pure Java driver
20. What is stored procedure?
Stored procedure is a group of SQL statements that forms a logical unit and performs a particular
task. Stored Procedures are used to encapsulate a set of operations or queries to execute on
database. Stored procedures can be compiled and executed with different parameters and results
and may have any combination of input/output parameters.
21. What is the Java API?
The Java API is a large collection of ready-made software components that provide many useful
capabilities, such as graphical user interface (GUI) widgets.
22. Why there are no global variables in Java?
Global variables are globally accessible. Java does not support globally accessible variables due
to following reasons:
1)The global variables breaks the referential transparency
2)Global variables creates collisions in namespace.
23. What are Encapsulation, Inheritance and Polymorphism?
Encapsulation is the mechanism that binds together code and data it manipulates and keeps both
safe from outside interference and misuse. Inheritance is the process by which one object
acquires the properties of another object. Polymorphism is the feature that allows one interface to
be used for general class actions.
24. What is the use of bin and lib in JDK?
Bin contains all tools such as javac, appletviewer, awt tool, etc., whereas lib contains API and all
packages.
25. What is method overloading and method overriding?
Method overloading: When a method in a class having the same method name with different
arguments is said to be method overloading. Method overriding : When a method in a class
having the same method name with same arguments is said to be method overriding.
26. What is the difference between this() and super()?
this() can be used to invoke a constructor of the same class whereas super() can be used to
invoke a super class constructor.
27. What is Domain Naming Service(DNS)?
It is very difficult to remember a set of numbers(IP address) to connect to the Internet. The
Domain Naming Service(DNS) is used to overcome this problem. It maps one particular IP
address to a string of characters. For example, www. mascom. com implies com is the domain
name reserved for US commercial sites, moscom is the name of the company and www is the
name of the specific computer, which is mascom’s server.
28. What is URL?
URL stands for Uniform Resource Locator and it points to resource files on the Internet. URL
has four components: [Link] address. com:80/[Link], where http - protocol name,
address - IP address or host name, 80 - port number and [Link] - file path.
29. What is RMI and steps involved in developing an RMI object?
Remote Method Invocation (RMI) allows java object that executes on one machine and to invoke
the method of a Java object to execute on another machine. The steps involved in developing an
RMI object are: a) Define the interfaces b) Implementing these interfaces c) Compile the
interfaces and their implementations with the java compiler d) Compile the server
implementation with RMI compiler e) Run the RMI registry f) Run the application.
30. What is RMI architecture?
RMI architecture consists of four layers and each layer performs specific functions: a)
Application layer - contains the actual object definition. b) Proxy layer - consists of stub and
skeleton. c) Remote Reference layer - gets the stream of bytes from the transport layer and sends
it to the proxy layer. d) Transportation layer - responsible for handling the actual machine-to-
machine communication.
31. What is a Java Bean?
A Java Bean is a software component that has been designed to be reusable in a variety of
different environments.
32. What are checked exceptions?
Checked exception are those which the Java compiler forces you to catch. e.g. IOException are
checked Exceptions.

33. What are runtime exceptions?


Runtime exceptions are those exceptions that are thrown at runtime because of either wrong
input data or because of wrong business logic etc. These are not checked by the compiler at
compile time.
34. What is the difference between error and an exception?
An error is an irrecoverable condition occurring at runtime. Such as OutOfMemory error. These
JVM errors and you can not repair them at runtime. While exceptions are conditions that occur
because of bad input etc. e.g. FileNotFoundException will be thrown if the specified file does not
exist. Or a NullPointerException will take place if you try using a null reference. In most of the
cases it is possible to recover from an exception (probably by giving user a feedback for entering
proper values etc.).
35. What is the purpose of finalization?
The purpose of finalization is to give an unreachable object the opportunity to perform any
cleanup processing before the object is garbage collected. For example, closing a opened file,
closing a opened database Connection.
36. What is the difference between yielding and sleeping?
When a task invokes its yield() method, it returns to the ready state. When a task invokes its
sleep() method, it returns to the waiting state.
37. What is the difference between preemptive scheduling and time slicing?
Under preemptive scheduling, the highest priority task executes until it enters the waiting or dead
states or a higher priority task comes into existence. Under time slicing, a task executes for a
predefined slice of time and then reenters the pool of ready tasks. The scheduler then determines
which task should execute next, based on priority and other factors.
38. What is mutable object and immutable object?
If a object value is changeable then we can call it as Mutable object. (Ex., StringBuffer, …) If
you are not allowed to change the value of an object, it is immutable object. (Ex., String, Integer,
Float, …)
39. What is the purpose of Void class?
The Void class is an uninstantiable placeholder class to hold a reference to the Class object
representing the primitive Java type void.

40. What is JIT and its use?


Really, just a very fast compiler… In this incarnation, pretty much a one-pass compiler — no
offline computations. So you can’t look at the whole method, rank the expressions according to
which ones are re-used the most, and then generate code. In theory terms, it’s an on-line
problem.
41. What is nested class?
If all the methods of a inner class is static then it is a nested class.
42. What is HashMap and Map?
Map is Interface and Hashmap is class that implements that.
43. What are different types of access modifiers?
public: Any thing declared as public can be accessed from anywhere. private: Any thing declared
as private can’t be seen outside of its class. protected: Any thing declared as protected can be
accessed by classes in the same package and subclasses in the other packages. default modifier :
Can be accessed only to classes in the same package.
44. What is the difference between Reader/Writer and InputStream/Output Stream?
The Reader/Writer class is character-oriented and the InputStream/OutputStream class is byte-
oriented.
45. What is servlet?
Servlets are modules that extend request/response-oriented servers, such as java-enabled web
servers. For example, a servlet might be responsible for taking data in an HTML order-entry
form and applying the business logic used to update a company’s order database.
46. What is Constructor?
A constructor is a special method whose task is to initialize the object of its class.
It is special because its name is the same as the class name.
They do not have return types, not even void and therefore they cannot return values.
They cannot be inherited, though a derived class can call the base class constructor.
Constructor is invoked whenever an object of its associated class is created.
47. What is an Iterator ?
The Iterator interface is used to step through the elements of a Collection.
Iterators let you process each element of a Collection.
Iterators are a generic way to go through all the elements of a Collection no matter how it is
organized.
Iterator is an Interface implemented a different way for every Collection.
48. What is the List interface?
The List interface provides support for ordered collections of objects.
Lists may contain duplicate elements.
49. What is memory leak?
A memory leak is where an unreferenced object that will never be used again still hangs around
in memory and doesnt get garbage collected.
50. What is the difference between the prefix and postfix forms of the ++ operator?
The prefix form performs the increment operation and returns the value of the increment
operation. The postfix form returns the current value all of the expression and then performs the
increment operation on that value.
51. What is the difference between a constructor and a method?
A constructor is a member function of a class that is used to create objects of that class. It has the
same name as the class itself, has no return type, and is invoked using the new operator.
A method is an ordinary member function of a class. It has its own name, a return type (which
may be void), and is invoked using the dot operator.
52. What will happen to the Exception object after exception handling?
Exception object will be garbage collected.
53. Difference between static and dynamic class loading.
Static class loading: The process of loading a class using new operator is called static class
loading. Dynamic class loading: The process of loading a class at runtime is called dynamic class
loading.
Dynamic class loading can be done by using [Link](….).newInstance().
54. Explain the Common use of EJB
The EJBs can be used to incorporate business logic in a web-centric application.
The EJBs can be used to integrate business processes in Business-to-business (B2B) e-commerce
[Link] Enterprise Application Integration applications, EJBs can be used to house
processing and mapping between different applications.
55. What is JSP?
JSP is a technology that returns dynamic content to the Web client using HTML, XML and
JAVA elements. JSP page looks like a HTML page but is a servlet. It contains Presentation logic
and business logic of a web application.

56. What is the purpose of apache tomcat?


Apache server is a standalone server that is used to test servlets and create JSP pages. It is free
and open source that is integrated in the Apache web server. It is fast, reliable server to configure
the applications but it is hard to install. It is a servlet container that includes tools to configure
and manage the server to run the applications. It can also be configured by editing XML
configuration files.
57. Where pragma is used?
Pragma is used inside the servlets in the header with a certain value. The value is of no-cache
that tells that a servlets is acting as a proxy and it has to forward request. Pragma directives allow
the compiler to use machine and operating system features while keeping the overall
functionality with the Java language. These are different for different compilers.
58. Briefly explain daemon thread.
Daemon thread is a low priority thread which runs in the background performs garbage
collection operation for the java runtime system.
59. What is a native method?
A native method is a method that is implemented in a language other than Java.
60. Explain different way of using thread?
A Java thread could be implemented by using Runnable interface or by extending the Thread
class. The Runnable is more advantageous, when you are going for multiple inheritance.
61. What are the two major components of JDBC?
One implementation interface for database manufacturers, the other implementation interface for
application and applet writers.
62. What kind of thread is the Garbage collector thread?
It is a daemon thread.
63. What are the different ways to handle exceptions?
There are two ways to handle exceptions,
1. By wrapping the desired code in a try block followed by a catch block to catch the exceptions.
and
2. List the desired exceptions in the throws clause of the method and let the caller of the method
handle those exceptions.
64. How many objects are created in the following piece of code?
MyClass c1, c2, c3;
c1 = new MyClass ();
c3 = new MyClass ();
Answer: Only 2 objects are created, c1 and c3. The reference c2 is only declared and not
initialized.
[Link] is UNICODE?
Unicode is used for internal representation of characters and strings and it uses 16 bits to
represent each other.
SECTION -3 PHP INTERVIEW QUESTIONS
1. Who is the father of PHP ?
Rasmus Lerdorf is known as the father of PHP.
2. What is the difference between $name and $$name?
$name is variable where as $$name is reference variable like $name=sonia and $$name=singh so
$sonia value is singh.

3. What are the method available in form submitting?


GET and POST
[Link] can we get the browser properties using PHP?
<?php
echo $_SERVER[‘HTTP_USER_AGENT’].”\n\n”;
$browser=get_browser(null,true);
print_r($browser);
?>
5. What Is a Session?
A session is a logical object created by the PHP engine to allow you to preserve data across
subsequent HTTP requests. Sessions are commonly used to store temporary data to allow
multiple PHP pages to offer a complete functional transaction for the same visitor.
6. How can we register the variables into a session?
<?php
session_register($ur_session_var);
?>
7. How many ways we can pass the variable through the navigation between the pages?
Register the variable into the session
Pass the variable as a cookie
Pass the variable as part of the URL
8. How can we know the total number of elements of Array?
sizeof($array_var)
count($array_var)
9. How can we create a database using php?
mysql_create_db();
10. What is the functionality of the function strstr and stristr?
strstr() returns part of a given string from the first occurrence of a given substring to the end of
the string.
For example:strstr("user@[Link]","@") will return "@[Link]".
stristr() is idential to strstr() except that it is case insensitive.

11. What are encryption functions in PHP?

CRYPT(), MD5()
12. How to store the uploaded file to the final location?
move_uploaded_file( string filename, string destination)
13. Explain mysql_error().
The mysql_error() message will tell us what was wrong with our query, similar to the message
we would receive at the MySQL console.
14. What is Constructors and Destructors?
CONSTRUCTOR : PHP allows developers to declare constructor methods for classes. Classes
which have a constructor method call this method on each newly-created object, so it is suitable
for any initialization that the object may need before it is used.
DESTRUCTORS : PHP 5 introduces a destructor concept similar to that of other object-oriented
languages, such as C++. The destructor method will be called as soon as all references to a
particular object are removed or when the object is explicitly destroyed or in any order in
shutdown sequence.
15. Explain the visibility of the property or method.
The visibility of a property or method must be defined by prefixing the declaration with the
keywords public, protected or private.
Class members declared public can be accessed everywhere.
Members declared protected can be accessed only within the class itself and by inherited and
parent classes.
Members declared as private may only be accessed by the class that defines the member.
16. What are the differences between Get and post methods.
There are some defference between GET and POST method
1. GET Method have some limit like only 2Kb data able to send for request
But in POST method unlimited data can we send
2. when we use GET method requested data show in url but
Not in POST method so POST method is good for send sensetive request
17. What are the differences between require and include?
Both include and require used to include a file but when included file not found
Include send Warning where as Require send Fatal Error

18. What is use of header() function in php ?


The header() function sends a raw HTTP header to a [Link] can use herder()
function for redirection of pages. It is important to notice that header() must
be called before any actual output is seen.
19. List out the predefined classes in PHP?
Directory
stdClass
__PHP_Incomplete_Class
exception
php_user_filter
20. What type of inheritance that PHP supports?
In PHP an extended class is always dependent on a single base class,that is, multiple inheritance
is not supported. Classes are extended using the keyword 'extends'.
21. How can we encrypt the username and password using php?
You can encrypt a password with the following Mysql>SET
PASSWORD=PASSWORD("Password");
We can encode data using base64_encode($string) and can decode using
base64_decode($string);
22. What is the difference between explode and split?
Split function splits string into array by regular expression. Explode splits a string into array by
string.
For Example:explode(" and", "India and Pakistan and Srilanka");
split(" :", "India : Pakistan : Srilanka");
Both of these functions will return an array that contains India, Pakistan, and Srilanka.
23. How do you define a constant?
Constants in PHP are defined using define() directive, like define("MYCONSTANT", 100);
24. How do you pass a variable by value in PHP?
Just like in C++, put an ampersand in front of it, like $a = &$b;
25. What does a special set of tags <?= and ?> do in PHP?
The output is displayed directly to the browser.
26. How do you call a constructor for a parent class?
parent::constructor($value)
27. What’s the special meaning of __sleep and __wakeup?
__sleep returns the array of all the variables than need to be saved, while __wakeup retrieves
them.
28. What is the difference between PHP and JavaScript?
javascript is a client side scripting language, so javascript can make popups and other things
happens on someone’s PC. While PHP is server side scripting language so it does every stuff
with the server.
29. What is the difference between the functions unlink and unset?
unlink() deletes the given file from the file system.
unset() makes a variable undefined.
30. How many ways can we get the value of current session id?
session_id() returns the session id for the current session.
31. What are default session time and path?
default session time in PHP is 1440 seconds or 24 minutes
Default session save path id temporary folder /tmp
32. for image work which library?
we will need to compile PHP with the GD library of image functions for this to work. GD and
PHP may also require other libraries, depending on which image formats you want to work with.
33. How can we get second of the current time using date function?
<?php
$second = date(“s”);
?>
34. What are the Formatting and Printing Strings available in PHP?
printf()- Displays a formatted string
sprintf()-Saves a formatted string in a variable
fprintf() -Prints a formatted string to a file
number_format()-Formats numbers as strings
35. How can we find the number of rows in a result set using PHP?
$result = mysql_query($sql, $db_link);
$num_rows = mysql_num_rows($result);
echo "$num_rows rows found";
SECTION-4 SOFTWARE TESTING INTERVIEW QUESTIONS
1. What is traceability matrix?
The relationship between test cases and requirements is shown with the help of a document. This
document is known as traceability matrix.
2. What is Equivalence partitioning testing?
Equivalence partitioning testing is a software testing technique which divides the application
input test data into each partition at least once of equivalent data from which test cases can be
derived. By this testing method it reduces the time required for software testing.
3. Does automation replace manual testing?
Automation is the integration of testing tools into the test environment in such a manner that the
test execution, logging, and comparison of results are done with little human intervention. A
testing tool is a software application which helps automate the testing process. But the testing
tool is not the complete answer for automation. One of the huge mistakes done in testing
automation is automating the wrong things during development. Many testers learn the hard way
that everything cannot be automated. The best components to automate are repetitive tasks. So
some companies first start with manual testing and then see which tests are the most repetitive
ones and only those are then automated.
As a rule of thumb do not try to automate:
1. Unstable software: If the software is still under development and undergoing many
changes automation testing will not be that effective.
2. Once in a blue moon test scripts: Do not automate test scripts which will be run once in a
while.
3. Code and document review: Do not try to automate code and document reviews; they will
just cause trouble.
The following figure shows what should not be automated.
All repetitive tasks which are frequently used should be automated. For instance, regression tests
are prime candidates for automation because they're typically executed many times. Smoke, load,
and performance tests are other examples of repetitive tasks that are suitable for automation.
White box testing can also be automated using various unit testing tools. Code coverage can also
be a good candidate for automation.
4. What is white box testing and list the types of white box testing?
White box testing technique involves selection of test cases based on an analysis of the internal
structure (Code coverage, branches coverage, paths coverage, condition coverage etc.) of a
component or system. It is also known as Code-Based testing or Structural testing. Different
types of white box testing are :
1. Statement Coverage
2. Decision Coverage
5. How do you define a testing policy?
The following are the important steps used to define a testing policy in general. But it can change
according to your organization. Let's discuss in detail the steps of implementing a testing policy
in an organization.
Definition: The first step any organization needs to do is define one unique definition for testing
within the organization so that everyone is of the same mindset.
How to achieve: How are we going to achieve our objective? Is there going to be a testing
committee, will there be compulsory test plans which need to be executed, etc?.
Evaluate: After testing is implemented in a project how do we evaluate it? Are we going to
derive metrics of defects per phase, per programmer, etc. Finally, it's important to let everyone
know how testing has added value to the project?.
Standards: Finally, what are the standards we want to achieve by testing? For instance, we can
say that more than 20 defects per KLOC will be considered below standard and code review
should be done for it.
6. What is the MAIN benefit of designing tests early in the life cycle?
It helps prevent defects from being introduced into the code.
7. What is risk-based testing?
Risk-based testing is the term used for an approach to creating a test strategy that is based on
prioritizing tests by risk. The basis of the approach is a detailed risk analysis and prioritizing of
risks by risk level. Tests to address each risk are then specified, starting with the highest risk
first.
8. What is the KEY difference between preventative and reactive approaches to testing?
Preventative tests are designed early; reactive tests are designed after the software has been
produced.
9. In white box testing what do you verify?
In white box testing following steps are verified.
1. Verify the security holes in the code
2. Verify the incomplete or broken paths in the code
3. Verify the flow of structure according to the document specification
4. Verify the expected outputs
5. Verify all conditional loops in the code to check the complete functionality of the
application
6. Verify the line by line coding and cover 100% testing
10. What is the difference between static and dynamic testing?
a) Static testing: During Static testing method, the code is not executed and it is performed
using the software documentation.
b) Dynamic testing: To perform this testing the code is required to be in an executable form.
11. What are different test levels?
There are four test levels
1. Unit/component/program/module testing
2. Integration testing
3. System testing
4. Acceptance testing
12. What is Integration testing?
Integration testing is a level of software testing process, where individual units of an application
are combined and tested. It is usually performed after unit and functional testing.
13. What are the tables in test plans?
Test design, scope, test strategies , approach are various details that Test plan document consists
of.
1. Test case identifier
2. Scope
3. Features to be tested
4. Features not to be tested
5. Test strategy & Test approach
6. Test deliverables
7. Responsibilities
8. Staffing and training
9. Risk and Contingencies

14. What is configuration management?


Configuration management is the detailed recording and updating of information for hardware
and software components. When we say components we not only mean source code. It can be
tracking of changes for software documents such as requirement, design, test cases, etc.
When changes are done in adhoc and in an uncontrolled manner chaotic situations can arise and
more defects injected. So whenever changes are done it should be done in a controlled fashion
and with proper versioning. At any moment of time we should be able to revert back to the old
version. The main intention of configuration management is to track our changes if we have
issues with the current system. Configuration management is done using baselines.
15. What is the difference between UAT (User Acceptance Testing) and System testing?
System Testing: System testing is finding defects when the system under goes testing as a
whole, it is also known as end to end testing. In such type of testing, the application undergoes
from beginning till the end.
UAT: User Acceptance Testing (UAT) involves running a product through a series of specific
tests which determines whether the product wil meet the needs of its users.
16. How does a coverage tool work?
While doing testing on the actual product, the code coverage testing tool is run simultaneously.
While the testing is going on, the code coverage tool monitors the executed statements of the
source code. When the final testing is completed we get a complete report of the pending
statements and also get the coverage percentage.
17. What is Fault Masking?
Error condition hiding another error condition.
18. What does COTS represent?
COTS - Commercial off The Shelf.
The purpose of which is allow specific tests to be carried out on a system or network that
resembles as closely as possible the environment where the item under test will be used upon
release.
Test Environment
What can be thought of as being based on the project plan, but with greater amounts of detail?
Phase Test Plan
19. Should testing be done only after the build and execution phases are complete?
In traditional testing methodology testing is always done after the build and execution [Link]
that's a wrong way of thinking because the earlier we catch a defect, the more cost effective it is.
For instance, fixing a defect in maintenance is ten times more costly than fixing it during
execution.
In the requirement phase we can verify if the requirements are met according to the customer
needs. During design we can check whether the design document covers all the requirements. In
this stage we can also generate rough functional data. We can also review the design document
from the architecture and the correctness perspectives. In the build and execution phase we can
execute unit test cases and generate structural and functional data. And finally comes the testing
phase done in the traditional way. i.e., run the system test cases and see if the system works
according to the requirements. During installation we need to see if the system is compatible
with the software. Finally, during the maintenance phase when any fixes are made we can retest
the fixes and follow the regression [Link], Testing should occur in conjunction with
each phase of the software development.
20. When should testing be stopped?
It depends on the risks for the system being tested. There are some criteria bases on which you
can stop testing.
1. Deadlines (Testing, Release)
2. Test budget has been depleted
3. Bug rate fall below certain level
4. Test cases completed with certain percentage passed
5. Alpha or beta periods for testing ends
6. Coverage of code, functionality or requirements are met to a specified point
21. Which of the following is the main purpose of the integration strategy for integration
testing in the small?
The main purpose of the integration strategy is to specify which modules to combine when and
how many at once.
22. What are semi-random test cases?
Semi-random test cases are nothing but when we perform random test cases and do equivalence
partitioning to those test cases, it removes redundant test cases, thus giving us semi-random test
cases.1 test for statement coverage, 2 for branch coverage
23. What is black box testing? What are the different black box testing techniques?
Black box testing is the software testing method which is used to test the software without
knowing the internal structure of code or program. This testing is usually done to check the
functionality of an application. The different black box testing techniques are :
1. Equivalence Partitioning
2. Boundary value analysis
3. Cause effect graphing
24. Which review is normally used to evaluate a product to determine its suitability for
intended use and to identify discrepancies?
Technical Review.
25. Why we use decision tables?
The techniques of equivalence partitioning and boundary value analysis are often applied to
specific situations or inputs. However, if different combinations of inputs result in different
actions being taken, this can be more difficult to show using equivalence partitioning and
boundary value analysis, which tend to be more focused on the user interface. The other two
specification-based techniques, decision tables and state transition testing are more focused on
business logic or business rules. A decision table is a good way to deal with combinations of
things (e.g. inputs). This technique is sometimes also referred to as a 'cause-effect' table. The
reason for this is that there is an associated logic diagramming technique called 'cause-effect
graphing' which was sometimes used to help derive the decision table
26. Faults found should be originally documented by whom?
By testers.
27. Are there more defects in the design phase or in the coding phase?
The design phase is more error prone than the execution phase. One of the most frequent defects
which occur during design is that the product does not cover the complete requirements of the
customer. Second is wrong or bad architecture and technical decisions make the next phase,
execution, more prone to defects. Because the design phase drives the execution phase it's the
most critical phase to test. The testing of the design phase can be done by good review. On
average, 60% of defects occur during design and 40% during the execution phase.
28. What are the Experience-based testing techniques?
In experience-based techniques, people's knowledge, skills and background are a prime
contributor to the test conditions and test cases. The experience of both technical and business
people is important, as they bring different perspectives to the test analysis and design process.
Due to previous experience with similar systems, they may have insights into what could go
wrong, which is very useful for testing.
29. What type of review requires formal entry and exit criteria, including metrics?
Inspection
30. Could reviews or inspections be considered part of testing?
Yes, because both help detect faults and improve [Link] test a function, what has to write a
programmer, which calls the function to be tested and passes it test data.
31. What is a test log?
The IEEE Std. 829-1998 defines a test log as a chronological record of relevant details about the
execution of test cases. It's a detailed view of activity and events given in chronological manner.
32. What does entry and exit criteria mean in a project?
Entry and exit criteria are a must for the success of any project. If you do not know where to start
and where to finish then your goals are not clear. By defining exit and entry criteria you define
your [Link] instance, you can define entry criteria that the customer should provide the
requirement document or acceptance plan. If this entry criteria is not met then you will not start
the project. On the other end, you can also define exit criteria for your project. For instance, one
of the common exit criteria in projects is that the customer has successfully executed the
acceptance test plan.
33. What is the difference between verification and validation?
Verification is a review without actually executing the process while validation is checking the
product with actual execution. For instance, code review and syntax check is verification while
actually running the product and checking the results is validation.
34. A Type of functional Testing, which investigates the functions relating to detection of
threats, such as virus from malicious outsiders?
a) Security Testing
Testing where in we subject the target of the test , to varying workloads to measure and evaluate
the performance behaviours and ability of the target and of the test to continue to function
properly under these different workloads?
b) Load Testing
Testing activity which is performed to expose defects in the interfaces and in the interaction
between integrated components is?
c) Integration Level Testing
35. Can you explain process areas in CMMI?
A process area is the area of improvement defined by CMMI. Every maturity level consists of
process areas. A process area is a group of practices or activities performed collectively to
achieve a specific objective. For instance, you can see from the following figure we have process
areas such as project planning, configuration management, and requirement gathering.
36. What is random/monkey testing? When it is used?
Random testing often known as monkey testing. In such type of testing data is generated
randomly often using a tool or automated mechanism. With this randomly generated input the
system is tested and results are analysed accordingly. These testing are less reliable; hence it is
normally used by the beginners and to see whether the system will hold up under adverse effects.
37. Which of the following are valid objectives for incident reports?
Provide developers and other parties with feedback about the problem to enable identification,
isolation and correction as necessary.
1. Provide ideas for test process improvement.
2. Provide a vehicle for assessing tester competence.
3. Provide testers with a means of tracking the quality of the system under test.
38. How does load testing work for websites?
Websites have software called a web server installed on the server. The user sends a request to
the web server and receives a response. So, for instance, when you type [Link] the
web server senses it and sends you the home page as a response. This happens each time you
click on a link, do a submit, etc. So if we want to do load testing you need to just multiply these
requests and responses "N" times. This is what an automation tool does. It first captures the
request and response and then just multiplies it by "N" times and sends it to the web server,
which results in load simulation.
So once the tool captures the request and response, we just need to multiply the request and
response with the virtual user. Virtual users are logical users which actually simulate the actual
physical user by sending in the same request and response. If you want to do load testing with
10,000 users on an application it's practically impossible. But by using the load testing tool you
only need to create 1000 virtual users.
39. What is functional system testing?
Testing the end to end functionality of the system as a whole is defined as a functional system
testing.
40. What kind of input do we need from the end user to begin proper testing?
The product has to be used by the user. He is the most important person as he has more interest
than anyone else in the project.
From the user we need the following data:
The first thing we need is the acceptance test plan from the end user. The acceptance test defines
the entire test which the product has to pass so that it can go into [Link] also need the
requirement document from the customer. In normal scenarios the customer never writes a
formal document until he is really sure of his requirements. But at some point the customer
should sign saying yes this is what he wants.
The customer should also define the risky sections of the project. For instance, in a normal
accounting project if a voucher entry screen does not work that will stop the accounting
functionality completely. But if reports are not derived the accounting department can use it for
some time. The customer is the right person to say which section will affect him the most. With
this feedback the testers can prepare a proper test plan for those areas and test it thoroughly.
The customer should also provide proper data for testing. Feeding proper data during testing is
very important. In many scenarios testers key in wrong data and expect results which are of no
interest to the customer.
41. Why can be tester dependent on configuration management?
Because configuration management assures that we know the exact version of the testware and
the test object.
42. What is a V-Model?
A software development model that illustrates how testing activities integrate with software
development phases.
43. What is maintenance testing?
Triggered by modifications, migration or retirement of existing software
45. Can you explain the workbench concept?
In order to understand testing methodology we need to understand the workbench concept. A
Workbench is a way of documenting how a specific activity has to be performed. A workbench
is referred to as phases, steps, and tasks as shown in the following figure.

There are five tasks for every workbench:


Input: Every task needs some defined input and entrance criteria. So for every workbench we
need defined inputs. Input forms the first steps of the workbench.
Execute: This is the main task of the workbench which will transform the input into the expected
Output.
Check: Check steps assure that the output after execution meets the desired result.
Production output: If the check is right the production output forms the exit criteria of the
workbench.
Rework: During the check step if the output is not as desired then we need to again start from the
execute step.

46. Can you explain the concept of defect cascading?


Defect cascading is a defect which is caused by another defect. One defect triggers the other
defect. For instance, in the accounting application shown here there is a defect which leads to
negative taxation. So the negative taxation defect affects the ledger which in turn affects four
other modules.
47. Can you explain cohabiting software?
When we install the application at the end client it is very possible that on the same PC other
applications also exist. It is also very possible that those applications share common DLLs,
resources etc., with your application. There is a huge chance in such situations that your changes
can affect the cohabiting software. So the best practice is after you install your application or
after any changes, tell other application owners to run a test cycle on their application.
48. What are Test comparators?
Is it really a test if you put some inputs into some software, but never look to see whether the
software produces the correct result? The essence of testing is to check whether the software
produces the correct result, and to do that, we must compare what the software produces to what
it should produce. A test comparator helps to automate aspects of that [Link] is
responsible for document all the issues, problems and open point that were identified during the
review meeting
49. What is the difference between pilot and beta testing?
The difference between pilot and beta testing is that pilot testing is nothing but actually using the
product (limited to some users) and in beta testing we do not input real data, but it's installed at
the end customer to validate if the product can be used in production.
50. What is the role of moderator in review process?
The moderator (or review leader) leads the review process. He or she determines, in co-operation
with the author, the type of review, approach and the composition of the review team. The
moderator performs the entry check and the follow-up on the rework, in order to control the
quality of the input and output of the review process. The moderator also schedules the meeting,
disseminates documents before the meeting, coaches other team members, paces the meeting,
leads possible discussions and stores the data that is collected.
51. What is an equivalence partition (also known as an equivalence class)?
An input or output ranges of values such that only one value in the range becomes a test case.
52. Can you explain data-driven testing?
Normally an application has to be tested with multiple sets of data. For instance, a simple login
screen, depending on the user type, will give different rights. For example, if the user is an admin
he will have full rights, while a user will have limited rights and support if he only has read-only
support rights. In this scenario the testing steps are the same but with different user ids and
passwords. In data-driven testing, inputs to the system are read from data files such as Excel,
CSV (comma separated values), ODBC, etc. So the values are read from these sources and then
test steps are executed by automated testing.

53. When should configuration management procedures be implemented?


During test planning.
54. What are the different strategies for rollout to end users?
There are four major ways of rolling out any project:
Pilot : The actual production system is installed at a single or limited number of users. Pilot
basically means that the product is actually rolled out to limited users for real work.
Gradual Implementation : In this implementation we ship the entire product to the limited
users or all users at the customer end. Here, the developers get instant feedback from the
recipients which allow them to make changes before the product is available. But the downside is
that developers and testers maintain more than one version at one time.
Phased Implementation: In this implementation the product is rolled out to all users in
incrementally. That means each successive rollout has some added functionality. So as new
functionality comes in, new installations occur and the customer tests them progressively. The
benefit of this kind of rollout is that customers can start using the functionality and provide
valuable feedback progressively. The only issue here is that with each rollout and added
functionality the integration becomes more complicated.
Parallel Implementation : In these types of rollouts the existing application is run side by side
with the new application. If there are any issues with the new application we again move back to
the old application. One of the biggest problems with parallel implementation is we need extra
hardware, software, and resources.
55. What is the purpose of exit criteria?
The purpose of exit criteria is to define when a test level is completed.
56. What determines the level of risk?
The likelihood of an adverse event and the impact of the event determine the level of risk.
57. When is used Decision table testing?
Decision table testing is used for testing systems for which the specification takes the form of
rules or cause-effect combinations. In a decision table the inputs are listed in a column, with the
outputs in the same column but below the inputs. The remainder of the table explores
combinations of inputs to define the outputs produced.
58. Can you explain tailoring?
As the name suggests, tailoring is nothing but changing an action to achieve an objective
according to conditions. Whenever tailoring is done there should be adequate reasons for it.
Remember when a process is defined in an organization it should be followed properly. So even
if tailoring is applied the process is not bypassed or omitted.
59. What is Six Sigma?
Six Sigma is a statistical measure of variation in a process. We say a process has achieved Six
Sigma if the quality is 3.4 DPMO (Defect per Million Opportunities). It's a problem-solving
methodology that can be applied to a process to eliminate the root cause of defects and costs
associated with it.
60. What are the benefits of Independent Testing?
Independent testers are unbiased and identify different defects at the same time.
61. In a REACTIVE approach to testing when would you expect the bulk of the test design
work to be begun?
The bulk of the test design work begun after the software or system has been produced.
62. What's the difference between System testing and Acceptance testing?
Acceptance testing checks the system against the "Requirements." It is similar to System testing
in that the whole system is checked but the important difference is the change in focus:
System testing checks that the system that was specified has been delivered. Acceptance
testing checks that the system will deliver what was requested. The customer should always do
Acceptance testing and not the developer.
The customer knows what is required from the system to achieve value in the business and is the
only person qualified to make that judgement. This testing is more about ensuring that the
software is delivered as defined by the customer. It's like getting a green light from the customer
that the software meets expectations and is ready to be used.
63. Which of the following defines the expected results of a test?
Test case specification or test design specification.
Test case specification defines the expected results of a test.
64. What is the benefit of test independence?
It avoids author bias in defining effective tests.
65. As part of which test process do you determine the exit criteria?
The exit criteria is determined on the bases of ‘Test Planning’.
66. Rapid Application Development?
Rapid Application Development (RAD) is formally a parallel development of functions and
subsequent integration. Components/functions are developed in parallel as if they were mini
projects, the developments are time-boxed, delivered, and then assembled into a working
prototype. This can very quickly give the customer something to see and use and to provide
feedback regarding the delivery and their requirements. Rapid change and development of the
product is possible using this methodology. However the product specification will need to be
developed for the product at some point, and the project will need to be placed under more
formal controls prior to going into production.
67. What is the difference between Testing Techniques and Testing Tools?
Testing technique : Is a process for ensuring that some aspects of the application system or unit
functions properly there may be few techniques but many tools.
Testing Tools : Is a vehicle for performing a test process. The tool is a resource to the tester, but
itself is insufficient to conduct testing
68. Can you explain regression testing and confirmation testing?
Regression testing is used for regression defects. Regression defects are defects occur when the
functionality which was once working normally has stopped working. This is probably because
of changes made in the program or the environment. To uncover such kind of defect regression
testing is conducted.
The following figure shows the difference between regression and confirmation testing.

If we fix a defect in an existing application we use confirmation testing to test if the defect is
removed. It's very possible because of this defect or changes to the application that other sections
of the application are affected. So to ensure that no other section is affected we can use
regression testing to confirm this.
69. What are the different Methodologies in Agile Development Model?
There are currently seven different agile methodologies, they are :
1. Extreme Programming (XP)
2. Scrum
3. Lean Software Development
4. Feature-Driven Development
5. Agile Unified Process
6. Crystal
7. Dynamic Systems Development Model (DSDM)
70. Which activity in the fundamental test process includes evaluation of the testability of
the requirements and system?
A ‘Test Analysis’ and ‘Design’ includes evaluation of the testability of the requirements and
system.
71. What is typically the MOST important reason to use risk to drive testing efforts?
Because testing everything is not feasible.
72. Consider the following techniques. Which are static and which are dynamic
techniques?
1. Equivalence Partitioning.
2. Use Case Testing.
3. Data Flow Analysis.
4. Exploratory Testing.
5. Decision Testing.
6. Inspections.
Data Flow Analysis and Inspections are static; Equivalence Partitioning, Use Case Testing,
Exploratory Testing and Decision Testing are dynamic.
73. Can you explain requirement traceability and its importance?
In most organizations testing only starts after the execution/coding phase of the project. But if
the organization wants to really benefit from testing, then testers should get involved right from
the requirement [Link] the tester gets involved right from the requirement phase then
requirement traceability is one of the important reports that can detail what kind of test coverage
the test cases have.
74. Why are static testing and dynamic testing described as complementary?
Because they share the aim of identifying defects but differ in the types of defect they find.
75. What are the phases of a formal review?
In contrast to informal reviews, formal reviews follow a formal process. A typical formal review
process consists of six main steps:
1. Planning
2. Kick-off
3. Preparation
4. Review meeting
5. Rework
6. Follow-up.
76. What are the Structure-based (white-box) testing techniques?
Structure-based testing techniques (which are also dynamic rather than static) use the internal
structure of the software to derive test cases. They are commonly called 'white-box' or 'glass-box'
techniques (implying you can see into the system) since they require knowledge of how the
software is implemented, that is, how it works. For example, a structural technique may be
concerned with exercising loops in the software. Different test cases may be derived to exercise
the loop once, twice, and many times. This may be done regardless of the functionality of the
software.
77. When “Regression Testing” should be performed?
After the software has changed or when the environment has changed Regression testing should
be performed.
78. What is negative and positive testing?
A negative test is when you put in an invalid input and receives errors. While a positive testing,
is when you put in a valid input and expect some action to be completed in accordance with the
specification.
79. What is the purpose of a test completion criterion?
The purpose of test completion criterion is to determine when to stop testing
80. What can static analysis NOT find?
For example memory leaks.
81. What is the difference between re-testing and regression testing?
Re-testing ensures the original fault has been removed; regression testing looks for unexpected
side effects.
82. What is the one Key reason why developers have difficulty testing their own work?
Lack of Objectivity
83. “How much testing is enough?”
The answer depends on the risk for your industry, contract and special requirements.
84. Why does the boundary value analysis provide good test cases?
Because errors are frequently made during programming of the different cases near the ‘edges’
of the range of values.
85. What makes an inspection different from other review types?
It is led by a trained leader, uses formal entry and exit criteria and checklists.
86. What are the different kinds of variations used in Six Sigma?
Variation is the basis of Six Sigma. It defines how many changes are happening in the output of
a process. So if a process is improved then this should reduce variations. In Six Sigma we
identify variations in the process, control them, and reduce or eliminate defects.
87. What is test coverage?
Test coverage measures in some specific way the amount of testing performed by a set of tests
(derived in some other way, e.g. using specification-based techniques). Wherever we can count
things and can tell whether or not each of those things has been tested by some test, then we can
measure coverage.
88. Why is incremental integration preferred over “big bang” integration?
Because incremental integration has better early defects screening and isolation ability
89. When do we prepare RTM (Requirement traceability matrix), is it before test case
designing or after test case designing?
It would be before test case designing. Requirements should already be traceable from Review
activities since you should have traceability in the Test Plan already. This question also would
depend on the organisation. If the organisations do test after development started then
requirements must be already traceable to their source. To make life simpler use a tool to manage
requirements.
90. What is called the process starting with the terminal modules?
Bottom-up integration
91. Explain Unit Testing, Integration Tests, System Testing and Acceptance Testing?
Unit testing : Testing performed on a single, stand-alone module or unit of code.
Integration Tests : Testing performed on groups of modules to ensure that data and control are
passed properly between modules.
System testing : Testing a predetermined combination of tests that, when executed
successfully meets requirements.
Acceptance testing : Testing to ensure that the system meets the needs of the organization and
the end user or customer (i.e. validates that the right system was built).
92. How would you estimate the amount of re-testing likely to be required?
Metrics from previous similar projects and discussions with the development [Link] testing
a grade calculation system, a tester determines that all scores from 90 to 100 will yield a grade of
A, but scores below 90 will not. This analysis is known as:
Equivalence partitioning:
A test manager wants to use the resources available for the automated testing of a web
application. The best choice is Tester, test automater, web specialist, DBA
93. During the testing of a module tester ‘X’ finds a bug and assigned it to developer. But
developer rejects the same, saying that it’s not a bug. What ‘X’ should do?
Send to the detailed information of the bug encountered and check the reproducibility
94. Does an increase in testing always improve the project?
No an increase in testing does not always mean improvement of the product, company, or
project. In real test scenarios only 20% of test plans are critical from a business angle. Running
those critical test plans will assure that the testing is properly done. The following graph explains
the impact of under testing and over testing. If you under test a system the number of defects will
increase, but if you over test a system your cost of testing will increase. Even if your defects
come down your cost of testing has gone up.
95. Which test cases are written first: white boxes or black boxes?
Normally black box test cases are written first and white box test cases later. In order to write
black box test cases we need the requirement document and, design or project plan. All 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 [Link] box test cases do not require system understanding but white box
testing needs more structural understanding. And structural understanding is clearer i00n the
later part of project, i.e., while executing or designing. For black box testing you need to only
analyze from the functional perspective which is easily available from a simple requirement
document.
A type of integration testing in which software elements, hardware elements, or both are
combined all at once into a component or an overall system, rather than in stages.
Big-Bang Testing
Which technique can be used to achieve input and output coverage? It can be applied to human
input, input via interfaces to a system, or interface parameters in integration testing.
Equivalence partitioning
Conditions, test cases or test scripts. This does not mean that other, more formal testing
techniques will not be used. For example, the tester may decide to use boundary value analysis
but will think through and test the most important boundary values without necessarily writing
them down. Some notes will be written during the exploratory-testing session, so that a report
can be produced afterwards.
96. What is “use case testing”?
In order to identify and execute the functional requirement of an application from end to finish
“use case” is used and the techniques used to do this is known as “Use Case Testing”
97. What is the difference between STLC ( Software Testing Life Cycle) and SDLC
( Software Development Life Cycle) ?
The complete Verification and Validation of software is done in SDLC, while STLC only does
Validation of the system. SDLC is a part of STLC.
98. Describe software review and formal technical review (FTR).
Software reviews works as a filter for the software process. It helps to uncover errors and defects
in software. Software reviews enhance the quality of software. Software reviews refine software,
including requirements and design models, code, and testing data.
A formal technical review (FTR) is a software quality control activity. In this activity, software
developer and other team members are involved. The objectives of an FTR are:
1. Uncover the errors.
2. Verify that the software under technical review meets its requirements.
3. To ensure that the software must follow the predefined standards.
4. To make projects more manageable.
The FTR includes walkthroughs and [Link] FTR is conducted as a normal meeting.
FTR will be successful only if it is properly planned, and executed.
99. What are the attributes of good test case?
The following are the attributes of good test case.
A good test has a high probability of finding an error. To find the maximum error, the tester and
developer should have complete understanding of the software and attempt to check all the
conditions that how the software might fail.
A good test is not redundant. Every test should have a different purpose from other, otherwise
tester will repeat the testing process for same condition.
A good test should be neither too simple nor too complex. In general, each test should be
executed separately. If we combine more than one test into one test case, it might be very
difficult to execute. Sometimes we can combine tests but it may hide some errors.
100. Describe cyclomatic complexity with example.
Cyclomatic complexity is a software metric that measure the logical strength of the program. It
was developed by Thomas J. McCabe. Cyclomatic complexity is calculated by using the control
flow graph of the program. In the flow graph, nodes are represented by circle. Areas bounded by
edges and nodes are called regions. When counting regions, we also include the area outside the
graph as a region.
SECTION-5 .NET INTERVIEW QUESTIONS
[Link] is .NET?
NET is an integral part of many applications running on Windows and provides common
functionality for those applications to run. This download is for people who need .NET to run an
application on their computer. For developers, the .NET Framework provides a comprehensive
and consistent programming model for building applications that have visually stunning user
experiences and seamless and secure communication.
[Link] many languages .NET is supporting now?
When .NET was introduced it came with several languages.
[Link],
C#,
COBOL
and
Perl, etc.
3. What is an IL?
Intermediate Language is also known as MSIL (Microsoft Intermediate Language) or CIL
(Common Intermediate Language). All .NET source code is compiled to IL. IL is then converted
to machine code at the point where the software is installed, or at run-time by a Just-In-Time
(JIT) compiler.
4. What is code access security (CAS)?
Code access security (CAS) is part of the .NET security model that prevents unauthorized access
of resources and operations, and restricts the code to perform particular tasks.
5. What is Difference between NameSpace and Assembly?
Assembly is physical grouping of logical units, Namespace, logically groups classes.
Namespace can span multiple assembly.
6. Mention the execution process for managed code.
A)Choosing a language compiler
B) Compiling the code to MSIL
C) Compiling MSIL to native code
D) Executing the code.
7. What is Microsoft Intermediate Language (MSIL)?
The .NET Framework is shipped with compilers of all .NET programming languages to develop
programs. There are separate compilers for the Visual Basic, C#, and Visual C++ programming
languages in .NET Framework. Each .NET compiler produces an intermediate code after
compiling the source code. The intermediate code is common for all languages and is
understandable only to .NET environment. This intermediate code is known as MSIL.
8. What is managed extensibility framework?
Managed extensibility framework (MEF) is a new library that is introduced as a part of .NET 4.0
and Silverlight 4. It helps in extending your application by providing greater reuse of
applications and components. MEF provides a way for host application to consume external
extensions without any configuration requirement.
9. Which method do you use to enforce garbage collection in .NET?
The [Link]() method.
10. What is the difference between int and int32.
There is no difference between int and int32. System.Int32 is a .NET Class and int is an alias
name for System.Int32.
11. What are tuples?
Tuple is a fixed-size collection that can have elements of either same or different data types.
Similar to arrays, a user must have to specify the size of a tuple at the time of declaration. Tuples
are allowed to hold up from 1 to 8 elements and if there are more than 8 elements, then the 8th
element can be defined as another tuple. Tuples can be specified as parameter or return type of a
method.
12. What is the full form of ADO?
The full form of ADO is ActiveX Data Object.
13. What are the two fundamental objects in [Link]?
DataReader and DataSet are the two fundamental objects in [Link].
14. What is the meaning of object pooling?
Object pooling is a concept of storing a pool (group) of objects in memory that can be reused
later as needed. Whenever, a new object is required to create, an object from the pool can be
allocated for this request; thereby, minimizing the object creation. A pool can also refer to a
group of connections and threads. Pooling, therefore, helps in minimizing the use of system
resources, improves system scalability, and performance.
15. Mention the namespace that is used to include .NET Data Provider for SQL server
in .NET code.
The [Link] namespace.
16. Which architecture does Datasets follow?
Datasets follow the disconnected data architecture.
17. What is the role of the DataSet object in [Link]?
One of the major component of [Link] is the DataSet object, which always remains
disconnected from the database and reduces the load on the database.

18. Which property is used to check whether a DataReader is closed or opened?


The IsClosed property is used to check whether a DataReader is closed or opened. This property
returns a true value if a Data Reader is closed, otherwise a false value is returned.
19. Name the method that needs to be invoked on the DataAdapter control to fill the
generated DataSet with data?
The Fill() method is used to fill the dataset with data.
20. What are the pre-requisites for connection pooling?
There must be multiple processes to share the same connection describing the same parameters
and security settings. The connection string must be identical.
21. Which adapter should you use, if you want to get the data from an Access database?
OleDbDataAdapter is used to get the data from an Access database.
22. What are different types of authentication techniques that are used in connection
strings to connect .NET applications with Microsoft SQL Server?
The Windows Authentication option
The SQL Server Authentication option
23. What are the parameters that control most of connection pooling behaviors?
Connect Timeout
Max Pool Size
Min Pool Size
Pooling
24. What is AutoPostBack?
If you want a control to postback automatically when an event is raised, you need to set the
AutoPostBack property of the control to True.
25. What is the function of the ViewState property?
The [Link] 4.0 introduced a new property called ViewStateMode for the Control class. Now
you can enable the view state to an individual control even if the view state for an [Link]
page is disabled.
26. Which properties are used to bind a DataGridView control?
The DataSource property and the DataMember property are used to bind a DataGridView
control.

27. What is the basic difference between ASP and [Link]?


The basic difference between ASP and [Link] is that ASP is interpreted; whereas, [Link]
is compiled. This implies that since ASP uses VBScript; therefore, when an ASP page is
executed, it is interpreted. On the other hand, [Link] uses .NET languages, such as C# and
[Link], which are compiled to Microsoft Intermediate Language (MSIL).
28. In which event are the controls fully loaded?
Page load event guarantees that all controls are fully loaded. Controls are also accessed in
Page_Init events but you will see that view state is not fully loaded during this event
29. How can we identify that the Page is Post Back?
Page object has an "IsPostBack" property, which can be checked to know that is the page posted
back.
30. Which is the parent class of the Web server control?
The [Link] class is the parent class for all Web server controls.
31. What are the advantages of the code-behind feature?
i)Makes code easy to understand and debug by separating application logic from HTML tags
ii)Provides the isolation of effort between graphic designers and software engineers
iii)Removes the problems of browser incompatibility by providing code files to exist on the Web
server and supporting Web pages to be compiled on demand.
32. Define a multilingual Web site.
A multilingual Web site serves content in a number of languages. It contains multiple copies for
its content and other resources, such as date and time, in different languages.
33. What is IIS? Why is it used?
Internet Information Services (IIS) is created by Microsoft to provide Internet-based services to
[Link] Web applications. It makes your computer to work as a Web server and provides the
functionality to develop and deploy Web applications on the server. IIS handles the request and
response cycle on the Web server. It also offers the services of SMTP and FrontPage server
extensions. The SMTP is used to send emails and use FrontPage server extensions to get the
dynamic features of IIS, such as form handler.
34. How can you register a custom server control to a Web page?
You can register a custom server control to a Web page using the @Register directive.

35. Which [Link] objects encapsulate the state of the client and the browser?
The Session object encapsulates the state of the client and browser.
36. Differentiate globalization and localization.
The globalization is a technique to identify the specific part of a Web application that is different
for different languages and make separate that portion from the core of the Web application. The
localization is a procedure of configuring a Web application to be supported for a specific
language or locale.
37. What is ViewState?
The ViewState is a feature used by [Link] Web page to store the value of a page and its
controls just before posting the page. Once the page is posted, the first task by the page
processing is to restore the ViewState to get the values of the controls.
38. Which method is used to force all the validation controls to run?
The [Link]() method is used to force all the validation controls to run and to perform
validation.
39. What does the Orientation property do in a Menu control?
Orientation property of the Menu control sets the horizontal or vertical display of a menu on a
Web page. By default, the orientation is vertical.
40. Differentiate between client-side and server-side validations in Web pages.
Client-side validations take place at the client end with the help of JavaScript and VBScript
before the Web page is sent to the server. On the other hand, server-side validations take place at
the server end.
41. What is garbage collection?
Garbage collection is a heap-management strategy where a run-time component takes
responsibility for managing the lifetime of the memory used by objects. This concept is not new
to .NET - Java and many other languages/runtimes have used garbage collection for some time.
42. What is serialization?
Serialization is the process of converting an object into a stream of [Link] is the
opposite process, i.e. creating an object from a stream of bytes. Serialization/Deserialization is
mostly used to transport objects (e.g. during remoting), or to persist objects (e.g. to a file or
database).

43. Where do you add an event handler?


It's the Attributesproperty, the Add function inside that property.
[Link]("onMouseOver","someClientCode();")
44. What do you mean by authentication and authorization?
Authentication is the process of validating a user on the credentials(username and password) and
authorization performs after authentication. After Authentication a user will be verified for
performing the various tasks, It access is limited it is known as authorization.
45. What is portable executable (PE) ?
The file format used for executable programs and for files to be linked together to form
executable programs
46. Differences between DLL and EXE?
.exe
[Link] are outbound file.
[Link] one .exe file exists per application.
3..Exe cannot be shared with other applications.
.dll
[Link] are inbound file .
[Link] .dll files may exists in one application.
3. .dll can be shared with other applications.
47. What is shadowing?
Shadowing is either through scope or through inheritance. Shadowing through inheritance is
hiding a method of a base class and providing a new implementation for the same. This is the
default when a derived class writes an implementation of a method of base class which is not
declared as overridden in the base class. This also serves the purpose of protecting an
implementation of a new method against subsequent addition of a method with the same name in
the base class.’shadows’ keyword is recommended although not necessary since it is the default.
48. What is Method Overriding? How to override a function in C#?
An override method provides a new implementation of a member inherited from a base class.
The method overridden by an override declaration is known as the overridden base method. The
overridden base method must have the same signature as the override method.
Use the override modifier to modify a method, a property, an indexer, or an event. You cannot
override a non-virtual or static method. The overridden base method must be virtual, abstract, or
override.
49. Differences between [Link] and [Link]?
Clone - Copies the structure of the DataSet, including all DataTable schemas, relations, and
constraints. Does not copy any data.
Copy - Copies both the structure and data for this DataSet.
50. What is the managed and unmanaged code in .net?
The .NET Framework provides a run-time environment called the Common Language Runtime,
which manages the execution of code and provides services that make the development process
easier. Compilers and tools expose the runtime's functionality and enable you to write code that
benefits from this managed execution environment. Code that you develop with a language
compiler that targets the runtime is called managed code; it benefits from features such as cross-
language integration, cross-language exception handling, enhanced security, versioning and
deployment support, a simplified model for component interaction, and debugging and profiling
services.
51. Whats an assembly?
Assemblies are the building blocks of .NET Framework applications; they form the fundamental
unit of deployment, version control, reuse, activation scoping, and security permissions. An
assembly is a collection of types and resources that are built to work together and form a logical
unit of functionality. An assembly provides the common language runtime with the information
it needs to be aware of type implementations. To the runtime, a type does not exist outside the
context of an assembly.
52. How do you create a permanent cookie?
Setting the Expires property to MinValue means that the Cookie never expires.
53. What’s a Windows process in .NET?
Windows process is an application that’s running and had been allocated memory in .NET
54. What is Delegation in .NET?
A delegate acts like a strongly type function pointer. Delegates can invoke the methods that they
reference without making explicit calls to those methods.
Delegate is an entity that is entrusted with the task of representation, assign or passing on
information. In code sense, it means a Delegate is entrusted with a Method to report information
back to it when a certain task (which the Method expects) is accomplished outside the Method's
class.
55. What is Serialization in .NET?
The serialization is the process of converting the objects into stream of bytes.
they or used for transport the objects(via remoting) and persist objects(via files and databases)
56. Difference between Class And Interface in .NET?
Class is logical representation of object. It is collection of data and related sub procedures with
definition.
Interface is also a class containing methods which is not having any definitions.
Class does not support multiple inheritance. But interface can support
57. Can any object be stored in a Viewstate in .NET?
An object that either is serializable or has a TypeConverter defined for it can be persisted in
ViewState.
58 What is the use of ErrorProvider Control in .NET?
The ErrorProvider control is used to indicate invalid data on a data entry form. Using this
control, you can attach error messages that display next to the control when the data is invalid, as
seen in the following image. A red circle with an exclamation point blinks, and when the user
mouses over the icon, the error message is displayed as a tooltip.
59. How do you validate the controls in an ASP .NET page?
Using special validation controls that are meant for validation of any controle.
We have Range Validator, Email Validator in .NET to validate any control.
60. How to manage pagination in a page using .NET?
Using pagination option in DataGrid control is available in .NET. We have to set the number of
records for a page, then it takes care of pagination by itself automatically
SECTION-6 DBMS INTERVIEW QUESTIONS
1. What is database?
A database is a collection of information that is organized. So that it can easily be accessed,
managed, and updated.
2. What is DBMS?
DBMS stands for Database Management System. It is a collection of programs that enables user
to create and maintain a database.
3. What is a Database system?
The database and DBMS software together is called as Database system.
4. What are the advantages of DBMS?
I. Redundancy is controlled.
II. Providing multiple user interfaces.
III. Providing backup and recovery
IV. Unauthorized access is restricted.
V. Enforcing integrity constraints.
5. What is normalization?
It is a process of analysing the given relation schemas based on their Functional Dependencies
(FDs) and primary key to achieve the properties
(1).Minimizing redundancy, (2). Minimizing insertion, deletion and update anomalies.
6. What is Data Model?
A collection of conceptual tools for describing data, data relationships data semantics and
constraints.
7. What is E-R model?
This data model is based on real world that consists of basic objects called entities and of
relationship among these objects. Entities are described in a database by a set of attributes.
8. What is Object Oriented model?
This model is based on collection of objects. An object contains values stored in instance
variables with in the object. An object also contains bodies of code that operate on the object.
These bodies of code are called methods. Objects that contain same types of values and the same
methods are grouped together into classes.
9. What is an Entity?
An entity is a thing or object of importance about which data must be captured.
10. What is DDL (Data Definition Language)?
A data base schema is specifies by a set of definitions expressed by a special language called
DDL.

11. What is DML (Data Manipulation Language)?


This language that enable user to access or manipulate data as organised by appropriate data
model. Procedural DML or Low level: DML requires a user to specify what data are needed and
how to get those data. Non-Procedural DML or High level: DML requires a user to specify what
data are needed without specifying how to get those data
12. What is DML Compiler?
It translates DML statements in a query language into low-level instruction that the query
evaluation engine can understand.
13. What is Query evaluation engine?
It executes low-level instruction generated by compiler.
14. What is Functional Dependency?
Functional Dependency is the starting point of normalization. Functional Dependency exists
when a relation between two attributes allows you to uniquely determine the corresponding
attribute’s value.
15. What is 1 NF (Normal Form)?
The first normal form or 1NF is the first and the simplest type of normalization that can be
implemented in a database. The main aims of 1NF are to:
1. Eliminate duplicative columns from the same table.
2. Create separate tables for each group of related data and identify each row with a unique
column (the primary key).
16. What is Fully Functional dependency?
A functional dependency X Y is full functional dependency if removal of any attribute A from X
means that the dependency does not hold any more.
17. What is 2NF?
A relation schema R is in 2NF if it is in 1NF and every non-prime attribute A in R is fully
functionally dependent on primary key.
18. What is 3NF?
A relation is in third normal form if it is in Second Normal Form and there are no functional
(transitive) dependencies between two (or more) non-primary key attributes.
19. What is BCNF (Boyce-Codd Normal Form)?
A table is in Boyce-Codd normal form (BCNF) if and only if it is in 3NF and every determinant
is a candidate key.
20. What is 4NF?
Fourth normal form requires that a table be BCNF and contain no multi-valued dependencies.
21. What is 5NF?
A table is in fifth normal form (5NF) or Project-Join Normal Form (PJNF) if it is in 4NF and it
cannot have a lossless decomposition into any number of smaller tables.
22. What is a query?
A query with respect to DBMS relates to user commands that are used to interact with a data
base.
23. What is meant by query optimization?
The phase that identifies an efficient execution plan for evaluating a query that has the least
estimated cost is referred to as query optimization.
24. What is an attribute?
It is a particular property, which describes the entity.
25. What is RDBMS?
Relational Data Base Management Systems (RDBMS) are database management systems that
maintain data records and indices in tables.
26. What’s difference between DBMS and RDBMS?
DBMS provides a systematic and organized way of storing, managing and retrieving from
collection of logically related information. RDBMS also provides what DBMS provides but
above that it provides relationship integrity.
27. What is SQL?
SQL stands for Structured Query Language. SQL is an ANSI (American National Standards
Institute) standard computer language for accessing and manipulating database systems. SQL
statements are used to retrieve and update data in a database.
28. What is Stored Procedure?
A stored procedure is a named group of SQL statements that have been previously created and
stored in the server database.
29. What is a view?
A view may be a subset of the database or it may contain virtual data that is derived from the
database files but is not explicitly stored.

30. What is Trigger?


A trigger is a SQL procedure that initiates an action when an event (INSERT, DELETE or
UPDATE) occurs.
31. What is Index?
An index is a physical structure containing pointers to the data.
32. What is extension and intension?
Extension -It is the number of tuples present in a table at any instance. This is time dependent.
Intension -It is a constant value that gives the name, structure of table and the constraints laid on
it.
33. What do you mean by atomicity and aggregation?
Atomicity-Atomicity states that database modifications must follow an “all or nothing” rule.
Each transaction is said to be “atomic.” If one part of the transaction fails, the entire transaction
fails.
Aggregation - A feature of the entity relationship model that allows a relationship set to
participate in another relationship set. This is indicated on an ER diagram by drawing a dashed
box around the aggregation.
34. What is RDBMS KERNEL?
Two important pieces of RDBMS architecture are the kernel, which is the software, and the data
dictionary, which consists of the system- level data structures used by the kernel to manage the
database.
35. Name the sub-systems of a RDBMS?
I/O, Security, Language Processing, Process Control, Storage Management, Logging and
Recovery, Distribution Control, Transaction Control, Memory Management, Lock Management.
36. How do you communicate with an RDBMS?
You communicate with an RDBMS using Structured Query Language (SQL)
37. Disadvantage in File Processing System?
· Data redundancy & inconsistency.
· Difficult in accessing data.
· Data isolation.
· Data integrity.
· Concurrent access is not possible.
· Security Problems.
38. What is VDL (View Definition Language)?
It specifies user views and their mappings to the conceptual schema.
39. What is SDL (Storage Definition Language)?
This language is to specify the internal schema. This language may Specify the mapping between
two schemas.
40. Describe concurrency control?
Concurrency control is the process managing simultaneous operations against a database so that
database integrity is no compromised. There are two approaches to concurrency control.
The pessimistic approach involves locking and the optimistic approach involves versioning.
41. Describe the difference between homogeneous and heterogeneous distributed
database?
A homogenous database is one that uses the same DBMS at each node. A heterogeneous
database is one that may have a different DBMS at each node.
42. What is a distributed database?
A distributed database is a single logical database that is spread across more than one node or
locations that are all connected via some communication link.
43. Explain the difference between two and three-tier architectures?
Three-tier architecture includes a client and two server layers.
The application code is stored on the application server and the database is stored on the
database server. A two-tier architecture includes a client and one server layer. The database is
stored on the database server.
44. Briefly describe the three types of SQL commands?
Data definition language commands are used to create, alter, and drop tables. Data manipulation
commands are used to insert, modify, update, and query data in the database. Data control
language commands help the DBA to control the database.
45. List some of the properties of a relation?
Relations in a database have a unique name and no multivalued attributes exist. Each row is
unique and each attribute within a relation has a unique name. The sequence of both columns and
rows is irrelevant.
46. Explain the differences between an intranet and an extranet?
An Internet database is accessible by everyone who has access to a Web site. An intranet
database limits access to only people within a given organization.
47. What is SQL Deadlock?
Deadlock is a unique situation in a multi user system that causes two or more users to wait
indefinitely for a locked resource.
48. What is a Catalog?
A catalog is a table that contains the information such as structure of each file, the type and
storage format of each data item and various constraints on the data .The information stored in
the catalog is called Metadata.
49. What is data ware housing & OLAP?
Data warehousing and OLAP (online analytical processing) systems are the techniques used in
many companies to extract and analyze useful information from very large databases for
decision making .
50. Describe the three levels of data abstraction?
Physical level: The lowest level of abstraction describes how data are stored.
Logical level: The next higher level of abstraction, describes what data are stored in database and
what relationship among those data.
View level: The highest level of abstraction describes only part of entire database.
51. What is Data Independence?
Data independence means that the application is independent of the storage structure and access
strategy of data.
52. How many types of relationship exist in database designing?
There are three major relationship models:-
One-to-one
One-to-many
Many-to-many
53. What is order by clause?
ORDER BY clause helps to sort the data in either ascending order to descending
54. What is the use of DBCC commands?
DBCC stands for database consistency checker. We use these commands to check the
consistency of the databases, i.e., maintenance, validation task and status checks.
55. What is Collation?
Collation refers to a set of rules that determine how data is sorted and compared.
56. What is difference between DELETE & TRUNCATE commands?
Delete command removes the rows from a table based on the condition that we provide with a
WHERE clause. Truncate will actually remove all the rows from a table and there will be no data
in the table after we run the truncate command.
57. What is Hashing technique?
This is a primary file organization technique that provides very fast access to records on certain
search conditions.
58. What is a transaction?
A transaction is a logical unit of database processing that includes one or more database access
operations.
59. What are the different phases of Transaction?
Analysis phase
Redo phase
Undo phase
60. What is “transparent dbms”?
It is one, which keeps its physical structure hidden from user.
61. What are the primitive operations common to all record management System?
Addition, deletion and modification.
62. Explain the differences between structured data and unstructured data.
Structured data are facts concerning objects and events. The most important structured data are
numeric, character, and dates.
Structured data are stored in tabular form. Unstructured data are multimedia data such as
documents, photographs, maps, images, sound, and video clips. Unstructured data are most
commonly found on Web servers and Web-enabled databases.
63. What are the major functions of the database administrator?
Managing database structure, controlling concurrent processing, managing processing rights and
responsibilities, developing database security, providing for database recovery, managing the
DBMS and maintaining the data repository.
64. What is a dependency graph?
A dependency graph is a diagram that is used to portray the connections between database
elements.
65. Explain the difference between an exclusive lock and a shared lock?
An exclusive lock prohibits other users from reading the locked resource; a shared lock allows
other users to read the locked resource, but they cannot update it.
66. Explain the "paradigm mismatch" between SQL and application programming
languages.
SQL statements return a set of rows, while an application program works on one row at a time.
To resolve this mismatch the results of SQL statements are processed as pseudofiles, using a
cursor or pointer to specify which row is being processed.
67. Name four applications for triggers.
(1)Providing default values, (2) enforcing data constraints,
(3) Updating views and (4) enforcing referential integrity
68. What are the advantages of using stored procedures?
The advantages of stored procedures are (1) greater security, (2) decreased network traffic, (3)
the fact that SQL can be optimized and (4) code sharing which leads to less work, standardized
processing, and specialization among developers.
69. Explain the difference between attributes and identifiers.
Entities have attributes. Attributes are properties that describe the entity's characteristics. Entity
instances have identifiers. Identifiers are attributes that name, or identify, entity instances.
70. What is Enterprise Resource Planning (ERP), and what kind of a database is used in an
ERP application?
Enterprise Resource Planning (ERP) is an information system used in manufacturing companies
and includes sales, inventory, production planning, purchasing and other business functions. An
ERP system typically uses a multiuser database.

71. Describe the difference between embedded and dynamic SQL?


Embedded SQL is the process of including hard coded SQL statements. These statements do not
change unless the source code is modified. Dynamic SQL is the process of generating SQL on
the [Link] statements generated do not have to be the same each time.
72. Explain a join between tables
A join allows tables to be linked to other tables when a relationship between the tables exists.
The relationships are established by using a common column in the tables and often uses the
primary/foreign key relationship.
73. Describe a subquery.
A subquery is a query that is composed of two queries. The first query (inner query) is within the
WHERE clause of the other query (outer query).
74. Compare a hierarchical and network database model?
The hierarchical model is a top-down structure where each parent may have many children but
each child can have only one parent. This model supports one-to-one and one-to-many
relationships.
The network model can be much more flexible than the hierarchical model since each parent can
have multiple children but each child can also have multiple parents. This model supports one-
to-one, one-to-many, and many-to-many relationships.
75. Explain the difference between a dynamic and materialized view.
A dynamic view may be created every time that a specific view is requested by a user. A
materialized view is created and or updated infrequently and it must be synchronized with its
associated base table(s).
76. Explain what needs to happen to convert a relation to third normal form.
First you must verify that a relation is in both first normal form and second normal form. If the
relation is not, you must convert into second normal form. After a relation is in second normal
form, you must remove all transitive dependencies.
77. Describe the four types of indexes?
A unique primary index is unique and is used to find and store a row. A nonunique primary
index is not unique and is used to find a row but also where to store a row (based on its unique
primary index). A unique secondary index is unique for each row and used to find table rows. A
nonunique secondary index is not unique and used to find table rows.

78. Explain minimum and maximum cardinality?


Minimum cardinality is the minimum number of instances of an entity that can be associated
with each instance of another entity. Maximum cardinality is the maximum number of instances
of an entity that can be associated with each instance of another entity.
79. What is deadlock? How can it be avoided? How can it be resolved once it occurs?
Deadlock occurs when two transactions are each waiting on a resource that the other transaction
holds. Deadlock can be prevented by requiring transactions to acquire all locks at the same time;
once it occurs, the only way to cure it is to abort one of the transactions and back out of partially
completed work.
80. Explain what we mean by an ACID transaction.
An ACID transaction is one that is atomic, consistent, isolated, and durable. Durable means that
database changes are permanent. Consistency can mean either statement level or transaction
level consistency. With transaction level consistency, a transaction may not see its own
[Link] means it is performed as a unit.
81. Under what conditions should indexes be used?
Indexes can be created to enforce uniqueness, to facilitate sorting, and to enable fast retrieval by
column values. A good candidate for an index is a column that is frequently used with equal
conditions in WHERE clauses.
82. What is difference between SQL and SQL SERVER?
SQL is a language that provides an interface to RDBMS, developed by IBM. SQL SERVER is a
RDBMS just like Oracle, DB2.
83. What is Specialization?
It is the process of defining a set of subclasses of an entity type where each subclass contain all
the attributes and relationships of the parent entity and may have additional attributes and
relationships which are specific to itself.
84. What is generalization?
It is the process of finding common attributes and relations of a number of entities and defining a
common super class for them.
85. What is meant by Proactive, Retroactive and Simultaneous Update?
Proactive Update: The updates that are applied to database before it becomes effective in real
world.
Retroactive Update: The updates that are applied to database after it becomes effective in real
world.
Simultaneous Update: The updates that are applied to database at the same time when it becomes
effective in real world.
86. What is RAID Technology?
Redundant array of inexpensive (or independent) disks. The main goal of raid technology is to
even out the widely different rates of performance improvement of disks against those in
memory and microprocessor. Raid technology employs the technique of data striping to achieve
higher transfer rates.
87. What are serial, non serial schedule?
A schedule S is serial if, for every transaction T participating in the schedule, all the operations
of T is executed consecutively in the schedule, otherwise, the schedule is called non-serial
schedule.
88. What are conflict serializable schedules?
A schedule S of n transactions is serializable if it is equivalent to some serial schedule of the
same n transactions.
89. What is view serializable?
A schedule is said to be view serializable if it is view equivalent with some serial schedule.
90. What is a foreign key?
A key of a relation schema is called as a foreign key if it is the primary key of
some other relation to which it is related to.
91. What are the disadvantages of using a dbms?
1) High initial investments in h/w, s/w, and training.
2) Generality that a DBMS provides for defining and processing data.
3) Overhead for providing security, concurrency control, recovery, and integrity functions.
92. What is Lossless join property?
It guarantees that the spurious tuple generation does not occur with respect to relation schemas
after decomposition.
93. What is a Phantom Deadlock?
In distributed deadlock detection, the delay in propagating local information might cause the
deadlock detection algorithms to identify deadlocks that do not really exist. Such situations are
called phantom deadlocks and they lead to unnecessary aborts.
94. What is a checkpoint and When does it occur?
A Checkpoint is like a snapshot of the DBMS state. By taking checkpoints, the DBMS can
reduce the amount of work to be done during restart in the event of subsequent crashes.
95. What is schema?
The description of a data base is called the database schema , which is specified during database
design and is not expected to change frequently . A displayed schema is called schema
diagram .We call each object in the schema as schema construct.
SECTION-7 NETWORKING INTERVIEW QUESTIONS
1. Define Network?
A network is a set of devices connected by physical media links. A network is recursively is a
connection of two or more nodes by a physical link or two or more networks connected by one or
more nodes.
2. What is Protocol?
A protocol is a set of rules that govern all aspects of information communication.
3. What is a Link?
At the lowest level, a network can consist of two or more computers directly connected by some
physical medium such as coaxial cable or optical fiber. Such a physical medium is called as
Link.
4. What is a node?
A network can consist of two or more computers directly connected by some physical medium
such as coaxial cable or optical fiber. Such a physical medium is called as Links and the
computer it connects is called as Nodes.
5. What is a gateway or Router?
A node that is connected to two or more networks is commonly called as router or Gateway. It
generally forwards message from one network to another.
6. Name the factors that affect the performance of the network?
[Link] of Users
b. Type of transmission medium
c. Hardware
d. Software

7. What is Round Trip Time?


The duration of time it takes to send a message from one end of a network to the other and back,
is called RTT.
8. List the layers of OSI
a. Physical Layer
b. Data Link Layer
c. Network Layer
d. Transport Layer
e. Session Layer
f. Presentation Layer
g. Application Layer
9. Which layers are network support layers?
a. Physical Layer
b. Data link Layer and
c. Network Layers
10. Which layers are user support layers?
a. Session Layer
b. Presentation Layer and
c. Application Layer
11. What is Pipelining ?
In networking and in other areas, a task is often begun before the previous task has ended. This is
known as pipelining.
12. What is Piggy Backing?
A technique called piggybacking is used to improve the efficiency of the bidirectional protocols.
When a frame is carrying data from A to B, it can also carry control information about arrived
(or lost) frames from B; when a frame is carrying data from B to A, it can also carry control
information about the arrived (or lost) frames from A.
13. What are the two types of transmission technology available?
(i) Broadcast and (ii) point-to-point

14. What is Bandwidth?


Every line has an upper limit and a lower limit on the frequency of signals it can carry. This
limited range is called the bandwidth.
15. Explain RIP (Routing Information Protocol)
It is a simple protocol used to exchange information between the routers.
16. What is subnet?
A generic term for section of a large networks usually separated by a bridge or router.
17. What is MAC address?
The address for a device as it is identified at the Media Access Control (MAC) layer in the
network architecture. MAC address is usually stored in ROM on the network adapter card and is
unique.
18. What is multiplexing?
Multiplexing is the process of dividing a link, the phycal medium, into logical channels for better
efficiency. Here medium is not changed but it has several channels instead of one.
19. What is simplex?
It is the mode of communication between two devices in which flow of data is unidirectional. i.e.
one can transmit and other can receive.
E.g. keyboard and monitor.
20. What is half-duplex?
It is the mode of communication between two devices in which flow of data is bi-directional but
not at the same time. ie each station can transmit and receive but not at the same time.
E.g walkie-talkies are half-duplex system.
[Link] is full duplex?
It is the mode of communication between two devices in which flow of data is bi-directional and
it occurs simultaneously. Here signals going in either direction share the capacity of the link.
E.g. telephone
22. What is sampling?
It is the process of obtaining amplitude of a signal at regular intervals.
23. What is Asynchronous mode of data transmission?
It is a serial mode of transmission.
In this mode of transmission, each byte is framed with a start bit and a stop bit. There may be a
variable length gap between each byte.
24. What is Synchronous mode of data transmission?
It is a serial mode of [Link] this mode of transmission, bits are sent in a continuous
stream without start and stop bit and without gaps between bytes. Regrouping the bits into
meaningful bytes is the responsibility of the receiver.
25. What are the different types of multiplexing?
Multiplexing is of three types. Frequency division multiplexing and wave division multiplexing
is for analog signals and time division multiplexing is for digital signals.
26. What are the different transmission media?
The transmission media is broadly categorized into two types
i)Guided media(wired)
i)Unguided media(wireless)
27. What are the duties of data link layer?
Data link layer is responsible for carrying packets from one hop (computer or router) to the next.
The duties of data link layer include packetizing, adderssing, error control, flow control, medium
access control.
28. .What are the types of errors?
Errors can be categorized as a single-bit error or burst error. A single bit error has one bit error
per data unit. A burst error has two or more bits errors per data unit.
29. What do you mean by redundancy?
Redundancy is the concept of sending extra bits for use in error detection. Three common
redundancy methods are parity check, cyclic redundancy check (CRC), and checksum.
30. Define parity check.
In parity check, a parity bit is added to every data unit so that the total number of 1s is even (or
odd for odd parity).Simple parity check can detect all single bit errors. It can detect burst errors
only if the total number of errors in each data unit is [Link] two dimensional parity checks, a
block of bits is divided into rows and a redundant row of bits is added to the whole block.
31. Define cyclic redundancy check (CRC).
C RC appends a sequence of redundant bits derived from binary division to the data unit. The
divisor in the CRC generator is often represented as an algebraic polynomial.

32. What is hamming code?


The hamming code is an error correction method using redundant bits. The number of bits is a
function of the length of the data bits. In hamming code for a data unit of m bits, we use the
formula 2r >= m+r+1 to determine the number of redundant bits needed. By rearranging the
order of bit transmission of the data units, the hamming code can correct burst errors.
[Link] stop and wait ARQ.
In stop and wait ARQ, the sender sends a frame and waits for an acknowledgement from the
receiver before sending the next frame.
34. What do you mean by network control protocol?
Network control protocol is a set of protocols to allow the encapsulation of data coming from
network layer protocol that requires the services of PPP
35. What do you mean by CSMA?
To reduce the possibility of collision CSMA method was developed. In CSMA each station first
listen to the medium (Or check the state of the medium) before sending. It can’t eliminate
collision.
36. What do you mean by Bluetooth?
It is a wireless LAN technology designed to connect devices of different functions such as
telephones, notebooks, computers, cameras, printers and so on.
37. What is IP address?
The internet address (IP address) is 32bits that uniquely and universally defines a host or router
on the [Link] portion of the IP address that identifies the network is called netid. The
portion of the IP address that identifies the host or router on the network is called hostid.
38. What do you mean by ALOHA ?
It is the method used to solve the channel allocation problem .It is used for:
i)ground based radio broadcasting
ii)In a network in which uncoordinated users are competing for the use of single channel.
It is of two types:
[Link] aloha
[Link] aloha
39. What is Firewalls?
It is an electronic downbridge which is used to enhance the security of a network. It’s
configuration has two components.
i)Two routers
ii)Application gateway
the packets traveling through the LAN are inspected here and packets meeting certain criteria are
forwarded and others are dropped.
40. What is Repeaters ?
A receiver receives a signal before it becomes too weak or corrupted,regenerates the original bit
pattern,and puts the refreshed copy back onto the [Link] operates on phycal layer of OSI model.
41. What is Bridges?
They divide large network into smaller [Link] can relay frames between two
originally separated [Link] provide security through partitioning [Link] operate on
physical and data link layer of OSI model.
42. What is ICMP?
ICMP is Internet Control Message Protocol, a network layer protocol of the TCP/IP suite used by
hosts and gateways to send notification of datagram problems back to the sender. It uses the echo
test / reply to test whether a destination is reachable and responding. It also handles both control
and error messages.
.43. What is FDM?
FDM is an analog technique that can be applied when the bandwidth of a link is greater than the
combined bandwidths of the signals to be transmitted.
44. What is WDM?
WDM is conceptually the same as FDM, except that the multiplexing and demultiplexing
involve light signals transmitted through fiber optics channel.
45. What is TDM?
TDM is a digital process that can be applied when the data rate capacity of the transmission
medium is greater than the data rate required by the sending and receiving devices.
46. List the steps involved in creating the checksum.
a. Divide the data into sections
b. Add the sections together using 1's complement arithmetic
c. Take the complement of the final sum, this is the checksum.
47. Compare Error Detection and Error Correction:
The correction of errors is more difficult than the detection. In error detection, checks only any
error has occurred. In error correction, the exact number of bits that are corrupted and location in
the message are known. The number of the errors and the size of the message are important
factors.
48. What are the protocols in application layer ?
The protocols defined in application layer are
• TELNET
• FTP
• SMTP
• DNS
49. What are the protocols in transport layer ?
The protocols defined in transport layer are
• TCP
• UDP
50. What do you mean by client server model ?
In client server model ,the client runs a program to request a service and the server runs a
program to provide the [Link] two programs communicate with each other. One server
program can provide services to many client programs.
51. What is TELNET ?
TELNET is a client –server application that allows a user to log on to a remote machine,giving
the user access to the remote system. TELNET is an abbreviation of terminal
Network.
52. What is Hypertext Transfer Protocol(HTTP) ?
It is the main protocol used to access data on the World Wide Web .the protol transfers data in
the form of plain text,hypertext,audio,video,and so on. It is so called because its efficiency
allows its use in a hypertext environment where there are rapid jumps from one document to
another.
53. What is World Wide Web ?
Ans: World Wide Web is a repository of information spread all over the world and linked
[Link] is a unique combination of flexibility,portability,and user-friendly features .The
World Wide Web today is a distributed client-server service,in which a client using a browser
can access a service using a [Link] service provided is distributed over many locations called
web sites.
54. What is Beaconing?
The process that allows a network to self-repair networks problems. The stations on the network
notify the other stations on the ring when they are not receiving the transmissions. Beaconing is
used in Token ring and FDDI networks.
55. What is RAID?
A method for providing fault tolerance by using multiple hard disk drives.
56. What is NETBIOS and NETBEUI?
NETBIOS is a programming interface that allows I/O requests to be sent to and received from a
remote computer and it hides the networking hardware from applications.
NETBEUI is NetBIOS extended user interface. A transport protocol designed by microsoft and
IBM for the use on small subnets.
57. What is difference between ARP and RARP?
The address resolution protocol (ARP) is used to associate the 32 bit IP address with the 48 bit
physical address, used by a host or a router to find the physical address of another host on its
network by sending a ARP query packet that includes the IP address of the receiver.
The reverse address resolution protocol (RARP) allows a host to discover its Internet address
when it knows only its physical address.
58. What is the minimum and maximum length of the header in the TCP segment and IP
datagram?
The header should have a minimum length of 20 bytes and can have a maximum length of 60
bytes.
59. What are major types of networks and explain?
Server-based network: provide centralized control of network resources and rely on server
computers to provide security and network administration
Peer-to-peer network: computers can act as both servers sharing resources and as clients using
the resources.
60. What are the important topologies for networks?
BUS topology: In this each computer is directly connected to primary network cable in a single
line.
Advantages: Inexpensive, easy to install, simple to understand, easy to extend.
STAR topology: In this all computers are connected using a central hub.
Advantages: Can be inexpensive, easy to install and reconfigure and easy to trouble shoot
physical problems.
RING topology: In this all computers are connected in loop.
Advantages: All computers have equal access to network media, installation can be simple, and
signal does not degrade as much as in other topologies because each computer regenerates it.
61. What is mesh network?
A network in which there are multiple network links between computers to provide multiple
paths for data to travel.
62. What is difference between baseband and broadband transmission?
In a baseband transmission, the entire bandwidth of the cable is consumed by a single signal. In
broadband transmission, signals are sent on multiple frequencies, allowing multiple signals to be
sent simultaneously.
63. What is packet filter?
Packet filter is a standard router equipped with some extra functionality. The extra functionality
allows every incoming or outgoing packet to be inspected. Packets meeting some criterion are
forwarded normally. Those that fail the test are dropped.
64. What is traffic shaping?
One of the main causes of congestion is that traffic is often busy. If hosts could be made to
transmit at a uniform rate, congestion would be less common. Another open loop method to help
manage congestion is forcing the packet to be transmitted at a more predictable rate. This is
called traffic shaping.
65. What is multicast routing?
Sending a message to a group is called multicasting, and its routing algorithm is called multicast
routing.
66. What is Kerberos?
It is an authentication service developed at the Massachusetts Institute of Technology. Kerberos
uses encryption to prevent intruders from discovering passwords and gaining unauthorized
access to files.
67. What is passive topology?
When the computers on the network simply listen and receive the signal, they are referred to as
passive because they don’t amplify the signal in any way. Example for passive topology - linear
bus.
68. What are the advantages of Distributed Processing?
a. Security/Encapsulation
b. Distributed database
c. Faster Problem solving
d. Security through redundancy
e. Collaborative Processing
69. Name the factors that affect the reliability of the network?
a. Frequency of failure
b. Recovery time of a network after a failure
70. When a switch is said to be congested?
It is possible that a switch receives packets faster than the shared link can accommodate and
stores in its memory, for an extended period of time, then the switch will eventually run out of
buffer space, and some packets will have to be dropped and in this state is said to congested
state.
SECTION-8 ALGORITHIM INTERVIEW QUESTIONS
1. Define the concept of an algorithm.
An algorithm is any well-defined computational procedure that takes some value (or set of
values) as input and produces some value (or set of values) as output. In short, it can be seen as a
sequence of computational steps that transform the input into the output.
[Link] are the arguments present in pattern matching algorithms?
These are the following arguments which are present in pattern matching Algorithms.
1) Subject,
2) Pattern
3) Cursor
4) MATCH_STR
5) REPLACE_STR
6) REPLACE_FLAG
3. Explain the function SUB in algorithmic notation?
In the algorithmic notation rather than using special marker symbols, generally people use the
cursor position plus a substring length to isolate a substring. The name of the function is SUB.
SUB returns a value the sub string of SUBJECT that is specified by the parameters i and j and an
assumed value of j.
4. In Algorithmic context how would you define book keeping operations?
Usually when a user wants to estimate time he isolates the specific function and brands it as
active operation. The other operations in the algorithm, the assignments, the manipulations of the
index and the accessing of a value in the vector, occur no more often than the addition of vector
values. These operations are collectively called as “book keeping operations”.
5. Define and describe an iterative process with general steps of flow chart?
There are four parts in the iterative process they are
Initialization: -The decision parameter is used to determine when to exit from the loop.
Decision: -The decision parameter is used to determine whether to remain in the loop or not.
Computation: - The required computation is performed in this part.
Update: - The decision parameter is updated and a transfer to the next iteration results.
6. State recursion and its different types?
Recursion is the name given to the technique of defining a set or a process in terms of itself.
There are essentially two types of recursion. The first type concerns recursively defined function
and the second type of recursion is the recursive use of a procedure.
7. Define and state the importance of sub algorithm in computation and its relation ship
with main algorithm?
A sub algorithm is an independent component of an algorithm and for this reason is defined
separately from the main algorithm. The purpose of a sub algorithm is to perform some
computation when required, under control of the main algorithm. This computation may be
performed on zero or more parameters passed by the calling routine.
8. Name any three skills which are very important in order to work with generating
functions.
The three most important skills which are used extensively while working with generating
functions are
1)Manipulate summation expressions and their indices.
2)Solve algebraic equations and manipulate algebraic expressions, including partial function
decompositions.
3)Identify sequences with their generating functions
9. What is the general strategy for Markov Algorithm?
The general strategy in a Markov Algorithm is to take as input a string x and, through a number
of steps in the algorithm, transform x to an output string y. this transformation process is
generally performed in computers for text editing or program compilation.
10. Define string in an algorithmic notation and an example to support it?
In the algorithmic notation, a string is expressed as any sequence of characters enclosed in single
quote marks.
11. How to find median of a BST?
Find the no. of elements on the left side.
If it is n-1 the root is the median.
If it is more than n-1, then it has already been found in the left subtree.
Else it should be in the right subtree
12. What is Diffie-Hellman?
It is a method by which a key can be securely shared by two users without any actual exchange.
13. What is the goal of the shortest distance algorithm?
The goal is completely fill the distance array so that for each vertex v, the value of distance[v] is
the weight of the shortest path from start to v.
14. Explain the depth of recursion?
This is another recursion procedure which is the number of times the procedure is called
recursively in the process of enlarging a given argument or arguments. Usually this quantity is
not obvious except in the case of extremely simple recursive functions, such as FACTORIAL
(N), for which the depth is N.
15. Explain about the algorithm ORD_WORDS?
This algorithm constructs the vectors TITLE, KEYWORD and T_INDEX.
16. Which are the sorting algorithms categories?
Sorting algorithms can be divided into five categories:
a) insertion sorts
b) exchange sorts
c) selection sorts
d) merge sorts
e) distribution sorts
[Link] a brute-force algorithm. Give a short example.
A brute force algorithm is a type of algorithm that proceeds in a simple and obvious way, but
requires a huge number of steps to complete. As an example, if you want to find out the factors
of a given number N, using this sort of algorithm will require to get one by one all the possible
number combinations.
18. What is a greedy algorithm? Give examples of problems solved using greedy
algorithms.
A greedy algorithm is any algorithm that makes the local optimal choice at each stage with the
hope of finding the global optimum. A classical problem which can be solved using a greedy
strategy is the traveling salesman problem. Another problems that can be solved using greedy
algorithms are the graph coloring problem and all the NP-complete problems.
19. What is a backtracking algorithm? Provide several examples.
It is an algorithm that considers systematically all possible outcomes for each decision. Examples
of backtracking algorithms are the eight queens problem or generating permutations of a given
sequence.
20. What is the difference between a backtracking algorithm and a brute-force one?
Due to the fact that a backtracking algorithm takes all the possible outcomes for a decision, it is
similar from this point of view with the brute force algorithm. The difference consists in the fact
that sometimes a backtracking algorithm can detect that an exhaustive search is unnecessary and,
therefore, it can perform much better.
21. Describe divide and conquer paradigm.
When a problem is solved using a divide and conquer algorithm, it is subdivided into one or
more subproblems which are all similar to the original problem in such a way that each of the
subproblems can be solved independently. In the end, the solutions to the subproblems are
combined in order to obtain the solution to the original problem.
22. Describe on short an insertion sorting algorithm.
An algorithm that sorts by insertion takes the initial, unsorted sequence and computes a series of
sorted sequences using the following rules:
a) the first sequence in the series is the empty sequence
b) given a sequence S(i) in the series, for 0<=i<="" p="" style="box-sizing: border-box;">
23. Which are the advantages provided by insertion sort?
Insertion sort provides several advantages:
a) simple implementation
b) efficient for small data sets
c) adaptive - efficient for data sets that are already substantially sorted: the time complexity is
O(n + d), where d is the number of inversions
d) more efficient in practice than most other simple quadratic, i.e. O(n2) algorithms such as
selection sort or bubble sort; the best case (nearly sorted input) is O(n)
e) stable - does not change the relative order of elements with equal keys
f) in-place - only requires a constant amount O( 1) of additional memory space
g) online - can sort a list as it receives it
24. Shortly describe the quicksort algorithm.
In quicksort, the steps performed are the following:
a) pick an element, called a pivot, from the list
b) reorder the list so that all elements with values less than the pivot come before the pivot, while
all elements with values greater than the pivot come after it (equal values can go either way)
c) recursively sort the sub-list of lesser elements and the sub-list of greater elements
25. What is the difference between selection and insertion sorting?
In insertion sorting elements are added to the sorted sequence in an arbitrary order. In selection
sorting, the elements are added to the sorted sequence in order so they are always added at one
end.
26. What is merge sorting?
Merging is the sorting algorithm which combines two or more sorted sequences into a single
sorted sequence. It is a divide and conquer algorithm, an O(n log n) comparison-based sorting
algorithm. Most implementations produce a stable sort, meaning that the implementation
preserves the input order of equal elements in the sorted output.

27. Which are the main steps of a merge sorting algorithm?


Sorting by merging is a recursive, divide-and-conquer strategy. The basic steps to perform are
the following:
a) divide the sequence into two sequences of length
b) recursively sort each of the two subsequences
c) merge the sorted subsequences to obtain the final result
28. Provide a short description of binary search algorithm.
Binary search algorithm always chooses the middle of the remaining search space, discarding
one half or the other, again depending on the comparison between the key value found at the
estimated position and the key value sought. The remaining search space is reduced to the part
before or after the estimated position.
29. What is the linear search algorithm?
Linear search is a method for finding a particular value in a list which consists of checking every
one of its elements, one at a time and in sequence, until the desired one is found. It is the
simplest search algorithm, a special case of brute-force search. Its worst case cost is proportional
to the number of elements in the list; and so is its expected cost, if all list elements are equally
likely to be searched for. Therefore, if the list has more than a few elements, other methods (such
as binary search or hashing) may be much more efficient.
30. What is best-first search algorithm?
It is a search algorithm that considers the estimated best partial solution next. This is typically
implemented with priority queues.
31. What is Huffman coding?
In computer science and information theory, Huffman coding is an entropy encoding algorithm
used for lossless data compression. The term refers to the use of a variable-length code table for
encoding a source symbol (such as a character in a file) where the variable-length code table has
been derived in a particular way based on the estimated probability of occurrence for each
possible value of the source symbol.
SECTION – 9 C# INTERVIEW QUESTIONS
1. What’s the advantage of using [Link] over [Link]?

StringBuilder is more efficient in the cases, where a lot of manipulation is done to the
text. Strings are immutable, so each time it’s being operated on, a new instance is
created.

2. Can you store multiple data types in [Link]?

No.
3. What’s the difference between the [Link]() and
[Link]()?
The first one performs a deep copy of the array, the second one is shallow.
4. How can you sort the elements of the array in descending order?
By calling Sort() and then Reverse() methods.
5. What’s the .NET datatype that allows the retrieval of data by a unique key?
HashTable.
6. What’s class SortedList underneath?
A sorted HashTable.
7. Will finally block get executed if the exception had not occurred?
Yes.
8. What’s the C# equivalent of C++ catch (…), which was a catch-all statement for
any possible exception?
A catch block that catches the exception of type [Link]. You can also omit
the parameter data type in this case and just write catch {}.
9. Can multiple catch blocks be executed?
No, once the proper catch code fires off, the control is transferred to the finally block (if
there are any), and then whatever follows the finally block.
10. Why is it a bad idea to throw your own exceptions?
Well, if at that point you know that an error has occurred, then why not write the proper
code to handle that error instead of passing a new Exception object to the catch block?
Throwing your own exceptions signifies some design flaws in the project.
11. What’s a delegate?
A delegate object encapsulates a reference to a method. In C++ they were referred to as
function pointers.

12. What’s a multicast delegate?


It’s a delegate that points to and eventually fires off several methods.
13. How’s the DLL Hell problem solved in .NET?
Assembly versioning allows the application to specify not only the library it needs to run
(which was available under Win32), but also the version of the assembly.

14. What are the ways to deploy an assembly?


An MSI installer, a CAB archive, and XCOPY command.
15. What’s a satellite assembly?
When you write a multilingual or multi-cultural application in .NET, and want to
distribute the core application separately from the localized modules, the localized
assemblies that modify the core application are called satellite assemblies.
16. What namespaces are necessary to create a localized application?
[Link], [Link].

17. What’s the difference between // comments, /* */ comments and /// comments?
Single-line, multi-line and XML documentation comments.
18. How do you generate documentation from the C# file commented properly with
a command-line compiler?
Compile it with a /doc switch.

19. What’s the difference between and XML documentation tag?


Single line code example and multiple-line code example.

20. Is XML case-sensitive?


Yes, so and are different elements.

21. What debugging tools come with the .NET SDK?


CorDBG – command-line debugger, and DbgCLR – graphic debugger. Visual
Studio .NET uses the DbgCLR. To use CorDbg, you must compile the original C# file
using the /debug switch.

22. What does the This window show in the debugger?


It points to the object that’s pointed to by this reference. Object’s instance data is shown.

23. What are three test cases you should go through in unit testing?
Positive test cases (correct data, correct output), negative test cases (broken or missing
data, proper handling), exception test cases (exceptions are thrown and caught properly).
24. What does assert() do?
In debug compilation, assert takes in a Boolean condition as a parameter, and shows the
error dialog if the condition is false. The program proceeds without any interruption if
the condition is true.
25. Why are there five tracing levels in [Link]?
The tracing dumps can be quite verbose and for some applications that are constantly
running you run the risk of overloading the machine and the hard drive there. Five levels
range from None to Verbose, allowing to fine-tune the tracing activities.
26. Where is the output of TextWriterTraceListener redirected?
To the Console or a text file depending on the parameter passed to the constructor.
27. How do you debug an [Link] Web application?
Attach the aspnet_wp.exe process to the DbgClr debugger.
28. What’s the difference between the Debug class and Trace class?
Documentation looks the same. Use Debug class for debug builds, use Trace class for
both debug and release builds.
29. Can you change the value of a variable while debugging a C# application?
Yes, if you are debugging via Visual [Link], just go to immediate window.
30. Explain the three services model (three-tier application).
Presentation (UI), business (logic and underlying code) and data (from storage or other
sources).
31. What are advantages and disadvantages of Microsoft-provided data provider
classes in [Link]?
[Link] data provider is high-speed and robust, but requires SQL Server license
purchased from Microsoft. [Link] is universal for accessing other sources, like
Oracle, DB2, Microsoft Access and Informix, but it’s a .NET layer on top of OLE layer,
so not the fastest thing in the world. [Link] is a deprecated layer provided for
backward compatibility to ODBC engines.

32. What’s the role of the DataReader class in [Link] connections?


It returns a read-only dataset from the data source when the command is executed.
33. What is the wildcard character in SQL?
Let’s say you want to query database with LIKE for all employees whose name starts
with La. The wildcard character is %, the proper query with LIKE would involve ‘La%’.
34. Explain ACID rule of thumb for transactions.
Transaction must be Atomic (it is one unit of work and does not dependent on previous
and following transactions), Consistent (data is either committed or roll back, no “in-
between” case where something has been updated and something hasn’t), Isolated (no
transaction sees the intermediate results of the current transaction), Durable (the values
persist if the data had been committed even if the system crashes right after).
35. What connections does Microsoft SQL Server support?
Windows Authentication (via Active Directory) and SQL Server authentication (via
Microsoft SQL Server username and passwords).
36. Which one is trusted and which one is untrusted?
Windows Authentication is trusted because the username and password are checked with
the Active Directory, the SQL Server authentication is untrusted, since SQL Server is
the only verifier participating in the transaction.
37. Why would you use untrusted verification?
Web Services might use it, as well as non-Windows applications.
38. What does the parameter Initial Catalog define inside Connection String?
The database name to connect to.
39. What’s the data provider name to connect to Access database?
[Link].
40. What does Dispose method do with the connection object?
Deletes it from the memory.
41. What is a pre-requisite for connection pooling?
Multiple processes must agree that they will share the same connection, where every
parameter is the same, including the security settings.

42. What’s the implicit name of the parameter that gets passed into the class’ set
method?
Value, and it’s datatype depends on whatever variable we’re changing.
43. How do you inherit from a class in C#?
Place a colon and then the name of the base class.
44. Does C# support multiple inheritance?
No, use interfaces instead.
45. When you inherit a protected class-level variable, who is it available to?
Classes in the same namespace.
46. Are private class-level variables inherited?
Yes, but they are not accessible, so looking at it you can honestly say that they are not
inherited. But they are.
47. What’s the top .NET class that everything is derived from?
[Link].
48. How’s method overriding different from overloading?
When overriding, you change the method behavior for a derived class. Overloading
simply involves having a method with the same name within the class.
49. What does the keyword virtual mean in the method definition?
The method can be over-ridden.
50. Can you declare the override method static while the original method is non-
static?
No, you can’t, the signature of the virtual method must remain the same, only the
keyword virtual is changed to keyword override.
51. Can you override private virtual methods?
No, moreover, you cannot access private methods in inherited classes, have to be
protected in the base class to allow any sort of access.
52. Can you allow class to be inherited, but prevent the method from being over-
ridden?
Yes, just leave the class public and make the method sealed.
53. What’s an interface class?

It’s an abstract class with public abstract methods all of which must be implemented in
the inherited classes.

54. Can you inherit multiple interfaces?


Yes, why not.
55. And if they have conflicting method names?
It’s up to you to implement the method inside your own class, so implementation is left
entirely up to you. This might cause a problem on a higher-level scale if similarly named
methods from different interfaces expect different data, but as far as compiler cares
you’re okay.
56. What’s the difference between an interface and abstract class?
In the interface all methods must be abstract, in the abstract class some methods can be
concrete. In the interface no accessibility modifiers are allowed, which is ok in abstract
classes.
57. How can you overload a method?
Different parameter data types, different number of parameters, different order of
parameters.
58. If a base class has a bunch of overloaded constructors, and an inherited class
has another bunch of overloaded constructors, can you enforce a call from an
inherited constructor to an arbitrary base constructor?
Yes, just place a colon, and then keyword base (parameter list to invoke the appropriate
constructor) in the overloaded constructor definition inside the inherited class.
59. Is it namespace class or class namespace?
The .NET class library is organized into namespaces. Each namespace contains a
functionally related group of classes so natural namespace comes first.
60. Where is a protected class-level variable available?
It is available to any sub-class derived from base class
61. Are private class-level variables inherited?
Yes, but they are not accessible.
62. Describe the accessibility modifier “protected internal”.
It is available to classes that are within the same assembly and derived from the
specified base class.

63. What does the term immutable mean?


The data value may not be changed.
Note: The variable value may be changed, but the original immutable data value was
discarded and a new data value was created in memory.
64. What is the syntax to inherit from a class in C#?
Place a colon and then the name of the base class.
Example: class MyNewClass : MyBaseClass
65. Can you prevent your class from being inherited by another class?
Yes. The keyword “sealed” will prevent the class from being inherited.
66. Can you allow a class to be inherited, but prevent the method from being over-
ridden?
Yes. Just leave the class public and make the method sealed.
67. What’s an abstract class?
A class that cannot be instantiated. An abstract class is a class that must be inherited and
have the methods overridden. An abstract class is essentially a blueprint for a class
without any implementation.
68. When do you absolutely have to declare a class as abstract?
1. When the class itself is inherited from an abstract class, but not all base abstract
methods have been overridden.
2. When at least one of the methods in the class is abstract.
69. What is an interface class?
Interfaces, like classes, define a set of properties, methods, and events. But unlike
classes, interfaces do not provide implementation. They are implemented by classes, and
defined as separate entities from classes.
70. Why can’t you specify the accessibility modifier for methods inside the
interface?
They all must be public, and are therefore public by default.
71. What happens if you inherit multiple interfaces and they have conflicting
method names?
It’s up to you to implement the method inside your own class, so implementation is left
entirely up to you. This might cause a problem on a higher-level scale if similarly named
methods from different interfaces expect different data, but as far as compiler cares
you’re okay.
72. What is the difference between a Struct and a Class?
Structs are value-type variables and are thus saved on the stack, additional overhead but
faster retrieval. Another difference is that structs cannot inherit.
73. What does the keyword “virtual” declare for a method or property?
The method or property can be overridden.
74. How is method overriding different from method overloading?
When overriding a method, you change the behavior of the method for the derived class.
Overloading a method simply involves having another method with the same name
within the class.
75. Can you declare an override method to be static if the original method is not
static?
No. The signature of the virtual method must remain the same. (Note: Only the keyword
virtual is changed to keyword override)
76. What are the different ways a method can be overloaded?
Different parameter data types, different number of parameters, different order of
parameters.
77. If a base class has a number of overloaded constructors, and an inheriting class
has a number of overloaded constructors; can you enforce a call from an inherited
constructor to a specific base constructor?
Yes, just place a colon, and then keyword base (parameter list to invoke the appropriate
constructor) in the overloaded constructor definition inside the inherited class.
SECTION-10 C LANGUAGE INTER VIEW QUESTIONS
1. What is C language?
The C programming language is a standardized programming language developed in the early
1970s by Ken Thompson and Dennis Ritchie for use on the UNIX operating system. It has since
spread to many other operating systems, and is one of the most widely used programming
languages. C is prized for its efficiency, and is the most popular programming language for
writing system software, though it is also used for writing applications.
2. What does static variable mean?
There are 3 main uses for the static.
1. If you declare within a function: It retains the value between function calls
2. If it is declared for a function name: By default function is extern..so it will be visible from
other files if the function declaration is as static..it is invisible for the outer files
3. Static for global variables: By default we can use the global variables from outside files If it is
static global..that variable is limited to with in the file.
#include
int t = 10;
main(){
int x = 0;
void funct1();
funct1();
printf("After first call \n");
funct1();
printf("After second call \n");
funct1();
printf("After third call \n");
}
void funct1()
{
static int y = 0;
int z = 10;
printf("value of y %d z %d",y,z);
y=y+10;
}
value of y 0 z 10 After first call
value of y 10 z 10 After second call
value of y 20 z 10 After third call
3. What are the different storage classes in C?
C has three types of storage: automatic, static and allocated. Variable having block scope and
without static specifier have automatic storage duration.
Variables with block scope, and with static specifier have static scope. Global variables (i.e, file
scope) with or without the the static specifier also have static scope. Memory obtained from
calls to malloc(), alloc() or realloc() belongs to allocated storage class.
4. What is hashing?
To hash means to grind up, and that’s essentially what hashing is all about. The heart of a
hashing algorithm is a hash function that takes your nice, neat data and grinds it into some
random-looking integer.
The idea behind hashing is that some data either has no inherent ordering (such as images) or is
expensive to compare (such as images). If the data has no inherent ordering, you can’t perform
comparison searches.
5. Can static variables be declared in a header file?
You can’t declare a static variable without defining it as well (this is because the storage class
modifiers static and extern are mutually exclusive). A static variable can be defined in a header
file, but this would cause each source file that included the header file to have its own private
copy of the variable, which is probably not what was intended.
6. Can a variable be both constant and volatile?
Yes. The const modifier means that this code cannot change the value of the variable, but that
does not mean that the value cannot be changed by means outside this code.
The function itself did not change the value of the timer, so it was declared const. However, the
value was changed by hardware on the computer, so it was declared volatile. If a variable is both
const and volatile, the two modifiers can appear in either order.
7. Can include files be nested?
Yes. Include files can be nested any number of times. As long as you use precautionary
measures, you can avoid including the same file twice. In the past, nesting header files was seen
as bad programming practice, because it complicates the dependency tracking function of the
MAKE program and thus slows down compilation. Many of today’s popular compilers make up
for this difficulty by implementing a concept called precompiled headers, in which all headers
and associated dependencies are stored in a precompiled state.

8. What is a null pointer?


There are times when it’s necessary to have a pointer that doesn’t point to anything. The macro
NULL, defined in , has a value that’s guaranteed to be different from any valid pointer. NULL is
a literal zero, possibly cast to void* or char*.
Some people, notably C++ programmers, prefer to use 0 rather than NULL.
The null pointer is used in three ways:
1) To stop indirection in a recursive data structure.
2) As an error value.
3) As a sentinel value.
9. What is the output of printf("%d") ?
When we write printf("%d",x); this means compiler will print the value of x. But as here, there is
nothing after %d so compiler will show in output window garbage value.
10. What is the difference between calloc() and malloc() ?
calloc(...) allocates a block of memory for an array of elements of a certain size. By default the
block is initialized to 0. The total number of memory allocated will be (number_of_elements *
size).
malloc(...) takes in only a single argument which is the memory required in bytes. malloc(...)
allocated bytes of memory and not blocks of memory like calloc(...).
malloc(...) allocates memory blocks and returns a void pointer to the allocated space, or NULL if
there is insufficient memory available.
calloc(...) allocates an array in memory with elements initialized to 0 and returns a pointer to the
allocated space. calloc(...) calls malloc(...) in order to use the C++ _set_new_mode function to
set the new handler mode.
11. What is the difference between printf() and sprintf() ?
sprintf() writes data to the character array whereas printf(...) writes data to the standard output
device.
12. How to reduce a final size of executable?
Size of the final executable can be reduced using dynamic linking for libraries.
13. Can you tell me how to check whether a linked list is circular?
Create two pointers, and set both to the start of the list. Update each as follows:
while (pointer1) {
pointer1 = pointer1->next;
pointer2 = pointer2->next;
if (pointer2) pointer2=pointer2->next;
if (pointer1 == pointer2) {
print ("circular");
}
}
If a list is circular, at some point pointer2 will wrap around and be either at the item just before
pointer1, or the item before that. Either way, its either 1 or 2 jumps until they meet.
14. Advantages of a macro over a function?
Macro gets to see the Compilation environment, so it can expand __ __TIME__ __FILE__
#defines. It is expanded by the preprocessor.
For example, you can’t do this without macros
#define PRINT(EXPR) printf( #EXPR “=%d\n”, EXPR)
PRINT( 5+6*7 ) // expands into printf(”5+6*7=%d”, 5+6*7 );
You can define your mini language with macros:
#define strequal(A,B) (!strcmp(A,B))
15. What is the difference between strings and character arrays?
A major difference is: string will have static storage duration, whereas as a character array will
not, unless it is explicity specified by using the static keyword.
Actually, a string is a character array with following properties:
* the multibyte character sequence, to which we generally call string, is used to initialize an array
of static storage duration. The size of this array is just sufficient to contain these characters plus
the terminating NUL character.
* it not specified what happens if this array, i.e., string, is modified.
* Two strings of same value[1] may share same memory area.
16. Write down the equivalent pointer expression for referring the same element a[i][j][k]
[l] ?
a[i] == *(a+i)
a[i][j] == *(*(a+i)+j)
a[i][j][k] == *(*(*(a+i)+j)+k)
a[i][j][k][l] == *(*(*(*(a+i)+j)+k)+l)

17. Which bit wise operator is suitable for checking whether a particular bit is on or off?
The bitwise AND operator. Here is an example:
enum {
KBit0 = 1,
KBit1,

KBit31,
};
if ( some_int & KBit24 )
printf ( “Bit number 24 is ON\n” );
else
printf ( “Bit number 24 is OFF\n” );
18. Which bit wise operator is suitable for turning off a particular bit in a number?
The bitwise AND operator, again. In the following code snippet, the bit number 24 is reset to
zero.
some_int = some_int & ~KBit24;
19. Which bit wise operator is suitable for putting on a particular bit in a number?
The bitwise OR operator. In the following code snippet, the bit number 24 is turned ON:
some_int = some_int | KBit24;
20. Does there exist any other function which can be used to convert an integer or a float to
a string?
Some implementations provide a nonstandard function called itoa(), which converts an integer to
string.
#include
char *itoa(int value, char *string, int radix);
DESCRIPTION
The itoa() function constructs a string representation of an integer.
PARAMETERS
value: Is the integer to be converted to string representation.
string: Points to the buffer that is to hold resulting string.
The resulting string may be as long as seventeen bytes.
radix: Is the base of the number; must be in the range 2 - 36.
A portable solution exists. One can use sprintf():
char s[SOME_CONST];
int i = 10;
float f = 10.20;
sprintf ( s, “%d %f\n”, i, f );
21. Why does malloc(0) return valid memory address ? What's the use?
malloc(0) does not return a non-NULL under every implementation. An implementation is free
to behave in a manner it finds suitable, if the allocation size requested is zero. The implmentation
may choose any of the following actions:
* A null pointer is returned.
* The behavior is same as if a space of non-zero size was requested. In this case, the usage of
return value yields to undefined-behavior.
Notice, however, that if the implementation returns a non-NULL value for a request of a zero-
length space, a pointer to object of ZERO length is returned! Think, how an object of zero
size should be represented
For implementations that return non-NULL values, a typical usage is as follows:
void
func ( void )
{
int *p; /* p is a one-dimensional array, whose size will vary during the the lifetime of the
program */
size_t c;
p = malloc(0); /* initial allocation */
if (!p)
{
perror (”FAILURE” );
return;
}
/* … */
while (1)
{
c = (size_t) … ; /* Calculate allocation size */
p = realloc ( p, c * sizeof *p );
/* use p, or break from the loop */
/* … */
}
return;
}
Notice that this program is not portable, since an implementation is free to return NULL for a
malloc(0) request, as the C Standard does not support zero-sized objects.
22. Difference between const char* p and char const* p
In const char* p, the character pointed by ‘p’ is constant, so u cant change the value of character
pointed by p but u can make ‘p’ refer to some other location.
In char const* p, the ptr ‘p’ is constant not the character referenced by it, so u cant make ‘p’ to
reference to any other location but u can change the value of the char pointed by ‘p’.
23. What is the result of using Option Explicit?
When writing your C program, you can include files in two ways. The first way is to surround
the file you want to include with the angled brackets < and >. This method of inclusion tells the
preprocessor to look for the file in the predefined default location. This predefined default
location is often an INCLUDE environment variable that denotes the path to your include files.
For instance, given the INCLUDE variable
INCLUDE=C:\COMPILER\INCLUDE;S:\SOURCE\HEADERS; using the #include version of
file inclusion, the compiler first checks the C:\COMPILER\INCLUDE directory for the specified
file. If the file is not found there, the compiler then checks the S:\SOURCE\HEADERS
directory. If the file is still not found, the preprocessor checks the current directory.
The second way to include files is to surround the file you want to include with double quotation
marks. This method of inclusion tells the preprocessor to look for the file in the current directory
first, then look for it in the predefined locations you have set up. Using the #include file version
of file inclusion and applying it to the preceding example, the preprocessor first checks the
current directory for the specified file. If the file is not found in the current directory, the
C:COMPILERINCLUDE directory is searched. If the file is still not found, the preprocessor
checks the S:SOURCEHEADERS directory.
The #include method of file inclusion is often used to include standard headers such as stdio.h or
stdlib.h.
The #include file include nonstandard header files that you have created for use in your program.
This is because these headers are often modified in the current directory, and you will want the
preprocessor to use your newly modified version of the header rather than the older, unmodified
version.
24. What is the benefit of using an enum rather than a #define constant?
The use of an enumeration constant (enum) has many advantages over using the traditional
symbolic constant style of #define. These advantages include a lower maintenance requirement,
improved program readability, and better debugging capability.
1) The first advantage is that enumerated constants are generated automatically by the compiler.
Conversely, symbolic constants must be manually assigned values by the programmer.
2) Another advantage of using the enumeration constant method is that your programs are more
readable and thus can be understood better by others who might have to update your program
later.
3) A third advantage to using enumeration constant
SECTION-11 OS INTERVIEW QUESTIONS
1. What is an operating system?
An operating system is a program that acts as an intermediary between the user and the computer
hardware. The purpose of an OS is to provide a convenient environment in which user can
execute programs in a convenient and efficient manner.
2. What are the different operating systems?
1. Batched operating systems
2. Multi-programmed operating systems
3. timesharing operating systems
4. Distributed operating systems
5. Real-time operating systems
3. What are the basic functions of an operating system?
Operating system controls and coordinates the use of the hardware among the various
applications programs for various uses. Operating system acts as resource allocator and manager.
Also operating system is control program which controls the user programs to prevent errors and
improper use of the computer. It is especially concerned with the operation and control of I/O
devices.
4. What is kernel?
Kernel is the core and essential part of computer operating system that provides basic services
for all parts of OS.
5. What is difference between micro kernel and macro kernel?
Micro kernel is a kernel which run services those are minimal for operating system performance.
In this kernel all other operations are performed by processor.
Macro Kernel is a combination of micro and monolithic kernel. In monolithic kernel all
operating system code is in single executable image.
6. What is dead lock?
Deadlock is a situation or condition where the two processes are waiting for each other to
complete so that they can start. This result both the processes to hang.
7. What is a process?
A program in execution is called a process.
Processes are of two types:
1. Operating system processes
2. User processes
8. What are the states of a process?
1. New
2. Running
3. Waiting
4. Ready
5. Terminated
9. What is starvation and aging?
Starvation is Resource management problem where a process does not get the resources it needs
for a long time because the resources are being allocated to other processes.
Aging is a technique to avoid starvation in a scheduling system.
10. What is semaphore?
Semaphore is a variable, whose status reports common resource, Semaphore is of two types one
is Binary semaphore and other is Counting semaphore.
11. What is context switching?
Transferring the control from one process to other process requires saving the state of the old
process and loading the saved state for new process. This task is known as context switching.
12. What is a thread?
A thread is a program line under execution. Thread sometimes called a light-weight process, is a
basic unit of CPU utilization; it comprises a thread id, a program counter, a register set, and a
stack
13. What is process synchronization?
A situation, where several processes access and manipulate the same data concurrently and the
outcome of the execution depends on the particular order in which the access takes place, is
called race condition. To guard against the race condition we need to ensure that only one
process at a time can be manipulating the same data. The technique we use for this is called
process synchronization.
14. What is virtual memory?
Virtual memory is hardware technique where the system appears to have more memory that it
actually does. This is done by time-sharing, the physical memory and storage parts of the
memory one disk when they are not actively being used.
15. What is thrashing?
It is a phenomenon in virtual memory schemes when the processor spends most of its time
swapping pages, rather than executing instructions. This is due to an inordinate number of page
faults.
16. What is fragmentation? Tell about different types of fragmentation?
When many of free blocks are too small to satisfy any request then fragmentation occurs.
External fragmentation and internal fragmentation are two types of fragmentation. External
Fragmentation happens when a dynamic memory allocation algorithm allocates some memory
and a small piece is left over that cannot be effectively used. Internal fragmentation is the space
wasted inside of allocated memory blocks because of restriction on the allowed sizes of allocated
blocks.
17. What are necessary conditions for dead lock?
1. Mutual exclusion (where at least one resource is non-sharable)
2. Hold and wait (where a process holds one resource and waits for other resource)
3. No preemption (where the resources can’t be preempted)
4. Circular wait (where p[i] is waiting for p[j] to release a resource. i= 1,2,…n
j=if (i!=n) then i+1
else 1 )
18. What is cache memory?
Cache memory is random access memory (RAM) that a computer microprocessor can access
more quickly than it can access regular RAM. As the microprocessor processes data, it looks first
in the cache memory and if it finds the data there (from a previous reading of data), it does not
have to do the more time-consuming reading of data from larger memory.
19. What is logical and physical addresses space?
Logical address space is generated from CPU; it bound to a separate physical address space is
central to proper memory management. Physical address space is seen by the memory unit.
Logical address space is virtual address space. Both these address space will be same at compile
time but differ at execution time.
20. Differentiate between Complier and Interpreter?
An interpreter reads one instruction at a time and carries out the actions implied by that
instruction. It does not perform any translation. But a compiler translates the entire instructions
21. What is Throughput, Turnaround time, waiting time and Response time?
Throughput – number of processes that complete their execution per time unit
Turnaround time – amount of time to execute a particular process
Waiting time – amount of time a process has been waiting in the ready queue
Response time – amount of time it takes from when a request was submitted until the first
response is produced, not output (for time-sharing environment)
22. What is Memory-Management Unit (MMU)?
Hardware device that maps virtual to physical address. In MMU scheme, the value in the
relocation register is added to every address generated by a user process at the time it is sent to
memory.
->The user program deals with logical addresses; it never sees the real physical addresses
23. What is a Real-Time System?
A real time process is a process that must respond to the events within a certain time period. A
real time operating system is an operating system that can run real time processes successfully

24. What is a trap and trapdoor?


Trapdoor is a secret undocumented entry point into a program used to grant access without
normal methods of access authentication. A trap is a software interrupt, usually the result of an
error condition.
25. When is a system in safe state?
The set of dispatchable processes is in a safe state if there exists at least one temporal order in
which all processes can be run to completion without resulting in a deadlock.
26. Explain the concept of the Distributed systems?
Distributed systems work in a network. They can share the network resources, communicate with
each other.
27. What is cache-coherency?
In a multiprocessor system there exist several caches each may containing a copy of same
variable A. Then a change in one cache should immediately be reflected in all other caches this
process of maintaining the same value of a data in all the caches s called cache-coherency.
28. What is a long term scheduler & short term schedulers?
Long term schedulers are the job schedulers that select processes from the job queue and load
them into memory for execution. The short term schedulers are the CPU schedulers that select a
process from the ready queue and allocate the CPU to one of them.
29. Explain the meaning of mutex.
Mutex is the short form for ‘Mutual Exclusion object’. A mutex allows multiple threads for
sharing the same resource. The resource can be file. A mutex with a unique name is created at
the time of starting a program. A mutex must be locked from other threads, when any thread that
needs the resource. When the data is no longer used / needed, the mutex is set to unlock.
30. What is cycle stealing?
We encounter cycle stealing in the context of Direct Memory Access (DMA). Either the DMA
controller can use the data bus when the CPU does not need it, or it may force the CPU to
temporarily suspend operation. The latter technique is called cycle stealing. Note that cycle
stealing can be done only at specific break points in an instruction cycle.
31. What is Marshalling?
The process of packaging and sending interface method parameters across thread or process
boundaries.

32. What is a daemon?


Daemon is a program that runs in the background without user’s interaction. A daemon runs in a
multitasking operating system like UNIX. A daemon is initiated and controlled by special
programs known as ‘processes’.
33. What is pre-emptive and non-preemptive scheduling?
Preemptive scheduling: The preemptive scheduling is prioritized. The highest priority process
should always be the process that is currently utilized.
Non-Preemptive scheduling: When a process enters the state of running, the state of that process
is not deleted from the scheduler until it finishes its service time.
34. What is busy waiting?
The repeated execution of a loop of code while waiting for an event to occur is called busy-
waiting. The CPU is not engaged in any real productive activity during this period, and the
process does not progress toward completion.
35. What is page cannibalizing?
Page swapping or page replacements are called page cannibalizing.
36. What is SMP?
To achieve maximum efficiency and reliability a mode of operation known as symmetric
multiprocessing is used. In essence, with SMP any process or threads can be assigned to any
processor.
37. What is process migration?
It is the transfer of sufficient amount of the state of process from one machine to the target
machine.
38. Difference between Primary storage and secondary storage?
Primary memory is the main memory (Hard disk, RAM) where the operating system resides.
Secondary memory can be external devices like CD, floppy magnetic discs etc. secondary
storage cannot be directly accessed by the CPU and is also external memory storage.
39. Define compactions.
Compaction is a process in which the free space is collected in a large memory chunk to make
some space available for processes.
40. What are residence monitors?
Early operating systems were called residence monitors.

41. What is dual-mode operation?


In order to protect the operating systems and the system programs from the malfunctioning
programs the two mode operations were evolved
System mode
User mode.
42. What is a device queue?
A list of processes waiting for a particular I/O device is called device queue.
43. What are the different types of Real-Time Scheduling?
Hard real-time systems required to complete a critical task within a guaranteed amount of time.
Soft real-time computing requires that critical processes receive priority over less fortunate ones.
44. What is relative path and absolute path?
Absolute path-- Exact path from root directory.
Relative path-- Relative to the current path.
45. What are the disadvantages of context switching?
Time taken for switching from one process to other is pure over head. Because the system does
no useful work while switching. So one of the solutions is to go for threading when ever
possible.
46. What is a data register and address register?
Data registers - can be assigned to a variety of functions by the programmer. They can be used
with any machine instruction that performs operations on data.
Address registers - contain main memory addresses of data and instructions or they contain a
portion of the address that is used in the calculation of the complete addresses.
47. What is DRAM?
Dynamic Ram stores the data in the form of Capacitance, and Static RAM stores the data in
Voltages.
48. What are local and global page replacements?
Local replacement means that an incoming page is brought in only to the relevant process'
address space. Global replacement policy allows any page frame from any process to be
replaced. The latter is applicable to variable partitions model only.

49. Explain the concept of the batched operating systems?


In batched operating system the users gives their jobs to the operator who sorts the programs
according to their requirements and executes them. This is time consuming but makes the CPU
busy all the time.
50. What is SCSI?
SCSI - Small computer systems interface is a type of interface used for computer components
such as hard drives, optical drives, scanners and tape drives. It is a competing technology to
standard IDE (Integrated Drive Electronics).
[Link] is a system in safe state?
The set of dispatchable processes is in a safe state if there exists at least one temporal order in
which all processes can be run to completion without resulting in a deadlock.
52. What is cycle stealing?
We encounter cycle stealing in the context of Direct Memory Access (DMA). Either the DMA
controller can use the data bus when the CPU does not need it, or it may force the CPU to
temporarily suspend operation. The latter technique is called cycle stealing. Note that cycle
stealing can be done only at specific break points in an instruction cycle.
53. What is an idle thread?
The special thread a dispatcher will execute when no ready thread is found.
54. What is FtDisk?
It is a fault tolerance disk driver for Windows NT.
[Link] is Dispatcher?
Dispatcher module gives control of the CPU to the process selected by the short-term scheduler;
this involves: Switching context, Switching to user mode, Jumping to the proper location in the
user program to restart that program, dispatch latency – time it takes for the dispatcher to stop
one process and start another running.
56. When does the condition 'rendezvous' arise?
In message passing, it is the condition in which, both, the sender and receiver are blocked until
the message is delivered.
57. What is process spawning?
When the OS at the explicit request of another process creates a process, this action is called
process spawning
58. What are the reasons for process suspension?
1) swapping
2) interactive user request
3) timing
4) parent process request
59. What are the sub-components of I/O manager in Windows NT?
1) Network redirector/ Server
2) Cache manager.
3) File systems
4) Network driver
5) Device driver
60. What is a drawback of MVT?
1) ability to support multiple processors
2) virtual storage
3) source level debugging
SECTION -12 DATA STRUCTURE INTERVIEW QUESTIONS
[Link] is data structure?
A data structure is a way of organizing data that considers not only the items stored, but also
their relationship to each other. Advance knowledge about the relationship between data items
allows designing of efficient algorithms for the manipulation of data.
[Link] number of queues needed to implement the priority queue?
Two. One queue is used for actual storing of data and another for storing priorities.
[Link] are the notations used in Evaluation of Arithmetic Expressions using prefix and
postfix forms?
Polish and Reverse Polish notations.
[Link] out few of the Application of tree data-structure?
i)The manipulation of Arithmetic expression
ii)Symbol Table construction
iii)Syntax analysis.
[Link] is the type of the algorithm used in solving the 8 Queens problem?
Backtracking
[Link] RDBMS, what is the efficient data structure used in the internal storage
representation?
B+ tree. Because in B+ tree, all the data is stored only in leaf nodes, that makes searching easier.
This corresponds to the records that shall be stored in leaf nodes.
7. What is a spanning Tree?
A spanning tree is a tree associated with a network. All the nodes of the graph appear on the tree
once. A minimum spanning tree is a spanning tree organized so that the total edge weight
between nodes is minimized.
8. List out the areas in which data structures are applied extensively?
Compiler Design, Operating System, Database Management System, Statistical
analysis package, Numerical Analysis, Graphics, Artificial Intelligence, Simulation
9. Translate infix expression into its equivalent post fix expression: (A-B)*(D/E)
(A-B)*(D/E) = [AB-]*[DE/] = AB-DE/*
10. What are priority queues?
A priority queue is a collection of elements such that each element has been assigned a priority.
11. What is a string?
A sequential array of characters is called a string.
12. What is Brute Force algorithm?
Algorithm used to search the contents by comparing each element of array is called Brute Force
algorithm.

13. What are the limitations of arrays?


i)Arrays are of fixed size.
ii)Data elements are stored in continuous memory locations which may not be available always.
iii)Adding and removing of elements is problematic because of shifting the locations.

14. How can you overcome the limitations of arrays?


Limitations of arrays can be solved by using the linked list.
15. What is a linked list?
Linked list is a data structure which store same kind of data elements but not in continuous
memory locations and size is not fixed. The linked lists are related logically.
16. What is a node?
The data element of a linked list is called a node.
17. What does node consist of?
Node consists of two fields:data field to store the element and link field to store the address of
the next node.
18. What is a queue ?
A Queue is a sequential organization of data. A queue is a first in first out type of data structure.
An element is inserted at the last position and an element is always taken out from the first
position.
19. What are the types of Collision Resolution Techniques and the methods used in each of
the type?
Open addressing (closed hashing),The methods used include:Overflow block
Closed addressing (open hashing),The methods used include:Linked list,Binary tree
20. What are the methods available in storing sequential files ?
Straight merging, Natural merging, Polyphase sort, Distribution of Initial runs.
21. Mention some of the problem solving strategies?
The most widely strategies are listed below
i)Divide and conquer
ii)Binary doubling strategy
iii)Dynamic programming
22. What is divide and conquer method?
The basic idea is to divide the problem into several sub problems beyond which cannot be further
subdivided. Then solve the sub problems efficiently and join then together to get the solution for
the main problem.

23. What is the need for the header?


Header of the linked list is the first element in the list and it stores the number of elements in the
list. It points to the first data element of the list.
24. Define leaf?
In a directed tree any node which has out degree o is called a terminal node or a leaf.
25. What are the applications of binary tree?
Binary tree is used in data processing.
26. What are the different types of traversing?
The different types of traversing are
i)Pre-order traversal-yields prefix from of expression.
ii)In-order traversal-yields infix form of expression.
iii)Post-order traversal-yields postfix from of expression.
27. Define pre-order traversal?
i)Process the root node
ii)Process the left subtree
iii)Process the right subtree
28. Define post-order traversal?
i)Process the left subtree
ii)Process the right subtree
iii)Process the root node
29. Define in -order traversal?
i)Process the left subtree
ii)Process the root node
iii)Process the right subtree
30. What is meant by sorting?
Ordering the data in an increasing or decreasing fashion according to some relationship among
the data item is called sorting.
31. What's the major distinction in between Storage structure and file structure and how?
The expression of an specific data structure inside memory of a computer system is termed
storage structure in contrast to a storage structure expression in auxiliary memory is normally
known as a file structure.
32. Stack can be described as a pointer. Explain?
Because stack will contain a head pointer which will always point to the top of the [Link]
Stack Operations are done using Head Pointer. Hence Stack ca be Described as a Pointer
33. What do you mean by: Syntax Error, Logical Error, Run time Error?
Syntax Error-Syntax Error is due to lack of knowledge in a specific language. It is due to
somebody does not know how to use the features of a [Link] can know the errors at the
time of compilation.
logical Error-It is due to the poor understanding of the requirement or problem.
Run time Error-The exceptions like divide a number by 0,overflow and underflow comes under
this.
34. What is mean by d-queue?
D-queue stands for double ended queue. It is a abstract data structure that implements a queue
for which elements can be added to front or rear and the elements can be removed from the rear
or front. It is also called head-tail linked list
35. What is AVL tree?
Avl tree is self binary tree in which balancing factor lie between the -1 to [Link] is also known as
self balancing tree.
36. what is binary tree?
Binary tree is a tree which has maximum no. of childrens either 0 or 1 or 2. i.e., there is at the
most 2 branches in every node.
37. What is the difference between a stack and a Queue?
Stack – Represents the collection of elements in Last In First Out order. Operations includes
testing null stack, finding the top element in the stack, removal of top most element and adding
elements on the top of the stack.
Queue - Represents the collection of elements in First In First Out [Link] include
testing null queue, finding the next element, removal of elements and inserting the elements from
the queue.
Insertion of elements is at the end of the [Link] of elements is from the beginning of the
queue
38. What actions are performed when a function is called?
i)arguments are passed
ii)local variables are allocated and initialized
iii)transferring control to the function
39. What is precision?
Precision refers the accuracy of the decimal portion of a value. Precision is the number of digits
allowed after the decimal point.
40. What do you mean by overflow and underflow?
When new data is to be inserted into the data structure but there is no available space [Link]
storage list is empty this situation is called [Link] we want to delete data from a data
structure that is empty this situation is called underflow
SECTION -13 NETWORK INTERVIEW QUESTIONS
1. Define Network?
A network is a set of devices connected by physical media links. A network is recursively is a
connection of two or more nodes by a physical link or two or more networks connected by one or
more nodes.
2. What is the criteria to check the network reliability?
A network Reliability is measured on following factors.
a) Downtime: The time it takes to recover.
b) Failure Frequency: The frequency when it fails to work the way it is intended.
3. What do you mean by Bandwidth?
Every Signal has a limit of its upper range and lower range of frequency of signal it can carry.
This range of limit of network between its upper frequency and lower frequency is termed as
Bandwidth.
4. What is a Link?
At the lowest level, a network can consist of two or more computers directly connected by some
physical medium such as coaxial cable or optical fiber. Such a physical medium is called as
Link.
5. What is a node?
A network can consist of two or more computers directly connected by some physical medium
such as coaxial cable or optical fiber. Such a physical medium is called as Links and the
computer it connects is called as Nodes.
6. What is a gateway or Router?
A node that is connected to two or more networks is commonly called as router or Gateway. It
generally forwards message from one network to another.
7. What is DNS?
DNS stands for Domain Name System. It is a Naming System for all the resources over Internet
which includes Physical nodes and Applications. DNS is a way to locate to a resource easily over
a network and serves to be an essential component necessary for the working of Internet.
8. What is point-point link?
If the physical links are limited to a pair of nodes it is said to be point-point link.
9. What is DHCP scope?
A scope is a range, or pool, of IP addresses that can be leased to DHCP clients on a given subnet.
10. What is FQDN?
An FQDN contains (fully qualified domain name) both the hostname and a domain name. It
uniquely identifies a host within a DNS hierarchy
11. What is the DNS forwarder?
DNS servers often must communicate with DNS servers outside of the local network. A
forwarder is an entry that is used when a DNS server receives DNS queries that it cannot resolve
locally. It then forwards those requests to external DNS servers for resolution.
12. Give a brief description of PAN, LAN, HAN, SAN, CAN, MAN, WAN, GAN.
a) PAN (Personal Area Network)
It is a connection of Computer and Devices that are close to a person VIZ., Computer,
Telephones, Fax, Printers, etc. Range Limit – 10 meters.
b) LAN (Local Area Network)
LAN is the connection of Computers and Devices over a small Geographical Location – Office,
School, Hospital, etc. A LAN can be connected to WAN using a gateway (Router).
c) HAN (House Area Network)
HAN is LAN of Home which connects to homely devices ranging from a few personal
computers, phone, fax and printers.
d) SAN (Storage Area Network)
SAN is the connection of various storage devices which seems local to a computer.
e) CAN (Campus Area Network)
CAN is the connection of devices, printers, phones and accessories within a campus which Links
to other departments of the organization within the same campus.
f) MAN (Metropolitan Area Network)
MAN is the connection of loads of devices which spans to Large cities over a wide Geographical
Area.
g) WAN ( Wide Area Network)
WAN connects devices, phones, printers, scanners, etc over a very wide geographical location
which may range to connect cities, countries and ever continents.
h) GAN (Global Area Network)
GAN connects mobiles across the globe using satellites.
13. What is POP3?
POP3 stands for Post Office Protocol Version3 (Current Version). POP is a protocol which
listens on port 110 and is responsible for accessing the mail service on a client machine. POP3
works in two modes such as Delete Mode and Keep Mode.
a) Delete Mode: A mail is deleted from the mailbox after successful retrieval.
b) Keep Mode: The Mail remains Intact in the mailbox after successful retrieval.
14. How would you recommend we support our mobile workers?
Look for answers that talk about bandwidth availability, user experience, and traffic security. It’s
also interesting to see if candidates ask what sort of applications mobile workers use and then
tailor their answers to reflect the way the network will be used.
15. What’s your experience of configuration management?
This question probes candidates' thoughts and experiences of the structure and governance that
surrounds networking. You want someone with deep technical knowledge and domain
experience, but also someone who isn’t a maverick who will make changes without following
the proper protocols.
16. What do you mean by MAC address? Does it has some link or something in common to
Mac OS of Apple?
MAC stands for Media Access Control. It is the address of the device identified at Media Access
Control Layer of Network Architecture. Similar to IP address MAC address is unique address,
i.e., no two device can have same MAC address. MAC address is stored at the Read Only
Memory (ROM) of the device.
MAC Address and Mac OS are two different things and it should not be confused with each
other. Mac OS is a POSIX standard Operating System Developed upon FreeBSD used by Apple
devices.
That’s all for now. We will be coming up with another articles on Networking series every now
and then. Till then, don’t forget to provide us with your valuable feedback in the comment
section below.
17. How will check ip address on 98?
Start ==> Run ==> command ==> winipcfg
How will you make partition after installing windows?
My computer ==> right click ==> manage ==> disk management ==>
select free space ==> right click ==> New partition
18. What is IP?
It's a unique 32 bits software address of a node in a network.
19. What is private IP?
Three ranges of IP addresses have been reserved for private address and they are not valid for
use on the Internet. If you want to access internet with these address you must have to use proxy
server or NAT server (on normal cases the role of proxy server is played by your ISP.).If you do
decide to implement a private IP address range, you can use IP addresses from any of the
following classes:
Class A : [Link] [Link]
Class B : [Link] [Link]
Class C : [Link] [Link]
20. What is public IP address?
A public IP address is an address leased from an ISP that allows or enables direct Internet
communication.
21. What's the benefit of subnetting?
1. Reduce the size of the routing tables.
2. Reduce network traffic. Broadcast traffic can be isolated within a single logical network.
3. Provide a way to secure network traffic by isolating it from the rest of the network.

22. What are the differences between static IP addressing and dynamic IP addressing?
With static IP addressing, a computer (or other device) is configured to always use the same IP
address. With dynamic addressing, the IP address can change periodically and is managed by a
centralized network service.
23. What is APIPA?
Automatic private IP addressing (APIPA) is a feature mainly found in Microsoft operating
systems. APIPA enables clients to still communicate with other computers on the same network
segment until an IP address can be obtained from a DHCP server, allowing the machine to fully
participate on the network. The range of these IP address are the [Link] to [Link]
with a default Class B subnet mask of [Link].
24. What are the LMHOSTS files?
The LMHOSTS file is a static method of resolving NetBIOS names to IP addresses in the same
way that the HOSTS file is a static method of resolving domain names into IP addresses. An
LMHOSTS file is a text file that maps NetBIOS names to IP addresses; it must be manually
configured and updated.
25. When were OSI model developed and why its standard called [Link] and so on?
OSI model was developed in February1980 that why these also known as [Link] Standard
(Note : 80 means ----> 1980, 2means ----> February)
26. What is Full form of ADS?
Active Directory Structure
27. How will you register and activate windows?
If you have not activated windows XP, you can do so at any time by clicking the windows
Activation icon in the system tray to initiate activation. Once you have activated windows XP,
this icon disappears from the system tray.
For registration
Start ==> Run ==> regwiz /r
28. Where do we use cross and standard cable?
Computer to computer ==> cross
Switch/hub to switch/hub ==>cross
Computer to switch/hub ==>standard

29. What is RAID?


A method for providing fault tolerance by using multiple hard disk drives.
30. What is NETBIOS and NETBEUI?
NETBIOS is a programming interface that allows I/O requests to be sent to and received from a
remote computer and it hides the networking hardware from applications.
NETBEUI is NetBIOS extended user interface. A transport protocol designed by Microsoft and
IBM for the use on small subnets.
31. What is redirector?
Redirector is software that intercepts file or prints I/O requests and translates them into network
requests. This comes under presentation layer.
32. What is Beaconing?
The process that allows a network to self-repair networks problems. The stations on the network
notify the other stations on the ring when they are not receiving the transmissions. Beaconing is
used in Token ring and FDDI networks.
33. How will enable sound service in 2003?
By default this service remain disable to enable this service
Start -------->administrative tools ---------> service -----------> windows audio ----------> start up
type -------->automatic
34. How will enable CD burning service in 2003?
By default this service remain disable to enable this service
Start --------> administrative tools --------> service -------->IMAPI CD burning com service
--------> start up type --------> automatic
35. What types of network do you have experience with?
This should be one of the first things you ask. It might be critical to you that the candidate has
prior experience with the type of network model you use, but even candidates that don't could be
good fits, assuming they are willing to learn and have other critical skills. In fact, candidates with
lots of experience on networks very similar to yours could be too set in their ways to adapt to the
way your business does things.
36. What can you tell me about the OSI Reference Model?
The OSI Reference Model provides a framework for discussing network design and operations.
It groups communication functions into 7 logical layers, each one building on the next. This
question will demonstrate whether candidates have the theoretical knowledge to back up their
practical skills.
37. What are the use of cross and standard cables? Where do you find their usages?
A Network cable may be crossover as well as straight. Both of these cables have different wires
arrangement in them, which serves to fulfill different purpose.
a) Area of application of Straight cable
1. Computer to Switch
2. Computer to Hub
3. Computer to Modem
4. Router to Switch
b) Ares of application of Crossover cable
1. Computer to Computer
2. Switch to Switch
3. Hub to Hub
38. What monitoring tools or approaches do you rate?
You can extend this to ask about what tools candidates have used in other jobs. Hopefully they
will be able to give you a range of products and techniques, and the rationale for their favorites.
This can tell you about the depth of their experience and also whether their choices of tools are a
good fit for your architecture.
39. Describe 802.3 standards
1. IEEE 802 : LAN/MAN
2. IEEE 802.1 : Standards for LAN/MAN bridging and management and remote media
access control bridging.
3. IEEE 802.2 : Standards for Logical Link Control (LLC) standards for connectivity.
4. IEEE 802.3 : Ethernet Standards for Carrier Sense Multiple Access with Collision
Detection (CSMA/CD).
5. IEEE 802.4 : Standards for token passing bus access.
6. IEEE 802.5 : Standards for token ring access and for communications between LANs
and MANs
7. IEEE 802.6 : Standards for information exchange between systems.
8. IEEE 802.7 : Standards for broadband LAN cabling.
9. IEEE 802.8 : Fiber optic connection.
10. IEEE 802.9 : Standards for integrated services, like voice and data.
11. IEEE 802.10 : Standards for LAN/MAN security implementations.
12. IEEE 802.11 : Wireless Networking – "WiFi".
13. IEEE 802.12 : Standards for demand priority access method.
14. IEEE 802.14 : Standards for cable television broadband communications.
15. IEEE 802.15.1 : Bluetooth
16. IEEE 802.15.4 : Wireless Sensor/Control Networks – "ZigBee"
17. IEEE 802.16 : Wireless Networking – "WiMAX"
40. What is virtual path?
Along any transmission path from a given source to a given destination, a group of virtual
circuits can be grouped together into what is called path.
41. What is virtual channel?
Virtual channel is normally a connection from one source to one destination, although multicast
connections are also permitted. The other name for virtual channel is virtual circuit.
42. What is logical link control?
One of two sublayers of the data link layer of OSI reference model, as defined by the IEEE 802
standard. This sublayer is responsible for maintaining the link between computers when they are
sending data across the physical network connection.
43. Why should you care about the OSI Reference Model?
It provides a framework for discussing network operations and design.
44. What is the difference between routable and non- routable protocols?
Routable protocols can work with a router and can be used to build large networks. Non-
Routable protocols are designed to work on small, local networks and cannot be used with a
router
45. What is MAU?
In token Ring , hub is called Multistation Access Unit(MAU).
46. Explain 5-4-3 rule
In a Ethernet network, between any two points on the network, there can be no more than five
network segments or four repeaters, and of those five segments only three of segments can be
populated.
47. What is the difference between TFTP and FTP application layer protocols?
The Trivial File Transfer Protocol (TFTP) allows a local host to obtain files from a remote host
but does not provide reliability or security. It uses the fundamental packet delivery services
offered by UDP.
The File Transfer Protocol (FTP) is the standard mechanism provided by TCP / IP for copying a
file from one host to another. It uses the services offered by TCP and so is reliable and secure. It
establishes two connections (virtual circuits) between the hosts, one for data transfer and another
for control information.
48. What is the minimum and maximum length of the header in the TCP segment and IP
datagram?
The header should have a minimum length of 20 bytes and can have a maximum length of 60
bytes.
49. What is difference between ARP and RARP?
The address resolution protocol (ARP) is used to associate the 32 bit IP address with the 48 bit
physical address, used by a host or a router to find the physical address of another host on its
network by sending a ARP query packet that includes the IP address of the receiver.
The reverse address resolution protocol (RARP) allows a host to discover its Internet address
when it knows only its physical address.
50. What is ICMP?
ICMP is Internet Control Message Protocol, a network layer protocol of the TCP/IP suite used by
hosts and gateways to send notification of datagram problems back to the sender. It uses the echo
test / reply to test whether a destination is reachable and responding. It also handles both control
and error messages.
51. What is terminal emulation, in which layer it comes?
Telnet is also called as terminal emulation. It belongs to application layer.
52. What is frame relay, in which layer it comes?
Frame relay is a packet switching technology. It will operate in the data link layer.
53. What do you meant by "triple X" in Networks?
The function of PAD (Packet Assembler Disassembler) is described in a document known as
X.3. The standard protocol has been defined between the terminal and the PAD, called X.28;
another standard protocol exists between hte PAD and the network, called X.29. Together, these
three recommendations are often called "triple X".

54. What is SAP?


Series of interface points that allow other computers to communicate with the other layers of
network protocol stack.
55. What is subnet?
A generic term for section of a large networks usually separated by a bridge or router.
56. What is subnet mask?
It is a term that makes distinguish between network address and host address in IP address.
Subnet mask value 0 defines host partition in IP address and value 1 – 255 defines Network
address.
57. What is backbone network?
A backbone network is a centralized infrastructure that is designed to distribute different routes
and data to various networks. It also handles management of bandwidth and various channels.
58. What is anonymous FTP?
Anonymous FTP is a way of granting user access to files in public servers. Users that are
allowed access to data in these servers do not need to identify themselves, but instead log in as
an anonymous guest.
59. What is subnet mask?
A subnet mask is combined with an IP address in order to identify two parts: the extended
network address and the host address. Like an IP address, a subnet mask is made up of 32 bits.
60. What is the maximum length allowed for a UTP cable?
A single segment of UTP cable has an allowable length of 90 to 100 meters. This limitation can
be overcome by using repeaters and switches.
61. What is data encapsulation?
Data encapsulation is the process of breaking down information into smaller manageable chunks
before it is transmitted across the network. It is also in this process that the source and
destination addresses are attached into the headers, along with parity checks.
62. Describe Network Topology
Network Topology refers to the layout of a computer network. It shows how devices and cables
are physically laid out, as well as how they connect to one another.

63. What is VPN?


VPN means Virtual Private Network, a technology that allows a secure tunnel to be created
across a network such as the Internet. For example, VPNs allow you to establish a secure dial-up
connection to a remote server.
64. Briefly describe NAT.
NAT is Network Address Translation. This is a protocol that provides a way for multiple
computers on a common network to share single connection to the Internet.
65. How does a network topology affect your decision in setting up a network?
Network topology dictates what media you must use to interconnect devices. It also serves as
basis on what materials, connector and terminations that is applicable for the setup.
66. What is RIP?
RIP, short for Routing Information Protocol is used by routers to send data from one network to
another. It efficiently manages routing data by broadcasting its routing table to all other routers
within the network. It determines the network distance in units of hops.
67. What are different ways of securing a computer network?
There are several ways to do this. Install reliable and updated anti-virus program on all
computers. Make sure firewalls are setup and configured properly. User authentication will also
help a lot. All of these combined would make a highly secured network.
68. What is NIC?
NIC is short for Network Interface Card. This is a peripheral card that is attached to a PC in
order to connect to a network. Every NIC has its own MAC address that identifies the PC on the
network.
69. What is the importance of the OSI Physical Layer?
The physical layer does the conversion from data bits to electrical signal, and vice versa. This is
where network devices and cable types are considered and setup.
70. How many layers are there under TCP/IP?
There are four layers: the Network Layer, Internet Layer, Transport Layer and Application Layer
Section-14 C++ and OOPS
1. What is OOPS?

OOPS is abbreviated as Object Oriented Programming system in which programs are considered
as a collection of objects. Each object is nothing but an instance of a class.

2. Write basic concepts of OOPS?

Following are the concepts of OOPS and are as follows:

1. Abstraction.
2. Encapsulation.
3. Inheritance.
4. Polymorphism.
3. What is a class?
A class is simply a representation of a type of object. It is the blueprint/ plan/ template that
describes the details of an object.

4. What is an object?

An object for constructor as an instance of a class, and it has its own state, behavior, and identity.

5. What is Encapsulation?

Encapsulation is an attribute of an object, and it contains all data which is hidden. That hidden
data can be restricted to the members of that class.

Levels are Public, Protected, Private, Internal and Protected Internal.

6. What is Polymorphism?

Polymorphism is nothing but assigning behavior or value in a subclass to something that was
already declared in the main class. Simply, polymorphism takes more than one form.

7. What is Inheritance?

Inheritance is a concept where one class shares the structure and behavior defined in another
class. If inheritance applied on one class is called Single Inheritance, and if it depends on
multiple classes, then it is called multiple Inheritance.

8. What are manipulators?

Manipulators are the functions which can be used in conjunction with the insertion (<<) and
extraction (>>) operators on an object. Examples are endl and setw.

9. Define a constructor?

A constructor is a method used to initialize the state of an object, and it gets invoked at the time
of object creation. Rules forconstructor are:
 Constructor Name should be same as class name.
 A constructor must have no return type.
10. Define Destructor?

A destructor is a method which is automatically called when the object is made of scope or
destroyed. Destructor name is also same as class name but with the tilde symbol before the name.

11. What is an Inline function?

An inline function is a technique used by the compilers and instructs to insert complete body of
the function wherever that function is used in the program source code.

12. What is a virtual function?

A virtual function is a member function of class, and its functionality can be overridden in its
derived class. This function can be implemented by using a keyword called virtual, and it can be
given during function declaration.

A virtual function can A token in C++, and it can be achieved in C Language by using function
pointers or pointers to function.

13. What is a friend function?

A friend function is a friend of a class that is allowed to access to Public, private or protected
data in that same class. If the function is defined outside the class cannot access such
information.

Friend can be declared anywhere in the class declaration, and it cannot be affected by access
control keywords like private, public or protected.

14. What is function overloading?

Function overloading an as a normal function, but it can perform different tasks. It allows the
creation of several methods with the same name which differ from each other by the type of
input and output of the function.

Example
void add(int& a, int& b);
void add(double& a, double& b);
void add(struct bob& a, struct bob& b);
15. What is operator overloading?

Operator overloading is a function where different operators are applied and depends on the
arguments. Operator,-,* can be used to pass through the function, and it has their own
precedence to execute

16. What is an abstract class?

An abstract class is a class which cannot be instantiated. Creation of an object is not possible
with an abstract class, but it can be inherited. An abstract class can contain only Abstract
method. Java allows only abstract method in abstract class while for other languages allow non-
abstract method as well.

17. What is a ternary operator?

The ternary operator is said to be an operator which takes three arguments. Arguments and
results are of different data types, and it depends on the function. The ternary operator is also
called a conditional operator.

18. What is the use of finalize method?

Finalize method helps to perform cleanup operations on the resources which are not currently
used. Finalize method is protected, and it is accessible only through this class or by a derived
class.

19. What are different types of arguments?

A parameter is a variable used during the declaration of the function or subroutine and arguments
are passed to the an, and it should match with the parameter defined. There are two types of
Arguments.

 Call by Value – Value passed will get modified only inside the function, and it returns the
same value whatever it is passed it into the function.
 Call by Reference – Value passed will get modified in both inside and outside the
functions and it returns the same or different value.

20. What is the super keyword?

Super keyword is used to invoke the overridden method which overrides one of its superclass
methods. This keyword allows to access overridden methods and also to access hidden members
of the superclass.

It also forwards a call from a constructor to a constructor in the superclass.

21. What is method overriding?


Method overriding is a feature that allows a subclass to provide the implementation of a method
that overrides in the main class. This will overrides the implementation in the superclass by
providing the same method name, same parameter and same return type.

22. What is an interface?

An interface is a collection of an abstract method. If the class implements an inheritance, and


then thereby inherits all the abstract methods of an interface.

23. What is exception handling?

An exception is an event that occurs during the execution of a program. Exceptions can be of any
type – Runtime exception, Error exceptions. Those exceptions are adequately handled through
exception handling mechanism like try, catch and throw keywords.
24. What are tokens?

The token is recognized by a compiler, and it cannot be broken down into component elements.
Keywords, identifiers, constants, string literals and operators are examples of tokens.

Even punctuation characters are also considered as tokens – Brackets, Commas, Braces and
Parentheses.

25. Difference between overloading and overriding?

Overloading is static binding whereas Overriding is dynamic binding. Overloading is nothing but
the same method with different arguments, and it may or may not return the same value in the
same class itself.

Overriding is the same method names with same arguments and return types associated with the
class and its child class.

26. Difference between class and an object?


An object is an instance of a class. Objects hold multiple information, but classes don’t have any
information. Definition of properties and functions can be done at class and can be used by the
object.

A class can have sub-classes, and an object doesn’t have sub-objects.

27. What is an abstraction?

Abstraction is a good feature of OOPS, and it shows only the necessary details to the client of an
object. Means, it shows only required details for an object, not the inner constructors, of an
object. Example – When you want to switch On television, it not necessary to show all the
functions of TV. Whatever is required to switch on TV will be showed by using abstract class.

28. What are access modifiers?

Access modifiers determine the scope of the method or variables that can be accessed from other
various objects or classes. There are 5 types of access modifiers, and they are as follows:

 Private.
 Protected.
 Public.
 Friend.
 Protected Friend.
29. What are sealed modifiers?

Sealed modifiers are the access modifiers where it cannot be inherited by the methods. Sealed
modifiers can also be applied to properties, events, and methods. This modifier cannot be applied
to static members.

30. How can we call the base method without creating an instance?

Yes, it is possible to call the base method without creating an instance. And that method should
be “Static method”.
Doing inheritance from that class.-Use Base Keyword from a derived class.

31. 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.

32. What are the various types of constructors?

There are three various types of constructors, and they are as follows:

– Default Constructor – With no parameters.

– Parametric Constructor – With Parameters. Create a new instance of a class and also passing
arguments simultaneously.

– Copy Constructor – Which creates a new object as a copy of an existing object.

33. What is early and late binding?

Early binding refers to the assignment of values to variables during design time whereas late
binding refers to the assignment of values to variables during run time.

34. What is ‘this’ pointer?

THIS pointer refers to the current object of a class. THIS keyword is used as a pointer which
differentiates between the current object with the global object. Basically, it refers to the current
object.

35. What is the difference between structure and a class?

Structure default access type is public , but class access type is private. A structure is used for
grouping data whereas class can be used for grouping data and methods. Structures are
exclusively used for data, and it doesn’t require strict validation , but classes are used to
encapsulates and inherit data which requires strict validation.

36. What is the default access modifier in a class?

The default access modifier of a class is Private by default.

37. What is a pure virtual function?

A pure virtual function is a function which can be overridden in the derived class but cannot be
defined. A virtual function can be declared as Pure by using the operator =0.

Example -.
1 Virtual void function1() // Virtual, Not pure
2
3 Virtual void function2() = 0 //Pure virtual

38. What are all the operators that cannot be overloaded?

Following are the operators that cannot be overloaded -.

1. Scope Resolution (:: )


2. Member Selection (.)
3. Member selection through a pointer to function (.*)

39. What is dynamic or run time polymorphism?

Dynamic or Run time polymorphism is also known as method overriding in which call to an
overridden function is resolved during run time, not at the compile time. It means having two or
more methods with the same name, same signature but with different implementation.

40. Do we require a parameter for constructors?

No, we do not require a parameter for constructors.

41. What is a copy constructor?

This is a special constructor for creating a new object as a copy of an existing object. There will
always be only on copy constructor that can be either defined by the user or the system.

42. What does the keyword virtual represented in the method definition?

It means, we can override the method.

43. Whether static method can use nonstatic members?

False.

44. What is a base class, sub class and super class?

The base class is the most generalized class, and it is said to be a root class.

A Sub class is a class that inherits from one or more base classes.

The super class is the parent class from which another class inherits.

45. What is static and dynamic binding?

Binding is nothing but the association of a name with the class. Static binding is a binding in
which name can be associated with the class during compilation time, and it is also called as
early Binding.

Dynamic binding is a binding in which name can be associated with the class during execution
time, and it is also called as Late Binding.
46. How many instances can be created for an abstract class?

Zero instances will be created for an abstract class.

47. Which keyword can be used for overloading?

Operator keyword is used for overloading.

48. What is the default access specifier in a class definition?

Private access specifier is used in a class definition.

49. Which OOPS concept is used as reuse mechanism?

Inheritance is the OOPS concept that can be used as reuse mechanism.

50. Which OOPS concept exposes only necessary information to the calling functions?

Encapsulation
SECTION -15 SQL QUERIES
1. Compare SQL & PL/SQL

Criteria SQL PL/SQL

What it is Single query or Full programming language


command execution

What it Data source for reports, Application language to build, format


comprises web pages and display report, web pages

Characteristic Declarative in nature Procedural in nature

Used for Manipulating data Creating applications

2. What is BCP? When is it used?

It is a tool used to duplicate enormous quantity of information from tables


and views. It does not facsimile the structures same as foundation to target.
BULK INSERT command helps to bring in a data folder into a record, table
or view in a user-specific arrangement.

3. When is the UPDATE_STATISTICS command used?

This command is used, ones the processing of large data is done.


When we delete a large number of files, alteration or reproduction takes
place in the tables, to be concerned of these changes we need to restructure
the indexes This is done UPDATE_STATISTICS.

4. Explain the steps needed to Create the scheduled job?

Steps to create a Scheduled Job :

1. Connect to the database of SQL server in SQL Server Management


Studio. On the SQL Server Agent, we will find a Jobs folder.
2. Right click on jobs and choose Add New.
3. A New Job window will come into view. Give an associated name for
the same.
4. Click next on the “Steps” in the left list of options. An SQL job can have
multiple steps either in the form of SQL declaration or a stored
practice call.
5. Click on the “Schedules” in the left list of options. An SQL job can
comprise of one or supplementary schedules. It is basically the
instance at which SQL job will jog itself. We can spell out returning
schedules also.

5. When are we going to use truncate and delete?

1. TRUNCATE is a DDL command, whereas DELETE is a DML command.


2. We can’t execute a trigger in case of TRUNCATE whilst with DELETE,
we can accomplish a trigger.
3. TRUNCATE is quicker than DELETE, for the reason that when we use
DELETE to delete the data, at that time it store the whole statistics in
the rollback gap on or after where we can get the data back after
removal. In case of TRUNCATE, it will not store data in rollback gap
and will unswervingly rub it out. TRUNCATE do not recover the deleted
data.
4. We can use any condition in WHERE clause using DELETE but it is not
possible with [Link] a table is referenced by any foreign key
constraints, then TRUNCATE won’t work.

Go through this SQL tutorial to learn more about SQL commands.

6. Explain correlated query work?

It’s most important to be attentive of the arrange of operations in an


interrelated subquery.
First, a row is processed in the outer doubt.
Then, for that exacting row, the subquery is executed – as a result for each
row processed by the outer query, the subquery will also be processed. In
correlated subquery, each time a line is worked for Emp1, the subquery will
also make a decision on the exacting row’s value for [Link] and run.
And the outer query will move on to the next row, and the subquery will
execute for that row’s value of [Link].
It will persist in anticipation of the “WHERE (1) = (… )” state is pleased.
Read this insightful tutorial to learn usage of SQL Clauses.

7. When is the Explicit Cursor Used ?

If the developer needs to perform the row by row operations for the result
set containing more than one row, then he unambiguously declares a pointer
with a name. They are managed by OPEN, FETCH and CLOSE.%FOUND,
%NOFOUND, %ROWCOUNT and %ISOPEN characteristics are used in all
types of pointers.

8. Find What is Wrong in this Query?


SELECT subject_code, AVG (marks) FROM students WHERE
AVG(marks) > 75 GROUP BY subject_code; The WHERE clause cannot
be used to restrict groups. Instead, the HAVING clause should be
used.
SELECT subject_code, AVG (marks)
FROM students
HAVING AVG(marks) > 75
GROUP BY subject_code;

9. Write the Syntax for STUFF function in an SQL server?

STUFF (String1, Position, Length, String2)


String1 - String to be overwritten
Position - Starting location for overwriting
Length - Length of substitute string
String2- String to overwrite.

10. Name some commands that can be used to manipulate text in T-


SQL code. For example, a command that obtains only a portion of
the text or replace a text string, etc.

 CHARINDEX( findTextData, textData, [startingPosition] ) –


Returns the starting position of the specified expression in a character
string. The starting position is optional.
 LEFT( character_expression , integer_expression ) – Returns the
left part of a character string with the specified number of characters.
 LEN( textData ) – Returns integer value of the length of the string,
excluding trailing blanks.
 LOWER ( character_expression ) – Returns a character expression
after converting uppercase character data to lowercase.
 LTRIM( textData) – Removes leading blanks.
PATINDEX( findTextData, textData ) – Returns integer value of the
starting position of text found in the string.
 REPLACE( textData, findTextData, replaceWithTextData ) –
Replaces occurrences of text found in the string with a new value.
 REPLICATE( character_expression , integer_expression ) –
Repeats a character expression for a specified number of times.
 REVERSE( character_expression ) – Returns the reverse of a
character expression.
 RTRIM( textData) – Removes trailing blanks.
SPACE( numberOfSpaces ) – Repeats space value specified number of
times.
 STUFF( textData, start , length , insertTextData ) – Deletes a
specified length of characters and inserts another set of characters at
a specified starting point.
 SUBSTRING( textData, startPosition, length ) – Returns portion of
the string.
 UPPER( character_expression ) – Returns a character expression
with lowercase character data converted to uppercase.

11. What are the three ways that Dynamic SQL can be executed?

 Writing a query with parameters.


 Using EXEC.
 Using sp_executesql.

Get a clear understanding of SQL in this riveting blog.

12. In what version of SQL Server were synonyms released? How do


synonyms work and explain its use cases? Synonyms were released
with SQL Server 2005.

 Synonyms enable the reference of another object (View, Table, Stored


Procedure or Function) potentially on a different server, database or
schema in your environment. In simple words, the original object that
is referenced in the whole code is using a completely different
underlying object, but no coding changes are necessary. Think of this
as an alias as a means to simplify migrations and application testing
without the need to make any dependent coding changes.
 Synonyms can offer a great deal of value when converting underlying
database objects without breaking front end or middle tier code. This
could be useful during a re-architecture or upgrade project.

Become Master of SQL by going through this SQL training course.

Download SQL Interview Questions asked by top MNCs in 2018


GET PDF

13. If you are a SQL Developer, how can you delete duplicate
records in a table with no primary key?
Use the SET ROWCOUNT command. For instance,
if you have 2 duplicate rows, you would SET ROWCOUNT 1, execute DELETE
command and then SET ROWCOUNT 0.

14. Is it possible to import data directly from T-SQL commands


without using SQL Server Integration Services? If so, what are the
commands?

Yes, six commands are available to import data directly in the T-SQL
language. These commands include :

 BCP : The bulk copy (bcp) command of Microsoft SQL Server provides
you with the ability to insert large numbers of records directly from the
command line. In addition to being a great tool for command-line
aficionados, bcp is a powerful tool for those seeking to insert data into
a SQL Server database from within a batch file or other programmatic
method.
 Bulk Insert : The BULK INSERT statement was introduced in SQL
Server 7 and allows you to interact with bcp (bulk copy program) via a
script.
 OpenRowSet : The OPENROWSET function can be referenced in the
FROM clause of a query as if it were a table name. The OPENROWSET
function can also be referenced as the target table of an INSERT,
UPDATE, or DELETE statement, subject to the capabilities of the OLE
DB provider. Although the query might return multiple result sets,
OPENROWSET returns only the first one.
 OPENDATASOURCE : Provides ad hoc connection information as part
of a four-part object name without using a linked server name.
 OPENQUERY : Executes the specified pass-through query on the
specified linked server. This server is an OLE DB data source.
OPENQUERY can be referenced in the FROM clause of a query as if it
were a table name.
 Linked Servers : Configure a linked server to enable the SQL Server
Database Engine to execute commands against OLE DB data sources
outside of the instance of SQL Server. Typically linked servers are
configured to enable the Database Engine to execute a Transact-SQL
statement that includes tables in another instance of SQL Server, or
another database product such as Oracle.

15. What is the native system stored procedure to execute a


command against all databases?

 The sp_MSforeachdb system stored procedure accepts


the @Command parameter which can be exetecuted against all
databases. The ‘?’ is used as a placeholder for the database name to
execute the same command.
 The alternative is to use a cursor to process specific commands
against each database.

16. How can a SQL Developer prevent T-SQL code from running on a
production SQL Server?

Use IF logic with the @@SERVERNAME function compared against a string


with a RETURN command before any other logic.

17. How do you maintain database integrity where deletions from


one table will automatically cause deletions in another table?

You can create a trigger that will automatically delete elements in the
second table when elements from the first table are removed.

18. What port does SQL server run on?


1433 is the standard port for SQL server.
Go through this SQL Video to get clear understanding of SQL.

19. What is the SQL CASE statement used for? Explain with an
example?

It allows you to embed an if-else like clause in the SELECT clause.

SELECT Employee_Name, CASE Location


WHEN 'alex' THEN Bonus * 2
WHEN 'robin' THEN Bonus *, 5
ELSE Bonus
END
"New Bonus"
FROM Intellipaat_employee;

Read this blog to learn why SQL Optimization has always been a
important aspect of database management.

20. What are the risks of storing a hibernate-managed object in


cache? How do you overcome the problems?

The primary problem here is that the object will outlive the session it came
from. Lazily loaded properties won’t get loaded if needed later. To overcome
the problem, perform cache on the object’s id and class and then retrieve
the object in the current session context.

21. When is the use of UPDATE_STATISTICS command ?

Updating statistics ensures that queries compile with up-to-date statistics.


However, updating statistics causes queries to recompile. We recommend
not updating statistics too often because there is a performance tradeoff
between improving query plans and the time it takes to recompile queries.
The specific tradeoffs depend on your application. UPDATE STATISTICS can
use tempdb to sort the sample of rows for building statistics.
Syntax

UPDATE STATISTICS table_or_indexed_view_name


[
{
{ index_or_statistics__name }
| ( { index_or_statistics_name } [ ,...n ] )
}
]
[ WITH
[
FULLSCAN
| SAMPLE number { PERCENT | ROWS }
| RESAMPLE
[ ON PARTITIONS ( { | } [, …n] ) ]
| [ ,...n ]
]
[ [ , ] [ ALL | COLUMNS | INDEX ]
[ [ , ] NORECOMPUTE ]
[ [ , ] INCREMENTAL = { ON | OFF } ]
] ;

::=
[ STATS_STREAM = stats_stream ]
[ ROWCOUNT = numeric_constant ]
[ PAGECOUNT = numeric_contant ]

22. What is SQL Profiler?

Microsoft SQL Server Profiler is a graphical user interface to SQL Trace for
monitoring an instance of the Database Engine or Analysis Services. You can
capture and save data about each event to a file or table to analyze later.
Use SQL Profiler to monitor only the events in which you are interested.
If traces are becoming too large, you can filter them based on the
information you want, so that only a subset of the event data is collected.
Monitoring too many events adds overhead to the server and the monitoring
process and can cause the trace file or trace table to grow very large,
especially when the monitoring process takes place over a long period of
time.

23. What command using Query Analyzer will give you the version of
SQL server and operating system?

SELECT SERVERPROPERTY (‘productversion’), SERVERPROPERTY


(‘productlevel’), SERVERPROPERTY (‘edition’).

24. What does it mean to have QUOTED_IDENTIFIER ON? What are


the implications of having it OFF?
When SET QUOTED_IDENTIFIER is ON, identifiers can be delimited by
double quotation marks, and literals must be delimited by single quotation
marks. When SET QUOTED_IDENTIFIER is OFF, identifiers cannot be
quoted and must follow all Transact-SQL rules for identifiers.

25. What is the STUFF function and how does it differ from the
REPLACE function in SQL?

Stuff function : – This function is used to replace string from the given start
position, passed as 2nd argument with string passed as last argument. In
Stuff function, 3rd argument defines the number of characters which are
going to be replaced.
Syntax :-

STUFF ( character_expression , start , length , replaceWith_expression )

For example :-

Select Stuff ('Intellipaat', 3, 3, 'abc')


This query will return the string "Iabcllipaat". In this example, Stuff
function replaces the string "Intellipaat" onwards the 3rd position('nte')
with 'abc'.

Replace Function :– Replace function is used to replace all occurrence of a


specified with the string passed as last argument.
Syntax :-

REPLACE ( string_expression , string_pattern , string_replacement )

For example :-

Select Replace ('Abcabcabc', 'bc', 'xy')


This query will return the string Axyaxyaxy. In this example, Replace
function replaces the occurrence of each 'bc' string with 'xy'.

Learn SQL from Experts! Enrol Today


26. How to get @@ERROR and @@ROWCOUNT at the same time?

If @@Rowcount is checked after Error checking statement then it will have 0


as the value of @@Recordcount as it would have been reset. And if
@@Recordcount is checked before the error-checking statement then
@@Error would get reset. To get @@error and @@rowcount at the same
time do both in same statement and store them in local variable.

SELECT @RC = @@ROWCOUNT, @ER = @@ERROR


27. What is de-normalization in SQL database administration? Give
examples

De-normalization is used to optimize the readability and performance of the


database by adding redundant data. It covers the inefficiencies in the
relational database software.
De-normalization logical data design tend to improve the query responses by
creating rules in the database which are called as constraints.
Examples include the following :

 Materialized views for implementation purpose such as :


 Storing the count of “many” objects in one-to-many relationship.
 Linking attribute of one relation with other relations.
 To improve the performance and scalability of web applications.

28. Can you explain about buffer cash and log Cache in SQL Server?

 Buffer Cache : Buffer cache is a memory pool in which data pages


are read. The ideal performance of the buffer cache is indicated as:
95% indicates that pages that were found in the memory are 95% of
time. Another 5% is need physical disk access.
If the value falls below 90%, it is the indication of more physical
memory requirement on the server.
 Log Caches : Log cache is a memory pool used to read and write the
log pages. A set of cache pages are available in each log cache. The
synchronization is reduced between log and data buffers by managing
log cache separately from the buffer cache.

29. Describe how to use Linked Server.

MS SQL Server supports the connection to different OLE DB on an ad hoc


basis. This persistent connection is referred as Linked Server.
Following are the steps to use Linked Server for any OLE DB. You
can refer this to use an MS-Excel workbook.

1. Open SQL Server Management Studio in SQL Server.


2. Expand Server Objects in Object Explorer.
3. Right-click on Linked Servers. Click on New Linked Server.
4. Select General page in the left pane and

1. Type any name for the linked server in the first text box.
2. Select the Other Data Source option.
3. Click on Microsoft Jet 4.0 OLE DB Provider from the Provider list.
4. Type the Excel as the name of the OLE DB data source.
5. Type the full path and file name of the Excel file in Data Source
box.
6. Type the Excel version no. (7.0, 8.0 etc) in the Provider String.
Use Excel 8.0 for Excel 2000, Excel 2002 or Excel 97.
7. To create a linked server click on OK.

30. How to find second highest salary of an Employee?

There are many ways to find second highest salary of Employees in SQ. You
can either use SQL Join or Subquery to solve this problem.
Here is SQL query using Subquery :

Select MAX(Salary) from Intellipaat_emplyee WHERE Salary NOT IN ( select


MAX(Salary) from Intellipaat_employee.

31. Explain how to send email from SQL database.

SQL Server has a feature for sending mails. Stored procedures can also be
used for sending mail on demand. With SQL Server 2005, MAPI client is not
needed for sending mails.
The following is the process for sending emails from database.

 Make sure that the SQL Server Mail account is configured correctly and
enable Database Mail.
 Write a script to send an e-mail. The following is the script.
 USE [YourDB]
 EXEC [Link].sp_send_dbmail
 @recipients = 'xyz@[Link];
abc@[Link];pqr@[Link]’
 @body = ' A warm wish for your future endeavor',
 @subject = 'This mail was sent using Database Mail' ;

GO

32. How to make remote connection in database?

The following is the process to make a remote connection in


database :

1. Use SQL Server Surface Area Configuration Tool for enabling the
remote connection in database.
2. Click on Surface Area Configuration for Services and Connections.
3. Click on SQLEXPRESS/Database Engine/RemoteConnections.
4. Select the radio button: Local and Remote Connections and select
‘Using TCP/IP only’ under Local and Remote Connections.
5. Click on OK button / Apply button

33. What is the purpose of OPENXML clause SQL server stored


procedure?
OPENXML parses the XML data in SQL Server in an efficient manner. It’s
primary ability is to insert XML data to the RDB. It is also possible to query
the data by using OpenXML. The path of the XML element needs to be
specified by using ‘xpath’.
The following is a procedure for retrieving xml data:

DECLARE @index int


DECLARE @xmlString varchar(8000)
SET @xmlString ='

abc
9343463943/PhoneNo>

xyz
9342673212

'
EXEC sp_xml_preparedocument @index OUTPUT, @xmlString
SELECT * FROM OPENXML (@index, 'Persons/Person') WITH (id varchar(10), Name
varchar(100) 'Name' , PhoneNo varchar(50) 'PhoneNo')
EXEC sp_xml_removedocument @index
The above code snippet results the following:
15201 abc 9343463943
15202 xyz 9342673212

34. How to store pdf file in SQL Server?

Create a column as type ‘blob’ in a table. Read the content of the file and
save in ‘blob’ type column in a table.
Or
Store them in a folder and establish the pointer to link them in the database.

35. Explain the use of keyword WITH ENCRYPTION. Create a Store


Procedure with Encryption.

It is a way to convert the original text of the stored procedure into encrypted
form. The stored procedure gets obfuscated and the output of this is not
visible to

CREATE PROCEDURE Abc


WITH ENCRYPTION
AS
<< SELECT statement>>
GO

WITH ENCRYPTION indicates that SQL Server will convert the original text of
CREATE PROCEDURE statement to an encrypted format. Users that do not
have no access to system tables or database files cannot retrieve the
encrypted text. However, the text will be available to privileged users.
Example:
CREATE PROCEDURE salary_sum
WITH ENCRYTION
AS
SELECT sum(salary)
FROM employee
WHERE emp_dept LIKE Develop

36. What is lock escalation?

Lock escalation is used to convert row locks and page locks into table locks
thereby “escalating” the smaller or finer locks. This increases the system
performance as each lock is nothing but a memory structure. Too many locks
would mean more consumption of memory. Hence, escalation is used.
Lock escalation from SQL Server 7.0 onwards is dynamically managed by
SQL Server. It is the process of converting a lot of low level locks into higher
level locks.

37. What is Failover clustering overview?

Failover clustering is mainly used for data availability. Typically, in a


failover cluster, there are two machines.

 One machine provides the basic services and the second is available
to run the service when the primary system fails.
 The primary system is monitored periodically to check if it works. This
monitoring may be performed by the failover computer or an
independent system also called as cluster controller. In an event of
failure of primary computer, the failover system takes control.

38. What is Builtin/Administrator?

The Builtin/Administrator account is basically used during some setup to join


some machine in the domain. It should be disabled immediately thereafter.
For any disaster recovery, the account will be automatically enabled. It
should not be used for normal operations.

39. What XML support does the SQL server extend?


SQL Server (server-side) supports 3 major elements :

1. Creation of XML fragments: This is done from the relational data using
FOR XML to the select query.
2. Ability to shred xml data to be stored in the database.
3. Finally, storing the xml data.

Client-side XML support in SQL Server is in the form of SQLXML. It can be


described in terms of :

 XML Views : providing bidirectional mapping between XML schemas


and relational tables.
 Creation of XML Templates : allows creation of dynamic sections in
XML.

SQL server can return XML document using FOR XML clause. XML documents
can be added to SQL Server database and you can use the OPENXML clause
to display the data from the document as a relational result set. SQL Server
2000 supports XPath queries.

You might also like