i
Cadence Design Systems
Filter interviews by
Medium coding qs with technical interview
I was interviewed in Aug 2023.
I was interviewed in Aug 2021.
Round duration - 75 minutes
Round difficulty - Medium
This was an online coding round where I had 2 questions to solve under 75 minutes. Both the coding questions were related to DP and were of Medium to Hard level of difficulty.
Algorithm :
1) Generate all the prime numbers in the range of values of the given array using Sieve Of Eratosthenes.
2) Now make an iteration for ‘arr1’ and check the elements in ‘arr1’ which are prime and store the elements in an array, say ‘finalA’.
3) Now make an iteration for ‘arr2’ and check the elements in ‘arr2’ which are prime and store the elements in an array, say ‘finalB’.
4) Now calculate the LCS fo...
Algorithm:
1) Find the maximum number max in the array.
2) Create a new auxiliary array dp of size max+1 and store frequencies of unique elements in the array, where dp[i] denotes the number of times i as an element is present in the input array.
3) Iterate the dp array(we will use this array to store the results), now for each index i from 2 to MAX we have two choices: dp[i] = max(dp[i-1], dp[i-2] + dp[i]*i).
...
Round duration - 60 minutes
Round difficulty - Medium
This round had 2 Algorithmic questions wherein I was supposed to code both the problems after discussing their approaches and respective time and space complexities . After that , I was grilled on some OOPS concepts related to C++.
Approach 1(Using Hashing) :
We are going to maintain a lookup table(a Hashmap) that basically tells if we have already visited a node or not, during the course of traversal.
Steps :
1) Visit every node one by one, until null is not reached.
2) Check if the current node is present in the loop up table, if present then there is a cycle and will return true, otherwise, put the node reference into the lookup table and repeat t...
Approach (Using Stack) :
1) Initialize an empty stack of integers.
2) Initialize a variable lowerBound to store the value of the root of the current tree. Initialize is as INT_MIN.
3) Iterate through i = 0 to N - 1
3.1) If ARR[i] is smaller than lowerBound, then we will return 0.
3.2) Repeatedly,
If the stack is non-empty, then remove the element at the top of the stack if it is smaller than ARR[i] and make...
What is Vtable and VPTR in C++?
Vtable : It is a table that contains the memory addresses of all virtual functions of a class in the order in which they are declared in a class. This table is used to resolve function calls in dynamic/late binding manner. Every class that has virtual function will get its own Vtable.
VPTR : After creating Vtable address of that table gets stored inside a pointer i.e. VPTR (Virtual Pointer). When you create an object of...
What Friend Functions in C++?
1) Friend functions of the class are granted permission to access private and protected members of the class in C++. They are defined globally outside the class scope. Friend functions are not member functions of the class.
2) A friend function is a function that is declared outside a class but is capable of accessing the private and protected members of the class.
3) There could be situations in programming wherein we w...
Round duration - 60 minutes
Round difficulty - Medium
This was also a DS/Algo round where I was given 2 questions to solve and I was expected to come up with the optimal approach as far as possible. I solved both the questions with the optimal time and space complexities and then I was asked some more questions related to DBMS towards the end of the interview.
Input:
Output: 2 35 2 10 2
The first line contai...
Approach 1 :
1) Like vertical Order Traversal, we need to put nodes of same horizontal distance together.
2) We do a level order traversal so that the topmost node at a horizontal node is visited before any other node of same horizontal distance below it.
3) Hashing is used to check if a node at given horizontal distance is seen or not.
TC : O(N*log(N)), where N = number of nodes in the binary tree
S...
If the input string is "abbc", then al...
I solved it using DP as I was able to figure out what my dp table would store and the dp transition state .
Approach :
1) Create a 2-D dp boolean vector(with all false initially) where dp[i][j] states whether s[i...j] is a palindrome or not .
2) Base Case : For every i from 0 to n-1 fill dp[i][i]=1 ( as a single character is always a palindrome )and increment the counter where counter=0 initially
3) Now, run 2 loops first ...
Difference between the DELETE and TRUNCATE command in a DBMS.
DELETE command :
1) This command is needed to delete rows from a table based on the condition provided by the WHERE clause.
2) It can be rolled back if required.
3) It maintains a log to lock the row of the table before deleting it and hence it’s slow.
TRUNCATE command :
1) This command is needed to remove complete data from a table in a database. It is like a DELETE command which
has no WHERE clause.
2) It ...
What is meant by normalization and denormalization?
NORMALIZATION :
1) Normalization is a process of reducing redundancy by organizing the data into multiple tables.
2) Normalization leads to better usage of disk spaces and makes it easier to maintain the integrity of the database.
DENORMALIZATION :
1) Denormalization is the reverse process of normalization as it combines the tables which have been normalized into a single table so that data retrieval becomes faster.
&...
Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.
Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.
I was interviewed before Apr 2021.
Round duration - 75 minutes
Round difficulty - Medium
This was an online coding round where I had 2 questions to solve under 75 minutes. Both the coding questions were of Medium to Hard level of difficulty.
Let S = “abdd” ...
Approach 1 (Brute Force) :
1) Generate all substrings of string1.
2) For each substring, check whether the substring contains all characters of string2.
3) Finally, print the smallest substring containing all characters of string2.
TC : O(N^3), where N=length of the given string s1 and s2
SC : O(1)
Approach 2 (Sliding Window) :
We can use a simple sliding window approach to solve this problem.
The solution is pretty intuitive....
The idea is simple: along the path, record all prefix sums in a hash table. For current prefix sum x, check if (x - target)
appears in the hash table.
Steps :
1) We will be using a unordered map which will be filled with various path sum.
2) For every node we will check if current sum and root’s value equal to k or not. If the sum equals to k then
increment the required answer by one.
3) Then we will add all those path sum i...
Round duration - 60 Minutes
Round difficulty - Medium
This round had 2 questions of DS/Algo to solve under 60 minutes and 2 questions related to Operating Systems.
Approach 1 (Recursive Inorder Traversal) :
We know that the inorder traversal of a BST always gives us a sorted array , so if we maintain two variable Tree
Nodes "previous" and "current" , we should always have previous->val < current->value for a valid BST.
Steps :
1) Create a boolean recursive function with two parameters (root and prev) which will return true if our binary tree is a
BST or else it will return fa...
Approach 1 (Naive Solution) :
1) The simplest approach to solve the problem is to generate all possible subarrays.
2) For each subarray, check if the difference between adjacent elements remains the same throughout or not.
3) Among all such subarrays satisfying the condition, store the length of the longest subarray and print it as the result.
TC : O(N^3), where N=size of the array
SC : O(1)
Approach 2 (Efficient Solution) :
...
Define Process and Threads in OS.
Process : A process is an instance of a program that is being executed. When we run a program, it does not execute
directly. It takes some time to follow all the steps required to execute the program, and following these execution
steps is known as a process.
A process can create other processes to perform multiple tasks at a time; the created processes are known as clone
or child process, and the main process is known as ...
What are the different types of semaphores ?
There are two main types of semaphores i.e. counting semaphores and binary semaphores.
1) Counting Semaphores :
These are integer value semaphores and have an unrestricted value domain. These semaphores are used to
coordinate the resource access, where the semaphore count is the number of available resources. If the resources
are added, semaphore count automatically incremented and if the resources are removed, the count i...
Round duration - 60 Minutes
Round difficulty - Hard
In this round, I was asked 3 coding questions out of which I had to implement the first two and for the last question I was only asked the optimal approach. The main challenge in this round was to implement the first two questions in a production ready manner without any bugs and so I had to spent some time thinking about some Edge Cases which were important with respect to the question.
Approach 1 (Naive Solution) :
1) Use two loops: The outer loop picks all the elements one by one.
2) The inner loop looks for the first greater element for the element picked by the outer loop.
3) If a greater element is found then that element is printed as next, otherwise, -1 is printed.
TC : O(N^2), where N=size of the array
SC : O(1)
Approach 2 (Using Stack) :
1) Push the first element to stack.
2) Pick rest of the element...
Given,a set of n elements I was supposed to print all the subsets of this set . I was famiiar with this question and had
already solved it in LeetCode and CodeStudio so coding it in the first go was not so hard for me .
Approach : I solved it using bitmasking . The main intuition was if I have a binary number like 1001 , I would take only
the 0th element and the 3rd element of the array .
Steps :
1) Run a loop from 0 to (2^...
Answer : The easiest way to do this is to use external sorting.
Steps :
1) We divide our source file into temporary files of size equal to the size of the RAM and first sort these files.
2) Assume 1GB = 1024MB, so we follow following steps.
2.1) Divide the source file into 5 small temporary files each of size 200MB (i.e., equal to the size of ram).
2.2) Read input_file such that at most ‘runSize’ elements are read at a time...
Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.
Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.
Cadence Design Systems interview questions for designations
I was interviewed before Sep 2020.
Round duration - 30 minutes
Round difficulty - Easy
Searching of node in linked list.
Detect loop in Iinked list.
Implementation of stack using singly linked list.
Round duration - 40 minutes
Round difficulty - Easy
Top view of binary tree.
Deletion from the linked list(All cases).
Do practice a lot of questions on linked list and stacks as these are two most important data structures asked in the interview. Also, try to implement it yourself without seeing the solution. Also prepare for Computer Science subjects like Operating System, Database Management System, Computer Networks, etc. I prepared them through Coding Ninjas notes which were simpler and easy to understand.
Application resume tips for other job seekersKeep your resume short and up to mark and check spellings before submitting it for the interview process.
Final outcome of the interviewSelectedGet interview-ready with Top Cadence Design Systems Interview Questions
Locate sum of 2 numbers in a linear array (unsorted and sorted) and their complexities
For unsorted array, use nested loops to compare each element with every other element until the sum is found
For sorted array, use two pointers approach starting from the beginning and end of the array and move them towards each other until the sum is found
Complexity for unsorted array is O(n^2) and for sorted array is O(n)
Pointers are used to manipulate memory addresses and values in C++. Increment/decrement, address of and value at operators are commonly used.
Incrementing a pointer moves it to the next memory location of the same data type
Decrementing a pointer moves it to the previous memory location of the same data type
The address of operator (&) returns the memory address of a variable
The value at operator (*) returns the value sto
To determine if a point is inside or outside a rectangle, we check if the point's coordinates fall within the rectangle's boundaries.
Check if the point's x-coordinate is greater than the left edge of the rectangle
Check if the point's x-coordinate is less than the right edge of the rectangle
Check if the point's y-coordinate is greater than the top edge of the rectangle
Check if the point's y-coordinate is less than the b...
To find line that divides rectangle into 2 equal halves through a point inside it.
Find the center of the rectangle
Draw a line from the center to the given point
Extend the line to the opposite side of the rectangle
The extended line will divide the rectangle into 2 equal halves
There are multiple combinations of 8-bit and 16-bit signed numbers. How many such combinations are possible?
There are 2^8 (256) possible combinations of 8-bit signed numbers.
There are 2^16 (65,536) possible combinations of 16-bit signed numbers.
To find the total number of combinations, we can add the number of combinations of 8-bit and 16-bit signed numbers.
Therefore, the total number of possible combinations is 256 +
Find duplicates in an array of elements in 0(n) time and 0(1) space.
Use the property of inputs to your advantage
Iterate through the array and mark elements as negative
If an element is already negative, it is a duplicate
Return all the negative elements as duplicates
Top trending discussions
General aptitude questions
Problem solving, solved 2 out of 3 questions
General topics were given in gd
I applied via campus placement at Motilal Nehru Institute National Institute of Technology (NIT), Allahabad and was interviewed in Aug 2024. There were 2 interview rounds.
Its basically a test comprising 32 mcq
12- logical reasoning
20- core C,DBMS, OS , Computer Networks
2 coding Questions
Linkedlist questions
based on 4 reviews
Rating in categories
Lead Software Engineer
153
salaries
| ₹18.2 L/yr - ₹47.4 L/yr |
Software Engineer2
99
salaries
| ₹13 L/yr - ₹26 L/yr |
Principal Software Engineer
87
salaries
| ₹24.9 L/yr - ₹55 L/yr |
Design Engineer
71
salaries
| ₹7 L/yr - ₹25 L/yr |
Lead Design Engineer
62
salaries
| ₹18.7 L/yr - ₹40 L/yr |
Synopsys
Mentor Graphics
Ansys Software Private Limited
Autodesk