# Adobe Interview | Set 6 (On-campus for MTS-1)

I would like to thank the entire Geeksforgeeks team, whose contribution has helped me a lot in my preparation for the interviews and getting placed at Adobe. No of rounds: 1 apti + 1 written + 4 PI Aptitude Round: 1 hr 15 questions on Analytical Ability, 30 questions on Data Interpretation and Quantitative Ability Written Round: 2 hrs 10 questions on Algorithms and OS, 10 questions on output of C/C++ code snippets PI Rounds- 1st Round: 45 minutes 1. Implement a queue using 2 stacks( average time complexity O(1) for push and pop ) 2. Discussion regarding demand paging. Then the interviewer asked me to give a detailed implementation of demand paging, using object-oriented approach, considering everything from page tables to swap disk I/O to page replacement policies. 2nd Round: 45 minutes 1. This round started with a puzzle: There are two buckets- one having 100L water and another having 50L milk. A spoonful of water is taken from 1st bucket and added to 2nd bucket and the mixture is stirred, now a spoonful of the mixture is taken from the 2nd bucket and added to the 1st. Compare the final volume of milk in 1st bucket to the final volume of water in 2nd bucket. 2. Defective ball puzzle: Find defective ball among 7 balls using minimum no of measures. 3. A system sends multiple queries to find all primes between two given numbers. Provide service to each query in less than O(p) time(p is total no of primes) Solution: Perform Sieve of Eratosthenes initially and maintain list of primes. For incoming queries, use binary search to find first and last primes between given numbers. 4. A modification of Towers of Hanoi problem: Consider 3 towers A(source), B(auxiliary), C(destination) and n discs. All usual constraints of the original problem hold true, but a new constraint is added: No disc(s) can be moved directly from A to C or from C to A, B has to be used in between. Solution: For n discs and towers A,B,C as source, auxiliary and destination respectively, consider the following function:
```Move(n discs, A,B,C)
{

If(n==1) print(nth disc, A->B->C);

Else
{

Move(n-1 discs, A,B,C);

print(nth disc, A->B);

Move(n-1 discs, C,B,A);

print(nth disc, B->C);

Move(n-1 discs, A,B,C);

}
}```