Adobe Interview Experience | 4 Years Experienced
Technical Round(1 hr): C++ problems asked in this round
- C++ Output-Based problems:
C++
classBase{public:Base(){cout<<"base called ";}};classDerived{Base b;public:Derived(){cout<<"derived called\n";}};intmain(){Derived d;return0;}What will be the output and why?
- new and delete concept related problem. Print output in below code
C++
classDerived {intid;public:Derived(intid){this->id = id;cout <<"derived const for id:"<< id;}~Derived() { cout <<"derived dest. for id"<< id; }};intmain(){Derived d(5);Derived* d1 =newDerived(10);deleted1;return0;} - Override concept related question
C++
classBase{public:voidshow(intx){cout<<"base called x="<<x<<endl;}};classDerived:publicBase{public:voidshow(floatx){cout<<"derived called x="<<x<<endl;}};intmain(){Derived d;d.show(10);//which func. will be called?d.Base::show(10);//also asked to write code to call to Base class show func.return0;} - Ref concept related problem. Complete following code, so that instance of class A can be created correctly.
C++
classA {int& m_ref;};intmain() {A a;return0;} - We need to create our own string class, which should behave similar to c++ string class. Write all necessary constructors and destructor for that.
- Also asked when initialization list should be used and when not?
- What’s the need to move semantics?
- https://medium.com/swlh/write-your-own-c-stl-string-class-e20113a8de79
Technical Round 2 (1hr 30 mins):
- Empty class concept program. Will below prog. work fine?
C++
classA {};intmain(){A a1;A* a2=newA();// as size of empty class object is 1// byte. So, it should be deallocated alsoreturn0;} - Given an array and k. find minimum no. of corner elements required to make their sum=k
arr[]={1,2,3,4,6,2,3,1} k=6ans=3
First told brute force approach of backtracking. O(pow(2,n));
I provided solution similar to approach discussed here: https://www.geeksforgeeks.org/maximize-sum-of-k-elements-in-array-by-taking-only-corner-elements/
- https://leetcode.com/problems/course-schedule-ii/
Asked about space and time complexity.
https://www.geeksforgeeks.org/topological-sorting-indegree-based-solution/
Also, asked about dif. b/w BFS and DFS
Technical Round 3 (1 hr):
- https://www.geeksforgeeks.org/sort-array-converting-elements-squares/. Told optimised approach to solve this
- https://www.geeksforgeeks.org/check-if-a-word-exists-in-a-grid-or-not/ I solved it using visited array. Interviewer asked about space and time complexity.
I told time complexity->(n*m)^2,
space complexity->n*m due to visited matrix. Asked to solve problem without using visited matrix.
- Asked about lamda expressions.
Asked If I do know about callback, in my company projects, if I have ever used callback.
Then he asked to complete a class implementation
C++
classSignalDispatcher{public://callbackFunc is lamda expr of format [](mystrut data){}voidon(string eventName, std::function<void(mystruct)> callbackFunc)//call all callbacks with this eventname and put data as argumentvoidtrigger(string eventName, mystrut data)};Told hashmap and vector approach to store callbacks and then call them
Also, asked to tell unit test cases for this code.
- Implement own generic vector class with 3 funcs push_back(), pop_back(), size()
Managerial Round 1 (~1hr 20 mins):
- Write a macro to find max of 3 numbers.
Asked about pros and cons of Macros. https://www.geeksforgeeks.org/macros-vs-functions/
considering cons of macros, is there any other way to skip context switching? inline functions
- Output based problem
C++
inta[6] = {0, 1, 2, 3, 4, 5};cout<<a[0];cout<<1[a];cout<<*(a+2);cout<<*(3+a):cout<<*a+4;cout<<a[-1];cout<<a[6]; - What is Little Endian and big endian. Write program to check endianess of machine https://www.geeksforgeeks.org/little-and-big-endian-mystery/
- Asked if I am familiar with bitwise operator. How to check if number is even or odd?
- Asked about which design patterns I have used? explain observer design pattern.
- Design class structure of snake and ladder game. Cross questions on space and time complexity
Managerial Round 2 (~1 hr):
- https://www.geeksforgeeks.org/reverse-words-in-a-given-string/
first told stack-based approach and then reduced space complexity to O(1)
- https://www.geeksforgeeks.org/print-nodes-top-view-binary-tree/
As I told about using map, asked about map internal implementation. I told that and then asked to write code for put() and get() api.
I write code without managing height, interviewer asked to write that as well, I was not able to do that.
Also discussed on unordered_map and difference b/w both of them
Director Round (~30 mins):
- Asked about my projects. Lots of discussion on my company’s project.
- Asked to design system in which pdf files can be shared among multiple users and can be edited at same time by multiple users.
Final Verdict: Selected
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course. In case you are prepared, test your skills using TCS, Wipro, Amazon. Google , E-Litmus and Microsoft Test Serieses.



