interview-questions

Write a method to sort characters of two different strings and than sort an array of those strings ?

Hi, Basic idea is to sort the strings and compare signature of strings, where signature is the alphabetically sorted string. What would be the efficient algorithm to do so ? Thanks. ...

How to Deal with Algorithm/Data Structures Problems in Interview Process ?

Hi, Recently I have been interviewing for quite a few Software Development Engineering position and almost every interview I have faced have been concentrated heavily on Algorithm and Data Structures, am wondering how could it be possible to face an unknown problem and design an algorithm for it using appropriate data structures that to...

How to answer what are your strengths and what are your weakness question during Interview ?

Hi, Recently, I am giving many interviews as Software Engineer, am pretty much comfortable with the technology side when it comes to answering questions like What are your Strength and What are your weakness, I have kind of hard time giving them answers. So my question is how can we handle questions like : What are your Strengths ?...

How to write program during compiling?

Write a small C program, which while compiling takes another program from input terminal, and on running gives the result for the second program. (NOTE: The key is, think UNIX). Suppose, the program is 1.c Then, while compiling $ cc -o 1 1.c int main() { printf("Hello World\n"); } ^D $ ./1 Hello World $ ...

Extracting bit from a char in C - Interview question

I had a interview today where they asked me to write two "C" functions, one to to extract a single bit and other to extract a range of bits from a character. I took a while and came up with these methods. int extractBit(char byte, int pos) { assert( (pos >= 0) && (pos < 8) ); return ( ( byte & (1<<pos) ) >> pos); } char extractB...

Best way to address required overtime during an interview

There are plenty of interview questions on SO so I hope this one is acceptable. At the least we can make it a wiki? Basically during the phone interview for a software dev position it was made clear that engineers put in significantly more hours than 40/wk. I'd like to address this to see if this is a part of the company culture or if t...

What types of topics, and questions can be expected when interviewing for entry level programming/IT positions?

I am in my senior year, and I am preparing for some interviews. I am wondering what I should review, and what I should prepare for when I'm getting ready for these interviews. What types of questions are asked during interviews? What key points and suggestions can you give me that might help me?! ...

Algorithms and Data Structures best suited for a spell checker, dictionary and a thesaurus

Best way to implement a dictionary (is their any DS better than Trie for Dictionary) thesaurus (no idea, as match is made on meanings of the words, similar meanings) spell checker (something better than a hash map), if possible with correct spelling recommendations. when asked in an 1-hr interviews, are we expected to write a...

Interview questions to detect copy-and-paste coders

What questions can I ask an interview candidate that would allow me to know whether he's a "copy-and-paste coder"? We're finding that even when candidates answer coding questions well in an interview, once on the job they'll still tend toward copying rather than refactoring. Anyone else have similar experiences? ...

Why are pointers and recursion looked upon as an complicated issues ?

Hi, Recently I was reading about Article on Interviewing an Software Engineering Position by Joel and he mentioned about asking candidate about Recursion and Pointer's after some simple puzzles. I wonder why Pointers and Recursion are considered to be complicated Issues ? Update: What can be done to improve on Pointers and Recursion...

Algorithm: efficient way to remove duplicate integers from an array

I got this problem from an interview with Microsoft. Given an array of random integers, write an algorithm in C that removes duplicated numbers and return the unique numbers in the original array. E.g Input: {4, 8, 4, 1, 1, 2, 9} Output: {4, 8, 1, 2, 9, ?, ?} One caveat is that the expected algorithm should not required the...

I was asked this in a recent interview

I was asked to stay away from HashMap or any sort of Hashing. The question went something like this - Lets say you have PRODUCT IDs of up to 20 decimals, along with Product Descriptions. Without using Maps or any sort of hashing function, what's the best/most efficient way to store/retrieve these product IDs along with their descripti...

What Software Engineering Areas should be stressed upon while Interviewing Candidate for Fulltime Software Engineering Position ?

Hi, This question is somewhat related to other posts which I found on Stackoverflow but not exactly and so am prompted to ask about it. I know we must ask for Data-Structures and Algorithms but what specific data-structures or Algorithms or other CS Concepts should be asked while interviewing Sr. Software Engineering Fulltime Positio...

Java: Interview questions for software tester?

These days I have an interview for the position: Software Testing Engineer. Any ideas what questions might pop to the interview? Any tips? ...

How do sites like LinkedIn efficiently display 1st/2nd/3rd-level relationship next to each person's name?

I recently botched a job interview by poorly answering a straightforward question: how do sites like LinkedIn efficiently show the relationship distance (1st/2nd/3rd) from you to every person displayed on a page (e.g. in people search results, list of people working in a company, etc.)? <EDIT> I got the essential "trick" of the solution...

C: Looping without using looping statements or recursion

I want to write a C function that will print 1 to N one per each line on the stdout where N is a int parameter to the function. The function should not use while, for, do-while loops, goto statement, recursion, and switch statement. Is it possible? I want to find an answer to this as this a challenge question ...

C++ interview preparation

I have a Phone interview coming up next with with a company which works in financial software industry. The interview is mainly going to be in C++ and problem solving and logic. Please tell me the method of preparation for this interview. I have started skimming through Thinking in C++ and brushing up the concepts. Is there any other way...

5 ways to use the static keyword in Java

I just had an interview where one of the questions was something like "Describe 5 ways to use the static keyword in Java." I could only think of 2 on the spot, and afterwards I found 2 more. What is the 5th? Declaring a field belonging to a class as opposed to an instance of the class. Declaring a method that can be called on a class...

How to write an evaluator for a string like "(1+3 * ( 5 / 4)) and get a numeric result.

hi, this is a interview question i am confused about its solution, i am thinking that i need stacks to push and pop these operators and operands, but do i need two stacks, one for operator and one for operands? or would just one stack do?i think we need two stacks but is there any way to solve using one stack? also i am bit confused ho...

Find the Smallest Integer Not in a List

An interesting interview question that a colleague of mine uses: Suppose that you are given a very long, unsorted list of unsigned 64-bit integers. How would you find the smallest non-negative integer that does not occur in the list? FOLLOW-UP: Now that the obvious solution by sorting has been proposed, can you do it faster than O(n lo...