VB.NET Interview Questions #5

Ah, it's a test you want. We don't do 'tests'Here’s installment #5 of my VB.NET interview questions series.

Previous Installments: VB.NET Interview Questions #1, VB.NET Interview Questions #2, VB.NET Interview Questions #3, VB.NET Interview Questions #4

Feel free to add a comment with your answers. Try to answer them before looking at the comments or searching MSDN or Google for an extra challenge.

True Or False

1. You can access variables declared in the Try block inside the corresponding Catch handler.

2. You don’t need to specify a default value for an optional parameter.

3. When updating a bound control, you should call a DataSet’s Clear method before calling the DataAdapter’s Fill method.

4. When a web form is ready for garbage collection the Unload event is raised.

5. The AdRotator control can be bound to a database table. 

General VB.NET Questions

1. Explain the 3 basic tiers found in a well designed web application.

2. Explain the difference between TCP, UDP, and HTTP data transmissions.

3. When would you want to use "Attach To Process" to debug a .NET application?

4. Describe how you would go about validating a social security number entered by a user.

5. Describe methods you could use to avoid deadlock problems in a multithreaded application.

Tough General Interview Questions

1. What habits in other programmers do you find most annoying?

2. How much time do you devote on a monthly basis to improving your skills?

3. Do you see yourself in a management role in the future?

4. Why did you choose programmer as a career?

5. What do you think is important in determining how well you will function with a team of programmers?

Open Ended Questions

1. What criteria would you use to determine if a particular program should be written as a web based ASP.NET application or as a WinForms application?

2. If you needed to create custom web applications for each of a company’s clients that could be quickly brought online and modified as needed what are some of the things you would consider in your design?

Have fun with these and let me know what you think about them by leaving a comment or answering the questions.

Share This Article: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
  • StumbleUpon
  • Technorati
  • DotNetKicks
  • DZone
Not That GoodCould Be BetterOKGoodGreat (3 votes, average: 2.33 out of 5)
Loading ... Loading ...

18 commentsOctober 21st, 2007

Winchester Mystery House Video

I’ve long said that many VB6 applications remind me of the Winchester Mystery House. This house, built by the heiress to the Winchester Rifle Company, is a sprawling mansion that had additions made to it essentially on the whim of the owner. Architecturally its a mess, but it still functions, much like a lot of VB6 programs you see with hundreds of forms and modules and with nooks and crannies that just don’t make any sense at all.

Here’s a video tour by the guys who did the Weird US series on the History Channel. It’s a fun video. Watch it and see if your VB6 app has something in common with this house.

 

 

 

 

Share This Article: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
  • StumbleUpon
  • Technorati
  • DotNetKicks
  • DZone
Not That GoodCould Be BetterOKGoodGreat (1 votes, average: 4 out of 5)
Loading ... Loading ...

Add commentOctober 20th, 2007

Site News for 10/14/07 through 10/20/07

Busy, Busy, BusyTrying to Keep Things Balanced

I’ve been working hard on my new "anything goes" speed blog, OpTempo, but I’m trying to keep the quality up here as well. I may not post quite as frequently here over the next few weeks, but I’ll make every post count. I’ll at least have one general programming article and two tutorial or code example articles a week plus my weekly VB.NET Interview Questions and Link Round-Up columns.

Most Popular Posts

Here are the 10 most popular posts of the week:

 

Coming Up Next Week

With any luck I’ll publish my follow-up article on coaching on Monday. I also have an overview article on Interfaces that someone requested just about ready as well. If you have a topic you would like for me to cover, let me know in a comment or email.

Share This Article: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
  • StumbleUpon
  • Technorati
  • DotNetKicks
  • DZone
Not That GoodCould Be BetterOKGoodGreat (No Ratings Yet)
Loading ... Loading ...

Add commentOctober 20th, 2007

Introduction to the Comparer Delegate

The Comparer Delegate Does the Hard Work for You

Once you have data in a generic List or Dictionary you may find that you need to sort it into the order you need. This is fairly easy if you’re using simple data types since .NET provides default comparers but it can get a little trickier if you need to sort objects. In this article we’ll look at how to use Comparer Delegates to do this.

What is a Comparer Delegate?

A comparer delegate is a routine that is used to compare two objects. It returns a 1 if the value of the first object is greater, -1 if the value of the first object is lesser, and 0 if the objects are equal. Since we’re working with objects we can compare multiple values in the two objects to determine which is greater than the other.

Code Example #1

In this example we’ll look at sorting PointF coordinates by their distance from 0,0. First, let’s load up our list and call the Sort method with our comparer that we’ll write in a moment.

Dim CoordinateList As New List(Of PointF)(New PointF() {New PointF(14, 22), New PointF(17, 21), _
                                          New PointF(15, 8), New PointF(15, 20), _
                                          New PointF(16, 7), New PointF(15, 21), _
                                          New PointF(17, 7), New PointF(16, 21), _
                                          New PointF(14, 23)})
CoordinateList.Sort(AddressOf ComparePointF)

Now, let’s code our comparer routine, ComparePointF:

Public Function ComparePointF(ByVal positionOne As PointF, ByVal positionTwo As PointF) As Integer
    Dim DistanceOne As Double = Math.Sqrt((positionOne.X ^ 2) + (positionOne.Y ^ 2))
    Dim DistanceTwo As Double = Math.Sqrt((positionTwo.X ^ 2) + (positionTwo.Y ^ 2))
    If DistanceOne > DistanceTwo Then
        Return 1
    ElseIf DistanceOne < DistanceTwo Then
        Return -1
    Else
        Return 0
    End If
End Function

Here we’re using the Pythagorean distance formula to determine the distance from 0,0 for each point and then comparing the results. The List object handles all of the sorting internally so the performance is quite good.

Code Example #2

In this example, we have an invoice object where we’re wanting to sort the objects first by customer type and then by the total amount of the invoice. Here’s what our comparer delegate would look like:

Public Function CompareInvoices(ByVal invoiceOne As Invoice, ByVal invoiceTwo As Invoice) As Integer
    If invoiceOne.CustomerType > invoiceTwo.CustomerType Then
        Return 1
    ElseIf invoiceOne.CustomerType < invoiceTwo.CustomerType Then
        Return -1
    Else
        If invoiceOne.Total > invoiceTwo.Total Then
            Return 1
        ElseIf invoiceOne.Total < invoiceTwo.Total Then
            Return -1
        Else
            Return 0
        End If
    End If
End Function

As you can see in this function, we first compare the customer type, then the total amount. Of course, you could make this even more complex for your sorting situations. All you have to keep in mind is your integer return value.

I hope these examples have been helpful to you in learning how to use the comparer delegate. If you have any further questions or observations about this subject, please feel free to leave a comment.

Share This Article: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
  • StumbleUpon
  • Technorati
  • DotNetKicks
  • DZone
Not That GoodCould Be BetterOKGoodGreat (No Ratings Yet)
Loading ... Loading ...

Add commentOctober 19th, 2007

Link Round-Up for 10/18/07

I’ve been a bit busy this week so I haven’t got as many links this time around.

Careers

I did run across a few good career related links though, such as this one on Tech Republic: Write a resume that will land you a programming job. It has some very detailed tips on how to write a resume that will get you an interview.

Also, on the career front, there was this good article by Rob Walling called Q & A on Leaving Management for Development. It’s a follow-up on an earlier article he had written on this topic but it has good info all on its own. Also check out the rest of his site for more good stuff.

Architecture and Methods

I found this article, How To Tell If You’re Doing Agile Right, by Ryan Cooper. I think he does a good job of making the business case for Agile development although I’m not sure if that’s what he intended to do.

Niclas Nilsson wrote this piece on Top Ten Software Architecture Mistakes that’s pretty good. Actually he’s just condensing what Eoin Woods had said in this longer, 2 part, article, Avoiding the Icebergs.

Programming

Saptarshi Purkayastha applies a little Eastern philosophy in this article, Programming Lesson: You Are The Bug…. He’s working on some follow-up articles with the same kind of theme so check back with him later as well.

That’s all the links for this week. As always, let me know of any interesting .NET or general software development links by leaving me a comment or dropping me an email.

Share This Article: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
  • StumbleUpon
  • Technorati
  • DotNetKicks
  • DZone
Not That GoodCould Be BetterOKGoodGreat (No Ratings Yet)
Loading ... Loading ...

Add commentOctober 18th, 2007

Next Posts Previous Posts


Visit Me At My New Site, Programming In C#

Most Popular Articles

Highest Rated Articles

Categories

Most Recent Articles

Feeds

 Subscribe in a reader

To subscribe by e-mail
Enter your address here

Delivered by FeedBurner

VB Opportunities

Archives