Two Questions that Most ASP.NET Developers Cannot Answer

by jmorris 10. September 2010 13:44

After interviewing approximently 30 applicant's for mid-level to senior level ASP.NET positions, nearly all cannot answer the following two questions:

  1. Describe the following access modifiers:
    1. private
    2. protected
    3. internal
    4. public
  2. What is the difference between an ASP.NET Literal control and a Label control

If they answer one of the two questions above, we bring them in for a more in-depth test and then subsequent interviews if they get a passsing score on the test. The first question is among the most basic of questions you can ask someone regarding the language we use, C#. The other is a simple question regarding the output of two ASP.NET WebForms controls...note that the average applicant has multiple years experiance (per their resume) on the WebForms platform. Also, before you say "why aren't you using MVC?", that statement is irrelevent to the questions.

Would you believe 1 in 10 developers (that I interviewed) cannot answer both questions? Sad, really...

Tags:

rant

Comments (23) -

Scott
Scott United States
9/10/2010 5:50:15 PM #

1.
- private - only visible to class
- protected - only visible to class and child classes
- internal - only visible to classes within the same assembly
- public - visible to all

2.
- Literal control renders straight text to the page
- Label wraps a <span> around the text to the page

jmorris
jmorris United States
9/11/2010 9:46:23 AM #

Right you are...so simple! Especially the first question, i would expect every .net programmer to get private, protected, and public correct...I just can't see how you can program in a language (C#) and not know the access modifiers.

Peter
Peter Iceland
9/11/2010 1:02:59 PM #

i thought in q 2, label wraps with a span, unless you set an associated control, then it wraps with label tags and populates the for field with the control you reference.

Peter
Peter Iceland
9/11/2010 1:03:56 PM #

doh, i should have read down Tong sorry!

jamie carruthers
jamie carruthers United Kingdom
9/11/2010 2:15:51 PM #

And I should have used the reply feature! Doh.

jamie carruthers
jamie carruthers United Kingdom
9/11/2010 12:42:13 PM #

@Scott Label will render html label if assigned to an input control using AssociatedControlID.

I've never seen internal before, but I program in VB not C#. We use Friend instead. How nice.

Mike Borozdin
Mike Borozdin Italy
9/11/2010 2:22:44 PM #

It can be viewed as an undoubtedly bad thing, on the other hand it just probably means you there are just a lot of applicants and of course not all of them are that worthy.

jmorris
jmorris United States
9/11/2010 7:50:02 PM #

True. My boss and I have noticed that the quality of applicants has been going down. We used to have a fair number make it any for the test and at least a first interview. Honestly, we would rather weed out the unqualified in the 10 minute phone interview. So this is good Smile

We theorize that this may be because of the recession, quality devs are not out looking and what's available is the stuff that other companies have pruned via layoffs. However, many of the applicant's are still working there current jobs, so that goes out the window Smile It could also simply be coincidence as well.

Guy
Guy United Kingdom
9/11/2010 3:57:20 PM #

has to be said they are some pretty basic questions and i would be very surprised that a 'seasoned' .net developer would not know the answers to them.

sad to say it - but i guarantee that some of the devs on my team would struggle with question 1 :-/

Tim
Tim United States
9/11/2010 5:44:40 PM #

I think if asked #2, I would have replied that a label control does not html encode its content, where a literal can through the Mode property. I've always thought that ASP.NET got this completely wrong. Label should *always* html encode (umm that's why it's label). The fact that I can do this:

<asp:Label runat="server" Text="<table><tr><td>Hello</td></tr></table>" />  and have it render a table is silly.


Prema
Prema India
9/13/2010 1:19:53 AM #

1.

private - only visible to only class.

protected - only visible to class and also its derived classes.

internal - only visible to classes within the same assembly only.

public - visible to all everywhere.


2.


Label:

Way of representation of text on browser.

Can render format/style as prefered.

Appends span element when rendered.

Has style properties to support the same.

Adds HTML elements to text.


Literal:

Way of representation of text/controls on browser dynamically as it is.

Cannot render style or format.

No support style attributes.

Doesnt add any HTML elements

Rolle
Rolle Sweden
9/13/2010 1:44:53 AM #

That sounds scary, indeed. I thought that was the "first" thing you learned when getting into C#...
But what is the criteria of "knowing" the answers to theses questions? E.g. in Q1, if they know all but "internal", is that a total fail? And in Q2, if they know that Literal just gives you the "raw" output and Label gives you a "spanned" output, is that a correct answer? Or do you have to know all the details (e.g like Prema wrote).

jmorris
jmorris United States
9/13/2010 10:20:04 AM #

I would give them a nod if they knew all but internal considering their background; if they wrote frameworks, they ought to know to it, if they were more front end the first three would suffice.

I would accept your second answer as well...i might ask you what you meant by raw. I am looking for "html encode" and "span". Details are nice and show in depth knowledge.

Tim
Tim United States
9/13/2010 7:25:22 AM #

I will admit, after almost 4 years experience, I wasn't completely accurate with my answers. Lol.

Jan Blomquist
Jan Blomquist Norway
9/17/2010 11:18:47 AM #

You ask these kind of questions and wonder why quality has degenerated? Often the answer is to be found within one self. Not sure if Donald Knuth could have answered the second one though Smile

jmorris
jmorris United States
10/19/2010 1:49:01 PM #

Haha, I cannot believe that anybody who develops in ASP.NET couldn't answer either. It's like asking what 2+2 is and getting an answer of 5.

Cris
Cris United States
9/24/2010 8:10:29 AM #

I've never seen internal before, but I program in VB not C#. We use Friend instead. How nice.

www.sayginnlp.com

An Phu
An Phu United States
3/12/2011 4:50:24 AM #

Try protected internal.

ko&#231;luk
koçluk Turkey
4/5/2011 8:09:19 AM #

I've never seen internal before, but I program in VB not C#. We use Friend instead. How nice.

driver downlad
driver downlad Turkey
4/5/2011 8:22:10 AM #

It can be viewed as an undoubtedly bad thing, on the other hand it just probably means you there are just a lot of applicants and of course not all of them are that worthy.

izmir ko&#231;luk
izmir koçluk Turkey
4/6/2011 3:30:01 AM #

Try protected internal...

ko&#231;luk
koçluk Turkey
6/8/2011 6:22:52 AM #

And I should have used the reply feature! Doh.

ko&#231;luk
koçluk Turkey
7/9/2011 2:26:37 AM #

@Scott Label will render html label if assigned to an input control using AssociatedControlID.

I've never seen internal before, but I program in VB not C#. We use Friend instead. How nice.

Pingbacks and trackbacks (1)+

Jeff Morris

Tag cloud

Month List

Page List