interview-questions

In JVM heap can there be more than one object with the same hash code?

This is a an interview question. ...

Which of the following elements can be adjusted when using the processmodel element of the machine.config file?

ASP.Net 3.5 using C# a. The number of queued requests before returning “Server Busy (error:503)” b. The maximum number of threads per processor c. The maximum number of threads per request. d. The maximim amount of memory utilized per request. want correct answer of the above question among given answers.I think b. will be the ans...

Concatenate null-terminated strings recursively

I'm inventing interview questions that require analysis of C++ code that does something simple with pointers and recursion. I tried to write strcat() in recursive manner: size_t mystrlen( const char* str ) { if( *str == 0 ) { return 0; } return 1 + mystrlen( str + 1 ); } void mystrcpy( char* to, const char* from ) {...

In 3 minutes, What is Reflection?

Many .Net interview question lists (including the good ones) contain the question: "What is Reflection?". I was recently asked to answer this in the context of a 5 question, technical test designed to be completed in 15 minutes on a sheet of blank paper handed to me in a cafeteria. My answer went along the lines of "Reflection allows you...

ASP.NET -Advantages of LINQ

Recently I am using LINQ. But when facing an interview I am unable to explain: What is LINQ? Moreover, is DataSet deprecated due to the introduction of LINQ? From an interview point of view, how should I answer those questions? ...

Data Structure Interview Question

I was asked the following Question: How would you store the data given below(which data structure would u pick): A-1-2-3-4-5-6 | B-7-8-9-10-11 | C-12-14-15-16-17 My ans: Since this looks like a bunch of lists with its head nodes linked together. Use two node types one id the regular node type with the following definition: Struct...

Searching a number in a rotated sorted Array

Given a Sorted Array which can be rotated find an Element in it in minimum Time Complexity. eg : Array contents can be [8, 1, 2, 3, 4, 5]. Assume you search 8 in it. ...

How to win this game?

Support we have an n * m table, and two players play this game. They rule out cells in turn. A player can choose a cell (i, j) and rule out all the cells from (i,j) to (n, m), and who rules out the last cell loses the game. For example, on a 3*5 board, player 1 rules out cell (3,3) to (3,5), and player 2 rules out (2,5) to (3,5), curre...

how to prepare for a Ruby interview in just one weekend

I'm a seasoned web developer but only have a modicum of Ruby/Rails experience. I just got an interview Monday at a Ruby shop, they do realize I don't have much Ruby experience. Besides 2 or 3 Ruby books I have lying around, what other resources might I avail myself of for a weekend crash course in Ruby. I do have a bare minimum accoun...

What are likely SSIS interview questions for a beginner?

For a beginner having an experience of 6 months in SSIS what are the most probable questions? For Control tabs, Each section of dataflow tabs like what are the most used Transformations in day to day life (I know that all are important as it depends on the project requirements) etc? Thanks in advance for the help. ...

structure on a heap memory

This question was recently asked to me in an interview for which i went confused!! "How do you initialize a structure in the heap memory ?" could anybody please tell me the correct answer for this? btw:how exactly are stack and heap memory are different from each other? And looking about the above question some might also ask me about ...

deep copy Linkedlist without destroying original list and extra storage space (using ANSI C)

this linkedlist is different than normal linkedlists is that besides the next pointer, it also has a other pointer that points to another node except itself in the linkedlist. so what's the best way to deep copy this linkedlist without destroying the original and no extra space? My approach was simply doing a O(n^2) loop , but should b...

Does anyone have C# code to repair a linked list that cycles?

http://stackoverflow.com/questions/1285560/how-do-you-remove-a-cycle-in-a-single-linked-list Before I write some sample code to do what this answer describes, does anyone already have a C# example of repairing a singly linked list that points back into itself? I understand the detection part (tortoise/hare) but the repair part is a lit...

How to solve this problem by prolog?

The criminal is one of A,B,C,D. A says:Not me. B says:It's D C says:It's B D says:Not me. And we know that only one of them tells the truth. Who is the one?I want to solve it by prolog. It's an interview question. ...

Function Pointer Calls

Let's say there is an imaginary operating system... There is a function in it called settime that gets a pointer to function and a timestamp. The catch is that every time the function is called it runs over the last call (so only the new function being provided as parameter will be called). I want to expose a new function to my users ...

interview questions - little help

i ran into thos quesiton in a google search.... they look pretty common, but i couldn't find a decent answer. any tips/links ? 1.Remove duplicates in array in O(n) without extra array 2.Write a program whose printed output is an exact copy of the source. Needless to say, merely echoing the actual source file is not allowed. ...

Delete a node in singly link list

How to delete a node in a singly link list with only one pointer pointing to node to be deleted? [Start and end pointers are not known, the available information is pointer to node which should be deleted] ...

Find Even/Odd number without using mathematical/bitwise operator

Hi, I was recently asked to write a program, that determines whether a number is even or odd without using any mathematical/bitwise operator! Any ideas? Thanks! ...

Call different functions using Direct Parameter Access in C

Hello, I recently stumbled upon this page. And I was particularly interested about the section which dealt with Direct Parameter Access. I was just wondering if there is any way to execute just one of the functions depending on the value of n in the following line: printf("%n$p", func1, func2, func3 .. funcN); where func1,.. have si...

Calculate the factorial of an arbitrarily large number, showing all the digits.

Hello, I was recently asked, in an interview, to describe a method to calculate the factorial of arbitrarily large numbers; a method in which we obtain all the digits of the answer. I have searched various places and asked in few forums. But I would like to like to know if there exists any way to achieve this without using libraries li...