Wednesday, May 30, 2012

Qualcomm Interview experience - .NET Tools Developer

I recently interviewed with the Qualcomm QCT Software team for their .NET tools developer position in San Diego, CA.

The process started with a member of their team directly calling me and setting up a telephonic interview. The interview was about 45 minutes. The questions were mainly pertaining to ASP.NET and SQL Server. A few which I can remember are:
What are the advantages of MVC v/s Web-Forms?
Asked me to write a simple join in LINQ to SQL.
Why do we use stored procedures?
What are Jquery selectors? In what order are they looked for?
What is DB indexing?
How do you get the value of the last inserted primary key? (This one is tricky, there're 3 ways of doing this and you may get 3 different values based on the DB state.)

I asked him a bit about the team and the role of the person they're looking to hire. He was kind enough to explain the position and the project in detail.
He told me that they're basically looking for "smart" people. "We don't expect you to know everything. We are looking for someone who can come on-board and quickly learn." He then gave himself as an example and said when he'd joined, he knew only Java. And that's what he was interviewed on.
At the end of the interview he told me the HR will be contacting me for an on-site interview in San Diego, CA. The HR contacted me a week later and I scheduled the interview in another week. I was given round trip air tickets, a rental car and accommodation for two days.

I scheduled my interview on a Friday as I wanted to keep Friday evening and Saturday morning for a bit of sight seeing. Also, that way I would miss only two days at work.
One of the 40 Qualcomm buildings at their San Diego HQ

The on-site interview consisted of 6 rounds (1 HR + 5 Technical).
HR Round
The staffing specialist asked me a few basic questions about what my interests were. Why was I looking for a new job, what technologies would I be interested in and so on. She did not ask what my salary expectation was, in spite of asking my current salary. That was a bit surprising.

After the HR round, I was taken by a shuttle to their building where all the interviews were scheduled.
1st Round - .NET Architect/ Sr. Developer
He basically talked about my current project, my technology preferences and the .NET architectures I've worked with. He then asked me to code (No preference of language.) a program to find the first non-repeating character. I first gave him an O(n^2) solution. He asked if I could improve the complexity and somehow I managed to verbally tell about him an O(n) solution which was somewhat similar to the one over here (I'd not seen this until after the interviews). He was reasonably satisfied with this solution. He then escorted me to the next interviewer's office.

2nd Round - Sr. Developer (Lunch Interview)
The interviewer asked what my preferences for lunch were. I said I don't eat pork or beef, apart from that, anything is fine. To my surprise (pleasant!), he took me to an Indian restaurant near by, although he was of Korean origin. The rest of the interview was pretty informal and he talked about his role in the company, what was important for him in the job and some of the technologies he was working on. The conversation then came to Web/WCF services in .NET. I said I'd never worked with WCF before but have coded Web services. He then asked me "Why should an  ASP.NET web service never return a DataSet or DataTable?" I didn't know the answer, as I thought a web service will always return the output in XML format, so how should the output DataStructure matter? But apparently, Python won't accept it if the web service is returning a DataSet or a DataTable. I will need to dig further sometime to know why this is so.The interview ended when we came back to his cabin in the office and he asked to write the program to print the Binary tree using pre-order traversal.

3rd Round -  .NET Architect/ Sr. Developer
I felt this guy was the smartest of the lot. He was pretty direct about everything he said and seemed to explain his project pretty well, when I asked about it. He talked a little while about my previous work-ex and moved on to a coding problem. He asked me to code the "Buzzfizz problem" (I did not know what this was at that point, but he was okay with explaining it.) and then some modification of the Fibonacci program code. He then asked about the advantages and downsides of C#. The interview ended with some questions about OOAD (Class diagrams mainly).

4th Round - .NET Lead
He took about 10 minutes to get to the interview but was polite enough to apologize for the delay. He started off with some basic .NET OO questions about interfaces, abstract classes and so on. He then moved on to some coding questions:
1. Write a program to find the number missing if you have been given 1-n numbers and you know just one in between them is missing.
2. Given two arrays with one number missing in one of them and not in the other, find the number. What property of integer datatype did you make use of to solve the problem?
3. Why do we need interfaces? If I knew all the functions I'm supposed to implement, why would I need  interfaces?
4. What are the advantages/disadvantages of database normalization?

5th Round -  Sr. Developer
I got the impression this interviewer was in a bad mood from the beginning. He asked me to code an n-ary tree in C#. He kept on interrupting me as I proceeded. I was pretty tired by this round and I didn't get the solution he desired. He moved on to the next question: Program to find the second greatest element in an array. I was able to tell him this verbally but did not manage to code due to my nervousness. I explained him that I was pretty tired after all the interviews and had had a pretty long flight. He was pretty cool after the interview though and said I should not worry too much. After that he escorted me to the outside of the building where the cab was waiting to take me to the building where I started.

Overall, I think the experience was really a positive one. San Diego has the most beautiful landscapes. I'd been to a beach after a really long time.
Yet another beach
Some random house by the beach

Sunday, May 13, 2012

Vicky Donor - A simple and funny take on a controversial topic

Vicky donor is a recent Hindi (Many dialogues and songs are in Punjabi, though) movie to hit the cinemas. The film centers around Vicky Arora (Ayushmaan Khurana) who is a sperm donor. The film then follows a romantic  tale of how he falls for Aashima Roy (Yami Gautam) and how his past as a sperm donor complicates the relationship.
Although the topic of sperm donation is controversial in India, the film focuses on the humorous aspect of it. Annu Kapoor plays Dr. Chadda, MBBS who runs an infertility clinic. The best part about the film is that the characters don't actually try to be funny. The humor burgeons from the subject matter.
Vicky Donor Poster
Overall, the film is refreshingly funny and it's good to see that films with small actors can be a huge success with a combination of good writing, script and acting.

Tuesday, May 8, 2012

Sorting and filtering a DataTable in VB.NET

There's no way to automatically sort a DataTable after it's populated.

A way around this is to sort the DefaultView of the DataTable (or any other DataView associated with the DataTable).

You can achieve this using the Sort property of the DataView. This is a string which specifies the column (or columns) to sort on, and the order (ASC or DESC).

myDataTable.DefaultView.Sort = "myColumnOfChoice DESC";

Works like a charm.

Filtering the contents of the DataTable:

In this function we check if a value is selected in any of the Dropdown lists  and add the value to the condition. In the last an extra condition “1=1” is added so that there will not be any problem is syntax even when no filter condition is selected.

Not the first entry in all DropDown lists is "All". So if that is selected we don't put any condition.

'Result is of type DataTable ans is populated and bound to a grid on Page_load

 Dim strCondition As String = ""

        If (Not ddlSrcState.SelectedIndex = 0) Then
            strCondition += "srcState='" + ddlSrcState.SelectedItem.Text + "' AND "
        End If
        If (Not ddlEquipType.SelectedIndex = 0) Then
            strCondition += " trl_type1='" + ddlEquipType.SelectedItem.Text + "' AND "
        End If
        If (Not ddlSrcCity.SelectedIndex = 0) Then
            strCondition += " srcCity = '" + ddlSrcCity.SelectedItem.Text + "' AND "
        End If
        If (Not ddlDestCity.SelectedIndex = 0) Then
            strCondition += " destCity = '" + ddlDestCity.SelectedItem.Text + "' AND "
        End If

        strCondition += "1=1"

        Result.DefaultView.RowFilter = strCondition
        Result.DefaultView.Sort = "srcState ASC"
        loadsGridView.DataSource = Result