## Friday, December 31, 2010

### What is MULTIORG in oracle apps?

application implementation maintaining multiple organizations and multiple set of books.

We will have Multiorg tables (table which is ending with _ALL). When ever we enter the

data, which will be stored in the Multiorg tables only.

Ex: OE_ORDER_HEADERS_ALL

OE_ORDER_LINES_ALL

PO_HEADERS_ALL

PO_LINES_ALL

### What is the difference between org_id and organization_id?

ORG_ID is used to distinguish the data of different business organizations.

ORGANIZATION_ID is used to identify the items belongs to which inventory organization

it has assigned.

### What is the API to set the org_id value?

value from the backend, so that system will retrieve the data from the database which is

related to mention the organization.

Syntax: Begin

FND_CLIENT_INFO.SET_ORG_CONTEXT(ORG_ID);

end;

EX: Begin

FND_CLIENT_INFO.SET_ORG_CONTEXT(128);

end;

### What are types of docs in Oracle Apps?

2. MD 070 -- Technical Document designed by the technical consultant.

3. MD 020 -- Technical document designed by the functional document.

4. MD 0120 -- Migration and user training document by the technical consultant.

5. CV 040 -- Conversion of the functional document by the functional consultant.

6. CV 060 -- Conversion of the technical document by the technical consultant.

### Given numbers 1-n where one of the numbers is repeated. find the repeated number[amazon]

For each number go to that index and make the number negative like

for 1 a[1] = -1

2 a[2] = -2

Next time when you do check a[2] already the number is negative it means that number is repeated

And the index of the number which is not negated is missing number

### How do you know whether a tree is binary search tree or not? [ Microsft]

### [Microsoft]

now among the even numbers, they should be sorted and among the odd numbers they should be sorted

## Thursday, December 30, 2010

### Why cant we approve purchase order even if hierarchy and approver also set?

### What are status of RFQ?

### when the purchase requisition status will go under In-process status?

### [Google]

2. Ctrl+A

3. Ctrl+C

4. Ctrl+V

If you can only press the keyboard for N times (with the above four keys), please write a program to produce maximum numbers of A. If possible, please also print out the sequence of keys.

So the input parameter is N (No. of keys that you can press), the output is M (No. of As that you can produce

### Interview Question

A pipe can fill a tank in 12 minutes and another pipe in 15 minutes, but a third pipe can empty it in 6 minutes. The first two pipes are kept open for 5 minutes in the beginning and then the third pipe is also opened. In what time is the cistern emptied?

a. 30 minutes

b. 35 minutes

c. 40 minutes

d. 45 minutes

### 8 Children and 12 men complete a work in 9 days. Each child takes twice the time taken by a man. In how many days will 12 men finish the same work?

a. 10 days

b. 11 days

c. 12 days

d. 13 days

### Interview Question

In a box carrying one dozen of oranges, one-third has become bad. If 3 oranges are taken out from the box at random, what is the probability that at least one orange out of the three oranges picked up is good?

### How many different 2-member teams can be selected for playing tennis out of 4 ladies and 3 gentlemen there being one lady and one gentleman on each team?

a. 70

b. 74

c. 72

d. 73

## Wednesday, December 29, 2010

### Horses Problem: Find the minimum number of races to find the top 3 horses given 25 horses and 5 horses can race in a race?

divide into 5 groups : find the top 5 horses in each group-> 5 races

race the five horses of the 5 groups->1 race(This results in 6 horses left for 3 positions)

final race (Total = 5+1+1 races)

### Classic – Egg Problem

You are given 2 eggs.You have access to a 100-storey building.

Eggs can be very hard or very fragile means it may break if dropped from the first floor or may not even break if dropped from 100 th floor.Both eggs are identical.You need to figure out the highest floor of a 100-storey building an egg can be dropped without breaking.

Now the question is how many drops you need to make. You are allowed to break 2 eggs in the process.

## Tuesday, December 28, 2010

### Find the minimum element in binary search tree

Given a non-empty binary search tree (an ordered binary tree), return the minimum data value found in that tree. Note that it is not necessary to search the entire tree. A maxValue() function is structurally very similar to this function. This can be solved with recursion or with a simple while loop.

## Monday, December 27, 2010

### check whether two binary trees are identical

Given two binary trees, return true if they are structurally identical -- they are made of nodes with the same values arranged in the same way.

### create a double tree for given binary tree

For each node in a binary search tree, create a new duplicate node, and insert the duplicate as the left child of the original node. The resulting tree should still be a binary search tree.

### Print the mirror of the binary tree

### Print paths of the binary tree

Given a binary tree, print out all of its root-to-leaf paths as defined above. This problem is a little harder than it looks, since the "path so far" needs to be communicated between the recursive calls.

### Find maximum depth of the tree

Given a binary tree, compute its "maxDepth" -- the number of nodes along the longest path from the root node down to the farthest leaf node. The maxDepth of the empty tree is 0, the maxDepth of the tree on the first page is 3.

### Given a binary tree, count the number of nodes in the tree.

Find the number of nodes in the tree

### Find depth or height of tree

`tree_height(mynode *p)`

{

if(p==NULL)return(0);

if(p->left){h1=tree_height(p->left);}

if(p=>right){h2=tree_height(p->right);}

return(max(h1,h2)+1);

}

## Sunday, December 26, 2010

### Procure to Pay cycle

1. Creating Requisition

2. Creating Purchase Order

3. Creating Receipt

4. Creating Invoice in AP

5. Paying the Invoice

6. Transfer, Import and Post to GL

### Given a string S of words and no of character per line m ,with m being greater than the longest word in S,print S in a set of lines so that each line contains no more than m characters and no word split between 2 lines.

### Given an infinite stream of bits with the bits being appended at the highest significant position. give an algorithm to to say whether the number formed by using the sequence of bits that had been processed till then, is divisible by 3 or not?

### There are 2 sorted arrays A and B of size n each. Write an algorithm to find the median of the array obtained after merging the above 2 arrays(i.e. array of length 2n). Full points are given for the solution bearing efficiency O(log n). Partial points for the efficiency O(n).

### There is a temple, whose premises have a garden and a pond. It has 4 idols, each of Ram, Shiv, Vishnu and Durga. The priest plucks x flowers from the garden and places them in the pond. The number of flowers doubles up, and he picks y flowers out of them and goes to offer it to Lord Ram. By the time he reaches to the pond, he finds the remaining flowers also have doubled up in the meantime, so he again picks up y from the pond and goes to Lord Shiv.This process is repeated till all the Gods have y flowers offered to them, such that in the end no flower is left in the pond. Find x and y.

### I have an array consisting of 2n+1 elements. n elements in it are married, i.e they occur twice in the array, however there is one element which only appears once in the array. I need to find that number in a single pass using constant memory. {assume all are positive numbers}

### I have a file in which there are supposed to be 4 billion numbers, starting from 1 to 4,000,000,000 but unfortunately one number is missing,i.e there are only 3,999,999,999 numbers, I need to find the missing number. In this question he asked me concepts like fopen, what will be the size of such a file and how such a big file will get loaded into RAM,and also concepts of logical/virtual/physical memory and memory paging.

### Types of Invoices in Oracle Apps

1) Standard – For all the normal payments we will crate this.

2) Prepayment - Advance Payment to the supplier based on the requirement.

3) Credit Memo - If supplier give the discount - for negative amount

4) Debit Memo - If company is going to deduct the amount - for negative amount

5) With holding tax – if supplier is not recognized, the on be half of the supplier company

will pay the tax.

6) PO Default - We will give the PO number according to that it will generate the

Invoices.

7) Recurring Invoices – WE will generate the Invoices multiple times for fixed supplier, fixed

amount, fixed duration.

8) Expense Report – Employee expenses

9) Quick Match – 2 Way, 3 Way, 4 Way

10) Mixed Invoice – Miscellaneous expenses