Category: Software Engineer In Test

0

Given an array, Print sum of all subsets

Objective: Given an array of numbers, write an algorithm to print all the subsets sum individually.   Example: Given Input: [1, 2] Output: 3 1 2 0 Explanation: subsets are [0], [1], [2], [1, 2]...

0

Lexicographically previous permutation With One swap

Objective: Given an array of integers (in particular order or permutation of a set of numbers), write an algorithm to find the lexicographically previous permutation of the given permutation with only one swap.  This...

0

Find all unique combinations of exact K numbers (from 1 to 9 ) with sum to N

Objective: Given two integers N and K. Write an algorithm to find all the combinations of k numbers which sum to N.  Conditions:  All K numbers must be between 1 and 9 and unique....

0

Maximum number edges to make Acyclic Undirected/Directed Graph

Given- Given V vertices, what is the maximum number of edges can be added to make Acyclic Undirected Graph. Follow up – what is the maximum number of edges that can be added to...

0

Evaluation of Prefix Expressions (Polish Notation) | Set 2

Earlier we had discussed how to evaluate prefix expression where operands are of single-digit. In this article, we will discuss how to evaluate prefix expression for any number ( not necessarily single digit.) Prefix...

0

ZigZag OR Diagonal traversal in 2d array/Matrix using queue

Objective: Given a two-dimensional array or matrix, Write an algorithm to print the given matrix in a zigzag manner or in other words print all the diagonals of the matrix. Example: int [][] grid...

0

Evaluation of Prefix Expressions (Polish Notation) | Set 1

Prefix notation is a notation for writing arithmetic expressions in which the operands appear after their operators. There are no precedence rules to learn. Let’s assume the below Operands are real numbers in real...

0

Evaluation of Postfix Expressions (Polish Postfix notation) | Set 2

Earlier we had discussed how to evaluate postfix expressions where operands are of single-digit. In this article, we will discuss how to evaluate postfix expressions for any number ( not necessarily single digit.) Postfix...

0

Evaluation of Postfix Expressions (Polish Postfix notation) | Set 1

Postfix notation is a notation for writing arithmetic expressions in which the operands appear before their operators. There are no precedence rules to learn, and parentheses are never needed. Because of this simplicity. Let’s...

0

Find all the numbers in the range which has prime set bits.

Objective: Given a range, find all the numbers in the range which has prime set bits. Example: L = 4, R = 10 Output: 5 Explanation: 4 = 1 0 0 ( not prime)...

0

Check if Arithmetic Expression contains duplicate parenthesis

Objective: Given an arithmetic expression, write an algorithm to find out whether the expression contains duplicate parenthesis. Duplicate Parenthesis: Two contiguous parentheses with no elements between them can be called as duplicate parenthesis.  Example:...

0

Determine the order of Tests when tests have dependencies on each other

Objective: You are working on a project where QA team has automated set of test cases for the project, but these test cases have to be executed in a specific order since test cases...

0

Find the maximum number present in a String

Given a string with alphabets and numbers. Write an algorithm to find the maximum number in the string. If any number is greater than equal to Max_Value of integer then return the Max_Value. Example:...

0

Convert Prefix to Postfix Expression

Objective: Given a Prefix expression, write an algorithm to convert it into Postfix expression. Example: Input: Prefix expression:  + A B  Output: Postfix expression: A B + Input: Prefix expression:  *-A/BC-/AKL Output: Postfix expression:...

0

Convert Roman Number to Integer

Objective: Given a Roman number, write a program to convert it to Integer. Roman Number –   Letters used in Roman numerals and the corresponding numerical values are given in the table below. Rules: ...

%d bloggers like this: