i
Ansys Software Private Limited
Filter interviews by
Clear (1)
I applied via Referral and was interviewed in Sep 2024. There were 3 interview rounds.
Three DSA questions one on likedlist one on BST and one on maps
Smart pointers in C++ provide automatic memory management and help prevent memory leaks.
Smart pointers are objects that manage the memory of a pointer automatically.
They ensure that memory is deallocated when it is no longer needed.
Examples include unique_ptr, shared_ptr, and weak_ptr.
DSA questions on graph and lots of puzzles
Top trending discussions
I was interviewed in Nov 2023.
F2F coding test which was pretty simple based on basic c++ concepts and few logical questions.
I applied via Naukri.com and was interviewed in Sep 2021. There was 1 interview round.
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 applied via Referral
posted on 10 May 2015
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
It was like 5 MCQ and two coding questions with difficult level of moderate
React components go through various stages in their life cycle, from initialization to destruction.
Initialization: Component is created and initialized with default props and state.
Mounting: Component is rendered on the DOM for the first time.
Updating: Component re-renders when props or state change.
Unmounting: Component is removed from the DOM.
Examples: componentDidMount() for mounting, componentDidUpdate() for updati
I applied via Campus Placement and was interviewed in Feb 2021. There were 4 interview rounds.
To find the middle of a linked list in one iteration, use two pointers with different speeds.
Initialize two pointers, one slow and one fast, both pointing to the head of the linked list.
Move the slow pointer one step at a time and the fast pointer two steps at a time.
When the fast pointer reaches the end of the linked list, the slow pointer will be at the middle node.
A binary tree is a data structure consisting of nodes, where each node has at most two children.
Binary tree is used to represent hierarchical relationships between nodes
Traversal of binary tree can be done in three ways: inorder, preorder, postorder
Binary search tree is a type of binary tree where left child is smaller and right child is greater than parent
Balanced binary tree has height difference of at most 1 between...
posted on 21 Mar 2022
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.
based on 1 interview
Interview experience
R&D Engineer
52
salaries
| ₹0 L/yr - ₹0 L/yr |
Applications Engineer
36
salaries
| ₹0 L/yr - ₹0 L/yr |
Senior R&D Engineer
33
salaries
| ₹0 L/yr - ₹0 L/yr |
Senior Application Engineer
26
salaries
| ₹0 L/yr - ₹0 L/yr |
Technical Support Engineer
24
salaries
| ₹0 L/yr - ₹0 L/yr |
Autodesk
Cadence Design Systems
Synopsys
Siemens