Friday, August 22, 2008

Wipro Interview Questions

Wipro Questions:
Write 5 best test cases like any password? Password should be mixed case with at least one
number or special characters?
Check for empty password it should fail.
Check for all alphabetic password it should fail
Check for all numeric password it should fail
Check for all special character password it should fail
Check for all mixed password it should succeed.
How can we convert XML data into Database table IN .Net?
dSet.ReadXml (Server.MapPath ("Forms.xml"))
What is the Difference between direct cast and ctype?
The difference between the two keywords is that CType succeeds as long as there is a valid conversion defined between the expression and the type, whereas Direct Cast requires the run-time type of an object variable to be the same as the specified type. If the specified type and the run-time type of the expression are the same, however, the run-time performance of DirectCast is better than that of CType. DirectCast throws an InvalidCastException error if the argument types do not match.
Dim t As String = "5"
Dim s As Integer = CType(t, Integer)
Dim t As String = "5"
Dim w As String = DirectCast(t, String)
What is the Difference between a sub and a function?
Sub keyword is used for the procedures and procedures never return a value where function key word is used for function and function returns a value that can be assigning to any
Variable.
What are the two kinds of properties?
Get and Set are the two kinds of properties..
What is the raise event used for?
It is used for raising the error from sql statement
Explain constructor.
Constructor is like a method with a same name as of ur class name ,no return type.It is used to initialize the memebr variables of the class.If there is no contructor provided compiler invokes the default constructor. the Moment there is contructor is provided to the class it can be any either default or parameterized the compiler stops invoking it own default
constructor
What is a system lock?
System Lock locks the desktop until correct password is being given
Can i have both C# and vb.net code in same assembly?how?
Yes you can add C# and VB.Net code in the same asssembly. For that add a new item to the project. Give the name of the file as Class1.vb if you want to add a vb code and Class1.cs if you want to add C# code.
When you compile the project it will compile to a single assembly. The language does not matter in the end since everthing
will be compile to MSIL.
Webconfig file is cofiguration of server or browser?
Server
Suppose, I have 3 pages, Page1.aspx, Page2.aspx, Page3.aspx. All pages are in diff. server. When user req. for a page, Page1.aspx opens Ist & a session established. If user req. for IIn page, second session established. Similarly, 3rd session established if user req. 3rd page. In this scenario, tot. 03 sessions are established. How we can minimize it so that it will work with only one session?
OUT PROC : Maintain the session in the SQL server.
can we transfer data from one page to another page using viewstate if so how?if not y?
By using viewstate it is not possible.sure it is not possible.bcoz its comes under the pagelevel state manage ment.to maintaning the state in page it self we are using the view state.
so viewstate object is available only after page_init() and
before page_load().
what are Httpmodule and HttpHandler?
http handler is a information between the web browser and web server
The HTTP handler is used in web services
An HttpModule is an assembly that implements the IHttpModule interface and handles events. ASP.NET includes a set of HttpModules that can be used by your application. For example, the SessionStateModule is provided by ASP.NET to supply session state services to an application. Custom HttpModules can be created to respond to either ASP.NET events or user events.
Suppose you display a data having 200 records in a datagrid. Then you
edit 100 records of them. Now when you will press update button,all
100 records should be updated in single shot rather than reading
every record and updating. How to do it?
Here, bind primary key of database to datagrid column make it visible false.and travel loop as
foreach(DataGridItem dataItem in DataGrid1.Items)
{
priceText = (TextBox)dataItem.FindControl("txtBookPrice");
bookIdText = (TextBox)dataItem.FindControl("txtBookId");
Updatecode_for_perticular_row ();
}
txtBookPrice= textbox from witch u would like to update
txtBookId= test i.e. unique id comming from database
With help of unique id in for loop find perticular text in texbox and update.
This code you will write on update button click.
Write a code for "RequiredFieldValidator" in java script
suppose the id of the field required to be validated is NameId
Thus:-
function validate()
{
if(document.getElementById("NameId").value == null)
alert("Please enter the name");
}
How to set/get parent page values in child page in asp.net?
get= var uid=document.getElementById('txtUserId').value;
set= document.getElementById('txtUserId').innerText=uid;
What is web.config. How many web.config files can be allowed to use in
an application ?
The web.config file is the configuration file of the web application. This means that the configuration settings of the application [such as authentication, authorisation, tracing, debugging, connectionstrings, ...] can be changed through the web.config file.
The main advantage is that that the changes made in the web.config file will be applicable to the web application without having to change the code of the application and without recompiling the application.
The root folder of a web application can have only one web.config file. But any inner/ sub folders can have a web.config file. It web.config file in the sub folders will override the one in the root folder of the application.
Can you explain the difference between an ADO.NET Dataset and an ADO
Recordset?
In ADO recordset(in memory representation of data) looks like single
table
where as
in ADO.NET dataset(in-memory representation of data) is a collection of one or more tables(use JOIN Query).
In ADO you communicate with the database by making the calls to an
OLEDB Provider
where as
in ADO.NET you communicate with the database through a Data Adapter(an OledbDataAdapter,SQLDataAdapter,OdbcDataAdapter or OracleDataAdapter object) which make calls to an OLEDB Provider or the API's provided by the underlying datasource.
In ADO recordset objects operate in a fully connected state
where as
in ADO.NET dataset operate in disconnected state.
ADO requires COM marshalling to transmit records sets among components, does require that ADO data types be converted to COM data types.
where as
ADO.NET does not require data-type conversions.
In ADO it is sometime sproblematic firewalls( firewalls are typically configured to allow HTML text to pass, but to prevent system-level requests (such as COM marshalling)from passing) prevent many types of requets
where as
in ADO.NET datasets using XML, firewalls can allow datasets to pass.
how validation controls will be executed on client and server?
Validation controls are execute on clien-side.They contains isValid property which is used to valid the control.Then it executes on the server.
What Name space does the web page belon in the .net framework class
hierarchy?
System.web.UI.Page
What is the difference between java and java script?
Java Script is object based language it is used for front end validations.java is object oriented language.object oriented language
supports OOP's,Object based not suppoted inheritence.
why you used Java Script? Can it use for both client side and server
side validation purpose?
Mainly used for client side scripting purpose.JavaScript is a platform-independent,event-driven, interpreted client-side scripting and programming language.
javascript cannot be used as server side scripting.
Does c++ support multilevel and multiple inheritance?
Yes ,c++ supports multilevel and multiple inheritance
Accenture :
What is Reflection in .NET?
It is used to get Class info. at the runtime.
The Class info. defines::no. of
constructors,methods,isobject,isvalue,issealed,ispublic,...
This can be achieve through Reflection.
How many .rpt files are be there in a main report having 2 sub
reports?
there are 3 .rpt files including the main and 2 sub report.but when the subreports are inserted into main it will behave like one only.
If you are calling three SPs from a window application how do u check
for the performance of the SPS ?
We can check the performance of SP's with SQL Profiler
What provider ADO.net use by default?(check)
no default provider
sql provider
Which is better in performance - CONSTRAINT or TRIGGER over a column
which restricts say an input of particular value in a column of a
table?

Constraint is better in terms of performance for same operation.
Which databases are part of SQL server default installation? Explain
the usage of each?
key default dbs :-
Master db : Holds info of all dbs located on SQL Server insytance.
Main db (else SQL Server won't work !)
MSdb : Stores info regarding Backups, SQL Agent info, DTS packages,
SQL Server jobs, replication info for log shipping.
Tempdb : To hold temp objects like global & local temp tables, sps
Model db: Used in creation of any new database within the SQL Server
instance of which it(model) is a part.
how do u achieve multilevel inheritance in .NET ?
by uing interfaces we can implement multiple inheritance
What is gacutil.exe. Where do we store assemblies ?
gacutil is a tool that will list, install, and uninstall assemblies in the GAC.
Where does web.config info stored? Will this be stored in the registry?
web.config contains authorization/authentication session related information.It is stored in the root directory of your application.Optionalyy you individual web.config can be created in each sub directory of your project if required.
How do you do role based security ?
Create a principle object which contains users identity (login name) and array of roles and pass this object to HttpContext.Current.User
The roles supplied to this object will be checked against
roles specified in the web.config file,if they matched then
they are allowed access to the page otherwise not.
allowed roles can be specified like this in web.config




How do you register the dotnet component or assembly ?
The steps to register a dot net component is:
The command line instruction to create a strong name.
sn -k ComInterOp.snk.
Strong name is a unique name created by hashing a 128-bit encryption key against the name of the Assembly (ComInterOp in our case). The strong name is created using SN.exe,that would create ComInterOp.snk file, which we would use while
creating the DotNet Assembly.
The command line instruction to create an assembly using the strong name
vbc /out:ComInterOp.dll /t:library /keyfile:ComInterOp.snk
Assembly Registration Tool.
The Assembly Registration Tool (Regasm.exe), reads the metadata within an assembly and adds the necessary entries to the registry, which allows COM clients to create DotNet Framework classes transparently. The Assembly Registration tool can generate and register a type library when you apply the /tlb: option. COM clients require that type libraries be installed in the Windows registry. Without this option, Regasm.exe only registers the types in an assembly, not the type library. Registering the types in an assembly and registering the type library are distinct activities.The command line instruction to create and register ComINterOp.tlb(Type Library) is
regasm ComInterOp.dll /tlb:ComInterOp.tlb.
The DotNet Services Installation Tool (Regsvcs.exe)
The command line instruction to install ComINterOp.dll in GAC is
Gacutil -i ComInterOp.dll.
About DTS package ?
It is Sql server object used to transfer data from Database into Execel, Notepad etc.
What does assemblyinfo.cs file consists of ?
AssemblyInfo.cs file contains details about the assembly name,version info.,security info. and various details including company,description and trademark etc.
What is strong name and which tool is used for this ?
Strong Name is to be assigned to shared assembly. when more then one application is going to use that dll/assembly,that assembly has to assign a strong name and has to be place in GAC(Global Assembly Cache).
sn.exe is used to generate a strong name.
What is shared and private assembly ?
Shared assemblies are accessed by more than one application and they are stored in GAC. private assemblies are accessed by only one application and they are stored in application directory and one of its subdirectory.
What are the types of assemblies and where can u store them and how ?
Please note there are three types of Assemblies.
Private - Assembly available only to clients in the same
directory.
Shared - Assemblies in GAC
Satelite - Assembly in the specific directory of the locale.
If you are using components in your application, how can you handle exceptions raised in a component ?
I think for simple Handling of Exceptions, we keep TRY,Catch Block and catch the exception and handle those ones.
Types of optimization and name a few ?
For SQL --
Heuristic Optimization
Syntactical Optimization
Cost-Based Optimization
Semantic Optimization
What are Authentication mechanisms in .Net?
there are 3 types of authentication mechanisams in .net.there are
1)forms authentication
2)windows authentication
3)passport authentication
What are the differences between Trace and Debug?
trace allows us to view how the code executed in details.
Debug allows line by line exection..
What is Boxing and Unboxing?
Boxing is to implicitly converting value type to refrence type,
int x = 10;
y = x;
Unboxing is to explicitly converting refrence type to value type
double y = 10.234;
int x = (int)y;
How to write unmanaged code and how to identify whether the code is
managed /unmanaged?

unmanaged code is not varify by clr,and clr is not varify third party
control and pointer.
Unmanaged code use like using dll or any other com object in
application then it is unmanaged code ,we cannot change the code.
How do you relate an aspx page with its code behind Page?
Inherits page.aspx.cs.
Can we throw exception from catch Block?
we can throw the exception in catch block by using throw New Exception("Exception Message")
How do you do exception management?
using try catch bolcks
How does Garbage collector(GC) works in .net?
In .net the garbage collection is called by the class
system.gc.collect
It manages the unused objects and releases the memory.
can sn.exe can be used before gacutil.exe
yes , sn.exe is an commandline tool which we asign a strong name sn -k and it can be placed into GAC(Global Assembly Catch)
About DataAdapters ?
Data Adapters provide interaction between DataBase and Dataset.It provide the functionalities like reading the data from database,update the data,filter the data and write the data to Database
About duration in caching technique ?
Duration will specify life time of caching content. 20 minitues
Types of object in asp ?
ASP Response
ASP Request
ASP Application
ASP Session
ASP Server
ASP Error
Difference between Response.Expires and Expires.Absolute ?
Response.Expires specifies the lenght of the time ie 20 seconds
Response.ExpiresAbsolute specifies the time ie 12:12:10
What is stateless asp or asp.net ?
Both ASP and ASP.NET are stateless. Because both ASP and ASP.NET uses HTTP protocol which is stateless.
What are asynchronous callbacks ?
call multiple threads at a time
What is a transaction and what are ACID properties?
A transaction is a sequence of sql Operations(commands),work as single atomic unit of work. To be qualify as "Transaction" , this sequence of operations must satisfy 4 properties , which is knwon as ACID test.
A(Atomicity):-The sequence of operations must be atomic,either all or no operations are performed.
C(Consistency):- When completed, the sequence of operations must leave data in consistent mode. All the defined relations/constraints must me Maintained.
I(Isolation): A Transaction must be isolated from all other transactions. A transaction sees the data defore the operations are performed , or after all the operations has performed, it can't see the data in between.
D(Durability): All oprtaions must be permanently placed on the system. Even in the event of system failure , all the operations must be exhibit.
What is the difference between managed and unmanaged code?
A code that executed under the instructions of CLR is called managed code.
A code that execute without the instruction of CLR is called
unmanaged code.
How do you merge two datasets into the third dataset in a simple
manner?

ds1.Merge(ds2,true)
When is an object created and what is its lifetime?
whenever developer is required, and the life-time is when we assinging null or close the program(application).
How many sub-reports can report can have?
0-256(maximum 256)
What is the difference between User Controls and Master Pages ?
Both are code reduce features and reusability Purpose.When we create
Masterpage that is common to overall project,whereas user controls
these r used when we have requirement on specific criteria.
Master pages are used to provide the consistent layout and common
behaviour for multiple pages in your applications.then u can add the
contenetplaceholder to add child pages custom content.
User Controls:Sometimes u need the functionality in ur web pages which
is not possible using the Built-In Web server controls then user can
create his own controls called user controls using asp.net builtin
controls.User controlsn are those with .aspx extensions and u can
share it in the application.
where we use javascript and for which purpose we use javascript how?
Javascript is a clint side scripting. Mostly used for validations.

No comments:

.

.