Saturday, 19 May 2012

Decimal comparison operators


The predefined decimal comparison operators are:
bool operator ==(decimal x, decimal y);
bool operator !=(decimal x, decimal y);
bool operator <(decimal x, decimal y);
bool operator >(decimal x, decimal y);
bool operator <=(decimal x, decimal y);
bool operator >=(decimal x, decimal y);
Each of these operators compares the numeric values of the two decimal operands and returns a bool value
that indicates whether the particular relation is true or false. Each decimal comparison is equivalent to
using the corresponding relational or equality operator of type System.Decimal.
Lifted (§14.2.7) forms of the unlifted predefined decimal comparison operators defined above are also predefined.

Floating-point comparison operators


The predefined floating-point comparison operators are:
bool operator ==(float x, float y);
bool operator ==(double x, double y);
bool operator !=(float x, float y);
bool operator !=(double x, double y);
bool operator <(float x, float y);
bool operator <(double x, double y);
bool operator >(float x, float y);
bool operator >(double x, double y);
bool operator <=(float x, float y);
bool operator <=(double x, double y);
bool operator >=(float x, float y);
bool operator >=(double x, double y);
The operators compare the operands according to the rules of the IEC 60559 standard:
If either operand is NaN, the result is false for all operators except !=, for which the result is true. For
any two operands, x != y always produces the same result as !(x == y). However, when one or both
operands are NaN, the <, >, <=, and >= operators do not produce the same results as the logical negation of
the opposite operator. [Example: If either of x and y is NaN, then x < y is false, but !(x >= y) is true.
end example]
• When neither operand is NaN, the operators compare the values of the two floating-point operands with
respect to the ordering
–∞ < –max < … < –min < –0.0 == +0.0 < +min < … < +max < +∞
where min and max are the smallest and largest positive finite values that can be represented in the given
floating-point format. Notable effects of this ordering are:
o Negative and positive zeros are considered equal.
o A negative infinity is considered less than all other values, but equal to another negative infinity.
o A positive infinity is considered greater than all other values, but equal to another positive infinity.
Lifted (§14.2.7) forms of the unlifted predefined floating-point comparison operators defined above are also predefined.

Relational and type-testing operators


The ==, !=,  <, >, <=, >=, is and as operators are called the relational and type-testing operators.
relational-expression:
shift-expression
relational-expression   <   shift-expression
relational-expression   >   shift-expression
relational-expression   <=   shift-expression
relational-expression   >=   shift-expression
relational-expression   is   type
relational-expression   as   type
equality-expression:
relational-expression
equality-expression   ==   relational-expression
equality-expression   !=   relational-expression
The is operator is described in §14.9.10 and the as operator is described in §14.9.11.
The ==, !=, <, >, <= and >= operators are comparison operators. For an operation of the form x op y, where
op is a comparison operator, overload resolution (§14.2.4) is applied to select a specific operator
implementation. The operands are converted to the parameter types of the selected operator, and the type of
the result is the return type of the operator. If both operands of an equality-expression have the null type
(§11.2.7) (and hence the null value as well), then overload resolution is not performed and the expression
evaluates to a constant value of true or false according to whether the operator is == or !=.

Tell About Yourself In Interview For Freshers With Answers


This is the very first question asked to you when you go for interview. These few words about you can put on the spot in a way no question can. Many of you lose control of the interview for first 5 minutes. This is not the time to give the interviewer a lengthy history and take into other direction. Here are few important tips for freshers to answer “Tell about yourself”

Make sure that you talk more on the interesting and skills required for the position you applied in this company.
Respond to this question has a commercial question that sells your autobiography.
Answer the question which is expected to ask like what is your goal, where you took training, your studies and where you grew up etc..
Prepare yourself that you will answer this in 60sec highlighting interest, your skills and strength.
Concentrate more on your common theme related to your skills and strength required for this job.
Here is a sample Tell me about you answer

“I was born in Hydrebad,  and attended Lincoln High School. Ever since I was a teenager, I tinkered with computers. It was my hobby, my passion, and my way of learning. Like most kids I enjoyed computer games. When my folks gave me a computer as a reward for making honor roll my sophomore year, I mastered DOS, Windows, and WordPerfect within six months. I then went on to teach myself programming basics. By the time I graduated high school, I knew I wanted to study programming. “

Disguise strength as a weakness. Tell weakness in a positive way.
Your main strategy is to make feel your interviewer that you can complete this job on time. So go ahead and give your qualities.
These were few things how you can face interview, but do you know what actually interviewer wants from you? Here are few points listed.

A proven record that shows you as an achiever.
Intelligence, honesty, integrity, dedication towards work, working overtime when needed.
Being social is also needed.
With all these important thing is communication with confident.

DATA STRUCTURES INTERVIEW QUESTIONS AND ANSWERS



1.What is difference between linear and non linear data structures?

(A) Linear data structures are data structures whose data are in linear. eg: Arrays

Non linear are data structures whose data are non linear format. eg: Trees

2. List the notations used in Evaluation of Arithmetic Expressions using prefix and postfix forms?

(A) Polish and Reverse Polish notations.

3. Can I use Selection method to for sorting?

(A) Yes, Selection method is used for Selection sort.

4.When I can call it complete Binary Tree?

(A) It is said to be complete when each node that has a right child also has a left child. Having a left child does not require a node to have a right child. Alternate Binary tree is a tree where their is always a left node for right node but may be may not be right node for left node.


5.How can I find the number of possible tree in the given tree?

(A) Number of possible tree = (2 power of n) – n

6.What is Hashing?

(A) Hashing is a technique to retrieve records from memory quickly.

Thursday, 3 May 2012

SQL Interview questions & answers


1. Which is the subset of SQL commands used to manipulate Oracle Database structures, including tables?
Data Definition Language (DDL)

2. What operator performs pattern matching?
 LIKE operator

3. What operator tests column for the absence of data?
IS NULL operator

4. Which command executes the contents of a specified file?
START <filename> or @<filename>

5. What is the parameter substitution symbol used with INSERT INTO command?
&

6. Which command displays the SQL command in the SQL buffer, and then executes it?
RUN

7. What are the wildcards used for pattern matching?
_ for single character substitution and % for multi-character substitution

8. State true or false. EXISTS, SOME, ANY are operators in SQL.
True

9. State true or false. !=, <>, ^= all denote the same operation.
True

10. What are the privileges that can be granted on a table by a user to others?
Insert, update, delete, select, references, index, execute, alter, all


11. What is the difference between TRUNCATE and DELETE commands?
TRUNCATE is a DDL command whereas DELETE is a DML command. Hence DELETE operation can be rolled back, but TRUNCATE operation cannot be rolled back. WHERE clause can be used with DELETE and not with TRUNCATE.


12. What command is used to get back the privileges offered by the GRANT command?
REVOKE

13. Which system tables contain information on privileges granted and privileges obtained?
       USER_TAB_PRIVS_MADE, USER_TAB_PRIVS_RECD

14. Which system table contains information on constraints on all the tables created?
      USER_CONSTRAINTS

15. TRUNCATE TABLE EMP;
  DELETE FROM EMP
Will the outputs of the above two commands differ?
Both will result in deleting all the rows in the table EMP.

16.What is Common Table Expression in SQL Server? Where do u use this?

17.What are DML, DCL, TCL and DDL statements in SQL Server? Explain briefly with an example?
18.What is mean by transaction in SQL Server?
19.What are difference between stored procedure and functions?
20.What are Max number of columns allows per table in SQL Server?
21.Sql stored procedures performance tuning tips and tricks?
22.What is Cascading referential integrity constraint?
23.SQL Query performance tips and tricks?
24.Difference between Primary key and unique key?
25.How many types of indexes are there in SQL Server?
26.What is SQL Server paging?
27.A table can have indexes. So, what are possibilities are there for tables?
28.Difference between #tempTable,##tempTable,@tableName?
29.Query for column values by comma separated in Sql Server?
30.Types of Joins in SQL Server? What are link between Common Table Expression and SQL Server?
31.What is sub query? How many types of sub queries are there in SQL Server?
32.What are the differences between drop, delete and truncate statements in SQL Server?
33.What are different types of temp tables in the SQL Server?
34.What is difference between clustered index and non clustered index in sql server?
35.What is mean by Cascading referential integrity constraint?





dotnet interview quetions & answers


1.Differences between DLL and EXE?
     dot exe
1.These are outbound file.
2.Only one dotexe file exists per application.
3. .Exe cannot be shared with other applications.


dot dll
1.These are inbund file .
2.Many dotdll files may exists in one application.
3. dotdll can be shared with other applications.


2.Can an assembly have EXE?


Assembly is nothing but single deployment and self describing. Yes Assembly can have dll/exe.


3.Compare & contrast rich client (smart clients or Windows-based) & browser-based Web application ?

 When implementing a client/server architecture you need to determine if it will be the client or the server that handles the bulk of the workload. By client, we mean the application that runs on a PC or workstation and relies on a server to perform some operations.In last week’s Did You Know article we discussed the differences between thick clients (also called fat clients) and thin clients in terms of hardware. The terms thick client and thin client, however, have double meanings, as thick and thin also are used to describe the applications or software. In this article we take a look at the terms thick and thin as related to client application software.


4.Can a DLL be changed to an EXE?

In short, the answer is no. Unlike an EXE file which contains a single entry point (typically WinMain() or simply main() depending on the type of exe file), a DLL file is a library of functions intended to be linked into a running application. A DLL file can have a nearly infinite (it’s based on file size and such) possible entry points.


5.Can a try block have more than one catch block?

Yes, It can have as many as you want. It allows you to catch very specific exceptions.

6.Compare Client server application with n-Tier application?

All web applications are N-Tier architectures. An N-Tier architecture is really a Client-Server architecture combined with the Layered architecture. The reason why I combine Client-Server and N-Tier here is because they are very much related.A Client-Server system is one in which the server performs some kind of service that is used by many clients. The clients take the lead in the communication. The basic Client-Server architecture has 2 tiers (Client and Server).


7.Can a try block have nested try blocks?

Yes perfectly legal, but not always it is useful.

8.How do you load an assembly at runtime?

Here is the sample code, hope it will help
Loader.AssemblyLoader assLoader = null;
object[] parms = { AssemblyName }; // string AssebmlyName

assLoader = (Loader.AssemblyLoader)domain.CreateInstanceFromAndUnwrap(“yourAssemply.dll”, “Loader.AssemblyLoader”, true, bindings, null, parms,null, null, null);

9.How do you view the methods and members of a DLL?

Go to visual studio 2003/2005 command prompt and type “ildasm”. It will open a window. In that window load ur dll, it will show all the methods and members.


10.What is shadowing?

Shadowing is either through scope or through inheritance. Shadowing through inheritance is hiding a method of a base class and providing a new implementation for the same. This is the default when a derived class writes an implementation of a method of base class which is not declared as overridden in the base class. This also serves the purpose of protecting an implementation of a new method against subsequent addition of a method with the same name in the base class.’shadows’ keyword is recommended although not necessary since it is the default.