interview-questions

Questions to Determine Maven Knowledge

I requested Maven training at work, and the bosses want to hire someone who knows Maven to come work with us as a consultant so that we'll learn Maven from a real-world perspective instead of a training perspective. I've been tasked with coming up with questions of various difficulty to ask potential hires in order to ascertain their Ma...

Questions to Determine Spring / Spring Security, etc Knowledge

I requested Spring / Spring Security, etc training at work, and the bosses want to hire someone who knows Spring to come work with us as a consultant so that we'll learn Spring from a real-world perspective instead of a training perspective. I've been tasked with coming up with questions of various difficulty to ask potential hires in o...

I have an interview for a DB2 C++ developer internship and IBM coming up and need to know how to best prepare

I got an interview for a DB2 C++ developer internship at IBM. I have the option of doing it over the phone or in person. Which would you recommend? Is it appropriate to say in my reply email "What will be the nature of the interview so I can best prepare for it?" so I can found out just how technical and code-based it will be. But in ge...

Algorithm to transform one word to another through valid words

I came across this variation of edit-distance problem: Design an algorithm which transforms a source word to a target word. for example: from head to tail, in each step, you just can replace one character, and the word must be valid. You'll be given a dictionary. It clearly is a variation of the edit distance problem, but in edit dista...

Thread limit in Unix before affecting performance

I have some questions regarding threads: What is the maximum number of threads allowed for a process before it decreases the performance of the application? If there's a limit, how can this be changed? Is there an ideal number of threads that should be running in a multi-threaded application? If it depends on what the application is do...

Interview question: Design a datastructure to support stack operations and to find minimun

Design a data structure which has the following features push the data pops the last inserted data [LIFO] Gives the minimum All of the above operations should have a complexity of O(1) ...

How to define an instance?

I was asked a question in an interview and i wasn't able to answer it... Here is the question How will you define an instance[c#]? My answer was it is an other name of an object... what is the right answer for this question... ...

Copying a string in C

Hi, I am confused about this code: (http://www.joelonsoftware.com/articles/CollegeAdvice.html) while (*s++ = *t++); What is the order of execution? Is *s = *t first done, and then are they each incremented? Or other way around? Thanks. EDIT: And what if it was: while(*(s++) = *(t++)); and while(++*s = ++*t); ...

What technique would you recomend when reviewing C++ for an interview?

I've got about 2/3 years C++ experience but I've spent most of my career doing Java. I'm about to go for an interview for a C++ programming role and I've been thinking about the best way to brush up my C++ to make sure I don't get caught out by any awkward questions. What would you recommend? ...

Production code for finding junction in a linked list

Hi all, I was asked this question in some interview. I was required to write code for finding junction in a linked list (which is in form of Y with both arms not necessarily equal) for production environment in O(1) space and linear time. I came up with this solution (which i had previously seen somewhere) : 1. Measure lengths of both l...

Copy a linked list

typedef struct Node { int data; Node *next; Node *other; }; Node *pHead; pHead is a singly linked list. The next field points to the next element in the list. The other field may point to any other element (could be one of the previous nodes or one of the nodes ahead) in the list or NULL. How does one write a copy function that...

C program to remove repeated char from a string

I came across a interview question that asked to remove the repeated char from a given string, in-place. So if the input was "hi there" the output expected was "hi ter". It was also told to consider only alphabetic repititions and all the alphabets were lower case. I came up with the following program. I have comments to make my logic c...

Is there a good source of programming tests we can give candidates at interview?

Particularly for PHP and Linux server admin. ...

How to do troubleshooting of 1000 sql queries everyday?

What would be the best way to trouble shoot thousands of sql queries everyday? Trouble shooting might includes finding the blocked queries, improving performance of query, Queries that are hogging maximum processing time. ...

Resource management by Linux

When a program with some theards, mutexes, shared data, file handles crash because of too much memory allocation, which all resources are freed. How do you recover? ...

How to verify if there is a circle in a tree?

Here is a tree: There will be one root. Each tree node has zero or more children. It is allowed that two nodes points to the same child. Say, both node A and node B has child C. However, it is prohibited that, Node A is an offspring of Node B, and Node B is an offspring of Node A. One prohibited case is Node...

counting records in unix file

This was an interview question, nevertheless still a programming question. I have a unix file with two columns name and score. I need to display count of all the scores. like jhon 100 dan 200 rob 100 mike 100 the output should be 100 3 200 1 You only need to use built in unix utility to solve it, so i am assuming using shell scrip...

how to guarantee no deadlock

I was stuck at one question in an interview. Given two threads, and each one has a lock, how to guarantee no deadlock. My knowledge is that it is not easy to avoid deadlock, that's why I got stuck. Can anybody give a hint. Thanks! ...

find if 4 points on a plane form a rectangle?

Can somebody please show me in C-style pseudocode how to write a function (represent the points however you like) that returns true if 4-points (args to the function) form a rectangle, and false otherwise? I came up with a solution that first tries to find 2 distinct pairs of points with equal x-value, then does this for the y-axis. Bu...

How could i rate myself for expertise in a programming knowledge?

Many times interviewer asked me following question: How much you rate yourself in core java out of ten? How much you rate yourself in web application out of ten? Java is a popular language and having huge set of API. I am a web developer. But, there are many parts in core java which i never or least used e.g. file handling, RMI, Sock...