interview-questions

Converting prime numbers

Possible Duplicate: Help with algorithm problem from SPOJ Came across this interview question. Given two n-digit prime numbers, convert the first prime number to the second changing one digit at a time. The intermediate numbers also need to be prime. This needs to be done in the minimum number of steps (checking for primality ...

Interview Question, What do they want to accomplish?

I was on a technical job interview today, and it was time to give me some programming exercises. I finally came to the last question: Given the numbers: 116 104 105 115 32 105 115 32 99 111 114 114 101 99 ? What is the next number? To really understand my mindset, I encourage you to stop reading, and really try to figure out what th...

What a tester need to do when he found a bug and the dev does not want to fix it – and it is important.

Interview question. Please help what the tester need to do? ...

In what scenarios crash happens before control comes to main() function ?

Possible Duplicate: Is there any way a C/C++ program can crash before main()? Hi, In what scenarios, application crashes before control reaches main() function ? My understanding so far: Global and Global static initialization happen before main(). So if order of initialization is not proper then it could lead crash when using...

Can we compute this in less than O(n*n) ...( nlogn or n)...

This is a question asked to me by a very very famous MNC. The question is as follows ... Input an 2D N*N array of 0's and 1's. If A(i,j) = 1, then all the values corresponding to the ith row and the jth column are going to be 1. If there is a 1 already, it remains as a 1. As an example , if we have the array 1 0 0 0 0 0 1 1 0 0...

What does this recursive function do?

I got this question in an interview. So, this seems to me a messed up Fibonacci seq. sum generator and this gives a stackoverflow. Because if(n==0) should be if(n<3) (exit condition is wrong). What should be the precise answer to this question? What was expected as an answer? foo (int n) { if (n == 0) return 1; return foo(n-1) + foo(n-2...

Unsigned and signed values in C (what is the output)

signed int x= -5; unsigned int y=x; what is the value of y? and how? ...

language neutral interview

what exactly does language neutral interview mean? do they just check for my OOPs/Other concepts or actually check how good my programming skills are? during the interview what exactly is expected out of me? any ideas? -Ivar ...

Duplicated strings in a 3TB TXT file

Say there is a 3TB TXT file, in which every line is a string, how to find those duplicated strings in them? It's an interview question from a friend of mine. We'd better make those questions clear enough after an interview, in case of the next one. PS: If I'm the interviewee, I will tell the interviewer: How can you guys store so many s...

Sql Server Interview Question: What function can you NOT call from inside a stored procedure or a user defined function (table or scalar)

In a recent interview I was asked to name a built-in function(s) that cannot be called from inside a stored procedure or a user defined function (both scalar and table-value). I didn't know the answer to the question and gave the generic "I don't know but I'd love to find out." It turns out after doing a bit of research that I'm no clos...

Good questions to determine a candidate's level of C# and t-SQL knowledge?

Possible Duplicate: Good C# Interview Questions for a Senior Dev Position What questions would you ask, specifically? If you were looking for a candidate with "strong t-SQL and C#" skills. The position is not a senior position, but requires an experienced web developer. What knowledge would you be looking for? ...

Interview question please help

How would you test a ‘Mobile’ version of IM? What are some key differences between testing this version versus a desktop application? ...

Unusual interview question

College friend told me about interview question that is asked in one company: Write reasonable(=compilable) method declaration that contains as many C# keywords as possible. If there are 2 or more the same keywords they are counted as one. Method's body is not considered. C# has finite number of keywords so such me...

square of a number being defined using #define

Hi, I was just going through certain code's which are frequently asked in Interview's. I came up with certain doubts, if anyone can help me regarding this? I am totally confused on this now, #include<stdio.h> #include<conio.h> #define square(x) x*x main() { int i,j; i=4/square(4); j=64/square(4); printf("\n %d...

What is the difference between http servlet and soap over http

Asked in the interview: What is the difference between http servlet and soap over http? What the advantages and disadvantages of both? In which case would use which? ...

Parsing URL string to remove unwanted stuff (C++)

Was asked this in an interview, my solution kinda sucked so I am wondering if anyone can do better. Given a URL string in this form: http://www.foo.com?key1=value1&amp;key2=value2&amp;key3=value3 and given a key I want to create a function that takes a key value and returns the original string WITHOUT the key and value. Example: in...

Interview Question: How to efficiently search in an ordered matrix?

I have a x by y matrix, where each row and each column are in ascending order as given below. 1 5 7 9 4 6 10 15 8 11 12 19 14 16 18 21 How to search this matrix for a number in O(x+y)? I was asked this question for an interview, but could not figure out the way. Curious to know if it could be done. ...

Mutex and Event on Windows

hi Had a question: Why do we need Mutex and Events in Windows? In the sense couldnt windows have just Mutex? What is that can be done with Events that cannot be done with Mutex? ...

Search in a sorted array of ints which rolls over

Is there a easy way to search in an array like this? Some examples below : 5 6 7 8 19 45 21 32 40 // Rolled over at 7 th element 15 22 32 45 121 341 40 // Rolled over at 7 th element 1 22 32 45 121 341 400 // Rolled over at 0 th element ...

Find the subsequence with largest sum of elements in an array

Hi, I recently interviewed with a company and they asked me to write an algorithm that finds the subsequence with largest sum of elements in an array. The elements in the array can be negative. Is there a O(n) solution for it? Any good solutions are very much appreciated. ...