## Software Engineer / Developer Interview Questions

- 0of 0 votes
Difference between a crash and exception.

Difference between macros and inline functions.

Mfc: message maps and virtual functions.

Different calling convention.

Late n early binding...

Garbage collector algorithm. When gc will fail to clean the memory.

How to know heap size, crash dump analysis, What is a stack n how to know stack memory size.

Commands in windbg.

Questions on Critical section, mutex, semaphores. Can we use mutex in single process and how?

Working of MSIL and JIT COMPILER.

Can a C# code, use c++ code and call kernel functions like createfile.

Areas: dot net, oops, operating systems, thread synchronization.

Difference in execution steps of c++ and c# code

- 1of 1 vote
Given a array

{{ 4,7,3,6,7}}

construct a triangle like

{{81}}

{{40,41}}

{{21,19,22}}

{{11,10,9,13}}

{{ 4,7,3,6,7}}

- 1of 1 vote
Find the largest sum contiguous sub array. The length of the returned sub array must be at least of length 2.

- 0of 0 votes
Problem Linkï¼šhttps://code.google.com/codejam/contest/4214486/dashboard#s=p1

At new years party there is a pyramidal arrangement of glasses for wine. For example, at the top level, there would just be one glass, at the second level there would be three, then 6 and then 10 and so on and so forth like the following image

.

The glasses are numbered using 2 numbers, L and N. L represents the level of the glass and N represents the number in that level. Numbers in a given level are as follows:

Level 1:

1

Level 2:

1

2 3

Level 3:

1

2 3

4 5 6

Level 4:

1

2 3

4 5 6

7 8 9 10

Each glass can hold 250ml of wine. The bartender comes and starts pouring wine in the top glass(The glass numbered L = 1 and N = 1) from bottles each of capacity 750ml.

As wine is poured in the glasses, once a glass gets full, it overflows equally into the 3 glasses on the next level below it and touching it, without any wine being spilled outside. It doesn't overflow to the glasses on the same level beside it. It also doesn't overflow to the any level below next level (directly).

For example: When the glass of L = 2 and N = 2 overflows, the water will overflow to glasses of L = 3 and N = 2, 4, 5.

Once that the bartender is done pouring B bottles, figure out how much quantity in ml of wine is present in the glass on level L with glass number N.

Input

The first line of the input gives the number of test cases, T. T test cases follow. Each test case consists of three integers, B, L, N, B is the number of bottles the bartender pours and L is the glass level in the pyramid and N is the number of the glass in that level.

Output

For each test case, output one line containing "Case #x: y", where x is the test case number (starting from 1) and y is the quantity of wine in ml in that glass.

- 0of 0 votes
What is memory alignment in terms of compiler

- 0of 0 votes
what are types of memory issues one faces

- 0of 0 votes
Write a program to find 2 complement of number

- 0of 0 votes
How can we divide a large file between multi threads to process it? If we are running a multi threaded application and input is a large file and we have to provide each thread a part of the file to make it fast. How we can achieve it in java?

- 0of 0 votes
Design an algorithm that, given a set S of n integers and another integer x,

determines whether or not there exist k (n>k>2) elements in S whose sum is

exactly x. Please give the running time of your algorithm

- -1of 1 vote
There is an array of 3-tuple, in the form of (a, 1, 5). The first element in the tuple is the id, the second and third elements are both integers, and the third is always larger than or equal to the second. Assume that the array is sorted based on the second element of the tuple. Write a function that breaks each of the 3-tuple into two 2-tuples like (a, 1) and (a, 5), and sort them according to the integer.

E.g. given (a, 1, 5), (b, 2, 4), (c, 7, 8), output (a, 1), (b, 2), (b, 4), (a, 5), (c, 7), (c, 8).

- 0of 0 votes
Consider a MxN matrix. You are given a start element(index) and an end element. The question is to find a path from start to end. Please note that in some blocks 'X' is marked which means your path cannot go through that element. My solution was to have a tree with 4 nodes (top/left/right/bottom) and recursively check if there is a path from start to end.

- 4of 4 votes
Given three arrays A,B,C containing unsorted numbers. Find three numbers a, b, c from each of array A, B, C such that |a-b|, |b-c| and |c-a| are minimum

Please provide as efficient code as you can.

Can you better than this ???

- 0of 0 votes
1. If we have 2 column in table, user id and date which user has logged in. How can we find the user id who has logged in most. means max number of time.

- 0of 0 votes
Given an array of positive and negative numbers(no zeroes),i have to arrange them in such a way that the positive and negative numbers should be arranged consecutively.The number of positive and negative numbers may not be equal i.e. if there is no positive number(or negative) left,then all the remaining negative numbers(or positive) are appended to the end of the array.The order is important i.e.if input array is { 2,-1,-3,-7,-8,9,5,-5,-7},then the output array should be {2,-1,9,-3,5,-7,-8,-5,-7}.The code is done in O(n) without using another array.I came up with a solution in which i chose 0 as pivot element and separate the numbers (using quicksort) but in this case the order is not preserved.

- 0of 0 votes
How can we get square of a number without using * or carrot sign.

- 0of 0 votes
Write a query which return 5 persons who had spent most from a table and table contains customer id, product id and expenses. Customer id can be duplicate.

- 0of 0 votes
There is 3 text file, like file1.txt, file2.txt etc. Every file contains customer id, product id and expenses. Now write java code which will return 5 persons who spent most in these three files. Customer id can be duplicate all over files.

- 0of 0 votes
How can we get the square of a number without using * or carrot sign.

- 0of 0 votes
Design a thread safe hash table from ground up.

Follow up question: How do you design it without using any locks.

- 1of 1 vote
Given a doubly linked list, copy the list.

Edit:

Struct node{

node *pNext;

node *pPrev;

node *pRandom;

};

pRandom has connection to any random nodes.

Write a program to clone this list.

- 0of 0 votes
what all design patterns are used in designing a shopping cart and explain?

- 0of 0 votes
How do you normalize shopping cart tables?

- 0of 0 votes
Password storage rather than storing in DB.

- 0of 0 votes
How the tables are stored(different tables structure)

- 0of 0 votes
Design a shopping cart.

- 0of 0 votes
You have the following function:

F(m, n) = F(m-1, n-1) + F(m, n-1)

m, n - positive integer numbers > 0

F(1, n) = 1

F(m, 1) = 1

You need to write this function. The problem is that if x=1000000 and y=1000000, for instance, the number of recursive calls will be extremely large.

- 0of 0 votes
You are given a list of items / combo_items with their price list.

And you are given list of items to buy.

Now you are asked to find which combination to buy so that it costs you minimum.

It doesnt matter if you are getting some extra items if it costs less.

Sr.No Price | Items/Combo_Items

1. 5 | Burger

2. 4 | French_Frice

3. 8 | Coldrink

4. 12 | Burger, French_Frice, Coldrink

5. 14 | Burger, Coldrink

Input Items to Buy:

Coldrink

Output(Sr.No)

3

Input Items to Buy:

Burger Coldrink

Output(Sr.No)

4

Input Items to Buy:

Burger French_Frice

Output(Sr.No)

1,2

- 0of 0 votes
Suppose you are a software vendor and you need to provide your API to a customer, but you don't want to give your source code. How would you do it?

- 0of 0 votes
Suppose you are a software vendor and you need to provide your API to a customer, but you don't want to give your source code. How would you do it?

- 0of 0 votes
There is a file contains the digital number characters:

`_ _ _ |_| |_ | | |_| |_| |_|`

Each digital number contains 3x3 characters, read this file and output the int type number: 8 6 0