You are on page 1of 30

PRASATHS INTERVIEW QUESTIONS &

Content
1 2 3 4 5 6 7 8 9 10 11 12 Asp.Net RDBMS C++ Data Structures XML PHP C# C VB.Net MSQL Recent PHP Recent C++

Title

Page number
1 3 4 7 9 11 13 15 18 20 21 27

ANSWERS

ASP.Net
Q : What is ASP.NET? A : ASP.NET is a compiled code and run the under CLR Environment because it is a Managed Code with OOPS Accepted. Q : Differentiate between execute query and execute nonquery.? A : Execute Query is the method of which is used to return the result of the command like select Query. Execute is Update Query. The Execute NonQuery is used to return the Query OS the statement like the update Delete Insert which returns No data.. Q : What do you mean by the authentication and authorization? A : Authentication is validating user rights Authorization is validating credentials Q : What are the types of memory management? A :Memory management is many types such as Storage memory Management. I/O Memory Management etc .. Q : What is a Constructor in ASP.NET? A : Constructor is the first method that are called on instantiation of a type. It provides the way to set of default values for data before the object is available for use. Performs other necessary functions before the object is available for use. Q : Explain the serialization in ASP.NET? A : Serialization is a process of converting an object into a stream of bytes. .Net has 2 serializers namely XMLSerializer and SOAP/BINARY Serializer. Serialization is maily used in the concept of .Net Remoting. Q :What is Destructor in ASP.NET? A : destructor is called the just before an object is destroyed. It can be used to run clean-up code. You cannot control when a destructor is called since object clean up by common language runtime. Q : what are the components of web form in ASP.NET explain it? A: Server controls : The server controls are Hypertext Markup Language (HTML) elements that include a runat=server attribute. They are provide the automatic state management and server-side events and respond to the user events by executing event handler on the server. Data controls : Data controls are allow to the connect to the database, execute command and retrieve data from database.

HTML controls :These controls also respond to the user events but the events processing happen on the client machine. System components : System components provide access to system-level events that occur on the server. Q : Explain the different parts that constitute ASP.NET application? A : ASP.NET Applications are three parts of constitute there are, (i) Content files (ii) Program logic files (iii) Configuration file Content files include static text, images and can be include elements from database. Program logic files exist as DLL file on the server that responds to the user actions. Configuration file to the offers various settings that determine how is the application runs on the server. Q : Describe the sequence of action takes place on the server when ASP.NET application starts first time? A : Following are the sequences: IIS starts ASP.NET worker process>> worker process loads assembly in the memory>>IIS sends the request to the assembly>>the assembly composes a response using the program logic>> IIS returns the response to the user in the form of HTML. Q : Whats the main difference between FormLayout and GridLayout ? A :FormLayout is a little of different only experience Web Developer used this one reason is it is helpful for wider range browser. If there is any absolute positioning we can notice that there are number of DIV tags. But in FormLayout whole work are done through the tables. But Grid Layout helps in providing absolute positioning of every control placed on the page. It is easier to develop page with absolute positioning because control can be placed any where according to our requirement. Q :Differentiate between WebCustomControl and in WebUserControl? A: Web custom controls:-Web Custom Control is a typical to create and good for the dynamic layout and another thing is it have full tool support for user and a single copy of control is required because it is placed in Global Assembly cache. Web user controls :- Web User Control is Easier to create and another thing is that its support is limited for users who use a visual design tool one gud thing is that its contains static layout one more thing a seprate copy is required for each application. Q : What Language is familiar to CLR? A: Any language that can be compiled into Microsoft Intermediate Language

(MSIL) is considered a .NET-compliant language. Following are a few part of the popular .NET-compliant languages supported by CLR.

RDBMS
Q : What is a database? A : A database is a logically coherent collection of data with the some inherent meaning, representing some aspect of real world and which is designed, built and populated with the data for a specific purpose. Q : What is Data Independence? A : Data independence means that "the application is independent of the storage structure and access strategy of data". In other words, The ability to modify the schema definition in one level should not affect the schema definition in the next higher level. There are two types of independence, Logical Data Independence: Modification in logical level should affect the view level Physical Data Independence: Modification in physical level should not affect the logical level. Q : What is Data Model? A : A collection of conceptual tools for describing the data, data relationships data semantics and constraints. Q : What is an Entity set? A : Entity set is a collection of all entities of a particular entity type in the database . Q : What is E-R model? A : This data model is based on the 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. Q : Name of sub-systems of a RDBMS? A : There are many types of sub systems in RDBMS I/O, Security, Language Processing, Process Control, Storage Management, Logging and Recovery, Distribution Control, Transaction Control, Memory Management, Lock Management. Q : How communicate with an RDBMS? Communicate with an RDBMS using Structured Query Language (SQL) Q :Whats the job of the information stored in data-dictionary? A : The information in the data dictionary validates the existence of the objects, provides the access to them, and maps the actual physical storage location.

Q : Whats a database Trigger? A : A database trigger is a PL/SQL block that can be defined to automatically execute for insert, update, and delete statements against a table. The trigger can be defined to execute once for the entire statement or once for every row that is inserted, updated, or deleted. For any one table, there are twelve events for which you can define database triggers. A database trigger can call the database procedures that are also written in PL/SQL. Q : What is a Transaction Manager? Transaction manager is a program module, which ensures that the database, remains in a consistent state despite of system failures and concurrent transaction execution proceeds without conflicting. Q : What is Buffer Manager? Buffer manager is a program module, which is responsible for fetching data from disk storage into the main memory and deciding what data to be cache in memory. Q : What is File Manager? File manager is a program module, which manages the allocation of space on disk storage and data structure used to the represent information stored on a disk. Q : What is DDL? A : A data base schema is specified by a set of definitions expressed by a special language called in DDL. Q: What is SDL ? Storage Definition language is to specify the internal schema. This language may specify the mapping between two schemas. Q : Whats a DDL Interpreter? A : DDL interprets is a DDL statements and record them in tables containing meta data. Q : What is a query? A : A query with respect to DBMS relates to user the commands that are used to interact with a data base. The query language can be classified into the data definition language (DDL)and data manipulation language(DML)

C++
Q : Explain in void pointer using C++? A : In C++, void represents the absence of type, so void the pointers are pointers that point to a value that has no type. The void pointers can point to any data type.

We can declare void pointer as follows. Void *p; Q : What is the function overloading in C++? A : You can have the multiple functions with same name using function overloading facility of C++. You can use same name for multiple functions when all these functions are doing same thing. Q : What is virtual function? Answer - Virtual function is the member function of a class that can be overridden in its derived class. It is declared with virtual keyword. Virtual function call is resolved at run-time (dynamic binding) whereas the non-virtual member functions are resolved at compile time (static binding). Q : What is Null object in C++? A : Null Object is an object of some class whose purpose is to indicate that a real object of that class does not exist. One common use for a null object is a return value from a member of function that is supposed to return an object with some specified properties but cannot find such an object. Q : What is virtual function? where is it used? A : Virtual function is a member of function that is declared by with in a base class and redefined by the derived class. to make a function virtual prefix the function name by the "virtual" keyword. It helps in polymorphism. Q : what is a template A template function defines a set of operations to performed on the various data types This data is passed to the function as an argument Q : What do you mean by the inheritance? A : The Inheritance is the process by which one can aquire the properties of another object Q : Explain the scope resolution operator? A: The scope resolution operator is a permits of a program to reference an identifier in the global scope that has been hidden by another identifier with the same name in the local scope. Q : What is parameterized type? A : : A template is a parameterized construct or type containing the generic code that can use or manipulate any type. It is called the parameterized because an actual type is a parameter of the code body. Polymorphism may be achieved through parameterized types. This type of polymorphism is called parameteric polymorphism. Parameteric polymorphism is the mechanism by which the same code is used on different types passed as parameters.

Q : Explain the scope resolution operator? A :Resolution operator permits a program to reference an identifier in the global scope that has been hidden by another identifier with the same name in the local scope. Q : Name of the some pure object oriented languages? A : Some pure object oriented languages are Smalltalk, Java, Eiffel, Sather. Q : Differentiate between a C++ struct and C++ class? A : The default member and base-class access specifies are different. This is one of the commonly misunderstood aspects of C++. Believe it is or not, many programmers think that a C++ struct is just like a C struct, while a C++ class has inheritance, access specifies, member functions, overloaded operators, and so on. Actually, the C++ struct has all the features of the class. The only differences are that a struct defaults to public member access and public base-class inheritance, and a class defaults to the private access specified and private baseclass inheritance. Q : Why do C++ compilers need the name mangling? A : Name mangling is the rule of according to which is the C++ changes function's name into function signature before the passing that the function to a linker. This is how the linker differentiates between different functions with the same name. Q : What is protocol class? A : An abstract class is a protocol class if: 1.Protocol neither contains nor inherits from the classes that contain member data, non-virtual functions, or private (or protected) members of any kind. 2. It has a non-inline virtual destructor defined with an empty implementation, 3. All member functions other than the destructor including inherited functions, are declared pure the virtual functions and left undefined. Q : What is the difference between the message and method? A: Method: Provides response to a message.It is an implementation of an operation.. Message: Objects communicate by sending the messages to each other.A message is sent to invoke a method. Q : What is an adaptor class ? A : A class that has no functionality of its own. It is the member functions hide the use of a third party software component or an object with the non-compatible interface or a non- object- oriented implementation.

Q : Whats the difference between char a[] = string; and char *p = string;? A : In the first case six bytes are allocated to the variable in a which is fixed, where as in the second case if *p is assigned to the some other value the allocate memory can change. Q : What is conversion constructor? A : A conversion constructor is that accepts one argument of a different type. Q : Whats an explicit constructor? A : A conversion constructor declared with the explicit keyword. The compiler doesnt use an explicit constructor to implement an implied conversion of types. It is the purpose of is reserved explicitly for construction.

DATA STRUCTURES
Q : Whats the purpose of a left child node and a right child node? A : The left child node and right child node helps in sorting technology because parent will be having larger value than that of left and left child will be having larger value than that of right. Q : What is the advantage of using a queue linked list? A : The Most Important is CPU Scheduling , refers a Queue for scheduling. Queue is to Faster then Other One(stack) Q : What is linked list? A : Linked list is a data structure which is contain the data elements and a pointer of the node type of which points to the next node in the linked list. It is useful when you do not know in advance how many elements will be there so you cannot pre allocate space (e.g. using an array). Q : Which data structure is used to perform the recursion? A : Stack has the LIFO (Last In First Out) property; it remembers it is a caller. Therefore, it knows as to whom it should return when the function has to return. On the other hand, recursion makes use of the system stack for storing the return addresses of the function calls. Every recursive function has its equivalent iterative (non-recursive) function. Even when such the equivalent is iterative procedures are written explicit, stack is to be used. Q : What are some of the applications for the tree data structure? A : There are three types of the application for the tree data structure, Symbol table construction. Manipulation of the arithmetic expressions. Syntax analysis

Q : What is spanning Tree? A : A spanning tree is a tree associated with a network. All the nodes are 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. Q : Whats the difference between STACK and ARRAY? A : In array the items can be entered or removed in any order. Basically each member access is done using the index. No strict order is to be followed here to remove a particular element. STACK follows LIFO. Thus the item that is first entered would be the last removed. Q : What is the method removes the value from the top of a stack? A : The pop() member method removes the value from the top of a stack, which is then returned by the pop() member method to the statement that is called the pop() member method. Q : What is queue ? A : A Queue is a sequential organization of data. A queue is a FIFO type of data structure. An element is an inserted at the last position and an element is always taken out from the first position. Q : Difference between malloc and calloc ? A : calloc: allocate the m times n bytes initialized to 0 malloc: allocate the n bytes. Q : what is an abstract data type? A : Abstract data type is a logical cohesion of operands or variables along with a set of operation which can be performed on it. In Java we have most of data types as abstract data types. It helps in implementing the oops concept of encapsulation, abstraction, modularisation. Eg :String data type in java is an abstract data type. String is defined as a character array data member of a class All operations related to or which can be performed on strings are included as methods of the class. Q : Whats the difference between bubble sort & quick sort? A : Bubble sort is a very easy to program, slower, iterative. Compares neighboring numbers swaps it if required and continues this procedure until there are no more swaps Quick Sort is a little difficult to program, Fastest, Recursive. Pivot number is selected, other numbers are compared with it and shifted to the right of number or left depending upon criteria again this method is applied to the left and right list generated to the pivot point number. Select pivot point among that the list. Q : What is linear and non-linear data structures? A : Linear data structure is an array, linked list Non linear data structure is a tree, graph

Q : What is user-defined data type? A : A user defined data type is a structure of which contains variables of basic data types. For (ex) user can define a data type called employee which contains variables like string EmpName, int DeptNo, float Salary etc.

XML
Q : How can u create an XML file? A : It is a quite easy to create, can create by the plain text editor like notepad or by .net model using so many in built methods like XmlTextWriter etc. Q : What is a XML Namespace? A : Defining a namespace to avoid the confusion involves using a prefix and adding an xmlns attribute to the tag to give the prefix a qualified name associated with the namespace. All the child elements with the same prefix are associated with the namespace defined in the start tag of an element. Q : Whats the difference between SAX parser and DOM parser? A : SAX parser - works incrementally and generate the events that are passed to the application. It does not generate data representation of xml content so some programming is required. However, it provides the stream processing and partial processing which cannot be done alone by DOM parser. DOM parser - reads the whole XML document and returns a DOM tree representation of xml document. It provides a convenient way for reading, analyzing and manipulating XML files. It is not well a suited for the large xml files, as it always reads the whole file before processing. Q : Describe the differences between XML and HTML? A : XML : User definable tags Content driven End tags required for well formed documents Quotes required around attributes values Slash required in empty tags HTML : Defined set of tags designed for web display Format driven End tags not required Quotes not required Slash not required Q : What is DOM? A : The Document Object Model (DOM) is an interface specification maintained by the W3C DOM Workgroup that defines is an application independent mechanism

to access, parse, or update XML data. In the simple terms it is a hierarchical model that allows developers to manipulate XML documents easily. Q :Why is XML such an important development? A : XML removes the two constraints which were holding the back Web developments: dependence on a single, inflexible document type (HTML); the complexity of full SGML. Q : What is a XPointer? A : XPointer is a set of recommendations developed by the W3C. The core recommendations are the XPointer Framework which provides an extensible addressing behavior for fragment identifiers in XML media types. XPointer gains its extensibility through the XPointer Framework, which identifies the syntax and processing architecture for XPointer expressions and through an extensible set of XPointer addressing schemes. These schemes, e.g., element() or xpointer(), are actually QNames. The xmlns() scheme makes it possible for an XPointer to declare namespace bindings and thereby the use third-party schemes as readily as W3C defined XPointer schemes. Q : What is the three essential components of security does the XML Signatures provide? A : Authentication, message integrity, and non-repudiation. In addition to signature information, an XML Signature can also contain the information describing the key used to sign the content. Q :Whats an XML namespace prefix? A : An XML namespace prefix is a prefix used to specify that a local element type or attribute name is in a particular XML namespace. Q : Why is XML such an important development? A : XML removes the two constraints which were holding back Web developments: 1. Dependence on a single, inflexible document type (HTML) which was being much abused for tasks it was never designed for; 2. The complexity of full SGML, whose syntax allows many powerful but hard-toprogram options. XML allows the flexible development of user-defined document types. It provides a robust, non-proprietary, persistent, and verifiable file format for the storage and the transmission of text and data both on and off the Web, and its remove the more complex options of SGML, making it easier to program for.

10

PHP
Q : How To Download and Install PHP for Windows? A : The best way to download and install PHP on Windows systems is to: which is the official Web site for PHP. Download PHP binary version for Windows in ZIP format. Unzip the downloaded file into a directory. Q : Where Are PHP Configuration Settings Stored? A : PHP stores configuration settings in a file called php.ini in PHP home directory. You can open it with any text editor to your settings. Q : What Are the Special Characters You Need to Escape in Single-Quoted Stings? A : There are two special characters you need to escape in a single-quote string: the single quote (') and the back slash (). Here is a PHP script example of singlequoted strings: <?php echo 'Hello world!'; echo 'It's Friday!'; echo ' represents an operator.'; ?> This script will print: Hello world!It's Friday! represents an operator Q : How To Convert Numbers to Strings in PHP? A : In a string context, PHP will automatically convert any numeric value to a string. Here is a PHP script examples: <?php print(-1.3e3); print(" "); print(strlen(-1.3e3)); print(" "); print("Price = $" . 99.99 . " "); print(1 . " + " . 2 . " = " . 1+2 . " "); print(1 . " + " . 2 . " = " . (1+2) . " ");

11

print(1 . " + " . 2 . " = 3 "); print(" "); ?> This script will print: -1300 5 Price = $99.99 3 1+2=3 1+2=3 The print() function requires a string, so numeric value -1.3e3 is automatically converted to a string "-1300". The concatenation operator (.) also requires a string, so numeric value 99.99 is automatically converted to a string "99.99". Expression (1 . " + " . 2 . " = " . 1+2 . " ") is a little bit interesting. The result is "3 " because concatenation operations and addition operation are carried out from left to right. So when the addition operation is reached, we have "1 + 2 = 1"+2, which will cause the string to be converted to a value 1. Q : How To Replace a Substring in a Given String in PHP? A : If you know the position of a substring in a given string, you can replace that substring by another string by using the substr_replace() function. Here is a PHP script on how to use substr_replace(): <?php $string = "Warning: System will shutdown in NN minutes!"; $pos = strpos($string, "NN"); print(substr_replace($string, "15", $pos, 2)." "); sleep(10*60); print(substr_replace($string, "5", $pos, 2)." "); ?> This script will print: Warning: System will shutdown in 15 minutes! (10 minutes later) Warning: System will shutdown in 5 minutes! Like substr(), substr_replace() can take negative starting position counted from the end of the string.

12

Q : How To Compare Two Strings with Comparison Operators in PHP? A : PHP supports 3 string comparison operators, <, ==, and >, that generates Boolean values. Those operators use ASCII values of characters from both strings to determine the comparison results. Here is a PHP script on how to use comparison operators: <?php $a = "PHP is a scripting language."; $b = "PHP is a general-purpose language."; if ($a > $b) { print('$a > $b is true.'." "); } else { print('$a > $b is false.'." "); } if ($a == $b) { print('$a == $b is true.'." "); } else { print('$a == $b is false.'." "); } if ($a < $b) { print('$a < $b is true.'." "); } else { print('$a < $b is false.'." "); } ?> This script will print: $a > $b is true. $a == $b is false. $a < $b is false.

C#
Q : What is the C# syntax to catch any possible exception? A : A catch block is that the catches the exception of type System .Exception. You can also omit the parameter data type in this case and just write catch {}. Q :What is the difference between System.String and System.Text.StringBuilder classes? A : System.String is a immutable. System.StringBuilder was designed with the purpose of having a mutable the string where as a variety of operations can be performed.

13

Q : Whats the syntax to inherit from a class in C#? A: A Place is a colon and then the name of the base class. Example: class MyNewClass : MyBaseClass Q : When do you correctly have to declare a class as abstract? A : When the class itself is the inherited from an abstract class, but not all base abstract methods have been overridden. When at least one of the methods in the class is abstract class. Q : Whats the difference between a Struct and a Class? A : Structs are the value-type variables and are thus saved on the stack, additional overhead but faster retrieval. Another difference is struct can not inherit. Q :What are the different ways of method can be overloaded? A: There are three types of ways can be overloaded, Different parameter data types, Different number of parameters, Different order of parameters. Q : Which is the following is used to denote comments in C#? A : All are correct, all are supported forms of commenting. It is just that /// is specifically for functionality in XML documentation. Q : What is true about readonly variable in C# code? A : B is the right choice. Since readonly field can only be initialized at the time of construction of the object. Read only means if you want to initialize the readonly property that intialize it inside the constructor. Q : Whats an interface class? A : It is an abstract class with the public abstract methods all of which is must be implemented in the inherited classes. Q : What is a delegate? A : A delegate is a object encapsulates a reference to a method. In C++ they were referred to as function pointers. Q : What is a multicast delegate? A Multicast delegate is that points to and eventually fires off several methods. Q : What is the difference between the Trace class and Debug class? A :Documentation looks the same. Use Debug class for debug builds, use the Trace class for both debug and release builds. Q : What is Inheritance? A :Inheritance is a process of acquiring attributes and behaviors from the

14

another object (normally a class or interface). Gives you ability to provide is-a relationship. Acquires attributes and behaviors from another. When a class acquires attributes and behaviors from another class. Q : What is a Destructor? A : A destructor is a deallocating the memory. Q : How a base class method is hidden? A : Hiding a base class method by declaring a method in the derived class with keyword new. This will override the base class method and old method will be suppressed.

C
Q : What is the difference between Structure and Union? A : The Main difference is Structure is Allocate the memory in as per the Data type. But Union is Allocate the Memory in max size of Declare the variable to all. The instance of unions can access on the one member at a time. The memory allocated for the instance is the size of largest member. But instance of a structure has memory for all members separately and all the members can be accessed independently. Q : What is File Mode?. Explain types Of file mode?. A : The meaning of file mode means in which mode we want to open the file. Types of modes are read mode, write mode. Q : What is Pointer?.which is one of the most useful in Structure or Unoin?. A : Pointer is the variable which holds the address of another variable. Union are useful because of memory no wastage but structures are frequently used than unions. Q : Whats the difference between global static and static variable? A : Global variables can be define anywhere in the program and they can be use any time's . Static variable defines the inside the functions and the value of static variables can not change in the program. Q : What is an abstract base class? A : A class that has at least one pure virtual function. It can not be instantiated as there is no definition exists for pure virtual function. Abstract classes are used for achieving polymorphism. Q : Difference between a do statement and a while statement? A: A do statement checks at the end of a loop to see whether the next iteration of

15

a loop should occur. The do statement will always execute the body of a loop at least once. A while statement checks at the beginning of a loop to see whether the next loop iteration should occur. Q : Explain the meaning of "Segmentation violation"? A : A segmentation violation is usually indicates an attempt to access memory which does not even exist. Q : What is the scope of static variables. A : The scope of a static variable is a local to the block in which the variable is defined. However, the value of the static variable persists between two function calls. Q : What is the difference between malloc() and calloc() function? A: Both functions are used to dynamically allocate the memory. The difference is that calloc initializes are the allocated memory to zero or Null while malloc contains garbage values. Q : What is NULL pointer? A: A null pointer does not point to any object. NULL and zero are interchangeable in pointer contexts. Usage of NULL should be considered a gentle reminder that a pointer is involved. It is only the pointer contexts that NULL and 0 are equivalent. NULL should not be used when another kind of 0 is required. Q : Describe the advantages of using macro? A : In modular programming, using functions is advisable when a certain code is repeated several times in a program. However, every time a function is called the control gets transferred to that function and then back to the calling function. This consumes a lot of execution time. One way to save this time is by using macros. Macros substitute a function call by the definition of that function. This saves are execution time to a great extent. Q : What is the difference between getch & scanf? A : The scanf we can enter more than one data type of different data type and it needs to enter a enter key to enter .But the getch we can enter only one char & this is not displayed to stout and do not wait for the enter key. Q : what is meant by the pointer? A : Pointer is a variable which indicates can store the address of another variable Q : What are the characteristics of arrays in C? A : An array holds elements that have the same data type Array elements are stored in subsequent memory locations

16

Array name represents the address of the starting element Two-dimentional array elements are stored row by row in subsequent memory locations. Array size should be mentioned in the declaration. Array size must be a constant expression and not a variable. Q : What are the different storage classes in C? A :There are three types of storage classes in c 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. Q : Write a program to interchange 2 variables without using the third one. A : a=7; b=2; a = a + b; b = a - b; a = a - b; Q : What is a static memory allocation? A : Static memory allocation: The compiler allocates the required memory space for a declared variable. By using the address of operator, the reserved address is obtained and this address may be assigned to a pointer variable. Since most of the declared variable have static memory, this way of assigning pointer value to a pointer variable is known as static memory allocation. memory is assigned during compilation time Q : What is a dynamic memory allocation? A : Dynamic memory allocation: It uses functions such as malloc( ) or calloc( ) to get memory dynamically. If these functions are used to get the memory dynamically and the values returned by these functions are assingned to the pointer variables, such assignments are known as dynamic memory allocation. memory is assigned during run time. Q :What is constructor or ctor? A :Constructor creates an object and initializes it. It also creates v table for the virtual functions. It is different from other methods in a class. Q : What is destructor? A : Destructor usually deletes the any extra resources allocated by the object. Q : What is default constructor? A : Constructor with the no arguments or all the arguments has default values.

17

Q : What is inheritance? A : Inheritance allows one class to reuse the state and behavior of another class. The derived class inherits the properties and method implementations of the base class and extends it by the overriding methods and adding the additional properties and methods. Q : What is Polymorphism? A : Polymorphism is allow a client of to treat different objects in the same way even if they were created from different classes and exhibit different behaviors. You can use implementation inheritance to achieve polymorphism in languages such as C++ and Java. Base class object's pointer can invoke methods in derived class objects.

VB.NET
Q : Define Context menu in VB.NET? A : It is useful for enabling access to commands in a variety of contextual situations. It is created at run time in the same manner as a main menus It is created the using Context Menu control. Q : Define the Validation in VB.NET? A :Validation of two types of level validation there are, Form-level :Validates all fields on a form simultaneously. Field-level : Validation validates each field as data is entered. Q : What is a visual inheritance in VB.NET? A : A Visual inheritance allows the deriving forms from the base form with common controls. Q : What is the difference between VB and VB.NET? A: VB does not support inheritance, but VB.NET supports the inheritance. VB does not support polymorphisms, but VB.NET supports Polymorphisms. VB is OOPS based, but VB.NET completely supported for OOPS. VB supports interfaces, but VB.NET fully supports interface based programming VB uses VB runtime, but VB.NET uses CLR. Q : How to store and retrieve images in sql server database through VB.NET? A : Server supports the ability for clients to store the objects within tables. Create the Field that data type Image and Initialize byte an array with a null value initially. Use FileInfo object to get file size. Open FileStream to read file. Q : What is the Advantages of VB.NET? A : First of all, VB.NET provides managed code execution that runs under the

18

Common Language Runtime (CLR), resulting in robust, stable and secure applications. All features of the .NET framework are readily available in VB.NET. VB.NET is totally object oriented. This is a major of addition that VB6 and other earlier releases did not have. VB.NET uses XML to transfer the data between the various layers in the DNA Architecture i.e. data are passed as simple text strings. The .NET framework comes with the ADO.NET, which follows the disconnected paradigm, i.e. once the required records are fetched the connection no longer exists. It is also retrieves the records that are expected to be accessed in the immediate future. This enhances Scalability of the application to a great extent. Error handling has changed in VB.NET. A new Try-Catch-Finally block has been introduced to handle errors and exceptions as a unit, allowing appropriate action to be taken at the place the error occurred thus discouraging the use of ON ERROR GOTO statement. This again credits to the maintainability of the code. Q :What is the difference between DataSet and DataTable? A : DataTable: Represents one table of in-memory data table can have one table only or we can say Data table is a collection of record's that consist the single table Dataset: Represents an in-memory cache of data we can also say data set is a collection of data table it is based on xml format. It is used to for data storing in cache as a disconnected recordset dataset is using data manipulation in cache without connection to database. Q :What is the DataType conversion in VB.NET ? A : Convert one variable type to another one is called datatype and Another conversion we can also called this casting in VB.NET some automatically conversion is also there. Q : What is the branching logic control in vb.net ? A : Function and subroutines are the answer. The diffrence between in two of them is function send to the information back from where it is called means function can return a value but subroutines can not do this. Q :What do you mean by Serialization and Deserialization and its use? A: To load data from xml file to vb.net form is called DeSerialization. To store the vb.net for data into an xml file is called Serialization. Q : What are the various open source tool available for VB.NET? A : When compared with the rapid development of open source tools for other languages from Microsoft (C#, etc) we can say the that development of tools for VB has been slow. Mono development platform is one which is implementing VB libraries are working on a compiler.

19

Q : What is the branching logic control in vb.net? A : Function and subroutines are the answer. The diffrence between in two of them is function send the information back from where it is called means function can return a value but subroutines can not do this.

MYSQL
Q : What are the advantages of mySQL comparing with oracle? A : MySql are many advantages in comparison to Oracle. 1 - MySql is Open a source, which can be available any time 2 - MySql has no cost of development purpose. 3 - MySql has most of features , which oracle provides 4 - MySql day by day updating with the new facilities. 5 - Good for small application. 6 Easy to learn and to become master. 7 - MySql has a good power these days. Even though MySql having so many advantages, Oracle is best database ever in Software development. Q : What are two examples of an OLTP environment? A : The two expels of an OLTP environments are On Line Banking On Line Reservation (Transportation like Rail, Air etc.) Q : What Is a Primary Key? A : A primary key is a single column or multiple columns is defined to have unique values that can be used as a row identifications. Q : What Is a Transaction? A : A transaction is a logical unit of work requested by a user to be applied to the database objects. MySQL server is introduced the transaction concept to allow users to group one or more SQL statements into a single transaction, so that the effects of all the SQL statements in a transaction can be either all committed (applied to the database) or all rolled back (undone from the database). Q : What are the indexes? A: An index is an internal structure which is provided quick access to rows of a

20

table based on the values of more than one columns. <!--[if !supportEmptyParas]--> <!--[endif]--> Q : What is a foreign key? A: A foreign key is a constraint associates one or more columns in a table with an identical set of columns on which a primary key has been defined in another table. A foreign key may refer to the primary key of another table or same table. Q : What is the difference between MyISAM Static and MyISAM Dynamic ? A: In MyISAM static is all the fields have fixed width. The Dynamic MyISAM table would be include fields such as TEXT, BLOB, etc. to accommodate the data types with various lengths. MyISAM Static would be easier to restore in case of corruption, since even though you might lose some data, you know exactly where to look for the beginning of the next record.

RECENT PHP
Title: Recent PHP Interview Questions & Answers Q : What Is a Persistent Cookie? A : A persistent cookie is a cookie which is stored in a cookie file permanently on the browser's computer. By default, cookies are created as temporary cookies which stored only in the browser's memory. When the browser is closed, temporary cookies will be erased. You should decide when to use temporary cookies and when to use persistent cookies based on their differences: Temporary cookies can not be used for tracking long-term information. Persistent cookies can be used for tracking long-term information. Temporary cookies are safer because no programs other than the browser can access them. Persistent cookies are less secure because users can open cookie files see the cookie values. Q : Whats the difference between include and require? A : Its how they handle failures. If the file is not found by require(), it will cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue Q : What are the differences between GET and POST methods in form submitting, give the case where we can use GET and we can use POST methods? Anwser 1:

21

When we submit a form, which has the GET method it displays pair of name/value used in the form at the address bar of the browser preceded by url. Post method doesn't display these values. Anwser 2: When you want to send short or small data, not containing ASCII characters, then you can use GET Method. But for long data sending, say more then 100 character you can use POST method. Once most important difference is when you are sending the form with GET method. You can see the output which you are sending in the address bar. Whereas if you send the form with POST method then user can not see that information. Anwser 3: What are "GET" and "POST"? GET and POST are methods used to send data to the server: With the GET method, the browser appends the data onto the URL. With the Post method, the data is sent as "standard input." Major Difference In simple words, in POST method data is sent by standard input (nothing shown in URL when posting while in GET method data is sent through query string. Ex: Assume we are logging in with username and password. GET: we are submitting a form to login.php, when we do submit or similar action, values are sent through visible query string (notice ./login.php? username=...&password=... as URL when executing the script login.php) and is retrieved by login.php by $_GET['username'] and $_GET['password']. POST: we are submitting a form to login.php, when we do submit or similar action, values are sent through invisible standard input (notice ./login.php) and is retrieved by login.php by $_POST['username'] and $_POST['password']. POST is assumed more secure and we can send lot more data than that of GET method is limited (they say Internet Explorer can take care of maximum 2083 character as a query string). Anwser 4:

22

In the get method the data made available to the action page ( where data is received ) by the URL so data can be seen in the address bar. Not advisable if you are sending login info like password etc. In the post method the data will be available as data blocks and not as query string in case of get method. Anwser 5: When we submit a form, which has the GET method it pass value in the form of query string (set of name/value pair) and display along with URL. With GET we can a small data submit from the form (a set of 255 character) whereas Post method doesn't display value with URL. It passes value in the form of Object and we can submit large data from the form. Anwser 6: On the server side, the main difference between GET and POST is where the submitted is stored. The $_GET array stores data submitted by the GET method. The $_POST array stores data submitted by the POST method. On the browser side, the difference is that data submitted by the GET method will be displayed in the browsers address field. Data submitted by the POST method will not be displayed anywhere on the browser. GET method is mostly used for submitting a small amount and less sensitive data. POST method is mostly used for submitting a large amount or sensitive data Q : How many ways can we get the value of current session id? A : session_id() returns the session id for the current session. Q : How can I execute a PHP script using command line? A : Just run the PHP CLI (Command Line Interface) program and provide the PHP script file name as the command line argument. For example, "php myScript.php", assuming "php" is the command to invoke the CLI program. Be aware that if your PHP script was written for the Web CGI interface, it may not execute properly in command line environment.

Q : How can we send mail using JavaScript? A : No. There is no way to send emails directly using JavaScript.

23

But you can use JavaScript to execute a client side email program send the email using the "mailto" code. Here is an example: function myfunction(form) { tdata=document.myform.tbox1.value; location=" mailto:mailid@domain.com?subject =..."; return true; } Q : How can we create a database using PHP and mysql? A : We can create MySQL database with the use of mysql_create_db($databaseName) to create a database. Q : How can we submit form without a submit button? A : We can use a simple JavaScript code linked to an event trigger of any form field. In the JavaScript code, we can call the document.form.submit() function to submit the form. For example: <input type=button value="Save" onClick="document.form.submit()"> Q : What is the difference between mysql_fetch_object and mysql_fetch_array? A : MySQL fetch object will collect first single matching record where mysql_fetch_array will collect all matching records from the table in an array Q : How can we find the number of rows in a result set using PHP? A : Here is how can you find the number of rows in a result set in PHP: $result = mysql_query($any_valid_sql, $database_link); $num_rows = mysql_num_rows($result); echo "$num_rows rows found"; Q : How many values can the SET function of MySQL take? A : MySQL SET function can take zero or more values, but at the maximum it can take 64 values. Q : How many values can the SET function of MySQL take? A : MySQL SET function can take zero or more values, but at the maximum it can take 64 values.

24

Q : What is the difference between the functions unlink and unset? A : unlink() is a function for file system handling. It will simply delete the file in context. unset() is a function for variable management. It will make a variable undefined. Q : What is the difference between CHAR and VARCHAR data types? A : CHAR is a fixed length data type. CHAR(n) will take n characters of storage even if you enter less than n characters to that column. For example, "Hello!" will be stored as "Hello! " in CHAR(10) column. VARCHAR is a variable length data type. VARCHAR(n) will take only the required storage for the actual number of characters entered to that column. For example, "Hello!" will be stored as "Hello!" in VARCHAR(10) column. How can we encrypt and decrypt a data present in a mysql table using mysql? AES_ENCRYPT() and AES_DECRYPT()

Q : What are the difference between abstract class and interface? A : Abstract class: abstract classes are the class where one or more methods are abstract but not necessarily all method has to be abstract. Abstract methods are the methods, which are declare in its class but not define. The definition of those methods must be in its extending class. Interface: Interfaces are one type of class where all the methods are abstract. That means all the methods only declared but not defined. All the methods must be define by its implemented class. Q : How can increase the performance of MySQL select query? A : We can use LIMIT to stop MySql for further search in table after we have received our required no. of records, also we can use LEFT JOIN or RIGHT JOIN instead of full join in cases we have related data in two or more tables. Q : Explain the ternary conditional operator in PHP? A : Expression preceding the ? is evaluated, if its true, then the expression preceding the : is executed, otherwise, the expression following : is executed Q : Whats the difference between md5(), crc32() and sha1() crypto on PHP? A : The major difference is the length of the hash generated. CRC32 is,

25

evidently, 32 bits, while sha1() returns a 128 bit value, and md5() returns a 160 bit value. This is important when avoiding collisions.

Q : What is the functionality of MD5 function in PHP? A : string md5(string) It calculates the MD5 hash of a string. The hash is a 32-character hexadecimal Q : What is the difference between htmlentities() and htmlspecialchars()? A : htmlspecialchars() - Convert some special characters to HTML entities (Only the most widely used) htmlentities() - Convert ALL special characters to HTML entitie Q : How can we submit from without a submit button? A : Trigger the JavaScript code on any event ( like onSelect of drop down list box, onfocus, etc ) document.myform.submit(); This will submit the form Q : What is the difference between PHP4 and PHP5? A : PHP4 cannot support oops concepts and Zend engine 1 is used. PHP5 supports oops concepts and Zend engine 2 is used. Error supporting is increased in PHP5. XML and SQLLite will is increased in PHP5. Q : 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. Q : What is difference between srand & shuffle? The srand function seeds the random number generator with seed and shuffle is used for shuffling the array values. shuffle - This function shuffles (randomizes the order of the elements in) an array. This function assigns new keys for the elements in array. It will remove any existing keys you may have assigned, rather than just reordering the keys. srand - Seed the random number generator The srand function seeds the random number generator with seed and shuffle is used for shuffling the array values. shuffle - This function shuffles (randomizes the order of the elements in) an array. This function assigns new keys for the elements in array. It will remove any existing keys you may have assigned, rather than just reordering the keys. srand - Seed the random number generator

26

Q : What are the different types of errors in PHP? A : 1. Notices: These are trivial, non-critical errors that PHP encounters while executing a script - for example, accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all - although you can change this default behavior. 2. Warnings: These are more serious errors - for example, attempting to include() a file which does not exist. By default, these errors are displayed to the user, but they do not result in script termination. 3. Fatal errors: These are critical errors - for example, instantiating an object of a non-existent class, or calling a non-existent function. These errors cause the immediate termination of the script, and PHPs default behavior is to display them to the user when they take place.

RECENT C++
Q : Explain in void pointer using C++? A : In C++, void represents the absence of type, so void the pointers are pointers that point to a value that has no type. The void pointers can point to any data type. We can declare void pointer as follows. Void *p; Q : What is the function overloading in C++? A : You can have the multiple functions with same name using function overloading facility of C++. You can use same name for multiple functions when all these functions are doing same thing. Q : What is virtual function? Answer - Virtual function is the member function of a class that can be overridden in its derived class. It is declared with virtual keyword. Virtual function call is resolved at run-time (dynamic binding) whereas the non-virtual member functions are resolved at compile time (static binding). Q : What is Null object in C++? A : Null Object is an object of some class whose purpose is to indicate that a real object of that class does not exist. One common use for a null object is a return value from a member of function that is supposed to return an object with some specified properties but cannot find such an object. Q : What is virtual function? where is it used?

27

A : Virtual function is a member of function that is declared by with in a base class and redefined by the derived class. to make a function virtual prefix the function name by the "virtual" keyword. It helps in polymorphism. Q : what is a template A template function defines a set of operations to performed on the various data types This data is passed to the function as an argument Q : What do you mean by the inheritance? A : The Inheritance is the process by which one can aquire the properties of another object Q : Explain the scope resolution operator? A: The scope resolution operator is a permits of a program to reference an identifier in the global scope that has been hidden by another identifier with the same name in the local scope. Q : What is parameterized type? A : : A template is a parameterized construct or type containing the generic code that can use or manipulate any type. It is called the parameterized because an actual type is a parameter of the code body. Polymorphism may be achieved through parameterized types. This type of polymorphism is called parameteric polymorphism. Parameteric polymorphism is the mechanism by which the same code is used on different types passed as parameters. Q : Explain the scope resolution operator? A :Resolution operator permits a program to reference an identifier in the global scope that has been hidden by another identifier with the same name in the local scope. Q : Name of the some pure object oriented languages? A : Some pure object oriented languages are Smalltalk, Java, Eiffel, Sather. Q : Differentiate between a C++ struct and C++ class? A : The default member and base-class access specifies are different. This is one of the commonly misunderstood aspects of C++. Believe it is or not, many programmers think that a C++ struct is just like a C struct, while a C++ class has inheritance, access specifies, member functions, overloaded operators, and so on. Actually, the C++ struct has all the features of the class. The only differences

28

are that a struct defaults to public member access and public base-class inheritance, and a class defaults to the private access specified and private baseclass inheritance. Q : Why do C++ compilers need the name mangling? A : Name mangling is the rule of according to which is the C++ changes function's name into function signature before the passing that the function to a linker. This is how the linker differentiates between different functions with the same name. Q : What is protocol class? A : An abstract class is a protocol class if: 1.Protocol neither contains nor inherits from the classes that contain member data, non-virtual functions, or private (or protected) members of any kind. 2. It has a non-inline virtual destructor defined with an empty implementation, 3. All member functions other than the destructor including inherited functions, are declared pure the virtual functions and left undefined. Q : What is the difference between the message and method? A: Method: Provides response to a message.It is an implementation of an operation.. Message: Objects communicate by sending the messages to each other.A message is sent to invoke a method. Q : What is an adaptor class ? A : A class that has no functionality of its own. It is the member functions hide the use of a third party software component or an object with the non-compatible interface or a non- object- oriented implementation. Q : Whats the difference between char a[] = string; and char *p = string;? A : In the first case six bytes are allocated to the variable in a which is fixed, where as in the second case if *p is assigned to the some other value the allocate memory can change. Q : What is conversion constructor? A : A conversion constructor is that accepts one argument of a different type. Q : Whats an explicit constructor? A : A conversion constructor declared with the explicit keyword. The compiler doesnt use an explicit constructor to implement an implied conversion of types. It is the purpose of is reserved explicitly for construction.

29

You might also like