# Cadence Software Interview Experience for Fresher

• Difficulty Level : Hard
• Last Updated : 19 May, 2020

I am a student from NSIT, final year (ICE). Here is my Cadence Interview experience.

Round 1:
Question on virtual function, size calculation of class with virtual function.
Given increasing sorted list of duplicate integers with one unique element. Find that element in lg(n).
e.g. 1 1 3 3 5 5 7 8 8 should return 7
new vs malloc, Do we check for null pointer with new[] like we do for malloc() ? If no, then why?

Round 2:
How to allocate 2D matrix dynamically.
A class having an int and an integer pointer as its data member, write the copy constructor for this class.
Shallow and Deep Copy
Height and Diameter of binary trees.
River crossing with 4 person puzzle.

Round 3:
Input output question:

```int x = 3, y = 4;
if (x++ == 3 || ++y == 4) {
cout << x << y << endl;
}
cout << x << y << endl;
int u = 3, v = 4;
if (u++ == 3 && ++v == 4) {
cout << u << v << endl;
}
cout << u << v << endl;```

Size of empty class & with virtual function.
Calculate the size of the Class object without sizeof() function.
AND, OR, gates from NAND.

Round 4:
Difference between latches and flip flop.
Design a 3-bit counter that reads : 1 -> 3 -> 5 -> 7 -> 1...
Find Kth largest element in BST without extra space, not even a heap of size k.
Given two arrays of sizes m and n, and are in sorted order, return a list that contains common elements in both arrays.
Reverse words in a string.

My Personal Notes arrow_drop_up