Jul 6, 2007

Sample of Interview Question about C#, ASP.NET, SQL and General

Sample of Interview Question about C#, ASP.NET, SQL and General

neeh sekedar sharing, semoga bermanfaat.

1. Find the fifth highest salary in Salary Table ?

SELECT MIN(Salary) AS Expr1 FROM tblEmployee
WHERE (empid IN (SELECT DISTINCT TOP 5 empid FROM tblSalary ORDER BY Salary))
2. What is Left Outer Join, Right Outer Join and Full Outer Join ?

LEFT OUTER JOIN - This returns all the matching rows and the unmatched rows of the left table of the SQL code.
RIGHT OUTER JOIN - This returns all the matching rows and the unmatched rows of the right table of the SQL.
FULL OUTER JOIN - This returns all the matching and unmatched rows from both the tables.



3. How you blank many controls(like textbox,checkbox,combobox etc) in C# ?



foreach ( objectcontrol in form1)
{

if ( typeof Objectcontrol is TextBox)

{

Objectcontrol.text = "";
}elseif ( typeof objectcontrol is checkbox)
{

objectcontorl.checked = false;
}

}

4. Define co-related query.
5. Difference between Delete and Truncate command in SQL.

You can delete all the data in a table by using the TRUNCATE command (you can also achieve this with a DELETE command but it is not as efficient due to the ROLLBACK memory usage). TRUNCATE flushes the table of data but leaves the structure and constraints intact. You can add a REUSE STORAGE option which tells the table to hold onto the memory it used to store the rows (but I can't think of any reason why you would want to do this).

6. What is three type of comment in C# program?

Single line, multiple line and document line.
Single line start form anywhere on a line with two forward slashs (//).
Multiple comment start with forward slash followed by an asterisk (/*) and end with asterisk followed by slash .
Document comment start with three forward slashes(///).

7. What is CLR?

It provide a environment in which program are executed, it activate object, perform security check on them, lay them out in the memory, execute them and garbage collect them. CTS ( Common Type System ) is the part of CLR.

8. What is CLS ( Common Language Specification )?

It define a set of feature that all .net compatible languages should support.

9. What are the core technologies in .NET plateform?

.NET framework, .NET enterprise servers, Net building block services and Visual Stdio .net

10. "What are the Difference between SQL 7.0 and SQL server 2000?

Bigint, Variant, Table, XML Support, Instead of Trigger.

11. What are the difference between Structure and Class?

The primary difference is that a structure is value data type and class is the reference data type.
Structure don't have default constructur or destructors.
In Structure all variable and method is public where as in class it is private by default.
Structure does not have inheritance.

12. How many Catch Statement are associated with single try statement?

A try statement have zero or more catch statement, There is no limit to the number of catch statement.

13. How is a base class method is Hidden?

Hiding a base class method by declaring a method in derived class with keyword new.

14 . What Command is used to implement properties in C#?

get and set properties.

15. What is Console and System a Class, a Data Member, a routine , a namespace and a type.

Console is a class in System Namespace and System is a Namespace.

16. How many values can be returned from a method in C#?

Only one value can be returned from method, however you can use ref or out variable to change more than one value in called method.

17. How you declare a output variable in Stored Procedure?

@varialename VariableType Output

18 .What is Magic Table in SQL.

INSERT and DELETE table popularly known as Magic Table.


19 . Can Primary key is a Foreign Key on the same table?

Yes, Let us consider there is employ Table ( empid, empName, empManagerid). In this table manager is also be an employ.



20 .Can we change the dimension of Array at run time like Array1[3,4]?

Yes, We can change only the first position of array dimension.



21. What keyword is used to accept a variable number of parameter in a method?

params keyword is used.



22. How to exit form Console Application in C#.?

int exitValue = 0;
Environment.Exit(exitValue);



23. Why we are using stored procedure.?

A stored procedure is a set of Structured Query Language (SQL) statements that you assign a name to and store in a database in compiled form so that you can share it between a number of programs.
• They allow modular programming.
• They allow faster execution.
• They can reduce network traffic.
• They can be used as a security mechanism.


24. How many different type of stored procedure.?

There are four different type of stored procedure given below:

>> Temporary Stored Procedures - SQL Server supports two types of temporary procedures: local and global. A local temporary procedure is visible only to the connection that created it. A global temporary procedure is available to all connections. Local temporary procedures are automatically dropped at the end of the current session. Global temporary procedures are dropped at the end of the last session using the procedure. Usually, this is when the session that created the procedure ends. Temporary procedures named with # and ## can be created by any user.
>> System stored procedures are created and stored in the master database and have the sp_ prefix.(or xp_) System stored procedures can be executed from any database without having to qualify the stored procedure name fully using the database name master. (If any user-created stored procedure has the same name as a system stored procedure, the user-created stored procedure will never be executed.)
>> Automatically Executing Stored Procedures - One or more stored procedures can execute automatically when SQL Server starts. The stored procedures must be created by the system administrator and executed under the sysadmin fixed server role as a background process. The procedure(s) cannot have any input parameters.
>> User defined stored procedure - These stored procedure is created by user.



25 . How do I mark the stored procedure to automatic execution?

You can use the sp_procoption system stored procedure in master database to mark the stored procedure to automatic execution when the SQL Server will start.



26. How you recompile SQL Server stored procedure?

• The sp_recompile system stored procedure forces a recompile of a stored procedure the next time it is run.
• Creating a stored procedure that specifies the WITH RECOMPILE option in its definition indicates that SQL Server does not cache a plan for this stored procedure; the stored procedure is recompiled each time it is executed. Use the WITH RECOMPILE option when stored procedures take parameters whose values differ widely between executions of the stored procedure, resulting in different execution plans to be created each time. Use of this option is uncommon, and causes the stored procedure to execute more slowly because the stored procedure must be recompiled each time it is executed.
• You can force the stored procedure to be recompiled by specifying the WITH RECOMPILE option when you execute the stored procedure. Use this option only if the parameter you are supplying is atypical or if the data has significantly changed since the stored procedure was created.



27. How we handle error in stored procedure?

UPDATE SALARY SET salary = 5000
IF @@ERROR <>0
BEGIN
SELECT 'Error Occured'
END
ELSE
BEGIN
SELECT 'Updated Successfully'
END


28. Can Stored procedure call itself?

Stored procedures are nested when one stored procedure calls another. You can nest stored procedures up to 32 levels.


29. What is the difference between view and stored procedure?

Views can have only select statements (create, update, truncate, delete statements are not allowed) Views cannot have "select into", "Group by" "Having", "Order by"



30. Why we are using locks inside stored procedure?

Microsoft® SQL Server™ 2000 uses locking to ensure transactional integrity and database consistency. Locking prevents users from reading data being changed by other users, and prevents multiple users from changing the same data at the same time. If locking is not used, data within the database may become logically incorrect, and queries executed against that data may produce unexpected results.
Lock mode Description. There are six different type of locks given below:

Shared (S) Used for operations that do not change or update data (read-only operations), such as a SELECT statement.
Update (U) Used on resources that can be updated. Prevents a common form of deadlock that occurs when multiple sessions are reading, locking, and potentially updating resources later.
Exclusive (X) Used for data-modification operations, such as INSERT, UPDATE, or DELETE. Ensures that multiple updates cannot be made to the same resource at the same time.
Intent Used to establish a lock hierarchy. The types of intent locks are: intent shared (IS), intent exclusive (IX), and shared with intent exclusive (SIX).
Schema Used when an operation dependent on the schema of a table is executing. The types of schema locks are: schema modification (Sch-M) and schema stability (Sch-S).
Bulk Update (BU) Used when bulk-copying data into a table and the TABLOCK hint is specified.



31. What is views in SQL Server ?.

A view is a virtual table made up of data from base tables and other views, but not stored separately.

• Views simplify users perception of the database (can be used to present only the necessary information while hiding details in underlying relations)
• Views improve data security preventing undesired accesses
• Views facilite the provision of additional data independence

View does not occupy any memory space when it is created in SQL Server.



32. Can u drop a table if it has a view?

Views or tables participating in a view created with the SCHEMABINDING clause cannot be dropped. If the view is not created using SCHEMABINDING, then we can drop the table.



33. How do you differentiate Local and Global Temporary table ?

You can create local and global temporary tables. Local temporary tables are visible only in the current session; global temporary tables are visible to all sessions. Prefix local temporary table names with single number sign (# table_name), and prefix global temporary table names with a double number sign (##table_name).



34. What is the difference between User Control and Custom Control ?

Custom Controls are compiled code (Dlls), easier to use, difficult to create, and can be placed in toolbox. Drag and Drop controls. Attributes can be set visually at design time. Can be used by Multiple Applications (If Shared Dlls), Even if Private can copy to bin directory of web application add reference and use. Normally designed to provide common functionality independent of consuming Application. User Controls are similar to those of ASP include files, easy to create, can not be placed in the toolbox and dragged - dropped from it. A User Control is shared among the single application files.



35. What does an assembly contain ?

• Manifest - The metadata describing the information below.
• Assembly name - Aids in versioning and visibility scope.
• Version information - The version number is integrated into the assembly's identity.
• Types - Boundaries and scopes of methods, classes, properties, events, attributes.
• Locale - Information describing language/culture.
• Cryptographic Hash - Public key encoded hash acting as version/security check.
• Security Permissions - The permissions within the assembly determine the permissions that can be granted for all aspects of the assembly contents.

36. What is the difference between Count and Count(*) in SQL Server ?

'Count': Counts the number of non-null values.
'Count (*)': Counts the number of rows in the table, including null values and duplicates.



37. How many page life cycle in ASP.NET ?

There are various stages described as under.

• Init
• LoadViewState
• LoadPostBackData
• Load
• RaisePostBackDataChangedEvent
• RaisePostBackEvents
• Pre-Render
• SaveViewState
• Renders
• Unload

Jul 5, 2007

Oleh-oleh dari Hotel PIH Batam 29 Jun - 1 Jul 2007

Oleh-oleh dari Hotel PIH Batam 29 Jun - 1 Jul 2007 part 2

Jul 3, 2007

Oleh-oleh dari Hotel PIH Batam 29 Jun - 1 Jul 2007

Oleh-oleh dari Hotel PIH Batam 29 Jun - 1 Jul 2007

sekedar sharing foto-foto hasil jepretan fotographer amatir di Hotel PIH Batam pada tanggal 29 june - 1 July 2007. Buat bung Puthut, bung Padjar, 'n mba izzah thanks atas bimbingannya..buat teman-teman fasilitator..selamat berjuang..

untuk melihat foto-fotonya silakan klik link di bawah ini..

  1. All masters of trainer from Acils
  2. Gi Serius neeh
  3. Coffe break hari kedua
  4. Persiapan memfasilitasi
  5. Lunch1
  6. Lunch2
  7. lunch3
  8. pucing ya mas?
  9. pandangan terpana bung Sugeng
bersambung.....