Interview questions (4)

1. Database schema design that caters to the handling of multiple real world relationships. 
2. In the event there was no Struts, how would I go about designing my own MVC model – to mimic a shopping cart application.
3. Provide a design that would search multiple search engines and provide a consolidated set of search results for a given keyword.
4. Review a piece of code.. what are the important things I should look for.
5. Write the getDepth() method of a tree. What are the approaches I can take… 
6. Write the substring method – the only available method is getChatAt(int)
7. Write a method that would reverse a string, a method that woudl reverse the words in a string
8. Write a method that would find the number of words in a given string. The same word should not be counted twice. 
9. Provide a design on how to implment the redo and undo features of paint. Provide alternate solutions and explain why they were alternate. 

Interview questions (3)

Here’s an addition to some of the more interesting interview questions I have received during my job hunt

1. How would you write your own garbage collector ?
The crux of the question is how would you identify which objects need to be garbage collected. Here, they are trying to test your knowledge of the heap and call stack.

2. You’ve got an array of numbers. They are not sorted. How do you find the the first pair that sums to X (a given number)
They’re looking for an optimized solution. The most obvious solution is an n^2 solution and thats not what they want…
Hint: Think about which data structure you could use.

Interview questions (2)

1. How would you write your own garbage collector ?
2. You’ve got an array of numbers. They are not sorted. How do you find the the first pair that sums to X (a given number)
3. Write an algorithm where given an array of numbers (ints) , find the number of pairs that sum up to a given number
4. Given a n by n matrix or integers, where each row is sorted in ascending order and each column is sorted in ascending order. Find a particular number in that matrix.
5. Write a basic compiler simulator
6. Given a sentence, write an algorithm that would reverse all the letters in teh sentence.
7. The same sentence, write an algorithm that would reverse all the words in that sentence.
8. When would you use a hashmap, hashset, linked list ?
9. Questions around serialization – why ? how to serialize, how to prevent serialization
10. Concurrency – dead locks, prevention of deadlocks, race conditions
11. Web apps – req/response, vs sessions, how do web servers keep track of sessions, why would you use pooling
12. Threads – whats a thread local, why would you use one, what do you need to be aware of when using threads

Other questions
– Why would you use materialized views.
– Joins, self joins, hierarchical queries

Deciding on subversion access priviledges…

As part of setting up the infrastructure for development we had to set up and configure subversion as our source control repository.

My initial thoughts were to provide read write access to all developers to all projects. My rational behind this was that, we were all adults and that there has to be some discipline when checking in code. As in no one would check in broken code.

However, after speaking to some of the team members it became apparent that most developers were new to this concept of working with a code repository and that they most probably would lazily check in code without ensuring their changes would cause a break in the build. Therefore, lets give each developer access to only their section of the codebase (frontend, backend etc).

Ok, thats understandable. i can live with that. After all prevention is better than cure 😛

However there was another school of thought that brought up this very interesting proposal. Since these developers were new to this practice, why not give very specific access privileges. I.e. class level. Wow… i had never thought of this.

Personally, i don’t think this is practical at all. It would be a nightmare trying to manage access privileges as developers finish a particular class and want to add/edit another class. And wouldn’t this be a serious bottleneck to development ?

Interesting argument.. how far can you go with prevention ?? :P:P

Interviews…

Over the last three weeks I’ve been interviewing with a certain company. The interview process has been very interesting. At each stage the interview questions just got harder and harder. I guess thats the norm. Its just that its been quite a while since i was subjected to this kind pressure, and to tell you the truth, i truly enjoyed it!

The questions ranged from data structures,
– Where they test your ability to select the most appropriate data structure to solve a problem
– awareness of common data structures and how you would traverse through them

To some really interesting algorithm questions like,
– write an algorithm where given an array of numbers (ints) , find the number of pairs that sum up to a given number.
– given a n by n matrix or integers, where each row is sorted in ascending order and each column is sorted in ascending order. Find a particular number in that matrix.

The question is fairly straightforward. However, they are not looking for the regular question anybody would give. They are looking for the smarter ones who think about more optimized ways of executing this algorithm. Therefore, the next part is generally focused around complexity.

The last interview was the most toughest. It covered all areas including, scalability concerns, fault tolerance and fail over, performance and availability strategies. All in all, whatever the outcome, I thoroughly enjoyed the experience. All of my interviewers were very easy-going friendly people who had the knack of setting the interviewee at ease.

Heres a link i found pretty useful,
http://discuss.techinterview.org/?interview