## Adobe Interview Questions

- 0of 0 votes

AnswerHow can you implement oops features in C?

- anonymous February 18, 2014 in India| Report Duplicate | Flag | PURGE

Adobe Member Technical Staff Object Oriented Design - -3of 3 votes

Answerswhy will the code show error when tried to compiled

below given is a C program snippet to get height of a binary tree.`int height (struct node * root) { if(root=NULL) return 0; else { return max(height(root->left), height(root->right))+1; } } int max(int a,int b) { return ((a>b)?a:b);`

}

- gdg February 13, 2014 in United States| Report Duplicate | Flag | PURGE

Adobe Algorithm - 1of 1 vote

AnswersTo find loop in a circular linked list, we generally move two pointers , one with speed of one move at a time and other at two at moves at a time. Why do we use ratio 2:1. What can be the best ratio of speed to find a loop in linked list

- NIC January 30, 2014 in India| Report Duplicate | Flag | PURGE

Adobe Member Technical Staff Problem Solving - 1of 1 vote

AnswersGiven N,find all a and b combination which satisfies a^3 + b^3 = N

- NIC January 30, 2014 in India| Report Duplicate | Flag | PURGE

Adobe Member Technical Staff Algorithm - 0of 0 votes

AnswersGiven a rectangular grid of N*M (1-based indexing) in which their are k monsters on k different cells.Now we need to answer Q queries in which we will be given lowest row number(L) and highest row number(H) we need to tell maximum area of rectangle between those rows that don't have a monster.(Here area of rectangle means count of cells only)

- justhack4fun688 January 05, 2014 in India

Example : Say we have a grid of 4 * 5 (mean n=4 and m=5) and monsters are located on 7(=k) cells which are (1,3) , (1,4) , (2,1) , (2,4) , (3,2) , (4,1) , (4,2) and let we have 1 query in which L=3 and H=4 then the maximum area is 6 here.

Now if the queries are very large say 10^6.Then how to tackle this problem.Is their any dynamic approach or so for doing it?| Report Duplicate | Flag | PURGE

Adobe Software Development Manager - -1of 3 votes

AnswersGiven an undirected graph with n vertices and m edges. How to check for perfect matching in the graph.(Perfect matching means each vertex has degree 1).Provide a code in c++.

- justhack4fun688 January 03, 2014 in United States| Report Duplicate | Flag | PURGE

Adobe Software Development Manager Algorithm - -1of 1 vote

AnswersI want to calculate number of DISTINCT palindromic substrings in a string.How to do it?

- justhack4fun688 December 11, 2013 in India

Like if aba is string the their are 3 distinct palindromic subsrings:{a,aba,b}

length of string could be 10^5 range.So i dont think O(n^2) solution will work.So the interviewer required some better algorithm.But i know only O(n^2) one.| Report Duplicate | Flag | PURGE

Adobe Software Engineer / Developer Algorithm - 0of 0 votes

AnswersHow to convert binary tree to BST inplace.?

- rahul23111988 December 05, 2013 in United States

P.S. shape of binary tree should be same after converting it into BST| Report Duplicate | Flag | PURGE

Adobe Member Technical Staff Algorithm - 0of 0 votes

AnswersSuppose we have two functions void g() and void h(). The function h() has been called somewhere in the body of g(). Now using a debugger, we find that that the program crashes as soon as the return statement in h() ( at the end of function h() ) is executed. There is nothing syntactically wrong with the program. How will you debug the code ?

- Rahul Sharma November 25, 2013 in India| Report Duplicate | Flag | PURGE

Adobe SDE-2 Compiler - 0of 0 votes

AnswersStarting and ending co-ordinates of one-dimensional line segments are given. Find the co-ordinates of longest line segment that can be formed from these segments. Write two functions addSegment() and findMaxSegment(). He asked to write a perfect C code.

- Rahul Sharma November 24, 2013 in India| Report Duplicate | Flag | PURGE

Adobe Intern Algorithm - -1of 1 vote

AnswersGiven: left bottom and right top coordinates of a rectangle.

- code123 October 27, 2013 in India

n numbers of rectangle ceated holes.Find the area of holes.

eg.one rectangle in in top ,second intersect with the first at right and simillarly third at left and forth at bottom.It creates a hole in between.Find the area of the hole.| Report Duplicate | Flag | PURGE

Adobe Software Engineer / Developer Algorithm - -9of 9 votes

Answerssolve (x-1)(x-9)=8;

- code123 October 27, 2013 in India| Report Duplicate | Flag | PURGE

Adobe Software Engineer / Developer Algorithm - 0of 0 votes

Answersthere are N number of matchboxes numbered 1...N.each matchbox contain various number of stick.Two player can alternatevely pick some amount of stick from the higest stick containing box . The player is condidered win if there is no stick after his move.Find the final move so that the move player win.

- code123 October 27, 2013 in India

Note:In case the number of stick is equal ,pick the stick from the higest numbered box.

eg: 3 box contain stick as:1,1,1.

if u take 1 stick from 3rd numbred box you will any how win the match.| Report Duplicate | Flag | PURGE

Adobe Software Engineer / Developer Algorithm - 0of 0 votes

AnswersYou are given a grid of numbers. A snake sequence is made up of adjacent numbers such that for each number, the number on the right or the number below it is +1 or -1 its value. For example,

- therethere October 15, 2013 in United States

1 3 2 6 8

-9 7 1 -1 2

1 5 0 1 9

In this grid, (3, 2, 1, 0, 1) is a snake sequence.

Given a grid, find the longest snake sequences and their lengths (so there can be multiple snake sequences with the maximum length).| Report Duplicate | Flag | PURGE

Adobe Algorithm - 0of 0 votes

Answersvalid Number-- A number is called valid if it satisfies as in following example:

- therethere October 13, 2013 in United States

A=1248 then products when taken 1,2,3,and 4 at a time are:

1,2,4,8,2,8,32,8,64,64(1,2,3,4,1*2,2*4,4*8,1*2*4,2*4*8,1*2*4*8)

if all these numbers are unique the number is valid here the number is not valid.| Report Duplicate | Flag | PURGE

Adobe - 0of 0 votes

AnswersFibonacci Numbers: A number is said to be Fibonacci number if it follows the fibonacci property. (Ex: 112, 1123, etc). But additionally, it need not necessarily start with 1, as with the normal fibonacci series. So, in this new definition, 112(1,1,2) is a fibonacci number and so is 121224(12,12,24), and so is 252550(25,25,50). So, given any two numbers as input, print out all the Fibonacci Numbers within that range..

- therethere October 11, 2013 in United States| Report Duplicate | Flag | PURGE

Adobe Applications Developer Algorithm - 0of 4 votes

Answersa word is valid if the letters follow their natural order in it. abcd is valid, acde is valid aaaa is valid, acb is not valid. condition for valid: char1<=char2<=char3<=… given a length n find all valid words of length n.

- therethere October 06, 2013 in United States| Report Duplicate | Flag | PURGE

Adobe Algorithm - 0of 0 votes

AnswersL = { <M> | there is at least one input string on which the Turing machine M does not halt}

- anshul221 September 26, 2013 in United States

Here, for a Turing machine M, the notation <M> denotes an encoding, oversome alphabet, of the code of the Turing machine.to

which of the following language classes does L belong:

(1) Regular.

(2) Context-free but not Regular.

(3) Recursive but not Context-free.

(4) Recursively enumerable but not recursive.

(5) Not recursively enumerable.| Report Duplicate | Flag | PURGE

Adobe Intern Automata - 0of 0 votes

AnswersFind lowest common ancestor of two nodes in a binary tree iteratively. Root in the binary search tree is not given.

- guptasunny158 August 10, 2013 in India| Report Duplicate | Flag | PURGE

Adobe Computer Scientist Algorithm - 0of 0 votes

AnswersWrite a program to find if sum of any two numbers of array is equal to SUM(given as argument). return 1 if it exists else return 0.

- Joey August 10, 2013 in India| Report Duplicate | Flag | PURGE

Adobe - 0of 0 votes

AnswersAn integer n ending with 3 always has a multiple with all 1's. For example 3 has a multiple 111111, 23 has a multiple 11...11. Write a function that takes an integer n and returns string which is the smallest multiple of the n with all 1s

- Joey August 10, 2013 in India| Report Duplicate | Flag | PURGE

Adobe C - 0of 0 votes

AnswersGiven a directed labelled graph in form of a knowledge base, and a query, write a parser which can return the edges and/or nodes requested in the query. (Knowledge base and queries are not case sensitive)

Knowledge base is given as input in a text file (input.txt).

For example a DAG can be represented as:

And the corresponding knowledge base for this DAG is :`(<Shelden>, <hasFriend>, <Raj>) (<Shelden>, <hasFriend>, <Leonard>) (<Shelden>, <worksAt>, <Caltech>) (<Leonard>, <worksAt>, <Caltech>) (<Raj>, <worksAt>, <Caltech>) (<Raj>, <age>,“30”) [Here 30 is a number and no edge can go out from this node while others like Nabraska, New_Delhi are entities, which can have further outgoing links.] (<Leonard>, <hasFriend>, <Penny>) (<Penny>, <bornIn>, <Nabraska>) (<Raj>, <bornIn>, <New_Delhi>)`

A query can be written as :

Find persons who are friends?

Test case 1 : Select ?person1 ?person2 where { ?person1 <hasfriend> ?person2. }

The goal is to fill all the variable represented by ? with their values from knowledge base and return in csv format:

The result of this query is:

Person 1 Person 2

Shelden Raj

Shelden Leonard

Leonard Penny

The similar query can be extended to have joins also:

- abhishek.vk88 August 10, 2013 in United States`Find persons who are friends with Sheldon and the company/colleges to which his friends belong? Test Case 2 : Select ?person ?university where { <Sheldon> <hasFriend> ?person . ?person <worksAt> ?university. } Person University Leonard Caltech Raj Caltech Test Case 3 : Select ?person1 ?person2 where { ?person1 <worksAt> <Caltech> . ?person2 <bornIn < Nabraska> . ?person1 <hasFriend> ?person2 .} Person 1 Person 2 Leonard Penny Test Case 5 : select * where {} Output : Parse Error How to approach this problem?`

| Report Duplicate | Flag | PURGE

Adobe Developer Program Engineer Algorithm Java - 1of 9 votes

AnswersGiven one egg and a building with infinite number of floors. Find out minimum number of throws at which (least) floor egg will break, if thrown?

- Nitin Gupta July 19, 2013 in India for Illustrator

I said we have to start at floor 1 and keep incrementing and testing by moving 1 floor up. Then he said optimize it by minimizing no of throws. I could not find more optimal way. I told him that I know with problem with 2 eggs and finite floor building.

Then, he told me that now lets there are 2 eggs and infinite floor building, find minimum no if throws required to find least floor at which egg breaks.

I still could not do that for infinite floors.| Report Duplicate | Flag | PURGE

Adobe Member Technical Staff Brain Teasers - 0of 0 votes

AnswersYou have 100 coins which needs to be distributed among 3 beggars A, B, C. In how many ways you can distribute these 100 coins to all the 3 beggars. Constraint: A cannot have more than 75 coins, B cannot have more than 50 coins, C cannot have more than 25 coins. Write complete code covering all the edge cases. Also suggest test cases.

- Stupid Developer July 08, 2013 in India| Report Duplicate | Flag | PURGE

Adobe Developer Program Engineer Algorithm - 0of 0 votes

AnswersName a data structure that can replicate a cache and why do you think so

- 3139a1m July 07, 2013 in United States| Report Duplicate | Flag | PURGE

Adobe Intern - 0of 0 votes

AnswersThere is a Blank Paper Sheet, Given a list of characters and their sizes,

- amitesh.hbti June 20, 2013 in India

for ex. A, P, O, N, Q with different font sizes and designs.

Now we need to cut characters from given sheet of paper of all sizes

atleast once. And also try to maxmize number of characters cut. Along with

this, when you remove a character, rest paper is more or less like a rough

sheet left. So we should try to minimize that rough sheet size as well.

Write Algo for this. Provide Data Structure, Complexity of algorithm.| Report Duplicate | Flag | PURGE

Adobe MTS - 0of 0 votes

Answershow to solve this ((3000000!)/(30!)^100000)%(any prime no.) in C++

- 3139a1m June 14, 2013 in India| Report Duplicate | Flag | PURGE

Adobe Intern C++ - 0of 0 votes

AnswersBy default, Hashtable is unordered. Then, how can you retrieve Hashtable elements in the same order as they are put inside???

- amit.grynch May 30, 2013 in United States| Report Duplicate | Flag | PURGE

Adobe Applications Developer Java

**CareerCup**is the world's biggest and best source for software engineering interview preparation. See all our resources.

Open Chat in New Window