Sie sind auf Seite 1von 27

Software Testing 1. What is SDLC and STLC? 2. When will you start the testing process? 3.

What is Test Plan and Test Case? 4. What is the difference between Integration Testing and System Testing? 5. If an ATM machine is given to you, how will you approach to test it and also check that correct information is updated in the database or not? 6. If an screen is given to you and the enter data in that screen is getting updated into one table. What all kinds of test case you will write and how will u check in the database wheather the enter data is updated correctly or not? 7. What is Performance Testing, Stress Testing and Load Testing. 8. What is the most difficult test case you have written? 9. What is the top priority bug you have found out in your previous career? 10. What is functional testing. 11. Testing Methodologies. SQL 1. What are different kinds of Joins and explain them with examples? 2. What is the difference between primary key and unique key? 3. What is the difference between Union and Union all? 4. What is the difference between Join and Union? 5. What are different kinds of indexes and explain? 6. What is the difference between WHERE and HAVING clause? 7. What is Normalization and De-Normalization? 8. What is a sub-query? 9. Take an example and write a query for SELF Join? 10. Write a query to get the second highest salary? 11. Write a query to display only the duplicate rows in a table? 12. What is the difference between Delete and Truncate? 13. What is a transaction? 14. How will you adjust the size of a database? 15. What are all the different MSSQL server files? 16. What is a Stored Procedure? 17. How will you declare Local variables? 18. How will you declare Global variables? 19. What is Transaction Log file used for? 20. How many clustered and Non-clustered indexes can be created on a table? 21. What are different types of triggers and explain. General 1. What is Win Registry and what it is used for? 2. What is the command to invoke Win Registry? 3. What is IIS? 4. What is XML? 5. Difference between WELL form XML and XML? 6. Automation Tools Win-Runner

1. How can you perform load and stress testing on a single ATM machine? 2. What are ACID properties? 3. What is replication? How many types of replications are there? 4. Write a query to get 'Last Day' of the last month. 5. How can you test a 'Mouse'? 6. How can you test a 'Coke' machine? 7. What are all Test deliverables? 8. What are the various components or folders which exist at 'Regedit' and What are all their usage? 9. Explain about 'Web Server', 'Web Service', IIS and security constraints? 10. What is 'Log file' in SQL Server? 11. What are the tuning techniques for SQL Server? 12. What is use of 'Query Profiler' 13. How can you assure when testing a 'Form' of saving data to db? Without having any specifications. 14. Difference between Remoting and Webservices and define each in brief

OLD Ones in Testing


1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. What is Black Box testing and White Box testing What is Regression Testing How the Test Plan and the Test Cases Documents are prepared Advantages and Disadvantages of Automation Testing What is Stress Testing Localization, Globalization issues What is Monkey Testing What are the various Metrics applicable for Testing Web Testing (What are the features that are to be tested) How will you log a bug If given FS, how the Testing estimates are made What do you do if the Functionality of the System is changed after completing the Testing If you come across a bug, which is not reproducible, what will you do If given FS, as a Tester what will you do If Label and a Text Box are to be tested how do u test it? What are the test cases Given the Functional specs how do you gather the data required for your project where no body is there to help you out You got a suggestion and the developer is not taking it as a bug how do you convince him How do you test a Job which is executable in SQL server Testing Tools worked on Ghosting What is a join and what are different joins

22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33.

Difference between union and join Difference between Group by and Having clause Binary compatibility in VB Implementation of Stored procedures Trace in SQL Server Clustered Index and Non Clustered Index What is a Trigger and the types Of Triggers Normalization (About First, Second and the Third Normal Forms) Database Design for the School Database. Some Queries based on the above design. Data types in ASP How is the Error reported in ASP

.Net Related:
1. what are the main differences between asp and asp.net? 2. what is user control? 3. How do you a replicate a set of controls across a number of ASP Pages. 4. If you have to replicate a set of controls(UI) across a number of web pages, what will you do? 5. What are different types of controls available in ASP.Net 6. how can you pass values between two pages in asp?how will you do the same in ASP.net? 7. what are the validation controls available in ASP.net? 8. how will you upload a file to IIS in Asp and how will you do the same in ASP.net? 9. What is Attribute Programming? What are attributes? Where are they used? 10.What are the Database related classes available in .Net? 11.What is the diff. bet DataReader & DataSet? 12.how do you connect to database in ASp.net and in ASP? 13.what is the difference between recordset and dataset? 14.what are the new object introduced in ado.net that are nor there in ADO? 15.What is a WebService? Give an example. 16.How is a WebService qualified or defined 17.what is format of WSDL? 18.what is xml? diffrences between xml and html? 19.what xsl?where will you use this technology..give an example. 20.question on Reflection? 21.how will you return results as xml from SQL server? 22.How do you design a database? - basics of DB Design, SPs, triggers? 23.What are the normal forms and which is the best? 24.If a database is in 3NF, how many minimum number of tables should it have? 25.What is referential integrity & how is it achieved? 26.What is a Primary Key? Can it have >1 field? 27.What are constraints?

28.why should you create index? Types on indexes? 29.what is a trigger and stored procedure? 30.what are inserted and deleted tables? 31.what is a view? where will you use views? 32.what is fillfactor ? 33.Pillars of OO Progg
34.What is a Constructor? 35.What is a Destructor? 36.what is late binding and early binding? 37.how objects will be managed in .net? 38.How do you handle errors in VB.net or c#? 39.How do you handle errors in VB? 40.Question on on error goto 0? 41.How are structures implemented in VB? 42. What is the necessity for Resume Next? 43.what is COMInterop? 44.Question on Tlbimp,Tlbexp and other tools? 45.What is the difference between COM and DCOM? 46.question on iunknown interface and methods i.r addref,release etc.. 47.What is the default interface for any COM component? 48.What are the methods available in IUnknown? 49.What is IDispatch? 50. what is the difference between activex exe and activex dll? 51. how will you choose between activex exe and activex dll? 52.OLE 53.ActiveX.exe example. 54.Ways to Instantiate a Object 55.Modeling languages. 56.ASP built-in objects 57.HTML and DHTML

Some Helpful Links http://channelw.wipro.com VelociQ


http://www.w3schools.com/sql/default.asp SQL Basic SQL HOME SQL Intro SQL SELECT SQL WHERE

SQL INSERT SQL UPDATE SQL DELETE SQL Demo SQL Try It SQL Advanced SQL ORDER BY SQL AND & OR SQL IN SQL BETWEEN SQL Aliases SQL JOIN SQL UNION SQL CREATE SQL DROP SQL ALTER SQL Functions SQL GROUP BY SQL SELECT INTO

Quiz
http://www.w3schools.com/quiztest/quiztest.asp?qtest=SQL

Microsoft .NET http://www.w3schools.com/ngws/default.asp


Q1. What is the basic difference between a join and a union? A1. A join selects columns from 2 or more tables. A union selects rows. Q2. What is normalization and what are the five normal forms? A2. Normalization is a design procedure for representing data in tabular format. The five normal forms are progressive rules to represent the data with minimal redundancy. Q3. What are foreign keys? A3. These are attributes of one table that have matching values in a primary key in another table, allowing for relationships between tables. Q4. Describe the elements of the SELECT query syntax.

A4. SELECT element FROM table WHERE conditional statement. Q5. Explain the use of the WHERE clause. A5. WHERE is used with a relational statement to isolate the object element or row. Q6. What techniques are used to retrieve data from more than one table in a single SQL statement? A6. Joins, unions and nested selects are used to retrieve data. Q7. What is a view? Why use it? A7. A view is a virtual table made up of data from base tables and other views, but not stored separately. Q8. Explain an outer join. A8. An outer join includes rows from tables when there are no matching values in the tables. Q9. What is subselect? Is it different from a nested select? A9. Subselect is a select which works in conjunction with another select. A nested select is a kind of subselect where the inner select passes to the where criteria for the outer select. Q10. What is the difference between group by and order by? A10. Group by controls the presentation of the rows, order by controls the presentation of the columns for the results of the SELECT statement. Q11. What keyword does an SQL SELECT statement use for a string search? A11. The LIKE keyword allows for string searches. The % sign is used as a wildcard. Q12. What are some sql aggregates and other built-in functions? A12. The common aggregate, built-in functions are AVG, SUM, MIN, MAX, COUNT and DISTINCT. Q13. How is the SUBSTR keyword used in sql? A13. SUBSTR is used for string manipulation with column name, first position and string length used as arguments. Eg. SUBSTR (NAME, 1 3) refers to the first three characters in the column NAME. Q14. Explain the EXPLAIN statement. A14. The explain statement provides information about the optimizer's choice of access path of the sql. Q15. What is referential integrity?

A15. Referential integrity is a method for ensuring the correctness of data in the RDBMS Referential integrity refers to the consistency that must be maintained between primary and foreign keys, ie every foreign key value must have a corresponding primary key value. Q16. What is a NULL value? What are the pros and cons of using NULLS? A16. A NULL value takes up one byte of storage and indicates that a value is not present as opposed to a space or zero value. Q17. What is a synonym? How is it used? A17. A synonym is used to reference a table or view by another name. The other name can then be written in the application code pointing to test tables in the development stage and to production entities when the code is migrated. The synonym is linked to the AUTHID that created it. Q18. What is an alias and how does it differ from a synonym? A18. An alias is an alternative to a synonym, designed for a distributed environment to avoid having to use the location qualifier of a table or view. The alias is not dropped when the table is dropped. Q19. When can an insert of a new primary key value threaten referential integrity? A19. Never. New primary key values are not a problem. However, the values of foreign key inserts must have corresponding primary key values in their related tables. And updates of primary key values may require changes in foreign key values to maintain referential integrity. Q20. What is the difference between static and dynamic sql? A20. Static sql is hard-coded in a program when the programmer knows the statements to be executed. For dynamic sql the program must dynamically allocate memory to receive the query results. Q21. Compare a subselect to a join. A21. Any subselect can be rewritten as a join, but not vice versa. Joins are usually more efficient as join rows can be returned immediately, subselects require a temporary work area for inner selects results while processing the outer select. Q22. What is the difference between IN subselects and EXISTS subselect? A22. If there is an index on the attributes tested an IN is more efficient since DB2 uses the index for the IN. (IN for index is the mnemonic). Q23. What is a Cartesian product?

A23. A Cartesian product results from a faulty query. It is a row in the results for every combination in the join tables. Q24. What is a tuple? A24. A tuple is an instance of data within a relational database. Q25. What is the difference between static and dynamic sql? A25. Static sql is compiled and optimized prior to its execution; dynamic is compiled and optimized during execution. Q26. Any SQL implementation covers data types in couple of main categories. Which of the following are those data types ? (Check all that apply) A. NUMERIC B. CHARACTER C. DATE AND TIME D. BLOBS E. BIT A26. A,B,C. Not all SQL implementations have a BLOB or a BIT data types. Q27. We have a table with a CHARACTER data type field. We apply a ">" row comparison between this field and another CHARACTER field in another table. What will be the results for records with field value of NULL ? (Check one that applies the best) A. TRUE B. FALSE C. UNKNOWN D. Error. E. Those records will be ignored A27. C. NULL in a row when compared will give an UNKNOWN result. Q28. Any database needs to go through a normalization process to make sure that data is represented only once. This will eliminate problems with creating or destroying data in the database. The normalization process is done usually in three steps which results in first, second and third normal forms. Which best describes the process to obtain the third normal form? (Check one that applies the best) A. Each table should have related columns. B. Each separate table should have a primary key. C. We have a table with multi-valued key. All columns that are dependent on only one or on some of the keys should be moved in a different table. D. If a table has columns not dependent on the primary keys, they need to be moved in a separate table. E. Primary key is always UNIQUE and NOT NULL. A28. D. All columns in a table should be dependent on the primary key. This will eliminate transitive dependencies in which A depends on B, and B depends on C, but we're not sure how C depends on A. Sql server can have 2 billion tables per tables and 1024 columns per table. Varchar can store up to 8000 bytes. sp_executesql and Execute statement are used to execute a sql stored Procedure. The execute statement doesn't support parameter substitution in the executed string. Truncate method is fast, Non-logged method of deleting all rows in a table, where delete logs each entry. Truncate immediately frees all the space occupied by table's indexes and data.

@@Rowcount is used to display the number of rows affected by last SQL statement. @@Error displays the error number for the last SQL statement executed. The value is zero,if there is no error. @@identity returns the last inserted identity value. Default sizes for databases Master database - Stores system files - 11MB Model database - Template for all databases - 0.75MB Temp database - Stores temporary objects - 8MB Msdb database - Used by SQL server agents for scheduling alerts and jobs and recording operators- 12MB The min. value for DB size is 512KB The default size for DB is 1MB Implementation of relationships 1-1 Relationship: It is the most uncommon relationship.You might use one-one relationship to divide a table with many fields,to isolate a part of table for security reasons can be implemented by referencing a primary key in one table to a primary key in other table. 1-m Relationship: It is the most common type of relationship, a record in Table A can have multiple matching records in B, where as record in B should have only one matching record in A. It can be implemented by Primary-foreign key relationships. M-m Relationship: Database doesnt support m-m relationships, The same can be implemented by introducing a third (Intermediate) table, which connects both, It is equivalent to having 2 1-m relationships with junction table.The Intermediate table contains a foreign key which is made up of Primary keys in I & II table. For Example the orders and products table have many-many relationship as defined, by creating 2 1-m relationships with Order details table. There are five normal forms 1st NF: Eliminate the repeating groups in the table. 2nd NF: All Non-key columns should depend on entire primary key, but not on partial key. 3rd NF: Eliminate interdependencies between non-key attributes. If the table should be in 3rd normal form, the minimum no. of tables should be one. Q. Why one should not prefix user stored procedures with sp_? A. If the stored procedure starts with sp_, sql server first searches that sp in master database and comes to current database. The stored procedures in master database is global,It is available to all DBs. It becomes an performance issue. Query Optimizer: It is a component which analysis the query and determines the the most efficient way to request the data and thus optimizing the sql statement. The process of choosing an execution plan out of several plans is called optimizing and this is done by query optimizer.

SQL Server Query Optimizer is a cost based optimizer. Each possible execution plan has an associated cost in terms of computing resources. The query optimizer chooses that plan which has lowest estimated cost. Query Execution plan deals with the sequence in which the source tables are accessed, and the methods used to extract the data from the table. Optimizer Hints are used to override the Query Optimizers choice of execution. The five categories of hints are Table hints, Join hints, Query hints, View hints, Lock hints. Sql Server 2000 provides two ways to design the triggers. 1) After Trigger (Default) 2) Instead of trigger You can specify multiple After triggering actions (Insert, Update, Delete).It can be applied to only tables. Instead of Triggers executes instead of triggering action. It can be applied to views and tables. The primary advantage of this trigger is one can update a view which is made up of multiple tables. The two virtual tables that will be used by trigger are Inserted and Deleted tables. Local variables are user-defined identified by @.The value can change during batch or stored procedure in which it is used. and Global variables are system-supplied and predefined identified by @@. Local Temporary table is used by single user and will be deleted when user disconnects Where as global temporary tables can be used by multiple users and the tables will remain until all users disconnect. The order for accessing object Server.Database.Owner.Table.Field. A derived table is a select statement that is used as a table, It is always enclosed in parenthesis and follows from or join. Here is an example of a derived table.
SELECT *FROM Accounts a INNER JOIN (SELECT CustomerID, CustomerName FROM Customers)c ON a.CustomerID = c.CustomerID . The SELECT statement that gets data from the Customers table is the derived table.

A view is a virtual tables that is made up of one or more tables. It can be used for security purpose, hiding complex queries. An Indexed view is a view that has unique clustered index created on it. This takes physical storage i.e it stores data. It will be used in OLAP, decision support where inserts/updates are low. It can be used in the following scenarios 1) Joins and aggregation of big tables. 2) Repeated joins of the same tables on the same keys.

Replication is a set of technologies for copying and distributing the data and database objects from one database to other and synchronizing between databases for consistency. It allows multiple sites to keep the copies of same data .This is useful when multiple sites need to read the same data, or need multiple servers for reporting applications. It separates OLTP from OLAP. Snapshot replication: It distributes data exactly as it appears at a specific moment in time and doesnt monitor for updates. It can be used when data changes are infrequent. It is often used for browsing data such as price lists, online catalog, or data for decision support where the current data is not required and data is used as read only. Transactional replication: With this an initial snapshot of data is applied, and whenever data modifications are made at the publisher, the individual transactions are captured and propagated to the subscribers. Merge Replication: It is the process of distributing the data between publisher and subscriber, It allows the publisher and subscriber to update the data while connected or disconnected, and then merging the updates between the sites when they are connected. The distributor is the server that is responsible for synchronizing the data between publishers and subscribers. The where clause applies to individual rows and having clause applies only to groups. Q.)Write a query to fetch all the managers names with the employee names in the order of manager name. Table: EMP Columns EmpId (Primary Key) EmpName (varchar) MgrId A) create table emp( EmpId char(2) Primary Key, EmpName varchar(20), MgrId char(2) references emp(empid)) select empl.EmpName as employee,mgr.EmpName as manager from emp empl,emp mgr where empl.mgrid=mgr.empid Q) Write a query to update all the names that has spaces in front of their names (above table). A) Update emp set empname='updated' where empname in (select empname from emp where empname like '% %') Q) Write a query to delete all the names that starts with J. A) Delete from emp where empname like 'j%' Set NoCount stops the message displaying the number of rows affected.

Temporary tables are like permanent table but they are created in tempdb, and they are deleted automatically when no longer in use. Collation specifies bit patterns that represent each character, and rules by which characters are compared and sorted.

June Additions
1. Puzzle: There are 2 empty jars of 3 ltrs and 5 ltrs. How do you fill 4 ltrs of water in one of the jars.? 2. Given a soft drink vending m/c scenario, write 5 imp test cases. 3. What is DTS? 4. What is datawarehousing? 5. How do you create a non-clustered index on primary key? 6. What is the output of the following SQL code: declare @str varchar(10) @str = @str + 'hello' print @str 8. What is ACT? 9. What is SQL injection? 10. What is cross scripting? 11. When do you know that a web app like asp.net is vulnerable to errors? 12. Puzzle: Given 3 boxes with 3 diff colors (eg., red, green and blue) and corresponding 3 balls. Every ball goes into the box with a rule that the same color ball doesn't go in the same color box. How many boxes are to be opened at the min. to determine the color of the ball in each box. 13. How do you find out the queries that have been executed last by different users in the database? 14. How do you execute a DTS package? 1. Write a query : For example there is an EMPLOYEE table as follows : EmpName PhoneNo A 1111 B 2222 C 3333 D 4444 A 5555 B 6666 A 7777 The output should be EmpName A B PhoneNo 3 2

ie, the phone number field should contain the number of phone numbers the employee is having.

the result set should contain only the employees that are having more than one phone number. Puzzles : 1. Form 4 Equilateral triangles using 6 equally sized pencils

1) What is FS? What does it contain? 2) What is DS? What does it contain? 3) What is a Test Plan ? 4) What is a Test Case ? 5) When do you think Testing team should get involved ? Why ? 6) What is XML ? What is the purpose of XML ? 7) What is the Windows Registry used for ? 8) How do invoke windows registry ? 9) What is the difference between Truncate and Delete ? Which of the two is the most preferrable one ? Why ? 10) Given a telephone to you, how do you write test cases in order to test the telephone ? 11) Given a webpage with 3 textboxes (Name, Date of Birth, Phone) with a "Submit" and "Cancel" buttons. When the page is submitted the values gets saved in the database. Write test cases for the user interface part of the webpage as well as the for the database. 12) Write a query to get the second highest salary of an employee. 13) What are Sessions ? 14) Why do you use Joins ? Types of Joins ? Explain Self Join with example.

Mamidi
1. There is a process which will do the process of taking a flat file (contains 5 columns and 5 rows) inserting that data into a table. Write test cases to test this process? 2. Write test cases for a Lift? 3. Write a query to get the top 5 maximum salaries? 1. What is the difference between primary key and Unique key constraints? 2. What is the third form of Normalization? 3. What are the system stored procedures? Give examples 4. How you will test Insert, Update and Delete statements? 5. How you will test Hotmail Site home page? 6. The query for joining 3 tables ie Emp, Dept an Project details with inner joins. 7. What is SQL injuction? 8. What are different types of Inner Joins? 9. How you will do performance testing on Web application? 10.What are the components of Rational Robot? 11.How you will do performance testing using Rational robot? 12. What is a white box testing and Black box testing?

Testing Questions: 1. What is traceability matrix 2. What is your role in preparation of a Test Plan 3. How do you write a test case. 4. What is localization and globalisation and how do we test it. SQL Server Questions: 1. Write a query to find the second highest salary 2. Many to Many relation(he had given me two tables and asked me to add some columns so that he can easily recognize to which emp he had assigned a job). 3. He want to copy a data from one database to another. The data in the primary database will not be available once it is being transferred to another database so what will be my job Before transferring the data At the time of transferring the data And after transferring the data. 4. What are different types of replication XML Questions: 1. How do you test an XML 2. What is the difference between well defined XML and well structured XML 3. What is DTD 4. What are web sessions 5. How do you transfer the data from one session to another General Questions: 1. Explain about your latest project (In terms of your role) 2. Before writing a test case what you will do with the documents. Java Questions: 1. What is an interface

SQL Servers

What is a major difference between SQL Server 6.5 and 7.0 platform wise?
SQL Server 6.5 runs only on Windows NT Server. SQL Server 7.0 runs on Windows NT Server, workstation and Windows 95/98.

Is SQL Server implemented as a service or an application?


It is implemented as a service on Windows NT server and workstation and as an application on Windows 95/98.

What is the difference in Login Security Modes between v6.5 and 7.0?
7.0 doesn't have Standard Mode, only Windows NT Integrated mode and Mixed mode that consists of both Windows NT Integrated and SQL Server authentication modes.

What is a traditional Network Library for SQL Servers?


Named Pipes

What is a default TCP/IP socket assigned for SQL Server?


1433

If you encounter this kind of an error message, what you need to look into to solve this problem? "[Microsoft][ODBC SQL Server Driver][Named Pipes]Specified SQL Server not found."
1.Check if MS SQL Server service is running on the computer you are trying to log into 2.Check on Client Configuration utility. Client and Server have to in sync.

What are the two options the DBA has to assign a password to sa?
a) to use SQL statement Use master Exec sp_password NULL, b) to use Query Analyzer utility

What is new philosophy for database devises for SQL Server 7.0?
There are no devises anymore in SQL Server 7.0. It is file system now.

When you create a database how is it stored?


It is stored in two separate files: one file contains the data, system tables, other database objects, the other file stores the transaction log.

Let's assume you have data that resides on SQL Server 6.5. You have to move it SQL Server 7.0. How are you going to do it?
You have to use transfer command.

Questions are categorized under the following sections, for your convenience: 1. 2. 3. 4. 5. Database design (8 questions) SQL Server architecture (12 questions) Database administration (13 questions) Database programming (10 questions) Database design

What is normalization? Explain different levels of normalization? o Check out the article Q100139 from Microsoft knowledge base and of course, theres much more information available in the net. Itll be a good idea to get a hold of any RDBMS fundamentals text book, especially the one by C. J. Date. Most of the times, it will be okay if you can explain till third normal form. What is denormalization and when would you go for it? o As the name indicates, denormalization is the reverse process of normalization. Its the controlled introduction of redundancy in to the database design. It helps improve the query performance as the number of joins could be reduced. How do you implement one-to-one, one-to-many and many-to-many relationships while designing tables? o One-to-One relationship can be implemented as a single table and rarely as two tables with primary and foreign key relationships. One-to-Many relationships are implemented by splitting the data into two tables with primary key and foreign key relationships. Many-to-Many relationships are implemented using a junction table with the keys from both the tables forming the composite primary key of the junction table. It will be a good idea to read up a database designing fundamentals text book. Whats the difference between a primary key and a unique key?

Both primary key and unique enforce uniqueness of the column on which they are defined. But by default primary key creates a clustered index on the column, where are unique creates a nonclustered index by default. Another major difference is that, primary key doesnt allow NULLs, but unique key allows one NULL only. What are user defined datatypes and when you should go for them? o User defined datatypes let you extend the base SQL Server datatypes by providing a descriptive name, and format to the database. Take for example, in your database, there is a column called Flight_Num which appears in many tables. In all these tables it should be varchar(8). In this case you could create a user defined datatype called Flight_num_type of varchar(8) and use it across all your tables. See sp_addtype, sp_droptype in books online. What is bit datatype and whats the information that can be stored inside a bit column? o Bit datatype is used to store boolean information like 1 or 0 (true or false). Untill SQL Server 6.5 bit datatype could hold either a 1 or 0 and there was no support for NULL. But from SQL Server 7.0 onwards, bit datatype can represent a third state, which is NULL. Define candidate key, alternate key, composite key. o A candidate key is one that can identify each row of a table uniquely. Generally a candidate key becomes the primary key of the table. If the table has more than one candidate key, one of them will become the primary key, and the rest are called alternate keys. A key formed by combining at least two or more columns is called composite key. What are defaults? Is there a column to which a default cant be bound? o A default is a value that will be used by a column, if no value is supplied to that column while inserting data. IDENTITY columns and timestamp columns cant have defaults bound to them. See CREATE DEFAULT in books online. What is a transaction and what are ACID properties? o A transaction is a logical unit of work in which, all the steps must be performed or none. ACID stands for Atomicity, Consistency, Isolation, Durability. These are the properties of a transaction. For more information and explanation of these properties, see SQL Server books online or any RDBMS fundamentals text book. Explain different isolation levels An isolation level determines the degree of isolation of data between concurrent transactions. The default SQL Server isolation level is Read Committed. Here are the other isolation levels (in the ascending order of isolation): Read Uncommitted, Read Committed, Repeatable Read, Serializable. See SQL Server books online for an explanation of the isolation levels. Be sure to read about SET TRANSACTION ISOLATION LEVEL, which lets you customize the isolation level at the connection level. Read Committed - A transaction operating at the Read Committed level cannot see changes made by other transactions until those transactions are committed. At this level of isolation, dirty reads are not possible but nonrepeatable reads and phantoms are possible. Read Uncommitted - A transaction operating at the Read Uncommitted level can see uncommitted changes made by other transactions. At this level of isolation, dirty reads, nonrepeatable reads, and phantoms are all possible. Repeatable Read - A transaction operating at the Repeatable Read level is guaranteed not to see any changes made by other transactions in values it has already read. At this level of isolation, dirty reads and nonrepeatable reads are not possible but phantoms are possible. Serializable - A transaction operating at the Serializable level guarantees that all concurrent transactions interact only in ways that produce the same effect as if each transaction were entirely executed one after the other. At this isolation level, dirty reads, nonrepeatable reads, and phantoms are not possible.
o

CREATE INDEX myIndex ON myTable(myColumn)What type of Index will get created after executing the above statement? o Non-clustered index. Important thing to note: By default a clustered index gets created on the primary key, unless specified otherwise. Whats the maximum size of a row? o 8060 bytes. Dont be surprised with questions like what is the maximum number of columns per table. 1024 columns per table. Check out SQL Server books online for the page titled: "Maximum Capacity Specifications". Explain Active/Active and Active/Passive cluster configurations Hopefully you have experience setting up cluster servers. But if you dont, at least be familiar with the way clustering works and the two clusterning configurations Active/Active and Active/Passive. SQL Server books online has enough information on this topic and there is a good white paper available on Microsoft site. Explain the architecture of SQL Server This is a very important question and you better be able to answer it if consider yourself a DBA. SQL Server books online is the best place to read about SQL Server architecture. Read up the chapter dedicated to SQL Server Architecture. What is lock escalation? o Lock escalation is the process of converting a lot of low level locks (like row locks, page locks) into higher level locks (like table locks). Every lock is a memory structure too many locks would mean, more memory being occupied by locks. To prevent this from happening, SQL Server escalates the many fine-grain locks to fewer coarse-grain locks. Lock escalation threshold was definable in SQL Server 6.5, but from SQL Server 7.0 onwards its dynamically managed by SQL Server. Whats the difference between DELETE TABLE and TRUNCATE TABLE commands? o DELETE TABLE is a logged operation, so the deletion of each row gets logged in the transaction log, which makes it slow. TRUNCATE TABLE also deletes all the rows in a table, but it wont log the deletion of each row, instead it logs the deallocation of the data pages of the table, which makes it faster. Of course, TRUNCATE TABLE can be rolled back. TRUNCATE TABLE is functionally identical to DELETE statement with no WHERE clause: both remove all rows in the table. But TRUNCATE TABLE is faster and uses fewer system and transaction log resources than DELETE. The DELETE statement removes rows one at a time and records an entry in the transaction log for each deleted row. TRUNCATE TABLE removes the data by deallocating the data pages used to store the tables data, and only the page deallocations are recorded in the transaction log. TRUNCATE TABLE removes all rows from a table, but the table structure and its columns, constraints, indexes and so on remain. The counter used by an identity for new rows is reset to the seed for the column. If you want to retain the identity counter, use DELETE instead. If you want to remove table definition and its data, use the DROP TABLE statement. You cannot use TRUNCATE TABLE on a table referenced by a FOREIGN KEY constraint; instead, use DELETE statement without a WHERE clause. Because TRUNCATE TABLE is not logged, it cannot activate a trigger. TRUNCATE TABLE may not be used on tables participating in an indexed view Explain the storage models of OLAP o Check out MOLAP, ROLAP and HOLAP in SQL Server books online for more infomation. What are the new features introduced in SQL Server 2000 (or the latest release of SQL Server at the time of your interview)? What changed between the previous version of SQL Server and the current version?

This question is generally asked to see how current is your knowledge. Generally there is a section in the beginning of the books online titled "Whats New", which has all such information. Of course, reading just that is not enough, you should have tried those things to better answer the questions. Also check out the section titled "Backward Compatibility" in books online which talks about the changes that have taken place in the new version. What are constraints? Explain different types of constraints. o Constraints enable the RDBMS enforce the integrity of the database automatically, without needing you to create triggers, rule or defaults. Types of constraints: NOT NULL, CHECK, UNIQUE, PRIMARY KEY, FOREIGN KEY. For an explanation of these constraints see books online for the pages titled: "Constraints" and "CREATE TABLE", "ALTER TABLE" What is an index? What are the types of indexes? How many clustered indexes can be created on a table? I create a separate index on each column of a table. What are the advantages and disadvantages of this approach? o Indexes in SQL Server are similar to the indexes in books. They help SQL Server retrieve the data quicker. Indexes are of two types. Clustered indexes and non-clustered indexes. When you create a clustered index on a table, all the rows in the table are stored in the order of the clustered index key. So, there can be only one clustered index per table. Non-clustered indexes have their own storage separate from the table data storage. Non-clustered indexes are stored as B-tree structures (so do clustered indexes), with the leaf level nodes having the index key and its row locater. The row located could be the RID or the Clustered index key, depending up on the absence or presence of clustered index on the table. If you create an index on each column of a table, it improves the query performance, as the query optimizer can choose from all the existing indexes to come up with an efficient execution plan. At the same t ime, data modification operations (such as INSERT, UPDATE, DELETE) will become slow, as every time data changes in the table, all the indexes need to be updated. Another disadvantage is that, indexes need disk space, the more indexes you have, more disk space is used. What is RAID and what are different types of RAID configurations? o RAID stands for Redundant Array of Inexpensive Disks, used to provide fault tolerance to database servers. There are six RAID levels 0 through 5 offering different levels of performance, fault tolerance. MSDN has some information about RAID levels and for detailed information, check out the RAID advisory boards homepage What are the steps you will take to improve performance of a poor performing query? o This is a very open ended question and there could be a lot of reasons behind the poor performance of a query. But some general issues that you could talk about would be: No indexes, table scans, missing or out of date statistics, blocking, excess recompilations of stored procedures, procedures and triggers without SET NOCOUNT ON, poorly written query with unnecessarily complicated joins, too much normalization, excess usage of cursors and temporary tables. Some of the tools/ways that help you troubleshooting performance problems are: SET SHOWPLAN_ALL ON, SET SHOWPLAN_TEXT ON, SET STATISTICS IO ON, SQL Server Profiler, Windows NT /2000 Performance monitor, Graphical execution plan in Query Analyzer. Download the white paper on performance tuning SQL Server from Microsoft web site. Dont forget to check out sql-server-performance.com What are the steps you will take, if you are tasked with securing an SQL Server? o Again this is another open ended question. Here are some things you could talk about: Preferring NT authentication, using server, databse and application roles to control access to the data, securing the physical database files using NTFS permissions, using an unguessable SA
o

password, restricting physical access to the SQL Server, renaming the Administrator account on the SQL Server computer, disabling the Guest account, enabling auditing, using multiprotocol encryption, setting up SSL, setting up firewalls, isolating SQL Server from the web server etc. Read the white paper on SQL Server security from Microsoft website. Also check out My SQL Server security best practices What is a deadlock and what is a live lock? How will you go about resolving deadlocks? o Deadlock is a situation when two processes, each having a lock on one piece of data, attempt to acquire a lock on the others piece. Each process would wait indefinitely for the other to release the lock, unless one of the user processes is terminated. SQL Server detects deadlocks and terminates one users process. A livelock is one, where a request for an exclusive lock is repeatedly denied because a series of overlapping shared locks keeps interfering. SQL Server detects the situation after four denials and refuses further shared locks. A livelock also occurs when read transactions monopolize a table or page, forcing a write transaction to wait indefinitely. Check out SET DEADLOCK_PRIORITY and "Minimizing Deadlocks" in SQL Server books online. Also check out the article Q169960 from Microsoft knowledge base. What is blocking and how would you troubleshoot it? o Blocking happens when one connection from an application holds a lock and a second connection requires a conflicting lock type. This forces the second connection to wait, blocked on the first. Read up the following topics in SQL Server books online: Understanding and avoiding blocking, Coding efficient transactions. Explain CREATE DATABASE syntax Many of us are used to creating databases from the Enterprise Manager or by just issuing the command: CREATE DATABAE MyDB. But what if you have to create a database with two filegroups, one on drive C and the other on drive D with log on drive E with an initial size of 600 MB and with a growth factor of 15%? o Thats why being a DBA you should be familiar with the CREATE DATABASE syntax. Check out SQL Server books online for more information. How to restart SQL Server in single user mode? How to start SQL Server in minimal configuration mode? o SQL Server can be started from command line, using the SQLSERVR.EXE. This EXE has some very important parameters with which a DBA should be familiar with. -m is used for starting SQL Server in single user mode and -f is used to start the SQL Server in minimal configuration mode. Check out SQL Server books online for more parameters and their explanations. As a part of your job, what are the DBCC commands that you commonly use for database maintenance? o DBCC CHECKDB, DBCC CHECKTABLE, DBCC CHECKCATALOG, DBCC CHECKALLOC, DBCC SHOWCONTIG, DBCC SHRINKDATABASE, DBCC SHRINKFILE etc. But there are a whole load of DBCC commands which are very useful for DBAs. Check out SQL Server books online for more information. What are statistics, under what circumstances they go out of date, how do you update them? o Statistics determine the selectivity of the indexes. If an indexed column has unique values then the selectivity of that index is more, as opposed to an index with non-unique values. Query optimizer uses these indexes in determining whether to choose an index or not while executing a query. Some situations under which you should update statistics: 1) If there is significant change in the key values in the index 2) If a large amount of data in an indexed column has been added, changed, or removed (that is, if the distribution of key values has changed), or the table has been truncated using the TRUNCATE TABLE statement and then repopulated 3) Database is upgraded from a previous version. Look up SQL Server books online for the following

commands: UPDATE STATISTICS, STATS_DATE, DBCC SHOW_STATISTICS, CREATE STATISTICS, DROP STATISTICS, sp_autostats, sp_createstats, sp_updatestats What are the different ways of moving data/databases between servers and databases in SQL Server? o There are lots of options available, you have to choose your option depending upon your requirements. Some of the options you have are: BACKUP/RESTORE, dettaching and attaching databases, replication, DTS, BCP, logshipping, INSERTSELECT, SELECTINTO, creating INSERT scripts to generate data. Explain different types of BACKUPs avaialabe in SQL Server? Given a particular scenario, how would you go about choosing a backup plan? o Types of backups you can create in SQL Sever 7.0+ are Full database backup, differential database backup, transaction log backup, filegroup backup. Check out the BACKUP and RESTORE commands in SQL Server books online. Be prepared to write the commands in your interview. Books online also has information on detailed backup/restore architecture and when one should go for a particular kind of backup. What is database replication? What are the different types of replication you can set up in SQL Server? o Replication is the process of copying/moving data between databases on the same or different servers. SQL Server supports the following types of replication scenarios: Snapshot replication Transactional replication (with immediate updating subscribers, with queued updating subscribers) Merge replication See SQL Server books online for indepth coverage on replication. Be prepared to explain how different replication agents function, what are the main system tables used in replication etc. How to determine the service pack currently installed on SQL Server? o The global variable @@Version stores the build number of the sqlservr.exe, which is used to determine the service pack installed. To know more about this process visit SQL Server service packs and versions. What are cursors? Explain different types of cursors. What are the disadvantages of cursors? How can you avoid cursors? o Cursors allow row-by-row processing of the resultsets. Types of cursors: Static, Dynamic, Forward-only, Keyset-driven. See books online for more information. Disadvantages of cursors: Each time you fetch a row from the cursor, it results in a network roundtrip, where as a normal SELECT query makes only one roundtrip, however large the resultset is. Cursors are also costly because they require more resources and temporary storage (results in more IO operations). Further, there are restrictions on the SELECT statements that can be used with some types of cursors. Most of the times, set based operations can be used instead of cursors. Here is an example: If you have to give a flat hike to your employees using the following criteria: Salary between 30000 and 40000 5000 hike Salary between 40000 and 55000 7000 hike Salary between 55000 and 65000 9000 hike. In this situation many developers tend to use a cursor, determine each employees salary and update his salary according to the above formula. But the same can be achieved by multiple update statements or can be combined in a single UPDATE statement as shown below: o UPDATE tbl_emp SET salary = CASE WHEN salary BETWEEN 30000 AND 40000 THEN salary + 5000 WHEN salary BETWEEN 40000 AND 55000 THEN salary + 7000 WHEN salary BETWEEN 55000 AND 65000 THEN salary + 10000 END o Another situation in which developers tend to use cursors: You need to call a stored procedure when a column in a particular row meets certain condition. You dont have to use cursors for

this. This can be achieved using WHILE loop, as long as there is a unique key to identify each row. For examples of using WHILE loop for row by row processing, check out the My code library section of my site or search for WHILE. Write down the general syntax for a SELECT statements covering all the options. Heres the basic syntax: (Also checkout SELECT in books online for advanced syntax). o SELECT select_list [INTO new_table_] FROM table_source [WHERE search_condition] [GROUP BY group_by_expression] [HAVING search_condition] [ORDER BY order_expression [ASC | DESC] ] What is a join and explain different types of joins. o Joins are used in queries to explain how different tables are related. Joins also let you select data from a table depending upon data from another table. Types of joins: INNER JOINs, OUTER JOINs, CROSS JOINs. OUTER JOINs are further classified as LEFT OUTER JOINS, RIGHT OUTER JOINS and FULL OUTER JOINS. For more information see pages from books online titled: "Join Fundamentals" and "Using Joins". Can you have a nested transaction? o Yes, very much. Check out BEGIN TRAN, COMMIT, ROLLBACK, SAVE TRAN and @@TRANCOUNT What is an extended stored procedure? Can you instantiate a COM object by using T-SQL? o An extended stored procedure is a function within a DLL (written in a programming language like C, C++ using Open Data Services (ODS) API) that can be called from T-SQL, just the way we call normal stored procedures using the EXEC statement. See books online to learn how to create extended stored procedures and how to add them to SQL Server. Yes, you can instantiate a COM (written in languages like VB, VC++) object from T-SQL by using sp_OACreate stored procedure. Also see books online for sp_OAMethod, sp_OAGetProperty, sp_OASetProperty, sp_OADestroy. For an example of creating a COM object in VB and calling it from T-SQL, see My code library section of this site. What is the system function to get the current users user id? o USER_ID(). Also check out other system functions like USER_NAME(), SYSTEM_USER, SESSION_USER, CURRENT_USER, USER, SUSER_SID(), HOST_NAME(). What are triggers? How many triggers you can have on a table? How to invoke a trigger on demand? o Triggers are special kind of stored procedures that get executed automatically when an INSERT, UPDATE or DELETE operation takes place on a table. In SQL Server 6.5 you could define only 3 triggers per table, one for INSERT, one for UPDATE and one for DELETE. From SQL Server 7.0 onwards, this restriction is gone, and you could create multiple triggers per each action. But in 7.0 theres no way to control the order in which the triggers fire. In SQL Server 2000 you could specify which trigger fires first or fires last using sp_settriggerorder. Triggers cant be invoked on demand. They get triggered only when an associated action (INSERT, UPDATE, DELETE) happens on the table on which they are defined. Triggers are generally used to implement business rules, auditing. Triggers can also be used to extend the referential integrity checks, but wherever possible, use constraints for this purpose, instead of triggers, as constraints are much faster. Till SQL Server 7.0, triggers fire only after the data modification operation happens. So in a way, they are called post triggers. But in SQL Server 2000 you could create pre triggers also. Search SQL Server 2000 books online for INSTEAD OF triggers. Also check out books online for inserted table, deleted table and COLUMNS_UPDATED()

There is a trigger defined for INSERT operations on a table, in an OLTP system. The trigger is written to instantiate a COM object and pass the newly insterted rows to it for some custom processing. What do you think of this implementation? Can this be implemented better? o Instantiating COM objects is a time consuming process and since you are doing it from within a trigger, it slows down the data insertion process. Same is the case with sending emails from triggers. This scenario can be better implemented by logging all the necessary data into a separate table, and have a job which periodically checks this table and does the needful. What is a self join? Explain it with an example. o Self join is just like any other join, except that two instances of the same table will be joined in the query. Here is an example: Employees table which contains rows for normal employees as well as managers. So, to find out the managers of all the employees, you need a self join. o CREATE TABLE emp ( empid int, mgrid int, empname char(10) ) o INSERT emp SELECT 1,2,Vyas INSERT emp SELECT 2,3,Mohan INSERT emp SELECT 3,NULL,Shobha INSERT emp SELECT 4,2,Shridhar INSERT emp SELECT 5,2,Sourabh o SELECT t1.empname [Employee], t2.empname [Manager] FROM emp t1, emp t2 WHERE t1.mgrid = t2.empid Heres an advanced query using a LEFT OUTER JOIN that even returns the employees without managers (super bosses) o SELECT t1.empname [Employee], COALESCE(t2.empname, No manager) [Manager] FROM emp t1 LEFT OUTER JOIN emp t2 ON t1.mgrid = t2.empid

1. What is a Cartesian product? What causes it? Expected answer: A Cartesian product is the result of an unrestricted join of two or more tables. The result set of a three table Cartesian product will have x * y * z number of rows where x, y, z correspond to the number of rows in each table involved in the join. It is causes by specifying a table in the FROM clause without joining it to another table. 2. What is an advantage to using a stored procedure as opposed to passing an SQL query from an application. Expected answer: A stored procedure is pre-loaded in memory for faster execution. It allows the DBMS control of permissions for security purposes. It also eliminates the need to recompile components when minor changes occur to the database. 3. What is the difference of a LEFT JOIN and an INNER JOIN statement? Expected answer: A LEFT JOIN will take ALL values from the first declared table and matching values from the second declared

table based on the column the join has been declared on. An INNER JOIN will take only matching values from both tables 4. When a query is sent to the database and an index is not being used, what type of execution is taking place? Expected answer: A table scan. 5. What are the pros and cons of using triggers? Expected answer: A trigger is one or more statements of SQL that are being executed in event of data modification in a table to which the trigger belongs. Triggers enhance the security, efficiency, and standardization of databases. Triggers can be beneficial when used: to check or modify values before they are actually updated or inserted in the database. This is useful if you need to transform data from the way the user sees it to some internal database format. to run other non-database operations coded in user-defined functions to update data in other tables. This is useful for maintaining relationships between data or in keeping audit trail information. to check against other data in the table or in other tables. This is useful to ensure data integrity when referential integrity constraints arent appropriate, or when table check constraints limit checking to the current table only.

Interview Questions C#
1. Whats the implicit name of the parameter that gets passed into the class set method? Value, and its datatype depends on whatever variable were changing. 2. How do you inherit from a class in C#? Place a colon and then the name of the base class. Notice that its double colon in C++. 3. Does C# support multiple inheritance? No, use interfaces instead. 4. When you inherit a protected class-level variable, who is it available to? Classes in the same namespace. 5. Are private class-level variables inherited? Yes, but they are not accessible, so looking at it you can honestly say that they are not inherited. But they are. 6. Describe the accessibility modifier protected internal. Its available to derived classes and classes within the same Assembly (and naturally from the base class its declared in). 7. C# provides a default constructor for me. I write a constructor that takes a string as a parameter, but want to keep the no parameter one. How many constructors should I write? Two. Once you

write at least one constructor, C# cancels the freebie constructor, and now you have to write one yourself, even if theres no implementation in it. 8. Whats the top .NET class that everything is derived from? System.Object. 9. Hows method overriding different from overloading? When overriding, you change the method behavior for a derived class. Overloading simply involves having a method with the same name within the class. 10. What does the keyword virtual mean in the method definition? The method can be over-ridden. 11. Can you declare the override method static while the original method is non-static? No, you cant, the signature of the virtual method must remain the same, only the keyword virtual is changed to keyword override. 12. Can you override private virtual methods? No, moreover, you cannot access private methods in inherited classes, have to be protected in the base class to allow any sort of access. 13. Can you prevent your class from being inherited and becoming a base class for some other classes? Yes, thats what keyword sealed in the class definition is for. The developer trying to derive from your class will get a message: cannot inherit from Sealed class WhateverBaseClassName. Its the same concept as final class in Java. 14. Can you allow class to be inherited, but prevent the method from being over-ridden? Yes, just leave the class public and make the method sealed. 15. Whats an abstract class? A class that cannot be instantiated. A concept in C++ known as pure virtual method. A class that must be inherited and have the methods over-ridden. Essentially, its a blueprint for a class without any implementation. 16. When do you absolutely have to declare a class as abstract (as opposed to free-willed educated choice or decision based on UML diagram)? When at least one of the methods in the class is abstract. When the class itself is inherited from an abstract class, but not all base abstract methods have been over-ridden. 17. Whats an interface class? Its an abstract class with public abstract methods all of which must be implemented in the inherited classes. 18. Why cant you specify the accessibility modifier for methods inside the interface? They all must be public. Therefore, to prevent you from getting the false impression that you have any freedom of choice, you are not allowed to specify any accessibility, its public by default. 19. Can you inherit multiple interfaces? Yes, why not. 20. And if they have conflicting method names? Its up to you to implement the method inside your own class, so implementation is left entirely up to you. This might cause a problem on a higher-level scale if similarly named methods from different interfaces expect different data, but as far as compiler cares youre okay. 21. Whats the difference between an interface and abstract class? In the interface all methods must be abstract; in the abstract class some methods can be concrete. In the interface no accessibility modifiers are allowed, which is ok in abstract classes. 22. How can you overload a method? Different parameter data types, different number of parameters, different order of parameters. 23. If a base class has a bunch of overloaded constructors, and an inherited class has another bunch of overloaded constructors, can you enforce a call from an inherited constructor to an arbitrary base constructor? Yes, just place a colon, and then keyword base (parameter list to invoke the appropriate constructor) in the overloaded constructor definition inside the inherited class.

24. Whats the difference between System.String and System.StringBuilder classes? System.String is immutable; System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed. 25. Whats the advantage of using System.Text.StringBuilder over System.String? StringBuilder is more efficient in the cases, where a lot of manipulation is done to the text. Strings are immutable, so each time its being operated on, a new instance is created. 26. Can you store multiple data types in System.Array? No. 27. Whats the difference between the System.Array.CopyTo() and System.Array.Clone()? The first one performs a deep copy of the array, the second one is shallow. 28. How can you sort the elements of the array in descending order? By calling Sort() and then Reverse() methods. 29. Whats the .NET datatype that allows the retrieval of data by a unique key? HashTable. 30. Whats class SortedList underneath? A sorted HashTable. 31. Will finally block get executed if the exception had not occurred? Yes. 32. Whats the C# equivalent of C++ catch (), which was a catch-all statement for any possible exception? A catch block that catches the exception of type System.Exception. You can also omit the parameter data type in this case and just write catch {}. 33. Can multiple catch blocks be executed? No, once the proper catch code fires off, the control is transferred to the finally block (if there are any), and then whatever follows the finally block. 34. Why is it a bad idea to throw your own exceptions? Well, if at that point you know that an error has occurred, then why not write the proper code to handle that error instead of passing a new Exception object to the catch block? Throwing your own exceptions signifies some design flaws in the project. 35. Whats a delegate? A delegate object encapsulates a reference to a method. In C++ they were referred to as function pointers. 36. Whats a multicast delegate? Its a delegate that points to and eventually fires off several methods. 37. Hows the DLL Hell problem solved in .NET? Assembly versioning allows the application to specify not only the library it needs to run (which was available under Win32), but also the version of the assembly. 38. What are the ways to deploy an assembly? An MSI installer, a CAB archive, and XCOPY command. 39. Whats a satellite assembly? When you write a multilingual or multi-cultural application in .NET, and want to distribute the core application separately from the localized modules, the localized assemblies that modify the core application are called satellite assemblies. 40. What namespaces are necessary to create a localized application? System.Globalization, System.Resources. 41. Whats the difference between // comments, /* */ comments and /// comments? Single-line, multiline and XML documentation comments. 42. How do you generate documentation from the C# file commented properly with a command-line compiler? Compile it with a /doc switch. 43. Whats the difference between <c> and <code> XML documentation tag? Single line code example and multiple-line code example. 44. Is XML case-sensitive? Yes, so <Student> and <student> are different elements. 45. What debugging tools come with the .NET SDK? CorDBG command-line debugger, and DbgCLR graphic debugger. Visual Studio .NET uses the DbgCLR. To use CorDbg, you must compile the original C# file using the /debug switch. 46. What does the This window show in the debugger? It points to the object thats pointed to by this reference. Objects instance data is shown.

47. What does assert() do? In debug compilation, assert takes in a Boolean condition as a parameter, and shows the error dialog if the condition is false. The program proceeds without any interruption if the condition is true. 48. Whats the difference between the Debug class and Trace class? Documentation looks the same. Use Debug class for debug builds, use Trace class for both debug and release builds. 49. Why are there five tracing levels in System.Diagnostics.TraceSwitcher? The tracing dumps can be quite verbose and for some applications that are constantly running you run the risk of overloading the machine and the hard drive there. Five levels range from None to Verbose, allowing to fine-tune the tracing activities. 50. Where is the output of TextWriterTraceListener redirected? To the Console or a text file depending on the parameter passed to the constructor. 51. How do you debug an ASP.NET Web application? Attach the aspnet_wp.exe process to the DbgClr debugger. 52. What are three test cases you should go through in unit testing? Positive test cases (correct data, correct output), negative test cases (broken or missing data, proper handling), exception test cases (exceptions are thrown and caught properly). 53. Can you change the value of a variable while debugging a C# application? Yes, if you are debugging via Visual Studio.NET, just go to Immediate window. 54. Explain the three services model (three-tier application). Presentation (UI), business (logic and underlying code) and data (from storage or other sources). 55. What are advantages and disadvantages of Microsoft-provided data provider classes in ADO.NET? SQLServer.NET data provider is high-speed and robust, but requires SQL Server license purchased from Microsoft. OLE-DB.NET is universal for accessing other sources, like Oracle, DB2, Microsoft Access and Informix, but its a .NET layer on top of OLE layer, so not the fastest thing in the world. ODBC.NET is a deprecated layer provided for backward compatibility to ODBC engines. 56. Whats the role of the DataReader class in ADO.NET connections? It returns a read-only dataset from the data source when the command is executed. 57. What is the wildcard character in SQL? Lets say you want to query database with LIKE for all employees whose name starts with La. The wildcard character is %, the proper query with LIKE would involve La%. 58. Explain ACID rule of thumb for transactions. Transaction must be Atomic (it is one unit of work and does not dependent on previous and following transactions), Consistent (data is either committed or roll back, no in-between case where something has been updated and something hasnt), Isolated (no transaction sees the intermediate results of the current transaction), Durable (the values persist if the data had been committed even if the system crashes right after). 59. What connections does Microsoft SQL Server support? Windows Authentication (via Active Directory) and SQL Server authentication (via Microsoft SQL Server username and passwords). 60. Which one is trusted and which one is untrusted? Windows Authentication is trusted because the username and password are checked with the Active Directory, the SQL Server authentication is untrusted, since SQL Server is the only verifier participating in the transaction. 61. Why would you use untrusted verificaion? Web Services might use it, as well as non-Windows applications. 62. What does the parameter Initial Catalog define inside Connection String? The database name to connect to. 63. Whats the data provider name to connect to Access database? Microsoft.Access. 64. What does Dispose method do with the connection object? Deletes it from the memory.

65. What is a pre-requisite for connection pooling? Multiple processes must agree that they will share the same connection, where every parameter is the same, including the security settings.

Das könnte Ihnen auch gefallen