Friday, November 30, 2012

Important SQL Server interview questions on data types: - How many bytes does “char” data type consume as compared to “nchar” data type?


“char” data types consumes 1 byte while “nchar” consumes 2 bytes. The reason is because “char” stores only ASCII characters while “nchar” can store UNICODE contents as well.

In case you are new to ASCII and UNICODE. ASCII accommodates 256 characters i.e.english letters ,punctuations , numbers etc.But if we want to store a Chinese character  or some other language characters then  it was difficult to the same with ASCII  , that’s where UNICODE comes in to picture. An ASCII character needs only 1 byte   to represent a character while UNICODE needs to 2 bytes.

One of my SQL Server friends who had gone for a SQL interview was grilled , whether we can update SQL Server views , I have tried to answer this question here with a video


The above question I have extracted from near to heart book
SQL Server interview questions By Shivprasad koirala by BPB publication

Regards,
Click to view more from authors on SQL Server interview questions and answers



Monday, November 26, 2012

You are 35 and not a manager – The Indian IT society trauma?



I am not trying to underestimate the position of a manager.  But I hate when people point fingers at me and say “You are 35 and still not a manager, till what age can you code?”.
I am so sorry to be harsh, but I really hate those people who for various reasons think that programmers are some kind of useless mass on earth. Do not contradict that many do not think they think and its truth.



By grace of god I am personally at a position where I do not care andI love programming, technology and would like to spend rest of life doing the same. 

But with that statement many good developers would have been converted to bad managers overnight.  Frankly I blame the Indian IT society who thinks after a certain age a person is less capable of  programming.
Leaving my so called personal confidence aside
thought to look at the other side of the mirror on, why majority developers are forced to become managers.









Social trauma
 

For some reasons when someone (especially senior managers) knows you are a developer they start thinking about you as a person who is not a decision maker or probably they  just imagine you as  technical lover  who has  no understanding of how to do business .


Some people also go one step further to conclude that a pure technical person can never be leader or motivate any one.

A person at the age of 30 is considered a failure, if he is involving himself in coding.







A manager allocating resources from a excel sheet is more respected by IT society than a developer or a technical architect slogging to solve problems.

Major people of IT society envy how a manager has his own cabin, how he commands, how he does so called project management, allocates resources, motivates people (some project managers have the illusion that they are bill gates) , implements processes blah blah. This is the first reason I think that a technical person starts thinking that a manager is a better fit than a technical role. He starts dreaming about the comfort zone and luxury enjoyed in a managerial position.

Technical person does not have money or the power
In India the salary difference of a senior technical person and equivalent experience manager is considerable. 

A manager who is working on a excel sheet, PPT and documents are paid more than technical people who actually create the software.

Adding to everything some senior managers have this feeling that a technical person can be made happy by giving challenging technical work and he will not crib for anything. Oh yes, I love technical work but at the end of the day I have to show my face to the family.




I am not saying start paying the senior technical person’s more. But this difference should be minimized so that atleast senior technical people start feeling that yes this role at this is age is also appreciated by the industry.

Technical architect position a joke


Many people can argue that, then choose the path of a technical architect. Oh, gosh, this position in Indian IT industry is abused (sorry for crossing limits) to a extent that there are people who refrain to take this position any more. I sometimes think this position is created to create a illusion that they are growing in their career.

As a technical architect, they expect you do everything. Right from technical solution, to nitty gritty problem solving and providing hands on solution to the developer’s.



Wondering when Indian IT industry will start respecting t
echnical people , give them appropriate respectable position , his words are considered during decision making and he stands shoulder to shoulder with the project manager  in terms of decision making.Sorry for the loud mouth. I do not have the genes to write these kinds of article but I am sure it echoes feelings of lot of technical people out there.Would like to hear from you guys, if your organization has a proper road map for techies and do they really feel comfortable with the road map.


Thursday, November 22, 2012

C# and ASP.NET MVC (Model view controller) interview questions and answers:- What are MVC partial views and how can we call the same in MVC pages?

ASP.NET MVC (Model view controller) partial view is a reusable view (like a user control)which can be embedded inside other view. For example let's say all your pages of your site have a standard structure with left menu,header and footer as shown in the image below.



For every page you would like to reuse the left menu, header and footer controls.So you can go and create partial views for each of these items and then you call that partial view in  the  main view.

When you add a view to your project you need to check the “Create partial view” check box.



Once the partial view is created you can then call the partial view in the main view using "Html.RenderPartial" method as shown in the below code snippet'










Below is an important SQL server interview question and answers video:-




Do visit us for c#  and ASP.NET MVC interview question and answers

See more stuffs on C#/ASP.NET interview questions 

Regards,

Click here to see more C# and ASP.NET interview questions and answers

Thursday, November 8, 2012

SQL Server Interview Question and answers: - How does index affect insert, updates and deletes?

First let me give a short answer so that you can please the interviewer and get your job. If you are inserting heavy data on table which have clustered indexes that will lead to page split. Due to heavy page splits the performance can degrade. So a proper balance of indexes should be maintained for tables which are heavy in transactions and have clustered indexes created.

Now let’s go for a big explanation of what exactly is a page split.

Indexes are organized in B-Tree structure divided in to root nodes, intermediate nodes and leaf nodes. The leaf node of the B-tree actually contains data. The leaf index node is of 8 KB size i.e. 8192 bytes. So if data exceed over 8 KB size it has to create new 8 KB pages to fit in data. This creation of new page for accommodating new data is termed as page split.

Let me explain you page split in more depth. Let’s consider you have a simple table with two fields “Id” and MyData” with data type as “int” and “char(2000)” respectively as shown in the below figure. “Id” column is clustered indexed.

That means each row is of size 2008 bytes (2000 bytes for “MyData” and 8 bytes for “Id”).




So if we have four records the total size will be 8032 bytes (2008 * 4) that leaves 160 bytes free.Do looat the above image for visual representation.

So if one more new record is added there is no place left to accommodate the new record and the index page is forced to go for an index page split.





















So the more we have page splits, the more the performance will be hit as the processor has to make extrefforts to make those page split’s, allocate space etc.

Here’s a awesome video on one more tough SQL Server interview question: -What are CTE (Common table expression) ? , you watch the same from by clicking on



Taken from the best selling SQL Server interview question book, you can see more about the book by clicking on  SQLServer interview questions book Dotnet interview questions and answers book  

See more stuffs on  SQL server interview questions

Regards,

Click here to view more SQL server interview questions and answers .