Let’s Face my .NET Interview

The title of this article is likely to make you curious and cause you to look at it. OK, let me explain the purpose of this article. Today I attended a .NET technical interview (and got clear in the first round though I am not at all interested to join there) in a company (I am not disclosing the company name). And while travelling by bus, I was thinking about what to write for another article in c-sharpcorner.com.

Then I decided that ok, let's write all my interview questions with my experiences and answers. Now it's the evening and I am providing my interview experiences from a few hours before.

Let's clarify some thing first. I have 9 months of experience and the interview questions have been that basic. So, if you are very much experienced or .NET savvy then it may seem that I am kidding with you.

OK, no more talking. Sit next to me and hear our conversation. It's only a 1:1 interview.

He offer me a chair when I enter in the room. I saw that he was reading my CV and highlighting a few portions with pencil (Hmm, loading ammunition for him to use). I took a seat and was waiting for his response.

image1.gif

He started with an ice-breaking question.

Tell me about yourself.


I told him a little of my background, my academics and a little bit about current and previous projects.

Have you used Infragestic and Telerik controls?


I said yes, as I said in my CV.

Which kind of control and version?

Q2 version, many controls like drop down list, combo box, list box, grid and so on and so on.

Then he starts to ask questions about SQL Server.

How many categories are there in SQL command?

Three, DDL, DML ,TCL and a few examples about them.

Structure of join query

I had drawn a tree structure to show various types of joins with Venn diagram.

What is self join and their uses?

A self join is needed when we want to make a join of one table with itself. Then I gave a small example.

Difference between left and left outer join

Left and left outer join are the same, there is no difference between them.

Is the outer keyword mandatory?

No.

Implement a try catch block in PL/SQL

I gave a small structure of a try catch block.

How to define transactions?

I gave an exmple of beginning a transaction and ending a transaction within a try catch block, if the try raises an error then a rollback will occur within the catch.

Find the third highest salary from a table.

It's a very popular one. I provided an answer with a nested query. First fetch the top 3 highest salaries from the table then filter and pick the minimum one from them. He asked me to find another method, but at that moment I could not think of an alternative.

Give an example of a nested query.

I have referred to the previous example (of the third highest salary) since I wrote it using a nested query.

Temporary table and table variable syntax

I provided an example with # and @ symbols.

Difference between local temp table and global temp table

Local temp table (starts with #) has the current user's session scope wherea a global temp table (starts with ##) has all user's scope.

Save point of transaction

A Save point is needed to rollback up to a certain point.

One insert statement to enter multiple rows.

Written using the following insert command.

Insert into <table> values(1,'a')(2,'b')

I had forgotten to provide a comma between each value pair. He point it out and corrected me.

What are ldf and mdf files

They are two files of SQL Server and I explained a little about them.

Syntax of function and trigger

I wrote the basic syntax of them. I made the mistake of not writing returns in the functions. He pointed it out and told me.

Types of trigger

I explained two types of triggers (instead of and after) and a little explanation about them, when they fire and so on and group by and and having clauses.

I gave an answer with one example to calculate the sum of a salary group by department. Where we can add a having clause to filter it again.

Find duplicate records

After a little struggle, I wrote one but it was not perfect. (Hmm,. my grip had slipped a little.)

What is a view?

I answered with a small example and also added how to make an index on a view.

Difference between primary key and unique key

It's a very common and popular question. I provided two differences. That is what he was expecting.

What is a candidate key?

I answered with a small example of a student table. Where roll is the primary key and registration number is the candidate key.

Then he began to ask about .NET and C# (though it was very basic).

Draw architecture of .NET framework

I had drawn a complete architecture. He told me to point out the location of Entity Framework and how LINQ provides abstraction on ADO.NET classes.

Latest version of C#

I directly came to the point that he wanted. Yes, asynchronous programming.

What is CLS and CTS?

Discuss them with a little technical knowledge.

How to see IL code?

Answered about ILDASM.

How to collect garbage?

Started to talk about GC.Collect() (it's an overloaded function) and about generation, how objects are promoted from one generation to another generation and so on.

Is there any other method?

I was taking time to find an alternate to GC.Collect(). After a few moments I suddenly discovered, hey the finalize dispose pattern is there to collect garbage (although it's not collection , it's nothing but disposing after use). And he was waiting for that.

How can multiple inheritance problems be overcome?

I provided a small structure and implementation of a class of multiple interfaces.

What is polymorphism and its Types?

I gave a definition of polymorphism with a classic example. The following is the example.

"Let's think about me. Now I am giving an interview, so you are my interviewer and I am the interviewee. Now when I go to my room, with respect to my roommate, I am his friend. And I talk to my mother after dinner on the phone (it's my daily routine for the past 7 years).

I am her son. So, I am not changing but my identity is changing with respect to people and places. It's nothing but polymorphism. The technical definition is "Ability to take more than one form". At first I was wondering what is its type but then it came to me, okay runtime and compile time. Actually I had forgotten the terminology. Then I showed an example of function overloading and overriding.

Then a few more was there but I have forgotten them, uh oh; no it is not coming to mind.

Then we started to talk about ASP.NET but not much.

What is MVC pattern?

Though, I am new to it and currently learning. I have drawn a picture with three bubble shapes ( yes, a classic MVC model picture, green, yellow and red colors, do you remember?) and began to discuss them little. Then I was trying to bring him into my safe zone. (Ha Ha, in ASP.Net web forms.)

How does viwestate work? Internally how does it store data?


I answered with the basic mechanism and how it stores data in key and value pairs and it's disadvantages when the page is heavy.

How to bind DataTable in grid and how to allow pagin

I answered the dataSource property but forgot about the paging properly. I answered, most probably it's Allow Paging.

Difference between DataView and DataGrid?

I was thinking and wondering for the answer of how they are related with each other. What is Dataview? I asked, sir, what is the Dataview? Is it a control? He replied, yes it's a control in the data section. Again I started to think and fnally I said sir, there is no control like this. (Or at least I have not used it). Then we discovered that he was a little incorrect and instead of DataView it is a Data Pager.

What is 3-tier architecture?

I showed a diagram with data flow from layer to layer and the forms of data.

Which namespace is used to make platform independent data access mechanisms?

I answered System.data.commn. Yes, it contains the DBFactory class.

How to solve the jQuery conflict problem?

I am hearing this question for the very first time, so obviously I was unable to provide an answer. He said something about a noconflict method. (I need to check that.)

A few more were there but at this moment they are not coming to mind.

So, it ended peacefully and I got confirmation for the next round within a few minutes.

So dear reader, here I have tried to show one motion picture of an interview session from my experience and knowledge.

The answer I have written here is not a complete and full answer. I have just tried to touch each and every question with important keywords. If you find any wrong question or answer then please correct me.

Up Next
    Ebook Download
    View all
    Learn
    View all