interview-questions

Object Orientation, Rails.

I was asked this question, "How do you see Object Orientation in terms of rails?". What would be a perfect answer for this in an interview? ...

Interview Expectations....

Hi All, I recently appeared for an interview for a multinational and came across questions like What are the new features of JDK5? What are the advantages of using Enums? Why would you use Serializable? What are the concrete implementations of the List interface? I missed LinkedList. ...and a few other fact based questions followed...

What are some good questions to ask a potential consultant w/out insulting them?

We're looking at possibly outsourcing some development to a local consultant, what type of questions would you ask during an initial meeting? We're potentially looking to have them build some basic webapps in ASP.NET and SQL Server 2008. Some of the other questions here are geared toward a new employee who may or may not have a lot of...

How can I return a random line from a file? Interview Question

I am preparing for a phone interview. I came upon these questions on the internet. Can anyone tell me some good answers for these? Suppose I give you a text file and ask you a to write a program that will return a random line from the file (all lines must have equal probability to be returned) Same as part 1, except this time the enti...

Web design test for interns

We are receiving some graphic design interns today and I may be given the task to test their web-designing skills. Because not all graphic designers are web designers, I would want to keep the tasks simple and easy to understand. What tasks or questions you would suggest for such a scenario? I do not want to test their HTML or CSS skill...

Good interview questions for a Python/TurboGears web developer?

If you were looking to hire a web developer who would primarily be working with TurboGears/Python - what sort of questions should you ask them? ...

Given a function for a fair coin, write a function for a biased coin?

I came across this reported interview question when doing some reviewing (the following quote is all the info I found about the problem): Given a function for a fair coin, write a function for a biased coin that returns heads 1/n times (n is a param) At first glance I wrote: int biased_coin(n) { //0=Tails, 1=Heads int sum...

Team Leader responsibility includes coding if needed?

"Today is Friday and the Client needs the feature by Monday (There is a slip in project schedule but client needs it any how.), No developer is willing/coming to work on Saturday and Sunday. What will you do as a Team Leader?" This was asked to my friend in interview. And my friend answered "If no developer is willing/coming then i lea...

C interview question---run-length coding of strings

Hello, A friend of mine was asked the following question a Yahoo interview: Given a string of the form "abbccc" print "a1b2c3". Write a function that takes a string and return a string. Take care of all special cases. How would you experts code it? Thanks a lot ...

How to design Automation framework for a database

Recently I faced an interview question, "If there is a database having many stored procedures and functions, then how would you design and develop a framework for automation testing?" How would you answer that question? ...

How can I do sessions URL is very long I cannot append JSESSIONID=389729387392.What is the solution for this?

Hi I got the answer for If I disabled the cookies then using URL ReDirect I can pass the JSESSIONID but my URL is already very long as I use the GET method it has constraint. Then how should I use my sessions.I want my application to be very security intensive. This is one of the question asked to my friend in GOOGLE interview. ...

rate my code: on the spot interview with startup

1.5hr of coding in their smaller than by bedroom office with 4 desks lol. Afterward, while destressing at a bar, I refactored it a bit. objective was: develop a mechanism to define a schema for json objects and validate against it coerce data to schema types if possible, in case an int came in as a float or str develop mechanism to co...

How to create a String class replica?

I need to create a class with exactly the same methods as java.lang.String. What is the best way to do this in Java? I know that I can't extend String class as it is final. I am not looking at solutions where I need to copy the source code of java.lang.String. For example, assume that I need the functionality length() within my custom...

Finding three elements in an array whose sum is closest to an given number

Given an array of integers, A1, A2, ..., An, including negatives and positives, and another integer S. Now we need to find three different integers in the array, whose sum is closest to the given integer S. If there exists more than one solution, any of them is ok. You can assume all the integers are within int32_t range, and no arithme...

Interview question: C program to sort a binary array in O(n)

I've comeup with the following program to do it, but it does not seem to work and goes into infinite loop. Its working is similar to quicksort. int main() { int arr[] = {1,1,0,1,0,0,0,1,0,1,0,1,0,1,0,1,0,1}; int N = 18; int *front, *last; front = arr; last = arr + N; while(front <= last) { while( (front < last) && (*front == 0...

Transmitting hand-written information over a network

A teacher is writing on a blackboard and we want to pass all the information on the blackboard over a low-bandwidth network in real-time. How do we do it? In one interview, I faced this question. ...

Interview test for applied scientific computing job

Do you know a good and objective question/test to examine applicants for a scientific computing job? (In fact, this test comes after the candidate passed an interview.) 1st) They need to be intelligent. (Edit, thanks for the words from Trent) 2nd) They would have to deal mostly with programming (C++ and Python, using scientific librar...

Which one is faster in java? 1. Math.max(a,b); 2. (a>b)?a:b

Hi This was the question asked in my interview Which one is faster in java and why? Math.max(a,b); (a>b)?a:b ...

Questions every good Java/J2EE Developer should be able to answer?

I was going through Questions every good .Net developer should be able to answer and was highly impressed with the content and approach of this question, and so in the same spirit, I am asking this question for Java/J2EE Developer. What questions do you think should a good Java/J2EE programmer be able to answer? I am marking this quest...

Preprocessing doubts in C.

HI all, This is a normal C routine program which i found out in some question bank. It is shown below: #define CUBE(p) p*p*p main() { int k; k = 27 / CUBE(3); printf("%d", k); } As per my understanding and knowledge the value of K should be 1 as CUBE(3) would be replaced by 3*3*3 during preprocessing and after the subseq...