Your Ad Here

LATEST INTERVIEW QUESTIONS

Sunday, January 11, 2009

Difficult Interview Questions - ASP.NET

Q. Explain what a diffgram is, and a good use for one?
A : The DiffGram is one of the two XML formats that you can use to render DataSet object contents to XML. A good use is reading database data to an XML file to be sent to a Web Service.

Q.Whats MSIL, and why should my developers need an appreciation of it if at all?
A : MSIL is the Microsoft Intermediate Language. All .NET compatible languages will get converted to MSIL. MSIL also allows the .NET Framework to JIT compile the assembly on the installed computer.

Q.Which method do you invoke on the DataAdapter control to load your generated dataset with data?


A : The Fill() method.

Q.Can you edit data in the Repeater control?
A : No, it just reads the information from its data source.

Q.Which template must you provide, in order to display data in a Repeater control?
A : ItemTemplate.

Q.How can you provide an alternating color scheme in a Repeater control?
A : Use the AlternatingItemTemplate.

Q.What property must you set, and what method must you call in your code, in order to bind the data from a data source to the Repeater control?

A : You must set the DataSource property and call the DataBind method.

Q.What base class do all Web Forms inherit from?
A : The Page class.

Q.Name two properties common in every validation control?
A : ControlToValidate property and Text property.

Q.Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in the combo box?

A : DataTextField property.

Q.Which control would you use if you needed to make sure the values in two different controls matched?

A : CompareValidator control.

Q.How many classes can a single .NET DLL contain?
A : It can contain many classes.

Q. What is ViewState?
A : ViewState allows the state of objects (serializable) to be stored in a hidden field on the page. ViewState is transported to the client and back to the server, and is not stored on the server or any other external source. ViewState is used to retain the state of server-side objects between post backs.

Q.What is the lifespan for items stored in ViewState?
A : Item stored in ViewState exist for the life of the current page. This includes postbacks (to the same page).

Q.What does the "EnableViewState" property do? Why would I want it on or off?
A : It allows the page to save the users input on a form across postbacks. It saves the server-side values for a given control into ViewState, which is stored as a hidden value on the page before sending the page to the clients browser. When the page is posted back to the server the server control is recreated with the state stored in viewstate.

Q.What are the different types of Session state management options available with ASP.NET?

A : ASP.NET provides In-Process and Out-of-Process state management. In-Process stores the session in memory on the web server. This requires the a "sticky-server" (or no load-balancing) so that the user is always reconnected to the same web server. Out-of-Process Session state management stores data in an external data source. The external data source may be either a SQL Server or a State Server service. Out-of-Process state management requires that all objects stored in session are serializable.

Q.What is CLS (Common Language Specificaiton)?
A : It provides the set of specificaiton which has to be adhered by any new language writer / Compiler writer for .NET Framework. This ensures Interoperability. For example: Within a ASP.NET application written in C#.NET language, we can refer to any DLL written in any other language supported by .NET Framework. As of now .NET Supports around 32 languages.

Q.What is CTS (Common Type System)?
A : It defines about how Objects should be declard, defined and used within .NET. CLS is the subset of CTS.

Q.What is Boxing and UnBoxing?
A : Boxing is implicit conversion of ValueTypes to Reference Types (Object). UnBoxing is explicit conversion of Reference Types (Object) to its equivalent ValueTypes. It requires type-casting.

Q.What is the difference between Value Types and Reference Types?
A : Value Types uses Stack to store the data where as the later uses the Heap to store the data.

Q.What are the different types of assemblies available and their purpose?
A : Private, Public/shared and Satellite Assemblies.
Private Assemblies : Assembly used within an application is known as private assemblies.
Public/shared Assemblies : Assembly which can be shared across applicaiton is known as shared assemblies. Strong Name has to be created to create a shared assembly. This can be done using SN.EXE. The same has to be registered using GACUtil.exe (Global Assembly Cache).

Satellite Assemblies : These assemblies contain resource files pertaining to a locale (Culture+Language). These assemblies are used in deploying an Gloabl applicaiton for different languages.

Q.What is view state and use of it?
A : The current property settings of an ASP.NET page and those of any ASP.NET server controls contained within the page. ASP.NET can detect when a form is requested for the first time versus when the form is posted (sent to the server), which allows you to program accordingly.



Q.What are user controls and custom controls?
A : Custom controls: A control authored by a user or a third-party software vendor that does not belong to the .NET Framework class library. This is a generic term that includes user controls. A custom server control is used in Web Forms (ASP.NET pages). A custom client control is used in Windows Forms applications.User Controls: In ASP.NET: A user-authored server control that enables an ASP.NET page to be re-used as a server control. An ASP.NET user control is authored declaratively and persisted as a text file with an .ascx extension. The ASP.NET page framework compiles a user control on the fly to a class that derives from the System.Web.UI.UserControl class.

Q.What are the validation controls?
A : set of server controls included with ASP.NET that test user input in HTML and Web server controls for programmer-defined requirements. Validation controls perform input checking in server code. If the user is working with a browser that supports DHTML, the validation controls can also perform validation using client script.

Q.. What's the difference between Response.Write() andResponse.Output.Write()?
A : The latter one allows you to write formattedoutput.

Q.What methods are fired during the page load?

A : Init()
When the page is instantiated, Load() - when the page is loaded into server memory,PreRender () - the brief moment before the page is displayed to the user as HTML, Unload() - when page finishes loading.

Q.Where does the Web page belong in the .NET Framework class hierarchy?
System.Web.UI.Page

Q.Where do you store the information about the user's locale?
System.Web.UI.Page.Culture

Q.What's the difference between Codebehind="MyCode.aspx.cs" and Src="MyCode.aspx.cs"?
A : CodeBehind is relevant to Visual Studio.NET only.

Q.What's a bubbled event?
A : When you have a complex control, likeDataGrid, writing an event processing routine for each object (cell, button,row, etc.) is quite tedious. The controls can bubble up their eventhandlers, allowing the main DataGrid event handler to take care of its constituents. Suppose you want a certain ASP.NET function executed on MouseOver over a certain button.

Campus Interview Papers: 30 VB Interview Questions & Answers

Q : How many objects resides in ADO ?
A : ADO Objects,Connection,Command,Recordset,Parameter,Field,Error

Q : What is the difference between ADODC and ADODB
A : When u build connection with database through coding, then its ADODB..
When u build connection with database through ADO component, then its ADODC

Q : What is difference between dbgrid and flexgrid control
A ; In case of flexgrid also you can make it editable, by placing the textbox on runtime on the cell and key in required data. This is possible with flexgrids onCellEnter and onCellLeave events.

Q: How will u handle error in vb application ? explain
A : If You want To Trap The Error In Visual Basic Code then
Write The Code In Every Procedure & Function

Public Sub xxxxx()
On Error Goto Err_xxxxx
Err_xxxxx:
if err.Number<>0 then
msgbox err.description
end if
End Sub

Q :What is MAPI?
A : Messaging Application programing Interface.

Q : Difference between subquery and coquery
A :A subquery is called a query with in the query. Such as
select n1,n2 from table1 where in n1 not in(select n1 from table2)
while main query is the only query like
select n1,n2 from table1

Q :What are the type of validation available in VB?
A : Field, Form

Q : What's the purpose of Visual source safe in vb?
A : The Visual source safe is used to set level of user control to read, add & destroy.

Q : Why we use Treeview Control?
A : To list the hierarchical list of the node objects. Such of files and Directories

Q : How many images can be placed in the image list?
A: 64

Q : What are the Style Properties of Combo Box?
A : Simple, Dropdown list We can type and select. Dropdown Combo Only Drop Down.

Q : How to change the Mouse Pointer?
A : S creen.MousePointer = VBHourGlass/VBNormal.

Q : Diff types of Lock Types?
A : RdConcurReadOnly 0 (Default)
RdConcurLock 1 (Pessimistic Locking)
RdConcurRowver 2 (Optimistic Lociking)
RdConcurValues 3
RdConcurBatch 4

Q : What are the scopes of the class?
Public, private, Friend

Q : Diff type of Datatypes?
A : LOB (Large Object Data type).
CLOB (Stores Character Objects).
BLOB ( Store Binary Objects such as Graphic, Video Chips and Sound files).
BFILE(Store file pointers to LOB It may Contain filename for photo’s store on CD_ROM).

Q : What is Inprocess and Out of Process?
A : Inprocess It will run with in the memory. ( Local Machine). Out of Process It will run out of the memory Normally in the server side.

Q : What is diff between the Generic Variable and Specific Variable?
A : Generic Variable:
Create Object Ex:-Ole-Automation . No need refer the object library.
Specific Variable:
Binding Procedure Early and Late Binding ( Can be Remove from the Memory).

Q : What are the Technologies for Accessing Database from Visual Basic?set?
A : DAO, Data Control, RDO, ODBCDIRECT, ADO, ODBC API , 0040.

Q : What is the diff between the Create Object and Get object?
A : Create Object - To create an instance of an object.
Get Object To get the reference to an existing object

Q : What is the max size allowed for Max Text box length.
A : 32,000

Q : How many event in VB6 form ? :
A : 31

Q : What about OCX Controls
A : OCX is a USER control. we can create a control of our own and use it in our projects. OCX can be created using Activex control

. For example if we have a Text Box for getting Numbers only in every form and in every project we can create a Text Box for getting numbers only in ActiveX Control and use it as we do to other Text Box.

Q : What is compatibility ?
A : IN Visual Basic have 3 types of Compatibilites is there.

1) No Compatibility :- New GUID created, references from other components will not work
2) Project Compatibility :-Default for a new component
3) Bianary Compatibility :-GUID does not change, references from other components will work

Q : How to send data from MS FlexGrid to database
A : FlexGrid1.TextMatrix(Row,Column) ...

Q : What is Stored Variable?
A stired variable is a variable which is permanently stored in the memory and we can use that variable in our project.

Q : What are the advantages of Visual Basic ?
A : 1) VB is a rapid application Tool to develop applications faster2) Flexibility in design time3) Debugging the source code4) .(dot) operator for objects to expose its properties and methods5) plug and play wizards to connect databases

Q : What is Tag & What is the purpose of using a Tag?
A : Tag is usaually used to store the value of any variable or store the value of any field for the future use. ...

Q : What is Diff. Between Use Defined Function and Array.
A : Array is collection of variable of similar datatypes saves unser the same name.while user definded function are like the store procedures but more effective than store proceures.we can pass the parameters to user definded funtion and it return u the results ...

Q : What is meant by urlencode and urldecode?
Anwser 1:
urlencode() returns the URL encoded version of the given string. URL coding converts special characters into % signs followed by two hex digits. For example: urlencode("10.00%") will return "10%2E00%25". URL encoded strings are safe to be used as part of URLs.
urldecode() returns the URL decoded version of the given string.

Anwser 2:
string urlencode(str) - Returns the URL encoded version of the input string. String values to be used in URL query string need to be URL encoded. In the URL encoded version:

Alphanumeric characters are maintained as is.
Space characters are converted to "+" characters.
Other non-alphanumeric characters are converted "%" followed by two hex digits representing the converted character.

string urldecode(str) - Returns the original string of the input URL encoded string.

For example:

$discount ="10.00%";
$url = " http://domain.com/submit.php?disc=".urlencode($discount );
echo $url;

You will get " http://domain.com/submit.php?disc=10%2E00%25 ".

Q : what is instead of trigger ? explain
A : Instead of Trigger is used in SQL Server it used when we execute some sql QUERYsome how that query doesn't execute then Instead of Trigger is fired.

Latest VB script Interview Questions & Answers

Q : What are the major differences between Visual Basic and VBScript?
A : They are different: You dont compile VB scripts like in Visual Basic. You just distribute them as plain text HTML files.The script engine interprets this text into intermediate code when it loads the Web page. It also creates a symbol table so that it can quickly look up things such as event-procedures and variable names. The scripting engine uses the ActiveX Scripting technology to interact with the browser.
IE supports VB scripts on your computer& we can create Web pages with VB scripts. For Visual Basic, you need a text editor,ActiveX,Control Pad and Web Browser.
Some other differences:

Debugging VBScript doesn't have a debugger like Visual Basic. You'll resort to using lots of message boxes, instead.

Event-handlers You don't have an editor in which you select an object and event to edit an event-procedure. You have to name event-procedures in your scripts so that the scripting engine can find the appropriate handler when an object fires an event.

Forms VBScript doesn't have a forms editor. It doesn't need one, because you can't display forms anyway. You put forms and controls on the Web page, instead. You can use the ActiveX Control pad to insert all those nasty tags in your Web page, however.

Q : What are the types of arrays handled by VBScript?
A : .Static array2.Dynamic array ...

Q : What is the use of ReDim statement in VBScript?
A : The ReDim statement is used to change the size of the array within the script:
for example you have declared an array
Dim Customers(50)
But now you want to change the size of the array so you can do that with the help of Redim

ReDim Customers(100)

Q : What is parametrization ?
A : Parametrization: where you can change object's parameters in accordance with a mathematical rule, or data from a file.

Q : Compare Java Script and VB Script?
A : VB and Java Script are much similar in functionality. They both interact with the document object model of the page. Many browsers have compatibility with Java Script but they are not compatible with VB script as such. For client side scripting developers using VB Script should always make sure of cross browser compatibility which is not the case when working with VB script.

Q : Explain about operator precedence in VB Script?
A : In operator precedence expressions are evaluated and resolved in a predetermined order. The order of evaluation can be modulated if you use parenthesis. Expressions present in parenthesis are evaluated first.

Q : Explain about .wsf files?
A : .wsf files are modeled in similar to XML. They can be executed with the help of Wscript.exe and it can be done from the command line also. This .wsf file can have multiple visual basic files. Reuse functionality is present with this extension file.

Q : Explain about ADODB.Stream class?
ADODB.Stream class can be used as string builder. VBScript string concatenation can be very costly because of frequent memory allocation features. Binary file and memory I/O operation is provided by ADODB.Stream class. This is widely used to convert bytes into string, etc.

Q : Explain about filter expression?
A : Filter expression returns an array based on a specific filter search condition and it returns a zero based array. Arguments included in the filter array are Input strings, value, include and compare. If there is no match for the value it returns an empty string.

PHP Programming

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 single-quoted strings:

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:

print(-1.3e3);
print(" ");
print(strlen(-1.3e3));
print(" ");
print("Price = $" . 99.99 . " ");
print(1 . " + " . 2 . " = " . 1+2 . " ");
print(1 . " + " . 2 . " = " . (1+2) . " ");
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():

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

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:

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

PHP

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 : What’s the difference between include and require?
A : It’s 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:
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:

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 browser’s 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.

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:

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.

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 it’s true, then the expression preceding the : is executed, otherwise, the expression following : is executed

Q : What’s the difference between md5(), crc32() and sha1() crypto on PHP?
A : The major difference is the length of the hash generated. CRC32 is, 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

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 PHP’s default behavior is to display them to the user when they take place.

.NET

Q : How is ASP .NET different from ASP?
A : Scripting is separated from the HTML, Code is compiled as a DLL, these DLLs can be executed on the server.

Q : What is ADO .NET ? what is difference between ADO and ADO.NET?
A : ADO.NET is stateless mechanism. I can treat the ADO.Net as a separate in-memory database where in I can use relationships between the tables and select insert and updates to the database. I can update the actual database as a batch.

Q : What is the difference between the C#.NET and VB.NET?
A : VB.NET
It didn't have the Operator Overloading.
It didn't have the XML Documentation.
It didn't have the Pointer Type variables.
C#.NET
It has XML Documentation, Operator Overloading and supports Pointer Variables using unsafe keyword
c#.net is the case sensitive.
vb.net is not the case sensitive

Q : How you can create a XML File?
A : To write Dataset Contents out to disk as an XML file use:

Q : How you can create a XML File?
A : To write Dataset Contents out to disk as an XML file use:
MyDataset.WriteXML(server.MapPath("MyXMLFile.xml"))
dataSet.WriteXml(string path);
string str = "";
string s="select * from emp";
SqlCommand cmd = new SqlCommand(s, con);
SqlDataReader dr = cmd.ExecuteReader();
//str += " " ;
str += "";
while (dr.Read())
{
str += "";
str += dr[0].ToString();
str += "
";
str += dr[1].ToString();
str += "
";
}
str += "
";
StreamWriter sw = File.CreateText("D:ampl.xml");
sw.WriteLine(str);
sw.Close();

Q :How is the difference between interface and abstract class?
A : Abstract classes can not be instantiated it can have or cannot have abstract method basically known as mustinherit as the methods are static in nature
where interfaces are the declaration and r defined where they are called used for dynamic methods
Interface needs to be implemented,abstract class has build in implementation.

Q :What is the smart navigation?
A : The cursor position is maintained when the page gets refreshed due to the server side validation and the page gets refreshed.

Q : How do you validate the controls is an ASP .NET page?
A : Using special validation controls that are meant for this. We have Range Validator, Email Validator.

Q :How do assemblies search each other?
A : By searching directory paths. There are several factors that can affect the path (such as the AppDomain host, and application configuration files), but for weakly named assemblies the search path is normally the application's directory and its sub-directories. For strongly named assemblies, the search path is the GAC followed by the private assembly path.

Q : What is the garbage collection?
A : Garbage collection is a heap-management strategy where a run-time component takes responsibility for managing the lifetime of the memory used by the objects. This concept is not new to .NET - Java and many other languages/runtimes have used garbage collection for some time.


Q :How do you validate controls in an ASP .NET page?
A : Using special validation controls there are meant for this. We have Range Validator, Email Validator.
A : Using special validation controls there are meant for this. We have Range Validator, Email Validator.

Q : What is the difference between Response.Write() andResponse.Output.Write()?
A : Response.Output.Write() allows you to write formatted output

Q : Name two properties common control in every validation
A : ControlToValidate property and Text property.

Q : What is the ViewState?
A : ViewState allows the state of objects (serializable) to be stored in a hidden field on the page. ViewState is transported to the client and back to the server, and is not stored on the server or any other external source. ViewState is used to the retain the state of server-side objects between postabacks.

Q : Difference between a Thread and a Process?
A : Both are individual execution paths, but process timeslicing (and memory space) is enforced by the OS, while thread differentiation is enforced by the applications.

Q : What is the GAC? What is the problem its solve?
A : The Global Assembly Cache. It is stored strongly-named assemblies in a single location, allowing for verification of code library uniqueness when executing.

Q : What is the difference between DataSet and DataTable?
A : Data set can store many tables but a data table can have one table only.

Q : What is the usage of console application?
A : Console Applications are command-line oriented applications that allow us to read characters from the console, write characters to the console and are executed in the DOS version. Console Applications are written in code and are supported by the System. Console namespace.

Q : Describe rapid application development tool?
A : Rapid action development tool describes about the software development process. This tool gives flexibility in iterative development and prototype deployment. It enhances the speed of application development. It is also used for the application maintenance.

Q : What is the MSIL, IL?
A :When compiling to managed code, the compiler translates your source code into the Microsoft intermediate language (MSIL),which is a CPU-independent set of instructions that can be efficiently converted to native code. MSIL includes instructions for loading, storing, initializing, and calling methods on objects, as well as instructions for arithmetic and logical operations, control flow, direct memory access, exception handling, and other operations. Microsoft intermediate language (MSIL) is a language used as the output of a number of compilers and as the input to a just-in-time (JIT) compiler. The common language runtime includes a JIT compiler for converting MSIL to native code.

Q : What is the difference between ref and out parameters?
A: An argument passed to a ref parameter must first be initialized. Compare this to out parameter, whose argument does not have to be explicitly initialized before being passed to an out parameter.

Q : How DLL Hell problem solved in .NET?
A : Assembly versioning allows the application to specify not only library it needs to run (which was available under Win32), but also the version of the assembly.

Saturday, January 3, 2009

Recent - JAVA Interview Questions & Answers

Q : What is the difference between Java platform and other platforms?
A : The Java platform differs from most other platforms in that it's a software-only platform that runs on top of other hardware-based platforms.

The Java platform has two components:

1. The Java Virtual Machine (Java VM)

2. The Java Application Programming Interface (Java API)

Q : What is Java Virtual Machine?

A : The Java Virtual Machine is a software that can be ported onto the various hardware-based platforms.

Q : What is the package? Define with an example?

A : A package is a grouping of related types providing access protection and name space management. Note that types refers to classes, interfaces, enumerations, and annotation types. Enumerations and annotation types are special kinds of classes and interfaces, respectively, so types are often referred to in this lesson simply as classes and interfaces.

Package is a directory of related classes and interfaces.
Eg: java.lang.*

Here java is a directory,lang stands for language & it is a sub directory, * indicates collection of related classes & interfaces

Q : What is the difference between the interface and abstract class?
A : An abstract class may contain code in method bodies, which is not allowed in an interface. With abstract classes, you have to inherit your class from it and Java does not allow multiple inheritance. On the other hand, you can implement multiple interfaces in your class.

Q : What is the thread?
A : A thread is an independent path of execution in a system.

Q :What is the multi-threading?
A: Multi-threading means various threads that runs in a system.

Q : What is the synchronization ? why is it important in Java Programming?
A : With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchronization, it is an possible for one thread to modify a shared object while another thread is in the process of using or updating that object’s value. This often causes dirty data and leads to significant errors.

Q : What is the purpose of Runtime class in Java Programming?
A :The purpose of Runtime class is to provide access to the Java runtime system in Java Programming.

Q :Describe difference between a static and a non-static inner class in Java Programming?
A non-static inner class may have object instances that are associated with instances of the class’s outer class. A static inner class does not have any other object instances.

Q : Name the primitive Java types?
A : The primitive types are,

byte, char, short, int, long, float, double, and boolean.

Q : What is the casting in Java Programming?
A : There are two types of casting, casting between primitive numeric types and casting between object references.
Casting between numeric types is used to convert larger values, such as double values, to smaller values, such as byte values. Casting between object references is used to refer the object by a compatible class, interface, or array type reference.

Q : What are the Encapsulation, Inheritance and Polymorphism?
A : 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.

Q : What is the difference between constructor and method?
A : Constructor will be automatically invoked when an object is created where as the method has to be called explicitly.

Q: What is a UNICODE?-
A : A Unicode is used for internal representation of characters and strings and it uses 16 bits to represent each other.

Q : What is a abstract class?
A :A abstract class is a class designed with implementation gaps for subclasses to fill in and is deliberately incomplete.

Q : What is daemon thread ? which the method is used to create the daemon thread?-
A: Daemon thread is a low priority thread which runs intermittently in the back ground doing the garbage collection operation for the java runtime system.

SetDaemon method is used to create a daemon thread.

Q: What are the wrapper classes?
A : The Wrapper classes are classes that allow primitive types to be accessed as objects.

Q : What is the difference between applet and a servlet?
A : Servlets are to servers what applets are to browsers.
Applets must have graphical user interfaces whereas servlets have no graphical user interfaces.

Q :What are the cookies ?
A : Cookies are a mechanism that a servlet uses to have a client hold a small amount of state-information associated with the user.

Q :What is Java Bean?
A : Java Bean is a software component that has been designed to be reusable in a variety of different environments.

Your Ad Here