Friday, July 13, 2007

Improving Performance of .Net Application by Avoiding Unnecessary String Creation

Everyone wants faster performance of application and we are been asked frequently on every .net forums that

- “How Can I Improve performance of C# Application”
- “How Can I Improve performance of ASP.net Application”

Well there are many ways but out of them we can also improve performance of .Net Application by avoiding unnecessary string creation

A System.String object is “immutable”. “Immutable” means, any change to a string requires creating a new string object. Unnecessary string creation degrades the performance.

Step1: Avoid Empty string Assignment

Bad Programming
String strMyString = “”;
//It creates an additional empty string, before assignment.

Good Programming
String strMyString = string.Empty;
//It doesn’t require to creates an additional empty string, before assignment.



Step2: Use Case-Insensitive String Comparison or Avoid unnecessary changes to string.

Many times we have habbit of casing the string before comparing, but casing the string creates a new string object. To avoid that use Case-Insensitive string comparison.

Bad Programming
if (strCheck.ToLower() == “yes”)
//It creates new string with strCheck content as lower and assign it.

Good Programming
if (System.String.Compare(strCheck,”yes”,true) == 0)
//System.String.Compare method returns Zero when strings are equal.

One step ahead of our discussion.

In above example you will notice that “yes” is a content which is been used to compare, but think if this comparison is made number of times, and at some point we need to change the comparison criteria from “yes” to “no” in that case it would be tedious task to replace each “yes” with “no”, moreover it is not 100% reliable.

To avoid such situation, one should always declare such data as constant, so changing its value will be reflected to all the places where it is been used.

Let consider above example, in that case you should create a class form, let say “clsConstant” wherein all the constants are been declared.

In clsConstant.cs File
public static string YES = "yes";

In form where it is used.
if (System.String.Compare(strCheck, clsConstant.YES,true) == 0)



Step3: Use StringBuilder class for string concatenations and manipulations.

Strings are immutable, means when you modify string it creates a new string based on your modification. Original string will be therein memory till it is garbage collected. So if your application requires extensive modification of strings, you should use StringBuilder class instead of using String class, as stringbuilder class object is mutable and does in-place modification of string.

Bad Programming
String strResult = “”;
String strAppend = “ABC”;
for( int iCount = 0; iCount < 50; iCount++)
{
strResult = strResult + strAppend;
}
//Here 50 times string is modified, and created

Good Programming
string strResult=string.Empty;
string strAppend = "ABC";

StringBuilder sb = new StringBuilder(strResult);
for(int iCount=0; iCount < 50; iCount++)
{
sb.Append(strAppend);
}
strResult = sb.ToString();

Difference between == and .Equals Method?

What is Difference between == and .Equals() Method?

I have blogged on this topic before, but was not fully satisfied and so explaining the difference in more better way.

For Value Type: == and .Equals() method usually compare two objects by value.

For Example:

int x = 10;

int y = 10;

Console.WriteLine( x == y);

Console.WriteLine(x.Equals(y));

Will display:

True

True


For Reference Type: == performs an identity comparison, i.e. it will only return true if both references point to the same object. While Equals() method is expected to perform a value comparison, i.e. it will return true if the references point to objects that are equivalent.

For Example:

StringBuilder s1 = new StringBuilder(“Yes”);

StringBuilder s2 = new StringBuilder(“Yes”);

Console.WriteLine(s1 == s2);

Console.WriteLine(s1.Equals(s2));

Will display:

False

True

In above example, s1 and s2 are different objects hence “==” returns false, but they are equivalent hence “Equals()” method returns true. Remember there is an exception of this rule, i.e. when you use “==” operator with string class it compares value rather than identity.

When to use “==” operator and when to use “.Equals()” method?

For value comparison, with Value Tyep use “==” operator and use “Equals()” method while performing value comparison with Reference Type.

Thursday, July 12, 2007

Good Programmer Vs Bad Programmer

Phil Haack has made a list of points which are found in Good Programmer.

  • Good Developers take Ownership
  • Good Developers Write Code With Less Bugs
  • Good Developers Write Maintainable Code
  • Good Developers Do More With Less Code
Read more...

It was better if he has also mention something about good programming practise, Anyways he has prepare a good list of points.

.NET Framework 3.5 New Features

The .NET Framework 3.5 brings no breaking changes. New technology is being added including LINQ, AJAX, WF, WCF and WPF Developer Tools and BCL enhancements.

.NET Framework 3.5 New Features


Faster .NET Framework execution

1. Faster garbage collection

2. Smarter, faster NGen requiring smaller working set RAM

3. 64 bit client improvements

4. ThreadPool performance improvements

5. Security check caching during NGen



Base Class Library – New Class Additions

6. BigInteger, HashSet and DateTime2 types

7. NSA Suite ”B” and FIPs compliant cryptography

8. Lightweight Reader/Writer Lock Classes

9. Anonymous and Named Pipes IO Classes

10. Integration with Event Tracing for Windows

11. New Addin hosting model for extensibility



Language Integrated Query (LINQ)

Deep integration of LINQ data-awareness into the programming languages and framework.



Workflow Enabled Services – Process and Messaging together

Using workflow to provide for durable and long-running services. New Tools, WF activities and new programming model classes have been added to simplify building workflow-enabled services using WF and WCF. This allows a .NET Framework developer to build business logic for a service using WF and expose messaging from that service using WCF. These improvements not only provide tools for this scenario but they reduce the amount of glue code that was previously required.



Web 2.0 Friendly and AJAX Enabled WCF Services

Ajax is a web development technique for making asynchronous exchanges of small amounts of data between browser and web service calls from the browser client script to the web server. A programming model is provided for building Ajax style web applications using WCF services. An HTTP programming model is also provided allowing for REST style web services.



Visual Studio Developer Tools for WF, WCF and in Visual Studio “Orcas”

Visual Studio”Orcas” has built in tools for web service authoring with WCF and for building workflow enabled software with WF. There are new project templates for WCF services, WF business logic, workflow enabled services, and AJAX services. The templates are conveniently set up to compile and run even before any custom code is added enabling .NET developers to get going quickly. There are also numerous other tools for developing with WF, WCF and WPF.



More WS-* Standards Support

Implementation in WCF of the latest OASIS specifications Web Services Atomic Transaction (WS-AtomicTransaction) 1.1, WS-ReliableMessaging 1.1, WS-SecureCOnversation and Web Services Coordination (WS-Coordination) 1.1.



RSS and ATOM Syndication API

Applications built using WCF will be able to easily expose syndicated data which can be consumed by an RSS or ATOM reader.



Partial Trust Support for WCF Hosting

Partial trust on the vlient is provided for ASMX parity focussing mainly on partially trusted WCF applications deployed through click-once. Support is provided for basic HTTP binding provided that the application runs in the Internet zone permissions and have granted the apropriate WebPermission. Secure communication is possible through transport security only. All other features are not available to partially trusted applications including hosting services, duplex communications, non-HTTP transports, WS-* protocols and any WF use.



Rules Data Improvements

The rules engine in WF is improved to add support for C# 3.0 extension metods, and for operator overloading . Also the ”new” operator is added to compete the base set of expression types.



Built-in WPF tools for Visual Studio “Orcas”

The Visual Studio designer for WPF was previously released as a CTP. It is not integrated into the development environment and is significantly improved.



Additional WPF Features and Improved Performance

WPF has smoother animations, faster startup and better overall performance. There are also new data types available for data binding with LINQ. Better integration support is now provided for with codename “WPF/E”.


Saturday, July 07, 2007

Silverlight Tutorials

Good Website for Silverlight Tutorials

  • Silverlight With Java Script Tutorial
  • Silverlight Examples & Samples

http://www.wynapse.com/Silverlight_Tutorials.aspx

What is Nullable Type in .Net 2.0?

What is Nullable Type in .Net 2.0?
Nullable in .Net 2.0, helps to determine whether variable has been assigned a value or not. Example: Quiz application having option yes/no, but it should displayed “Not Attempted” when user does not make any choice.

Declaring a variable as nullable enables the HasValue and Value members.

Nullable b = null; -OR-

// Shorthand notation for declaring nullable type, only for C#
bool? b = null;


Example of Nullable Type
Use HasValue to detect whether or not a value has been set:
if (b.HasValue)
Console.WriteLine("User has Attempted Given Question");
else
Console.WriteLine("User has not Attempted Given Question");

//Output
User has not Attempted Given Question

The Nullable type is a new feature in .NET 2.0.

Improving Performance with Connection Pooling

Improving Performance with Connection Pooling

Opening a connection is a database-intensive task. It can be one of the slowest operations that you perform in an ASP.NET page. Furthermore, a database has a limited supply of connections, and each connection requires a certain amount of memory overhead (approximately 40 kilobytes per connection).

If you plan to have hundreds of users hitting your Web site simultaneously, the process of opening a database connection for each user can have a severe impact on the performance of your Web site.

Fortunately, you can safely ignore these bad warnings if you take advantage of connection pooling. When database connections are pooled, a set of connections is kept open so that they can be shared among multiple users. When you request a new connection, an active connection is removed from the pool. When you close the connection, the connection is placed back in the pool.

Connection pooling is enabled for both OleDb and SqlClient connections by default.

To take advantage of connection pooling, you must be careful to do two things in your ASP.NET pages.

First
, you must be careful to use the same exact connection string whenever you open a database connection. Only those connections opened with the same connection string can be placed in the same connection pool. For this reason you should place your connection string in the web.config file and retrieve it from this file whenever you need to open a connection

Second, you must also be careful to explicitly close whatever connection you open as quickly as possible. If you do not explicitly close a connection with the Close() method, the connection is never added back to the connection pool.

SQL Injection Problem, Example and Solution for Preventing

SQL Injection Problem, Example and Solution for Preventing:

What is SQL Injection Problem? SQL injection is a strategy for attacking databases.

Example of SQL Injection Problem:
An ASP page asks the user for a name and a password, and then sends the following string to the database:
SELECT FROM users WHERE username = 'whatever' AND password = 'mypassword'

It seems safe, but it isn't. A user might enter something like this as her user name:
' OR 1>0 --

When this is plugged into the SQL statement, the result looks like this:
SELECT FROM users WHERE username = '' OR 1>0 -- AND password = ''

This injection comments out the password portion of the statement. It results in a list of all the names in the users table, so any user could get into your system.

How to Prevent SQL Injection Problem.
There are numerous ways a malicious user might penetrate your system using SQL injection and various defenses, but the simplest approach is to avoid dynamic SQL. Instead, use stored procedures everywhere.

ADO.net Terms

ADO.net Terms

1. Data Source: It can be a database, text file, excel spread sheet or an XML file.

2. Data Provider: A set of libraries that is used to communicate with data source. Eg: SQL data provider for SQL, Oracle data provider for Oracle, OLE DB data provider for access, excel or mysql.

3. SQL Connection: It establishes connection.

4. SQL Command: It allows to manipulate database by executing stored procedure or sql statements.

5. SQL DataReader: It provides a forward-only, read-only, connected recordset.

6. DataSet: dataset is a disconnected, in-memory representation of data. It can contain multiple data table from different database.

7. SQL DataAdapter: It populates dataset from data source. It contains a reference to the connection object and opens and closes the connection automatically when reading from or writing to the database.

8. DataView: It provides a means to filter and sort data within a data table.

9. 'Disconnected Data Source': Ado.net makes the connection to the database server only when it needs to do a transaction and disconnects once the transaction is over (similar to an http connection over the internet). This greatly reduces the network traffic.

10. Strongly Typed Dataset Object: Strongly typed Dataset object allows you to create early-bound data retrieval expression. It is faster than late-bound data retrieval expression.

Difference between ADO and ADO.net Technology

Difference between ADO and ADO.net
1. ADO used connected data usage, while ADO.net used disconnected data environment.
2. ADO used OLE DB to access data and is COM-based, while ADO.net uses XML as the format for transmitting data to and from your database and web application.
3. In ADO, Record set, is like a single table or query result, while in ADO.net Dataset, can contain multiple tables from any data source.
4. In ADO, it is sometime problematic because firewall prohibits many types of request, while in ADO.net there is no such problem because XML is completely firewall-proof.

Difference between ADO.net Dataset and ADO Recordset
1 A DataSet can represent an entire relational database in memory, complete with tables, relations, and views.
2 A DataSet is designed to work without any continuing connection to the original data source.
3 Data in a DataSet is bulk-loaded, rather than being loaded on demand.
There's no concept of cursor types in a DataSet.
4 DataSets have no current record pointer You can use For Each loops to move through the data.
5 You can store many edits in a DataSet, and write them to the original data source in a single operation.
6 Though the DataSet is universal, other objects in ADO.NET come in different versions for different data sources.

base Keyword in .Net

base keyword and calling base class constructor in .Net

Using the base keyword, you can access any of a base class public or protected class members.

Another way to access base class members is through an explicit cast.

The colon, ":", and keyword base call the base class constructor with the matching parameter list.

In below example, Inside the Child print() method, we explicitly call the Parent print() method. This is done by prefixing the method name with "base.".

using System;

public class Parent
{
string parentString;
public Parent()
{
Console.WriteLine("Parent Constructor.");
}
public Parent(string myString)
{
parentString = myString;
Console.WriteLine(parentString);
}
public void print()
{
Console.WriteLine("I'm a Parent Class.");
}
}

public class Child : Parent
{
public Child() : base("From Derived")
{
Console.WriteLine("Child Constructor.");
}
public new void print()
{
base.print(); //CALLING BASE CLASS METHOD, USING BASE. SYNTAX.
Console.WriteLine("I'm a Child Class.");
}
public static void Main()
{
Child child = new Child();
child.print();
((Parent)child).print();
}
}

Output:From DerivedChild Constructor.
I'm a Parent Class.
I'm a Child Class.
I'm a Parent Class.

What is Virtual Method in .Net?

What is Virtual Method in .Net?

By declaring base class function as virtual, we allow the function to be overridden in any of derived class.

Example of Virtual Method in .Net:

Class parent
{
virtual void hello()
{ Console.WriteLine(“Hello from Parent”); }
}

Class child : parent
{
override void hello()
{ Console.WriteLine(“Hello from Child”); }
}

static void main()
{
parent objParent = new child();
objParent.hello();
}

//Output
Hello from Child.

Example of Polymorphism in .Net

Example of Polymorphism in .Net

What is Polymorphism?
Polymorphism means same operation may behave differently on different classes.
Example of Compile Time Polymorphism: Method Overloading
Example of Run Time Polymorphism: Method Overriding

Example of Compile Time Polymorphism

Method Overloading
- Method with same name but with different arguments is called method overloading.
- Method Overloading forms compile-time polymorphism.
- Example of Method Overloading:
class A1
{
void hello()
{ Console.WriteLine(“Hello”); }

void hello(string s)
{ Console.WriteLine(“Hello {0}”,s); }
}


Example of Run Time Polymorphism

Method Overriding
- Method overriding occurs when child class declares a method that has the same type arguments as a method declared by one of its superclass.
- Method overriding forms Run-time polymorphism.
- Note: By default functions are not virtual in C# and so you need to write “virtual” explicitly. While by default in Java each function are virtual.
- Example of Method Overriding:
Class parent
{
virtual void hello()
{ Console.WriteLine(“Hello from Parent”); }
}

Class child : parent
{
override void hello()
{ Console.WriteLine(“Hello from Child”); }
}

static void main()
{
parent objParent = new child();
objParent.hello();
}
//Output
Hello from Child.

FAQ on Inheritance in .Net

FAQ on Inheritance in .Net

What is Inheritance?
The process of sub-classing a class to extend its functionality is called Inheritance.
It provides idea of reusability.

What is Order of Constructor execution in Inheritance?
constructors are called in the order from the top to the bottom (parent to child class) in inheritance hierarchy.

What is Order of Destructor execution in Inheritance?
The destructors are called in the reverse order, i.e., from the bottom to the top (child to parent class) in the inheritance hierarchy.

What are Sealed Classes in C#?
The sealed modifier is used to prevent derivation from a class. A compile-time error occurs if a sealed class is specified as the base class of another class. (A sealed class cannot also be an abstract class)

Does C# supports Multiple Inheritance?
Multiple inheritance of classes is not allowed in C#.

How do I achieve Multiple Inheritance in C#?
In C# you can implements more than one interface, thus multiple inheritance is achieved through interface.

Which is the ultimate base class for all the classes in .Net?
Sytem.Object, The Object class defined in the System namespace is implicitly the ultimate base class of all the classes in C# (and the .NET framework)

Does structure in C# supports inheritance?
Structures (struct) in C# does not support inheritance, it can only implements interfaces.

Static Member, Static Method, Static Constructor

Static Members of the class
“static members” belong to the whole class rather than to individual object

How to access static member of class?
Static members are accessed with the name of class rather than reference to objects. Example: className.StaticMemberName

Example of Static Member

class Test
{
public int rollNo;
public int mathsMarks;
public static int totalMathMarks;
}

class TestDemo
{
public static void main()
{
Test stud1 = new Test();
stud1.rollNo = 1;
stud1.mathsMarks = 40;

stud2.rollNo = 2;
stud2.mathsMarks = 43;

Test.totalMathsMarks = stud1.mathsMarks + stud2.mathsMarks;
}
}



Static Method of the class
- Static Method is Method that you can call directly without first creating an instance of a class. Example: Main() Method, Console.WriteLine()
- You can use static fields, methods, properties and even constructors which will be called before any instance of the class is created.
- As static methods may be called without any reference to object, you can not use instance members inside static methods or properties, while you may call a static member from a non-static context. The reason for being able to call static members from non-static context is that static members belong to the class and are present irrespective of the existence of even a single object.


Static Constructor
In C# it is possible to write a static no-parameter constructor for a class. Such a class is executed once, when first object of class is created.

One reason for writing a static constructor would be if your class has some static fields or properties that need to be initialized from an external source before the class is first used.
Example
Class MyClass
{
static MyClass()
{
//Initialization Code for static fields and properties.
}
}

Advantage of using Properties

Advantage of using Properties

What is Properties?

Attribute of object is called properties. Eg1:- A car has color as property.
Example of using properties in .Net:

private string m_Color;;

public string Color
{
get
{
return m_Color;
}
set
{
m_Color = value;
}
}

Car Maruti = new Car();
Maruti.Color= “White”;
Console.Write(Maruti.Color);


Advantage of using Properties You might have question Isn't it better to make a field public than providing its property with both set { } and get { } block? After all the property will allow the user to both read and modify the field so why not use public field instead?
Not always! Properties are not just to provide access to the fields; rather, they are supposed to provide controlled access to the fields of our class. As the state of the class depends upon the values of its fields, using properties we can assure that no invalid (or unacceptable) value is assigned to the fields. Example explaining how Properties are useful
private int age;

public int Age
{
get
{
return age;
}
set
{
if(value <> 100)
//throw exception
else
age = value;
}
}

Struct Vs Class in .Net

Difference between Struct and Class

Struct are Value type and are stored on stack, while Class are Reference type and are stored on heap.

Struct “do not support” inheritance, while class supports inheritance. However struct can implements interface.

Struct should be used when you want to use a small data structure, while Class is better choice for complex data structure.

Choosing between struct and class

Use of structure in following condition is desirable.
When you have small data structure
Data Structure does not require to extent the functionality.
When you want to perform faster operation on data structure. (As structure are stored on stack, operation performed on it are faster.)

Use of class in following condition is desirable.
When you have complex data structure
Data Structure requires to extend functionality.
When you want to optimize memory usage. (As class is stored on heap, they are about to be garbage collected when no reference pointing to an object.)


What is the difference between instantiating structures with and without using the new keyword?

When a structure is instantiated using the new keyword, a constructor (no-argument or custom, if provided) is called which initializes the fields in the structure. When a structure is instantiated without using the new keyword, no constructor is called. Hence, one has to explicitly initialize all the fields of the structure before using it when instantiated without the new keyword.

What is “out” keyword in C#

What is “out” keyword in C#

“out Keyword” in C#.

out keyword is used for passing a variable for output purpose. It has same concept as ref keyword, but passing a ref parameter needs variable to be initialized while out parameter is passed without initialized.
It is useful when we want to return more than one value from the method.

Point to be kept in mind while using out keyword.
You must assigned value to out parameter in method body, otherwise the method won’t compiled.

Example of “out keyword”:
class Test
{
public static void Main()
{
int a; // may be left un-initialized
DoWork(out a); // note out
Console.WriteLine("The value of a is " + a);
}

public static void DoWork(out int i) // note out
{
i=4; //must assigned value.
}
}

The program will result : The value of a is 4

What is “ref” keyword in C#

What is “ref” keyword in C#

“ref Keyword” in C#.

Passing variables by value is the default. However, we can force the value parameter to be passed by reference.

Point to be kept in mind while using ref keyword.
variable “must” be initialized before it is passed into a method.


Example, Without Using ref keyword
class Test
{
public static void Main()
{
int a = 3;
DoWork(a);
Console.WriteLine("The value of a is " + a);
}

public static void DoWork(int i)
{
i++;
}
}
The program will result in : The value of a is 3


Example, With the Use of ref keyword
class Test
{
public static void Main()
{
int a = 3; // must be initialized
DoWork(ref a); // note ref
Console.WriteLine("The value of a is " + a);
}

public static void DoWork(ref int i) // note ref
{
i++;
}
}
The program will result : The value of a is 4

How Enumeration can Improves code readability

How Enumeration can Improves code readability

Advantage of Enumeration
Enumeration improves code readability.
It also helps in avoiding typing mistake.

Example of Poor Coding (Code without Enumeration)

int iQuizAnswer = 1;

switch(iQuizAnswer)
{
case 0:
Response.Write("Your Answer is NO");
break;
case 1:
Response.Write("Your Answer is YES");
break;
case 2:
Response.Write("You haven’t Attempt");
break;
}


Example of Enumeration (Improving Code Readability)

Declaring Enumeration
enum QuizAnswer
{
NO,
YES,
Unanswered
};


Your Code
//Creating Instance of Enumeration and Assigning QuizAnswer “Yes”
QuizAnswer myQuizAnswer = QuizAnswer.YES;

switch(myQuizAnswer)
{
case QuizAnswer.NO:
Response.Write("Your Answer is NO");
break;
case QuizAnswer.YES:
Response.Write("Your Answer is YES");
break;
case QuizAnswer.Unanswered:
Response.Write("You haven’t Attempt");
break;
}

Thursday, July 05, 2007

How do i get .Net Job?

How do i get .Net Job?

One of the Group member of dotnetguts@yahoogroups.com ask the question, How do i get ".Net Job", Well this again common question. Here are few tips for getting Jobs in .Net, "Asp.net Jobs", "C# Jobs", "Vb.net Jobs".

Step 1:
Get the required knowledge of technology in which you want a Job.
I suggest you to refer this post if you are "New to .Net"


Step 2:
Collect FAQs for .Net, C#, Asp.net, Vb.net
.Net FAQs Links Collection


Step 3:
Judge your status of expertise and make a comfortable list of FAQ, which you can prepare. While preparing question checklist for interview don't forget to mark questions bold, which you feel important, so that it will be helpful during last minute reference.


Step 4:
Now you have gather enough knowledge to appear for interview, so next step comes is presentation, You need to market yourself. You need to understand the needs of a firm you are going to target, and present yourself accordingly.
Here are Few "Interview Presentation" Tips


Step 5:
Apply for Jobs. Find Jobs at popular websites like "Naukri.com", "Monster.com", "Timesjob.com", now a days a popular media to find job is on blog, so find jobs @ "MyDailyJob.blogspot.com" and such blog. Make sure that you have an effective resume before you apply. Considerate each application as opportunity, remember "God help those who help themselves", so never make careless effort. Company should feel your interest, earness and willingness for Job.


Step 6:
On Interview day, Dress yourself decent, professional and in which you feel comfortable. Be on Time.


Step 7:
Prepare a Backup checklist. It is not possible for everyone to know everything and even interviewer know that, so Show the points which differentiates you from others.
Example of How to show your specialities
a) Show that you are willing to learn new things.
b) How best you can handle situation during tuff moment. ie. Don't loose temper during tuff situation.
c) What you do if you don't know something. ie. Tell them i use forum to get answer of my query, I have subscribe to following helpful groups, GOOGLE best way to search your any questions.
d) Your programming style. Interviewer might be a programmer and he is looking for someone who writes good code which easily manageable, so if possible do preapre a small checklist of your programming style and keep forward to them.
e) Show your extra efforts, certification or any good work.


Step 8:
Follow-up email., after completion of your interview it is necessary to send a Follow-up email thanking them, it will last a longer impression and will give chance to considerate among other candidates.


Step 9:
If After applying all your best, you didn't get job, so dear friend don't loose the hope, this is the time for making you internally stronger, say yourself that some "Good Opportunity is waiting for you". If possible try reading some motivation books or thoughts which will inspire you, and refill a new energy to work hard. "MyDailyFun.blogspot.com" contains Motivationa and Inspiration stories, so if you feel bit down cheerup yourself, and get back on work, because without effort no gain.

Good Luck

H1B Interview FAQ and H1B Technical FAQ

Tips for H1B Interview
-
Be Polite
- Take deep breath and Relax.
- Listen Carefully and Answer upto the point.


H1B Visa Interview FAQ

Interview
Good Morning

Why you want to go USA?
For Working.

Which company you are going?
Your company name

What is turnover of your present company and USA company?
$xxx,xx,xxx P.A.

How many employees in USA company?
Employees Strength of your company

How you came to know about this company?
Thru Dice.com Job Site.

Why you are going after so long? (Sometimes they ask to candidate who appear after long time of approval)
Explain Valid reason, or in case no valid reason you may try that you are working on Important project when you received approval.

Where are you working currently?
Your present company name, what they are working in and how many employee strength. Example: I am working with abc co., which works mainly into web development with xxx no. of employees.

What is your current salary?
Your currently salary.

Why is your salary is low as compare to other IT Professional? (They do ask this question, specially to people coming from small town with less salary as compare to salary in big cities)
Explain the valid reason. Example: Sir I am coming from abc town, wherein monthly expense is just Rsxxx. In short you need to convince him that your salary is good in your town as compare to other cities.

What is the salary you will get in USA?
$xxxxxP.A. + other benefits which includes Medical Insurance, Relocation and Performance Appraisal.

Why is your salary low when compared to other US Companies?
There will be increase after six months, also I will be getting Medical Insurance + Relocation + Performance Appraisal.; And still the pay is good when compared to pay in Australia or India. Not only money there are several factors like.. Challenging projects, career growth etc which made me to accept the offer with synergy.

How were you Selected? Or How many rounds of interviews the USA company conducted? What are they?
They had conducted 3 Rounds of Interview, 2 Technical and 1 HR Interview. All were telephonic interview.

What is the Address of the Company?
Address of your company

When did you applied for Job?
January 2007

When and how did you get interviewed?
Telephonic Interview was scheduled via email, during evening hours.

How long the interview lasted?
Technical Interview was lasted about 30 minutes. And HR Interview was lasted for 15 minutes.

What did you talk in the interview?
They asked me question about what is my education, how much I scored and other questions related to technical.

Who and when your H1 was filed.
ABC company has filed my petition (After acceptance, they have asked me send all my documents for visa processing.)

How did you find your attorney/lawyer?
My company has managed the lawyer in N.J.

Who had taken interview for you?
Interviewer Name

What is your HR Name?
HR Name

Can you give me the dates of your interview?
Somewhere in Feb 2007 or Exact date if you remember

Who are the clients for your USA company?
>
Example: IBM, Computer Horizon Corp., Comsys Inc., Sapphire Technologies, Satnam Data Systems.

What are the technologies you are working on?
.Net Technologies (Asp.net, C#)

Who is the President/CEO of US company?
Name of CEO of your company

What kind of projects US company is working on? Or Employer’s Main Business areas?
They mainly focus on ERP based Project, Banking Application, CRM, Web development.

What is the annual turn over of the company?
Gross Annual Income $xxxxxxxx

What does your US employer do?
They Offer consulting services in various fields of IT.

Why are you changing your Job?
For Career Growth and to enhance skill

Why you want to work in US?
For Career Growth, it give me chance to work with various client environment, it will help me to improve my skill set.

Have you applied for any other Country?
NO.

Do you know what is the leaving cost in US specific to the place where you are going?
35K P.A.

When did you received your offer letter?
Date when you received your offer letter. (Approximation do in case you are not aware of exact date).

What is the current project you are going to work?
Name the project or In case project is not decided than you can say project will be allocated ones I would settle and join my company in USA.

What is your current role?
Software Engineer

What is your role in US company?
Programmer Analyst

Where are you going to work in US?
ABC company, Mountain Lake, N.J.

What is your designation in US company?
Programmer Analyst

What are your responsibilities as a programmer analyst?
• Analyze user requirement
• Designing the application
• Programming the application
• Testing Application

Which Technologies are u going to work in US?
I am going to work on ASP.net Technology. I had done my certification in .NET

When did US company founded?
In year 1995

When are you planned to travel?
2nd Week of October

How will you survive for the first month?
Company will take care of my accommodation, initially I would be staying at hotel.

Have you been to any other country before?
--- Answer it.

If yes then, When had you been in USA
March 2007

When had you return from USA
April 2007

What was the purpose of your trip
It was a business trip

What work do you do in your present company? Or What kind of Project you are currently working on?
I am software engineer, my work is to identify requirement and providing equivalent web-based solution.

Explain me in detail what work you have to do? What websites you have developed?
I have to make websites like ecommerce websites, bloggers.com websites, etc, etc.

How much time you are being with employer
X year.

What were you doing before you join your present company.
I was working with XYZ Information and Technology

Will you come back to India?
Yes.

When you will be back to india?
Within 2 years

Why you want to return back?
My Marriage will be after year and I can take advantage of opportunities in India after returning to USA.




H1B Technical Interview FAQ

Note: Generally they don't ask technical questions during H1B Interview in Consulate, but it is always good to be prepared in case of cross checking. Tip: Be Confident, as they are not technical people they just want to ensure that you are not fake entity.

Do Prepare with Main Terminology, example if you claim to expert in .Net you should able to explain what is .Net, similarly for SQL than you should

Sample Questions

1) What is .Net Platform?

Microsoft .NET is a software development platform based on virtual machine architecture. Dot Net Platform is:

à Language Independent – dot net application can be developed different languages (such as C#, VB, C++, etc.)

à Platform Independent – dot net application can be run on any operating system which has .net framework installed.

à Hardware Independent – dot net application can run on any hardware configuration

It allows us to build windows based application, web based application, web service, mobile application, etc.

2) What is .Net Framework?

.Net Framework provides a foundation upon which .net application and xml webservices are built and executed.

3) Two main Components of .Net Framework

  1. Common Language Runtime
  2. Base Class Library.

5) .Net Compliant Languages – Language which supports .Net Programming. Eg: VB, C#, C++, J#, etc.

6) .Net Application – Application which is developed using .Net Framework.

7) .Net Framework Class Library – It consist of thousands of Pre-developed classes that can be used to build application.

8) Common Language Specification (CLS) – It defines features that all .net compatible language should support.

9) Common Type System (CTS) – All .net supported languages will produce code that is ultimately based on these type.

10) Common Language Runtime (CLR) – It provides an “managed” environment in which .net application can execute.

It provides following services :

1. Language Integration

2. Memory Management (Memory Allocation and Garbage Collection)

3. Memory Type Safety (Memory Leaks)

4. Security

11) Microsoft Intermediate Language (MSIL)

An intermediate language generated by compiler is called MSIL. All .Net assemblies are represented in MSIL. The main Advantage of using MSIL is it provides equal performance for multiple language programming, as code is compiled to native code.

Eg: Performance of application developed in C# is similar to VB.net or any other .Net compliant language that is because of MSIL.

12) Managed Environment

Code that operates within the CLR is called managed code. Managed code benefits from the services that the CLR offers, including garbage collection, memory management, security, etc.

13) Unmanaged Environment

Code that does not operate within the CLR is called unmanaged code. Unmanaged code does not get benefits offered by CLR including garbage collection, memory management, security, etc. Eg. COM components are unmanaged code.

14) Advantage provided by Dot Net Framework

Language Independent, that is programmer can concentrate more on problem than to learn new language.

What is ADO.net

ADO.net is data access architecture for the Microsoft .NET Framework.

Difference between ADO and ADO.net

  1. ADO used connected data usage, while ADO.net used disconnected data environment.

  1. Data Source: It can be a database, text file, excel spread sheet or an XML file.
  2. Data Provider: A set of libraries that is used to communicate with data source. Eg: SQL data provider for SQL, Oracle data provider for Oracle, OLE DB data provider for access, excel or mysql.
  3. SQL Connection: It establishes connection.
  4. SQL Command: It allows to manipulate database by executing stored procedure or sql statements.
  5. SQL DataReader: It provides a forward-only, read-only, connected recordset.
  6. DataSet: dataset is a disconnected, in-memory representation of data. It can contain multiple data table from different database.
  7. SQL DataAdapter: It populates dataset from data source. It contains a reference to the connection object and opens and closes the connection automatically when reading from or writing to the database.
  8. DataView: It provides a means to filter and sort data within a data table.




For More Details on H1B Visa

Sunday, July 01, 2007

Free e-learning on SQL Server 2008

Free e-learning on SQL Server 2008

https://www.microsoftelearning.com/eLearning/courseDetail.aspx?courseId=78337

Title: Clinic 7045: What's New in Microsoft® SQL Server™ 2008
Course Type: Self-paced Course
Available Offline: Yes
Estimated Time of Completion: 2 Hours
Language: English
Description: In this clinic, you will learn about the new and enhanced features included in SQL Server 2008. You will explore the new data types and the data management features. Additionally, you will learn about the enhanced Integration Services, Analysis Services, and Reporting Services included in SQL Server 2008. This online clinic is composed of a rich multimedia experience.

Objectives: At the end of the course, students will be able to:

  • Describe the features of SQL Server 2008 and their benefits.
  • Describe the features of enterprise data platform that help you to secure data in applications.
  • Describe the dynamic development features that facilitate the development of database applications.
  • Describe the features of SQL Server 2008 that provide data storage solutions beyond relational databases.
  • Describe the enhanced features in SSIS that help you to integrate data effectively.
  • Describe the enhanced features in SSAS that help you to improve the BI infrastructure.
  • Describe the enhanced features in SSRS that help you to improve the scalability of the reporting engine.

Most Recent Post

Subscribe Blog via Email

Enter your email address:



Disclaimers:We have tried hard to provide accurate information, as a user, you agree that you bear sole responsibility for your own decisions to use any programs, documents, source code, tips, articles or any other information provided on this Blog.
Page copy protected against web site content infringement by Copyscape