Add office photos
Engaged Employer

Cadence Design Systems

4.1
based on 272 Reviews
Video summary
Filter interviews by

100+ Vibhor Steel Tubes Interview Questions and Answers

Updated 15 Jan 2025
Popular Designations

Q1. Find All Pairs with Given Sum

Given an integer array arr and an integer Sum, count and return the total number of pairs in the array whose elements add up to the given Sum.

Input:

The first line contains two sp...read more
Ans.

Count and return the total number of pairs in the array whose elements add up to a given sum.

  • Use a hashmap to store the frequency of each element in the array.

  • Iterate through the array and for each element, check if (Sum - current element) exists in the hashmap.

  • Increment the count of pairs if the complement exists in the hashmap.

Add your answer

Q2. Longest Common Prime Subsequence Problem Statement

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 determine ...read more

Ans.

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

Add your answer

Q3. Minimum Number of Jumps Problem

Given an array ARR of N integers, determine the minimum number of jumps required to reach the last index of the array (i.e., N - 1). From any index i, you can jump to an index i ...read more

Ans.

The problem involves finding the minimum number of jumps required to reach the last index of an array, where each element indicates the maximum distance that can be jumped from that position.

  • Use a greedy approach to keep track of the farthest reachable index and the current end of the jump.

  • Iterate through the array, updating the farthest reachable index and incrementing the jump count when necessary.

  • Return the jump count as the minimum number of jumps needed to reach the last...read more

Add your answer

Q4. Validate Partial Binary Search Tree (BST) Problem Statement

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 true if...read more

Ans.

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 check if both left and right subtrees are partial BSTs

  • Handle cases ...read more

Add your answer
Discover Vibhor Steel Tubes interview dos and don'ts from real experiences

Q5. Maximum Sum Problem Statement

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 operation, sel...read more

Ans.

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.

Add your answer

Q6. Check If Preorder Traversal Is Valid

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 where ea...read more

Ans.

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 or the stack is empty.

  • The last popped element becomes the ...read more

Add your answer
Are these interview questions helpful?

Q7. Count Palindromic Substrings Problem Statement

Given a string STR, determine the total number of palindromic substrings within STR.

Input:

The first line contains an integer 't' representing the number of test ...read more
Ans.

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.

Add your answer

Q8. Next Greater Element Problem Statement

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 element, ...read more

Ans.

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 after iterating through the array, it means there is no greate...read more

Add your answer
Share interview questions and help millions of jobseekers 🌟

Q9. Counting Sort Problem Statement

Ninja is learning about sorting algorithms, specifically those that do not rely on comparisons. Can you help Ninja implement the counting sort algorithm?

Example:

Input:
ARR = {-...read more
Ans.

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 the range of input values.

Add your answer

Q10. Two Teams (Check Whether Graph is Bipartite or Not)

Determine if a given undirected graph can be divided into exactly two disjoint cliques. Print 1 if possible, otherwise print 0.

Input:

The first line contains...read more
Ans.

Check if a given undirected graph can be divided into exactly two disjoint cliques.

  • Create an adjacency list to represent the graph

  • Use BFS or DFS to check if the graph is bipartite

  • If the graph is bipartite, it can be divided into two disjoint cliques

Add your answer

Q11. Top View of a Binary Tree

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.

Input:

The first line contains an integer 't' represe...read more
Ans.

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 appears first in level order traversal.

Add your answer

Q12. There are fifteen horses and a racing track that can run five horses at a time. You have to figure out the top 3 horses out of those and you don't have any timer machine to measure. How will you find the top 3...

read more
Ans.

Divide the horses into groups of 5 and race them. Take the top 2 from each race and race them again. Finally, race the top 2 horses to determine the top 3.

  • Divide the horses into 3 groups of 5 and race them.

  • Take the top 2 horses from each race and race them again.

  • Finally, race the top 2 horses to determine the top 3.

View 1 answer

Q13. K - Sum Path In A Binary Tree

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 each p...read more

Ans.

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'.

Add your answer

Q14. Longest Increasing Subsequence Problem Statement

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 subse...read more

Ans.

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.

Add your answer

Q15. Power Set Generation

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' is the s...read more

Ans.

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.

Add your answer

Q16. Cycle Detection in a Linked List

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 connects ba...read more

Ans.

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

Add your answer

Q17. Maximum Length Pair Chain Problem

You are provided with 'N' pairs of integers, where the first number in each pair is less than the second number, i.e., in pair (a, b) -> a < b. A pair chain is defined as a seq...read more

Ans.

Find the length of the longest pair chain that can be formed using the provided pairs.

  • Sort the pairs based on the second number in each pair.

  • Iterate through the sorted pairs and keep track of the maximum chain length.

  • Update the maximum chain length based on the conditions given in the problem statement.

Add your answer

Q18. Smallest Window Problem Statement

Given two strings, S and X, your task is to find the smallest substring in S that contains all the characters present in X.

Example:

Input:
S = "abdd"
X = "bd"
Output:
bd
Explan...read more
Ans.

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.

Add your answer

Q19. Puzzle: Jumbled N pens and N caps, all caps separated from their pens, all pens have some thickness properties. How would you cap all the pens?

Ans.

Match the thickness of each pen with its cap and cap them accordingly.

  • Sort the pens and caps by thickness.

  • Match the first pen with the first cap, second pen with the second cap and so on.

  • Cap the pens with their respective caps.

  • If there are any leftover caps or pens, they do not have a match.

Add your answer

Q20. Puzzle: 100 floor building and 2 eggs given, find the minimum/maximum number of trys required to find the floor where the egg will break. The answer I gave was 19. He asked me to normalize the solution; we then...

read more
Ans.

Find the minimum/maximum number of tries required to find the floor where the egg will break in a 100 floor building with 2 eggs.

  • Use binary search approach to minimize the number of tries

  • Start with dropping the egg from the 14th floor, then 27th, 39th, and so on

  • If the first egg breaks, use the second egg to find the exact floor by checking each floor one by one

  • If the first egg doesn't break, move up to the next floor and repeat the process

  • The maximum number of tries is 14 if ...read more

Add your answer
Q21. What is the Diamond Problem in C++ and how can it be resolved?
Ans.

Diamond Problem is a common issue in multiple inheritance in C++ where a class inherits from two classes that have a common base class.

  • Diamond Problem occurs when a class inherits from two classes that have a common base class, leading to ambiguity in accessing members.

  • It can be resolved in C++ using virtual inheritance, where the common base class is inherited virtually to avoid duplicate copies of base class members.

  • Example: class A is inherited by classes B and C, and then...read more

Add your answer
Q22. How do you search for a node in a linked list?
Ans.

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

Add your answer

Q23. You are given an array of elements. Some/all of them are duplicates. Find them in 0(n) time and 0(1) space. Property of inputs – Number are in the range of 1..n where n is the limit of the array

Ans.

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

Add your answer

Q24. A point and a rectangle is present with the given coordinates. How will you determine whether the point is inside or outside the rectangle?

Ans.

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 bottom edge of the rectangle

  • If all four conditions are true...read more

Add your answer

Q25. There is a point inside the rectangle. How will you determine the line that passes through the point and divides the rectangle into 2 equal halves?

Ans.

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

Add your answer

Q26. There is a scheme which contains 8-bit and 16-bit signed numbers. How many such combinations are possible?

Ans.

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 + 65,536 = 65,792.

Add your answer
Q27. What is data abstraction and how can it be achieved?
Ans.

Data abstraction is the process of hiding implementation details and showing only the necessary features of an object.

  • Data abstraction can be achieved through classes and objects in object-oriented programming.

  • It involves creating a class with private data members and public methods to access and modify those data members.

  • By using data abstraction, users can interact with objects without needing to know the internal workings of the object.

  • For example, a car object may have me...read more

Add your answer
Q28. What is meant by multitasking and multithreading in operating systems?
Ans.

Multitasking involves running multiple tasks concurrently, while multithreading allows multiple threads within a single process to run concurrently.

  • Multitasking allows multiple processes to run concurrently on a single processor, switching between them quickly.

  • Multithreading allows multiple threads within a single process to run concurrently, sharing resources like memory and CPU time.

  • Multitasking is at the process level, while multithreading is at the thread level.

  • Example: A...read more

Add your answer

Q29. What is a static function in a C++ class? Why is it used? How to call a static function of class from any part of the code

Ans.

Static function in C++ class is used to access class-level data without creating an object.

  • Static functions can be called using the class name and scope resolution operator (::)

  • They cannot access non-static data members of the class

  • They can be used to implement utility functions that do not require access to object-specific data

  • Static functions are shared among all objects of the class

Add your answer

Q30. Concept of virtual function in C++. How is a vtable maintained? What are its enteries? Example code where virtual function is used

Ans.

Virtual functions in C++ use vtables to enable dynamic binding. Example code included.

  • Virtual functions allow polymorphism in C++

  • Vtables are used to maintain a list of virtual functions

  • Each class with virtual functions has its own vtable

  • Vtable entries are function pointers to the virtual functions

  • Example code: class Shape { virtual void draw() = 0; };

  • Example code: class Circle : public Shape { void draw() override { ... } };

Add your answer

Q31. What is the difference between C++ and Objective C and where will you use it?

Ans.

C++ is a general-purpose programming language while Objective C is a superset of C used for iOS and macOS development.

  • C++ is widely used for developing applications, games, and system software.

  • Objective C is primarily used for iOS and macOS development.

  • C++ supports both procedural and object-oriented programming paradigms.

  • Objective C is an object-oriented language with dynamic runtime features.

  • C++ has a larger standard library compared to Objective C.

  • Objective C uses a Smallt...read more

Add your answer

Q32. There is a stack where push and pop operation are happening. At any point of time user will query secondMin(). This API should return second minimum present in the stack

Ans.

Implement an API to return the second minimum element in a stack.

  • Create a stack and a variable to store the second minimum element.

  • Whenever a new element is pushed, compare it with the current second minimum and update if necessary.

  • Whenever an element is popped, check if it is the current second minimum and update if necessary.

  • Return the second minimum element when the secondMin() API is called.

Add your answer
Q33. What is the difference between the DELETE and TRUNCATE commands in a DBMS?
Ans.

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 table_name WHERE condition; TRUNCATE table_name;

Add your answer

Q34. Given a dictionary, how can you represent it in memory? What will be the worst case complexity of a search done on the DS designed?

Ans.

A dictionary can be represented in memory as an array of strings. Worst case complexity of search is O(n).

  • A dictionary can be represented as an array of strings where each string contains a key-value pair separated by a delimiter.

  • For example, ['apple: a fruit', 'banana: a fruit', 'carrot: a vegetable']

  • The worst case complexity of a search in this DS is O(n) as we may need to traverse the entire array to find the desired key-value pair.

Add your answer
Q35. How would you design a system like Pastebin?
Ans.

Design a system like Pastebin for sharing text snippets

  • Use a web application framework like Django or Flask for the backend

  • Store text snippets in a database like MySQL or MongoDB

  • Generate unique URLs for each snippet to share with others

  • Implement features like syntax highlighting, expiration time, and password protection

  • Consider implementing user accounts for managing and organizing snippets

Add your answer

Q36. What is the difference between class container and class composition?

Ans.

Class container is a class that holds objects of other classes, while class composition is a way to combine multiple classes to create a new class.

  • Class container holds objects of other classes, acting as a collection or container.

  • Class composition combines multiple classes to create a new class with its own behavior and attributes.

  • In class container, the objects are typically stored in a data structure like an array or a list.

  • In class composition, the classes are combined by...read more

Add your answer
Q37. What is meant by normalization and denormalization?
Ans.

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 improve query performance by reducing the number of joins need...read more

Add your answer

Q38. What is a malloc function and where is it used and how is it different from new?

Ans.

malloc is a function in C that dynamically allocates memory on the heap. It is used to allocate memory for variables or data structures.

  • malloc is used in C programming language.

  • It is used to allocate memory on the heap.

  • malloc is different from 'new' in C++ as it does not call constructors for objects.

View 1 answer

Q39. A point and a rectangle are present with the given coordinates. How will you determine whether the point is inside or outside the rectangle?

Ans.

To determine if a point is inside or outside a rectangle, compare the point's coordinates with the rectangle's boundaries.

  • Compare the x-coordinate of the point with the x-coordinates of the left and right boundaries of the rectangle.

  • Compare the y-coordinate of the point with the y-coordinates of the top and bottom boundaries of the rectangle.

  • If the point's x-coordinate is between the left and right boundaries AND the point's y-coordinate is between the top and bottom boundari...read more

Add your answer

Q40. scenario: 2 blocks 100 um apart. current of 8 mA flows with 10 ohms resistance. What should be the metal width for routing.(Need to show the complete calculation)

Ans.

To determine the metal width for routing, calculate the resistance and use it to find the required width.

  • Calculate resistance using R = ρ * (L/A), where ρ is the resistivity of the metal, L is the distance between blocks, and A is the cross-sectional area of the metal.

  • Use Ohm's Law (V = I * R) to find the voltage drop across the metal.

  • Finally, use the voltage drop and current to determine the required metal width.

Add your answer

Q41. Explain block functionality of your previous project in detail and how your started your layout till tape out.

Ans.

Block functionality of previous project involved data processing and storage. Layout started with floorplanning and power grid design.

  • Implemented data processing block using Verilog HDL

  • Designed storage block using flip-flops and registers

  • Started layout with floorplanning to allocate space for different blocks

  • Designed power grid to ensure proper distribution of power to all blocks

  • Performed physical design tasks such as placement and routing

  • Verified functionality through simula...read more

Add your answer

Q42. Different segments of memory. Where all can a variable be allocated?

Ans.

A variable can be allocated in different segments of memory.

  • Global memory segment

  • Stack memory segment

  • Heap memory segment

  • Code memory segment

Add your answer
Q43. Can you define process and threads in operating systems?
Ans.

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 multiple tabs is a process, and each tab running JavaScrip...read more

Add your answer
Q44. Can you explain the TCP/IP Protocol?
Ans.

TCP/IP is a set of rules governing the exchange of data over the internet.

  • TCP/IP stands for Transmission Control Protocol/Internet Protocol.

  • It is a suite of communication protocols used to connect devices on the internet.

  • TCP ensures that data is delivered reliably and in order, while IP handles the addressing and routing of data packets.

  • Examples of TCP/IP applications include web browsing (HTTP), email (SMTP), and file transfer (FTP).

Add your answer
Q45. How do you detect a loop in a linked list?
Ans.

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.

Add your answer

Q46. How will you calculate the width of the tree?

Ans.

The width of a tree can be calculated by finding the maximum number of nodes at any level.

  • Traverse the tree level by level using breadth-first search

  • Keep track of the maximum number of nodes at any level

  • Return the maximum number of nodes as the width of the tree

View 1 answer

Q47. What is the width of a tree? How will you calculate the width of the tree?

Ans.

The width of a tree is the maximum number of nodes at any level in the tree.

  • To calculate the width of a tree, we can perform a level order traversal and keep track of the maximum number of nodes at any level.

  • We can use a queue data structure to perform the level order traversal.

  • At each level, we count the number of nodes in the queue and update the maximum width if necessary.

Add your answer
Q48. Explain the process of deleting a node from a linked list, covering all possible cases.
Ans.

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

Add your answer
Q49. What are the different types of semaphores?
Ans.

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 processes by using a unique name.

  • Recursive semaphores: Allow a...read more

Add your answer

Q50. What does the term “object oriented programming mean?”

Ans.

Object oriented programming is a programming paradigm that uses objects to represent and manipulate data.

  • OOP focuses on creating reusable code through the use of classes and objects

  • It emphasizes encapsulation, inheritance, and polymorphism

  • Examples of OOP languages include Java, C++, and Python

Add your answer

Q51. What is the difference between overloading and overriding?

Ans.

Overloading is having multiple methods with the same name but different parameters. Overriding is having a method in a subclass with the same name and parameters as in the superclass.

  • Overloading is compile-time polymorphism while overriding is runtime polymorphism.

  • Overloading is used to provide different ways of calling the same method while overriding is used to provide a specific implementation of a method in a subclass.

  • Overloading is achieved within the same class while ov...read more

Add your answer

Q52. What is auto, volatile variables? Scopes of variables

Ans.

Auto and volatile are storage classes in C language. Scopes of variables determine where they can be accessed.

  • Auto variables are declared within a block and have a local scope.

  • Volatile variables are used to indicate that the value of the variable may change at any time.

  • Global variables have a file scope and can be accessed from any function within the file.

  • Static variables have a local scope but retain their value between function calls.

  • Extern variables have a global scope an...read more

Add your answer

Q53. Locate the sum of 2 numbers in a linear array (Unsorted and sorted) and their complexities

Ans.

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)

Add your answer

Q54. Explain matching and it type in detail with example. Why do we do matching.

Ans.

Matching is the process of comparing two or more items to determine if they are the same or similar.

  • Matching involves comparing characteristics or features of items to find similarities or differences.

  • Types of matching include pattern matching, string matching, and image matching.

  • Matching is used in various fields such as computer science, psychology, and genetics.

  • Example: Matching fingerprints to identify a suspect in a criminal investigation.

  • Example: Matching job candidates...read more

Add your answer

Q55. Why do we go for higher metal jump not for lower metal jump for resolving Antenna.

Ans.

Higher metal jumps are preferred over lower metal jumps for resolving antenna issues due to better signal propagation and reduced interference.

  • Higher metal jumps provide better signal propagation and reduced interference compared to lower metal jumps.

  • Higher metal jumps help in achieving better antenna performance and coverage.

  • Lower metal jumps may result in signal degradation and increased interference.

  • Higher metal jumps offer improved signal strength and quality for antennas...read more

Add your answer

Q56. Given a number, tell number of bits set in the number in its binary representation. Ex. N = 5, Ans – 2 (101 has 2 1’s in it)

Ans.

Count the number of set bits in a given number's binary representation.

  • Convert the number to binary representation

  • Iterate through each bit and count the number of set bits

  • Use bitwise AND operator to check if a bit is set or not

  • Keep incrementing the count for each set bit

Add your answer
Q57. What are friend functions in C++?
Ans.

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 friends with.

  • Friend functions are not member functions of the class.

  • They can be standalone functions or functions of another class.

  • Example: friend void displayDetails(Student);

Add your answer
Q58. What are Vtable and VPTR in C++?
Ans.

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 functions.

  • Example: class Base { virtual void func() {} };...read more

Add your answer
Q59. Can you explain the DHCP Protocol?
Ans.

DHCP Protocol is used to automatically assign IP addresses to devices on a network.

  • DHCP stands for Dynamic Host Configuration Protocol

  • It allows devices to obtain IP addresses and other network configuration information dynamically

  • DHCP servers assign IP addresses to devices for a specific lease period

  • DHCP uses a client-server model where the client requests an IP address and the server assigns one

  • DHCP uses UDP port 67 for the server and UDP port 68 for the client

Add your answer

Q60. Why does a program crash? Valgrind issues etc

Ans.

Programs can crash due to various reasons such as memory errors, bugs, hardware issues, etc.

  • Memory errors such as accessing uninitialized memory, buffer overflows, etc.

  • Bugs in the code such as infinite loops, null pointer dereferences, etc.

  • Hardware issues such as power failures, overheating, etc.

  • External factors such as network failures, input/output errors, etc.

  • Tools like Valgrind can help detect memory errors and other issues.

Add your answer
Q61. What is the top view of a binary tree?
Ans.

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 top view.

  • The top view can be obtained by performing a lev...read more

Add your answer

Q62. write a command to find the lines containing the word "ERROR" from a log file and copy it to new file.

Ans.

Command to find lines with 'ERROR' in log file and copy to new file

  • Use grep command to search for 'ERROR' in log file: grep 'ERROR' logfile.txt

  • Use redirection to copy the output to a new file: grep 'ERROR' logfile.txt > newfile.txt

Add your answer

Q63. Pointers with increment/decreament, address of and value at operators (++,--,*,&amp;)

Ans.

Explanation of pointers with increment/decrement, address of and value at operators.

  • Pointers are variables that store memory addresses.

  • Increment/decrement operators change the address stored in a pointer.

  • Address of operator (&) returns the memory address of a variable.

  • Value at operator (*) returns the value stored at a memory address.

  • Pointers can be used to manipulate data directly in memory.

Add your answer

Q64. Is a C program faster than a C++ compiled program

Ans.

It depends on the specific use case and implementation.

  • C and C++ have different strengths and weaknesses.

  • C is often used for low-level programming and system-level tasks.

  • C++ is often used for object-oriented programming and high-level tasks.

  • The performance difference between C and C++ can be negligible or significant depending on the implementation.

  • Optimizations and compiler settings can also affect performance.

  • Benchmarking and profiling can help determine which language is f...read more

Add your answer

Q65. Given an array of numbers (+ve and –ve), tell the subarray with the highest sum

Ans.

Find subarray with highest sum in an array of numbers.

  • Use Kadane's algorithm to find maximum subarray sum

  • Initialize max_so_far and max_ending_here to 0

  • Iterate through the array and update max_ending_here and max_so_far

  • Return the subarray with highest sum

  • Example: [-2, 1, -3, 4, -1, 2, 1, -5, 4] => [4, -1, 2, 1]

Add your answer

Q66. What all type of sorting algorithms do you know?

Ans.

I know various sorting algorithms including bubble sort, insertion sort, selection sort, merge sort, quick sort, heap sort.

  • Bubble sort - repeatedly swapping adjacent elements if they are in wrong order

  • Insertion sort - inserting each element in its proper place in a sorted subarray

  • Selection sort - selecting the smallest element and swapping it with the first element

  • Merge sort - dividing the array into two halves, sorting them and then merging them

  • Quick sort - selecting a pivot...read more

Add your answer

Q67. Pointers with increment/decrement, address of and value at operators (++,–,*,&amp;)

Ans.

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 stored at a memory address

Add your answer
Q68. Implement a stack using a singly linked list.
Ans.

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; }

Add your answer

Q69. What is the width of a tree?

Ans.

The width of a tree refers to the maximum number of nodes at any level in the tree.

  • The width of a tree can be determined by traversing the tree level by level and counting the maximum number of nodes at any level.

  • The width of a tree can also be calculated using breadth-first search (BFS) algorithm.

  • The width of a tree is not related to the height or depth of the tree.

View 1 answer

Q70. What is latchup and how it can be resolved

Ans.

Latchup is a condition in integrated circuits where parasitic thyristors are inadvertently triggered, causing a high current flow.

  • Latchup can be resolved by adding guard rings around sensitive components to prevent parasitic thyristors from triggering.

  • Using layout techniques such as spacing sensitive components further apart can also help prevent latchup.

  • Properly designing the power distribution network and ensuring proper grounding can also mitigate latchup issues.

Add your answer

Q71. What is Antenna effect and how it can be resolved.

Ans.

Antenna effect is the phenomenon where the gate of a transistor behaves like an antenna, causing unwanted signal interference.

  • Antenna effect occurs in integrated circuits due to the gate acting as an antenna and picking up external signals.

  • It can lead to performance degradation and reliability issues in the circuit.

  • To resolve antenna effect, techniques like adding shielding layers, changing layout design, and using guard rings can be employed.

  • Simulation tools can also be used...read more

Add your answer

Q72. Explain WPE and how it can be taken care.

Ans.

WPE stands for Water Pressure Equalization. It is a system used to maintain equal pressure in a water distribution network.

  • WPE helps prevent water hammer, which can damage pipes and fittings.

  • It ensures consistent water pressure throughout the network, even when demand fluctuates.

  • Regular maintenance of valves, pumps, and pressure regulators is essential to ensure the WPE system functions properly.

Add your answer

Q73. Em&amp;IR in detail and how these can be will resolved

Ans.

Em&IR stands for Emissions and Immunity in the context of design engineering. Resolving these issues involves identifying sources of electromagnetic interference and implementing mitigation techniques.

  • Em&IR refers to the study of electromagnetic emissions from electronic devices and their susceptibility to external interference.

  • Common sources of electromagnetic interference include power supplies, motors, and wireless communication devices.

  • To resolve Em&IR issues, design engi...read more

Add your answer

Q74. 1.What is defect life cycle? 2.difference between smoke and sanity 3.method overloading 4.selenium webdriver

Ans.

Defect life cycle is the process of identifying, reporting, fixing, retesting, and closing defects in software development.

  • Defect is identified by testing team

  • Defect is reported in a defect tracking tool

  • Development team fixes the defect

  • Testing team retests the fixed defect

  • Defect is closed if it passes retesting

Add your answer

Q75. What is the difference between C and C++

Ans.

C++ is an extension of C with object-oriented programming features.

  • C++ supports classes and objects while C does not.

  • C++ has better support for polymorphism and inheritance.

  • C++ has a larger standard library than C.

  • C++ allows function overloading while C does not.

  • C++ supports exception handling while C does not.

Add your answer

Q76. What is the difference between a latch and flip flop

Add your answer

Q77. Difference between static and dynamic bindings

Ans.

Static binding is resolved at compile-time while dynamic binding is resolved at runtime.

  • Static binding is also known as early binding while dynamic binding is also known as late binding.

  • Static binding is faster than dynamic binding as it is resolved at compile-time.

  • Dynamic binding is more flexible than static binding as it allows for polymorphism.

  • An example of static binding is method overloading while an example of dynamic binding is method overriding.

View 1 answer

Q78. What are blocking and non blocking assignments?

Ans.

Blocking assignments wait for the assigned value to be calculated before moving on to the next statement, while non-blocking assignments allow multiple assignments to occur simultaneously.

  • Blocking assignments use the = operator, while non-blocking assignments use the <= operator

  • Blocking assignments are executed sequentially in the order they appear in the code, while non-blocking assignments are executed concurrently

  • Blocking assignments are used for combinational logic, while...read more

Add your answer

Q79. Check if rectangles overlap or not and some pointers dicsussion

Ans.

Check if rectangles overlap by comparing their coordinates

  • Compare the x and y coordinates of the two rectangles to see if they overlap

  • If one rectangle is to the left of the other, or above the other, they do not overlap

  • If the rectangles overlap, the x and y ranges will intersect

Add your answer

Q80. Allocate a 2-D array using C/C++

Ans.

Allocate a 2-D array using C/C++

  • Use the 'new' operator to allocate memory for the array

  • Specify the number of rows and columns in the array

  • Access elements using array indexing

Add your answer

Q81. Height of a tree, diameter of a tree

Ans.

The height and diameter of a tree are important measurements for forestry and landscaping purposes.

  • Height can be measured using a clinometer or by using trigonometry and a measuring tape.

  • Diameter can be measured at breast height (4.5 feet above ground) using a diameter tape or by measuring circumference and dividing by pi.

  • These measurements are important for determining the health and growth of a tree, as well as for planning and managing forests and landscapes.

  • For example, a...read more

Add your answer

Q82. Capacitor and voltage in series and parallel

Ans.

Capacitors in series add reciprocally, in parallel add directly. Voltage in series is the sum, in parallel is the same.

  • Capacitors in series: 1/Ctotal = 1/C1 + 1/C2

  • Capacitors in parallel: Ctotal = C1 + C2

  • Voltage in series: Vtotal = V1 + V2

  • Voltage in parallel: Vtotal = V1 = V2

Add your answer

Q83. Which are the EDA tools you know

Ans.

Some EDA tools include Cadence Virtuoso, Synopsys Design Compiler, and Mentor Graphics ModelSim.

  • Cadence Virtuoso

  • Synopsys Design Compiler

  • Mentor Graphics ModelSim

Add your answer

Q84. Explain the MOSFET operation and Body Bias effect

Ans.

MOSFET is a type of transistor used in electronic devices. Body Bias effect refers to the change in threshold voltage due to biasing of the body terminal.

  • MOSFET stands for Metal-Oxide-Semiconductor Field-Effect Transistor.

  • It has three terminals: Gate, Source, and Drain.

  • The operation of a MOSFET involves controlling the flow of current between the Source and Drain terminals by applying a voltage to the Gate terminal.

  • Body Bias effect refers to the change in threshold voltage of...read more

Add your answer

Q85. What is UNION in C?

Ans.

UNION in C is a data type that allows storing different data types in the same memory location.

  • UNION is declared using the 'union' keyword.

  • It can be used to save memory by sharing the same memory location for different data types.

  • Accessing the members of a union can be done using the dot operator or the arrow operator.

  • Example: union myUnion { int i; float f; };

  • Example: myUnion.u.i = 10; myUnion.u.f = 3.14;

Add your answer

Q86. Cell padding concept in struct/class

Ans.

Cell padding is the space between the content of a cell and its border in a table.

  • Cell padding can be set using CSS or HTML attributes.

  • It affects the appearance of the table and can improve readability.

  • Padding can be set for individual cells or for the entire table.

  • Example:

  • Example: td { padding: 10px; }

Add your answer

Q87. Analyse the output of the circuitry

Ans.

The output of the circuitry needs to be analyzed for functionality and accuracy.

  • Examine the input and output signals to ensure they are within expected ranges

  • Check for any noise or interference in the output

  • Verify that the circuit is functioning as designed based on the specifications

  • Look for any potential issues or errors in the output

Add your answer

Q88. Write a verilog code for sequence detectro

Ans.

Verilog code for sequence detector

  • Use state machines to detect the desired sequence

  • Define states for each part of the sequence

  • Use combinational logic to transition between states

  • Implement the Verilog code using if-else statements and always blocks

Add your answer

Q89. write a c program on fibbonacci series

Ans.

A C program to generate Fibonacci series

  • Declare variables to store current and previous Fibonacci numbers

  • Use a loop to calculate and print Fibonacci numbers

  • Handle edge cases like 0 and 1 separately

Add your answer

Q90. Difference between regression n retesting

Ans.

Regression testing is testing the entire application after changes, while retesting is testing specific areas after fixes.

  • Regression testing is done to ensure that new code changes do not affect existing functionality.

  • Retesting is done to verify that a specific bug or issue has been fixed.

  • Regression testing involves running the entire test suite, while retesting focuses on specific test cases.

  • Example: After fixing a bug in the login functionality, retesting would involve test...read more

Add your answer

Q91. Find repetitive words in string program

Ans.

Program to find repetitive words in a string

  • Split the string into words using a delimiter like space

  • Create a hashmap to store word frequencies

  • Iterate through the words and update the hashmap

  • Identify words with frequency greater than 1 as repetitive

Add your answer

Q92. What is EMIR analysis

Ans.

EMIR analysis is a process used to assess the impact of new regulations on financial institutions.

  • EMIR stands for European Market Infrastructure Regulation

  • It involves analyzing the requirements set forth by EMIR and determining how they will affect the operations of financial institutions

  • This analysis helps organizations ensure compliance with EMIR regulations and make any necessary adjustments to their processes

Add your answer

Q93. Graphs data structure and algorithms?

Ans.

Graphs are data structures used to represent relationships between nodes. Algorithms like Dijkstra's and BFS are commonly used with graphs.

  • Graphs are composed of nodes (vertices) and edges that connect them.

  • Common graph algorithms include Dijkstra's shortest path algorithm and Breadth-First Search (BFS).

  • Graphs can be directed or undirected, weighted or unweighted.

  • Examples of graph applications include social networks, routing algorithms, and recommendation systems.

Add your answer

Q94. check substring palindrome or not

Ans.

Check if a substring in an array of strings is a palindrome or not.

  • Iterate through each string in the array

  • For each string, check if any of its substrings are palindromes

  • Return true if a palindrome substring is found, false otherwise

Add your answer

Q95. Reverse linked list recursively

Ans.

Reverse a linked list recursively

  • Create a recursive function to reverse the linked list

  • Pass the current node and its next node as parameters

  • Update the next pointer of the current node to point to the previous node

Add your answer

Q96. Array addition of two numbers

Ans.

Add two numbers represented as arrays

  • Iterate through the arrays from right to left, adding digits and carrying over if necessary

  • Handle cases where one array is longer than the other

  • Return the result as a new array

Add your answer

Q97. Access modifiers in java

Ans.

Access modifiers in Java control the visibility of classes, methods, and variables.

  • There are four types of access modifiers in Java: public, protected, default (no modifier), and private.

  • Public: accessible from any other class.

  • Protected: accessible within the same package or subclasses.

  • Default: accessible only within the same package.

  • Private: accessible only within the same class.

  • Example: public class MyClass {}

Add your answer

Q98. Complete code of all projects

Ans.

It is not common practice to provide complete code of all projects in an interview setting.

  • It is not recommended to share complete code of all projects due to confidentiality and intellectual property concerns.

  • Instead, focus on discussing the technologies used, challenges faced, and solutions implemented in your projects.

  • Provide code snippets or high-level overviews of your projects to showcase your skills and experience.

Add your answer

Q99. Explain the working of CMOS inverter

Ans.

CMOS inverter is a type of logic gate that converts input signals into their complementary outputs.

  • CMOS inverter consists of a PMOS transistor and an NMOS transistor connected in series.

  • When input is high, PMOS conducts and NMOS is off, resulting in output low.

  • When input is low, NMOS conducts and PMOS is off, resulting in output high.

  • CMOS technology is widely used in digital integrated circuits due to its low power consumption and high noise immunity.

Add your answer

Q100. Low power methods tried in ur work

Ans.

Implemented clock gating, power gating, and dynamic voltage and frequency scaling techniques to reduce power consumption in digital designs.

  • Utilized clock gating to disable clocks to unused logic blocks

  • Implemented power gating to completely shut off power to unused modules

  • Utilized dynamic voltage and frequency scaling to adjust voltage and frequency based on workload

  • Optimized power consumption through efficient design and coding practices

Add your answer
1
2
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at Vibhor Steel Tubes

based on 48 interviews
Interview experience
4.3
Good
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Interview Questions from Similar Companies

4.0
 • 407 Interview Questions
3.7
 • 339 Interview Questions
3.8
 • 301 Interview Questions
4.1
 • 221 Interview Questions
3.3
 • 150 Interview Questions
3.6
 • 144 Interview Questions
View all
Top Cadence Design Systems Interview Questions And Answers
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter