Alation Interview Questions  

See also
Cadence Interview Questions
Please click Like if you loved this article?

Array Questions Alation

Question 1. Remove Minimum Number of Elements Such That no Common Element Exist in both Array Given two arrays A and B consisting of n and m elements respectively. Remove minimum number of elements such that no common element exist in both array and print the count of elements which removed. Example   Input: A[]={ 1, 2, 1, 1} B[]= {1, 1} Output: Please click Like if ...

Read more

Question 2. Addition of Two Matrices Problem Statement   In the “Addition of Two Matrices” problem, we have given two matrices a and b. We have to find the final matrix after adding matrix b in matrix a. If the order is the same for both the matrices then only we can add them otherwise we can’t. ...

Read more

String Questions Alation

Question 3. Longest Substring Without Repeating Characters Given a string, we have to find the length of the longest substring without repeating characters. Let’s look into a few examples: Example   pwwkew 3 Explanation: Answer is “wke” with length 3 aav 2 Explanation: Answer is “av” with length 2 Approach-1 for Longest Substring Without Repeating Characters    Brute Force  ...

Read more

Tree Questions Alation

Question 4. Check whether a given Binary Tree is Complete or not Problem Statement   The problem “Check whether a given Binary Tree is Complete or not” states that you are given the root of a binary tree, check whether the tree is complete or not. A complete Binary Tree has all its levels filled except for the last level and the nodes ...

Read more

Question 5. Count the number of nodes at given level in a tree using BFS Description   The problem “Count the number of nodes at given level in a tree using BFS” states that you are given a Tree (acyclic graph) and a root node, find out number of nodes at L-th level. Acyclic Graph: It is a network of nodes connected through edges which has ...

Read more

Graph Questions Alation

Question 6. Count the number of nodes at given level in a tree using BFS Description   The problem “Count the number of nodes at given level in a tree using BFS” states that you are given a Tree (acyclic graph) and a root node, find out number of nodes at L-th level. Acyclic Graph: It is a network of nodes connected through edges which has ...

Read more

Queue Questions Alation

Question 7. Implementation of Deque using Doubly Linked List Problem Statement   The problem “Implementation of Deque using Doubly Linked List” states that you need to implement the following functions of Deque or Doubly Ended Queue using a doubly linked list, insertFront(x) : Add element x at the starting of Deque insertEnd(x) : Add element x at the end of ...

Read more

Question 8. Check whether a given Binary Tree is Complete or not Problem Statement   The problem “Check whether a given Binary Tree is Complete or not” states that you are given the root of a binary tree, check whether the tree is complete or not. A complete Binary Tree has all its levels filled except for the last level and the nodes ...

Read more

Question 9. Smallest Multiple of a Given Number In the smallest multiple of a given number made of digits 0 and 9 only problem we have given a number n, find the smallest number made from digits 0 and 9 that is divisible by n. Assume that the answer will not exceed 106. Examples   Input 3 Output 9 ...

Read more

Matrix Questions Alation

Question 10. Addition of Two Matrices Problem Statement   In the “Addition of Two Matrices” problem, we have given two matrices a and b. We have to find the final matrix after adding matrix b in matrix a. If the order is the same for both the matrices then only we can add them otherwise we can’t. ...

Read more