i
Cadence Design Systems
Filter interviews by
Clear (1)
Medium coding qs with technical interview
Reverse an array of strings
Create a new array and iterate through the original array in reverse order, adding each element to the new array
Use built-in array methods like reverse() or spread operator for a more concise solution
Ensure to handle edge cases like empty array or null values
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.
Imagine Ninja is tackling a puzzle during his long summer vacation. He has two arrays of integers, each with lengths 'N' and 'M'. Ninja's task is to dete...
Find the length of the longest subsequence common to two arrays consisting only of prime numbers.
Iterate through both arrays to find prime numbers
Use dynamic programming to find the longest common subsequence
Consider edge cases like empty arrays or no common prime numbers
You are given an array ARR
of N integers. Your task is to perform operations on this array until it becomes empty, and maximize the sum of selected elements. In each operatio...
Given an array, select elements to maximize sum by removing adjacent elements. Return the maximum sum.
Iterate through the array and keep track of the frequency of each element.
Select the element with the highest frequency first, then remove adjacent elements.
Repeat the process until the array becomes empty and calculate the sum of selected elements.
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++.
Your task is to determine if a given Singly Linked List of integers forms a cycle.
Explanation: A cycle in a linked list occurs when there is a node in the list that conn...
Detect if a given singly linked list of integers forms a cycle.
Use Floyd's Tortoise and Hare algorithm to detect cycle in linked list
Maintain two pointers, one moving at double the speed of the other
If they meet at some point, there is a cycle in the linked list
Determine whether a given array ARR
of positive integers is a valid Preorder Traversal of a Binary Search Tree (BST).
A binary search tree (BST) is a tree structure w...
Check if a given array of positive integers is a valid Preorder Traversal of a Binary Search Tree (BST).
Create a stack to keep track of nodes.
Iterate through the array and compare each element with the top of the stack.
If the current element is less than the top of the stack, push it onto the stack.
If the current element is greater than the top of the stack, pop elements from the stack until a greater element is found ...
Vtable and VPTR are used in C++ for implementing polymorphism through virtual functions.
Vtable (Virtual Table) is a table of function pointers used to implement dynamic dispatch for virtual functions.
VPTR (Virtual Pointer) is a pointer that points to the Vtable of an object.
Vtable is created by the compiler for each class that has virtual functions.
VPTR is added as a hidden member in each object of a class with virtual...
Friend functions in C++ are functions that are not members of a class but have access to its private and protected members.
Friend functions are declared inside a class with the keyword 'friend'.
They can access private and protected members of the class.
They are not member functions of the class, but have the same access rights as member functions.
Friend functions are useful when you want to allow a function external to
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.
You are given a binary tree. Your task is to print the Top View of the Binary Tree, displaying the nodes from left to right order.
The first line contains an integer 't'...
The task is to print the Top View of a Binary Tree from left to right order.
Use a map to store the horizontal distance of each node from the root.
Perform a level order traversal of the tree and keep track of the horizontal distance of each node.
Print the nodes in the map in ascending order of their horizontal distance.
Handle the case where multiple nodes have the same horizontal distance by printing the one that appear
Given a string STR
, determine the total number of palindromic substrings within STR
.
The first line contains an integer 't' representing the number ...
Count the total number of palindromic substrings in a given string.
Iterate through each character in the string and expand around it to find palindromic substrings.
Use dynamic programming to store previously calculated palindromic substrings.
Consider both odd and even length palindromes while counting.
Example: For input 'abbc', palindromic substrings are ['a', 'b', 'b', 'c', 'bb']. Total count is 5.
DELETE removes specific rows from a table, while TRUNCATE removes all rows and resets auto-increment values.
DELETE is a DML command, while TRUNCATE is a DDL command.
DELETE can be rolled back, while TRUNCATE cannot be rolled back.
DELETE triggers delete triggers, while TRUNCATE does not trigger any triggers.
DELETE is slower as it maintains logs, while TRUNCATE is faster as it does not maintain logs.
Example: DELETE FROM t
Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity, while denormalization is the process of intentionally introducing redundancy to improve performance.
Normalization involves breaking down a table into smaller tables and defining relationships between them to reduce redundancy and dependency.
Denormalization involves combining tables and duplicating data to impr...
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.
Given two strings, S
and X
, your task is to find the smallest substring in S
that contains all the characters present in X
.
S = "abdd"
X = "bd"
Find the smallest substring in S that contains all characters in X.
Use a sliding window approach to find the smallest substring in S that contains all characters in X.
Keep track of the characters in X using a hashmap.
Move the window by adjusting the start and end pointers until all characters in X are found.
Return the smallest substring encountered.
Given a binary tree where each node contains an integer value, and a value 'K', your task is to find all the paths in the binary tree such that the sum of the node values in ...
Find all paths in a binary tree where the sum of node values equals a given value 'K'.
Traverse the binary tree using DFS and keep track of the current path and its sum.
At each node, check if the current sum equals 'K' and add the path to the result.
Continue traversal to the left and right child nodes recursively.
Return the list of paths that sum up to 'K'.
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.
You are provided with a binary tree containing 'N' nodes. Your task is to determine if this tree is a Partial Binary Search Tree (BST). Return t...
Validate if a binary tree is a Partial Binary Search Tree (BST) by checking if each node's left subtree contains nodes with data less than or equal to the node's data, and each node's right subtree contains nodes with data greater than or equal to the node's data.
Check if each node's left subtree follows BST property (data <= node's data) and right subtree follows BST property (data >= node's data)
Recursively che...
Given an array of integers with 'N' elements, determine the length of the longest subsequence where each element is greater than the previous element. This...
Find the length of the longest strictly increasing subsequence in an array of integers.
Use dynamic programming to solve this problem efficiently.
Initialize an array to store the length of the longest increasing subsequence ending at each index.
Iterate through the array and update the length of the longest increasing subsequence for each element.
Return the maximum value in the array as the result.
Processes are instances of a program in execution, while threads are lightweight processes within a process.
A process is a program in execution, with its own memory space and resources.
Threads are lightweight processes within a process, sharing the same memory space and resources.
Processes are independent of each other, while threads within the same process can communicate and share data.
Example: A web browser running ...
Different types of semaphores include binary semaphores, counting semaphores, and mutex semaphores.
Binary semaphores: Can only have two states - 0 or 1. Used for mutual exclusion.
Counting semaphores: Can have multiple states. Used for managing resources with limited capacity.
Mutex semaphores: Similar to binary semaphores but with additional features like priority inheritance.
Named semaphores: Can be shared between proc...
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.
You are given an array arr
of length N
. For each element in the array, find the next greater element (NGE) that appears to the right. If there is no such greater ele...
The task is to find the next greater element for each element in an array to its right, if no greater element exists, return -1.
Use a stack to keep track of elements for which the next greater element is not found yet.
Iterate through the array from right to left and pop elements from the stack until a greater element is found.
Store the next greater element for each element in a separate array.
If the stack is empty afte...
Given a sorted array of 'N' integers, your task is to generate the power set for this array. Each subset of this power set should be individually sorted.
A power set of a set 'ARR' i...
Generate power set of a sorted array of integers with individually sorted subsets.
Use recursion to generate all possible subsets by including or excluding each element in the array.
Sort each subset before adding it to the power set.
Handle base case when all elements have been considered to add the subset to the power set.
Ninja is learning about sorting algorithms, specifically those that do not rely on comparisons. Can you help Ninja implement the counting sort algorithm?
Implement counting sort algorithm to sort an array of integers without comparisons.
Count the frequency of each element in the input array.
Create a prefix sum array to determine the position of each element in the sorted array.
Iterate through the input array and place each element in its correct position based on the prefix sum array.
Time complexity of counting sort is O(n+k), where n is the number of elements and k is
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
To search for a node in a linked list, iterate through the list and compare each node's value with the target value.
Start at the head of the linked list
Iterate through each node by following the 'next' pointer
Compare the value of each node with the target value
Return the node if found, otherwise return null
To detect a loop in a linked list, we can use Floyd's Cycle Detection Algorithm.
Initialize two pointers, slow and fast, at the head of the linked list.
Move slow pointer by one step and fast pointer by two steps.
If there is a loop, the two pointers will eventually meet.
Alternatively, we can use a hash set to store visited nodes and check for duplicates.
Implement a stack using a singly linked list
Create a Node class with data and next pointer
Create a Stack class with top pointer pointing to the top of the stack
Implement push, pop, and peek operations by manipulating the linked list
Example: Node class - Node { int data; Node next; }
Round duration - 40 minutes
Round difficulty - Easy
The top view of a binary tree shows the nodes visible from the top when looking down from the root node.
The top view of a binary tree is the set of nodes visible from the top when looking down from the root node.
Nodes at the same horizontal distance from the root are considered at the same level in the top view.
If multiple nodes are at the same horizontal distance, only the topmost node at that level is included in the...
Deleting a node from a linked list involves updating pointers to maintain the list's integrity.
Identify the node to be deleted by traversing the list
Update the previous node's next pointer to skip the node to be deleted
Free the memory allocated to the node to be deleted
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
To check if a directed graph is cyclic or not
Use Depth First Search (DFS) algorithm to traverse the graph
Maintain a visited set to keep track of visited nodes
Maintain a recursion stack to keep track of nodes in the current DFS traversal
If a node is visited and is already in the recursion stack, then the graph is cyclic
If DFS traversal completes without finding a cycle, then the graph is acyclic
Return a random byte from a stream of bytes with equal probability.
Create a variable to store the count of bytes read
Create a variable to store the current random byte
For each byte read, generate a random number between 0 and the count of bytes read
If the random number is 0, store the current byte as the random byte
Return the random byte
Check if a binary tree is a binary search tree or not.
Traverse the tree in-order and check if the values are in ascending order.
For each node, check if its value is greater than the maximum value of its left subtree and less than the minimum value of its right subtree.
Use recursion to check if all nodes in the tree satisfy the above condition.
Algorithm to find Nth-to-Last element in a singly linked list of unknown length
Traverse the list and maintain two pointers, one at the beginning and one at Nth node from beginning
Move both pointers simultaneously until the second pointer reaches the end of the list
The first pointer will be pointing to the Nth-to-Last element
If N=0, return the last element
Parse the list only once
Print all possible permutations of an array of integers
Use recursion to swap elements and generate permutations
Start with the first element and swap it with each subsequent element
Repeat the process for the remaining elements
Stop when all elements have been swapped with the first element
Print each permutation as it is generated
Design a stack that prints the minimum element pushed in O(1)
Use two stacks, one for storing elements and another for storing minimums
When pushing an element, compare it with the top of minimum stack and push the smaller one
When popping an element, pop from both stacks
To get the minimum element, just return the top of minimum stack
To find the starting point of a loop in a linked list, use Floyd's cycle-finding algorithm.
Use two pointers, one moving at twice the speed of the other.
When they meet, move one pointer to the head of the list and keep the other at the meeting point.
Move both pointers one step at a time until they meet again, which is the starting point of the loop.
To find a number in a matrix where all rows and columns are sorted non-decreasingly. Complexity of the solution.
Use binary search to find the number in each row and column
Start from the top-right corner or bottom-left corner to optimize search
Time complexity: O(m log n) or O(n log m) depending on the starting corner
I was interviewed in Jul 2017.
Code to print * in five consecutive lines
Use a loop to iterate five times
Inside the loop, print a string containing a single * character
Code to calculate number of bounces a ball goes through until it comes to rest.
Use a loop to simulate the bounces until the ball stops bouncing
Calculate the height of each bounce using the given formula
Keep track of the number of bounces in a counter variable
The best and less time consuming way to calculate factorial of a number is using iterative approach.
Iteratively multiply the number with all the numbers from 1 to the given number
Start with a result variable initialized to 1
Multiply the result with each number in the range
Return the final result
Code to find factorial using function recursion
Define a function that takes an integer as input
Check if the input is 0 or 1, return 1 in that case
Otherwise, call the function recursively with input-1 and multiply it with the input
I was interviewed before Feb 2022.
posted on 31 May 2022
I was interviewed before May 2021.
Round duration - 90 minutes
Round difficulty - Easy
Timing - 10AM-11:30AM
Online proctored test
Given a binary tree of integers, your task is to print the right view of it. The right view represents a set of nodes visible when the tree is viewed from the righ...
The task is to print the right view of a binary tree, representing nodes visible from the right side in top-to-bottom order.
Traverse the tree level by level and keep track of the rightmost node at each level
Print the rightmost node of each level to get the right view of the tree
Use a queue for level order traversal and a map to store the rightmost nodes
A thief is planning to rob a store and can carry a maximum weight of 'W' in his knapsack. The store contains 'N' items where the ith item has a weight of 'wi' and a value of...
Yes, the 0/1 Knapsack problem can be solved using dynamic programming with a space complexity of not more than O(W).
Use a 1D array to store the maximum value that can be stolen for each weight from 0 to W.
Iterate through each item and update the array based on whether including the item would increase the total value.
The final value in the array at index W will be the maximum value that can be stolen.
Round duration - 45 minutes
Round difficulty - Medium
Timing : 4PM-5PM
Environment - Online
There was a panel of 3 interviewers
You can find the size of an array in C or C++ by dividing the total size of the array by the size of one element.
Calculate the total size of the array by multiplying the number of elements by the size of each element.
Divide the total size by the size of one element to get the size of the array.
For example, if you have an array of strings arr[] = {'hello', 'world', 'example'}, you can find the size by dividing the total
B+ trees are used for indexing in databases to efficiently search and retrieve data.
B+ trees are balanced trees where each node can have multiple keys and child pointers.
Data is stored in leaf nodes, while non-leaf nodes are used for navigation.
B+ trees are commonly used in databases because of their ability to efficiently search and retrieve data.
Example: In a database table with an index on a specific column, B+ tree...
Round duration - 45 mintues
Round difficulty - Easy
Timing - 11AM-12:15PM
Environment - online video call
Again there was a panel of 2 senior engineers
You are given an n-ary tree consisting of 'N' nodes. Your task is to determine the maximum sum of the path from the root to any leaf node.
For the giv...
Find the maximum sum of the path from the root to any leaf node in an n-ary tree.
Traverse the tree from root to leaf nodes while keeping track of the sum of each path.
At each node, calculate the sum of the path from the root to that node and update the maximum sum found so far.
Consider using depth-first search (DFS) or breadth-first search (BFS) for tree traversal.
Handle cases where nodes have negative values or where
Tip 1 : Brush Up on Computer Science Fundamentals
Tip 2 : Prepare a Brief Self-Introduction
Tip 1 : Do not put fake resume
Tip 2 : Writing internship project helps.
Some of the top questions asked at the Cadence Design Systems Software Developer interview -
based on 2 interviews
2 Interview rounds
based on 4 reviews
Rating in categories
Lead Software Engineer
157
salaries
| ₹0 L/yr - ₹0 L/yr |
Software Engineer2
103
salaries
| ₹0 L/yr - ₹0 L/yr |
Principal Software Engineer
93
salaries
| ₹0 L/yr - ₹0 L/yr |
Software Engineer
84
salaries
| ₹0 L/yr - ₹0 L/yr |
Design Engineer
72
salaries
| ₹0 L/yr - ₹0 L/yr |
Synopsys
Mentor Graphics
Ansys Software Private Limited
Autodesk