interview-questions

Interview Question on .NET Threading

Could you describe two methods of synchronizing multi-threaded write access performed on a class member? Please could any one help me what is this meant to do and what is the right answer. ...

What questions should every good JavaScript developer 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 JavaScript Developer. What questions do you think should a good JavaScript programmer be able to respond to? EDIT : I am markin...

Questions every good Database/SQL 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 Database/SQL Developer. What questions do you think should a good Database/SQL programmer be able to respond to? EDIT : I am ma...

How does this pointer arithmetic work?

#include <stdio.h> int main(void){ unsigned a[3][4] = { {2,23,6,7}, {8,5,1,4}, {12,15,3,9} }; printf("%u",*((int*)(((char*)a)+4))); return 0; } The output in my machine is the value at a[0][1] i.e 23.Could somebody explain how is this working ? Edit: Rolling Back to old yucky code,exactly what was presented to me :P ...

Sorting digits of an integer

You are given an integer 51234 (say) we need to sort the digits of a number the output will be 12345. How to do it without using array ? ...

Junior Developer Interview Questions

I'm a junior c# web developer preparing for my first interview. What kinds of things/topics should I be expected to know? ...

c programming puzzle

Given an array all of whose elements are positive numbers, find the maximum sum of a subsequence with the constraint that no 2 numbers in the sequence should be adjacent in the array. So 3 2 7 10 should return 13 (sum of 3 and 10) or 3 2 5 10 7 should return 15 (sum of 3, 5 and 7). I tried it using all possible allowed sums and then fin...

Questions every good web UI developer should be able to answer

By "web UI developer", I mean someone whose primary job is to craft pages using HTML, CSS and JavaScript. They should probably be able to learn enough PHP or Rails or something to get by when creating pages that draw their information from a more sophisticated back-end, e.g., <div>Your <?=$subscription['title']?> Subscription</div> Th...

In C, copying of array like this is not possible. Why? and best hack

int x[10],y[10]; x = y; I am thinking of a simple hack, which would enable me to get this effect. ...

An efficient way that deletes specified characters from a string

For example, given a str of "Stackoverflow is for every one" and remove of "aeiou", the function should transform str to "Stckvrflw s fr vry n". I have one char array of string: str[] and one char array of chars to be removed:remove[] My Solution: Loop str[] looking for each in character in remove[]. Shift str[] one place left every-t...

Intersection of two linked lists

Given two sorted linked lists, L1 and L2, a solution to compute their intersection L1 intersection L2. ...

Find the longest repeating string and the number of times it repeats in a given string

For example, given string "abc fghi bc kl abcd lkm abcdefg", the function should return string "abcd" and the count of 2. A O(n^2) solution seems easy but I am looking for a better solution. Edited: If nothing better than O(n^2) is possible than which approach would be best performance wise. ...

select only first letters of words from a varchar field.

Hi, I was asked in an interview,a question from oracle sql.this seemed to be a simple question but i had no clue to answer.could anybody help? if there is string like "newyork is a beautiful city" in a colum. select column_name from table_name; will result newyork is a beautiful city what is the query required to give the output...

convert big endian to little endian in C [without using provided func]

I need to write a function to convert big endian to little endian in C. I can not use any library function. ...

Is it possible to call a C function, given its name as a string?

I saw this question in one of the C puzzles!! Is this really possible? How can I call a function, given its name as a string? is it possible to use string that is read with scanf be used directly to call a function? i already have thought of if(strcmp(str,"string"))then call the function. but is there any other approach? ...

How to guard against memory leaks?

I was recently interviewing for a C++ position, and I was asked how I guard against creating memory leaks. I know I didn't give a satisfactory answer to that question, so I'm throwing it to you guys. What are the best ways to guard against memory leaks? Thanks! ...

An interview question

Given a linked list of T size , select first 2n nodes and delete first n nodes from them; Then do it for the next 2n nodes and so on... For example- Let's consider a linked list of size 7: `1->2->3->4->5->6->7` If n = 2, the desired output is : `1->2->5->6->7` I didn't understand what this problem is actually indicating.Could...

array of N pointers to functions returning pointers to functions.....

This was asked to me in an interview! i really got confused How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters could anybody please help? ...

Java recruitment test?

I have just applied for a Java developer job and the recruiter told me he wanted me to take an online Java test to see how my Java knowledge was. Fact questions with multiple answers. Does anyone have idea what site it could be? Tips on what should i prepare? -- So, i got to make this test: Java 2 - Non-GUI Which consisted of questi...

Find SmallestInt : Smallest integer greater than or equal to n that contains exactly k distinct digits(given values of n and k)

Hi guys, I found this on the internet. It looks good an interview question. I guess I got the working correct but programatically I haven't tried it. SmallestInt You are given an integer n. Return the smallest integer greater than or equal to n that contains exactly k distinct digits in decimal notation. Definition ...