Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent activity in Tier 1 Placement Questions
0
votes
0
answers
1
Make Equal Subarray Problem Statement You are given two arrays (A and B) each of size N. You want to change A to B.
Make Equal SubarrayProblem StatementYou are given two arrays (A and B) each of size N.You want to change A to B. Changing the i-th element of A to i-th element of B costs...
rk231219
1.6k
views
rk231219
asked
Jan 5, 2022
2
votes
1
answer
2
Open the lock
You are given a number lock of 4 digits and it accepts a serial input. What should be the minimum length of an input string so that the lock is guaranteed to open assuming it opens if any of the consecutive 4 digits matches the code. Also how to get one such sequence?
You are given a number lock of 4 digits and it accepts a serial input. What should be the minimum length of an input string so that the lock is guaranteed to open assumin...
Shiva Sagar Rao
1.3k
views
Shiva Sagar Rao
answer edited
May 27, 2021
Algorithm Challenges
algorithm-challenge
placement-questions
+
–
1
votes
1
answer
3
what is the best time complexity to find maximum product of exactly k elements in an array ?
According to me first we sort the array in O(nlogn) time and then in O(k) time , find the product , so total time complexity is O(nlogn) , so am I right or can it be done in lesser time ?
According to me first we sort the array in O(nlogn) time and then in O(k) time , find the product , so total time complexity is O(nlogn) , so am I right or can it be done...
Shiva Sagar Rao
2.0k
views
Shiva Sagar Rao
answer edited
May 25, 2021
Algorithm Challenges
algorithm-challenge
placement-questions
+
–
0
votes
0
answers
4
Evaluate an arithmetic expression
Given an arithmetic expression involving *, + only write an object oriented code for its representation and evaluation
Given an arithmetic expression involving *, + only write an object oriented code for its representation and evaluation
Shiva Sagar Rao
1.1k
views
Shiva Sagar Rao
retagged
May 25, 2021
Algorithm Challenges
algorithm-challenge
placement-questions
+
–
1
votes
0
answers
5
Equivalence of Boolean Expressions
Write an object oriented code for representing boolean expressions and then a function for checking the equivalence of two boolean expressions.
Write an object oriented code for representing boolean expressions and then a function for checking the equivalence of two boolean expressions.
Shiva Sagar Rao
449
views
Shiva Sagar Rao
retagged
May 25, 2021
Algorithm Challenges
algorithm-challenge
placement-questions
+
–
2
votes
2
answers
6
Maximum Continuous Sum in an Array
Given an array of $n$ elements find the maximum continuous sum in it. For example consider the below array of $n=6$. 23 4 -10 2 15 1 Answer is 35.
Given an array of $n$ elements find the maximum continuous sum in it. For example consider the below array of $n=6$.23 4 -10 2 15 1Answer is 35.
Shiva Sagar Rao
3.0k
views
Shiva Sagar Rao
retagged
May 25, 2021
Algorithm Challenges
algorithm-challenge
placement-questions
dynamic-programming
+
–
13
votes
3
answers
7
IIITH-PGEE 2016
An anthropologist is visiting the island of knights and knaves one after the other.. This particular island is a very peculiar place, for it has only two kinds of inhabitants, namely, knights and knaves! Now, knights always tell the truth and knaves always lie! There are cluster of ... B: A is a knave, and this is the island of Maya. Is this the island of Maya? What are A and B ?
An anthropologist is visiting the island of knights and knaves one after the other.. This particular island is a very peculiar place, for it has only two kinds of inhabit...
gatecse
2.1k
views
gatecse
recategorized
Apr 25, 2021
Puzzles
puzzles
puzzle
iiith-pgee
verbal-aptitude
+
–
6
votes
4
answers
8
Wine Bottle
A bad king has a cellar of 1000 bottles of delightful and very expensive wine. A neighboring queen plots to kill the bad king and sends a servant to poison the wine. Fortunately (or say unfortunately) the bad king's guards catch the servant after he has only poisoned one ... in mind of the king, how will he be able to do so ? (of course he has less then 1000 prisoners in his prisons)
A bad king has a cellar of 1000 bottles of delightful and very expensive wine. A neighboring queen plots to kill the bad king and sends a servant to poison the wine. Fort...
jayeshasawa001
5.7k
views
jayeshasawa001
commented
Sep 7, 2020
Puzzles
puzzle
puzzles
placement-questions
+
–
3
votes
2
answers
9
Amazon Interview question on Linked list
Given a linked list : 1->2->3->4->5->6, make the following changes 1->6->2->5->3->4 What would be the most effiicient way to make this change?
Given a linked list :1->2->3->4->5->6,make the following changes1->6->2->5->3->4What would be the most effiicient way to make this change?
soujanyareddy13
2.3k
views
soujanyareddy13
retagged
May 22, 2020
Algorithm Challenges
linked-list
algorithms
amazon-interview
+
–
1
votes
4
answers
10
Maximum length substring with k unique characters
Given an input string of length $n$, find the maximum length of the substring containing maximum $k$ unique characters. For example, for "abbcdaadcd" and $k=2$ answer will be 4 for the substring "daad".
Given an input string of length $n$, find the maximum length of the substring containing maximum $k$ unique characters. For example, for "abbcdaadcd" and $k=2$ answer wil...
Debargha Bhattacharj
1.9k
views
Debargha Bhattacharj
answer edited
Feb 18, 2019
Algorithm Challenges
placement-questions
interview
+
–
0
votes
0
answers
11
InterView Bit
Given a non negative integer A, following code tries to find all pair of integers (a, b) such that a and b are positive integers a <= b, and a2 + b2 = A. 0 <= A <= 100000 However, the code has a small bug. Correct the bug and submit the ... b * b == A) { vector<int> newEntry; newEntry.push_back(a); newEntry.push_back(b); ans.push_back(newEntry); } } } return ans; }
Given a non negative integer A,following code tries to find all pair of integers (a, b) such thata and b are positive integersa <= b, anda2 + b2 = A.0 <= A <= 100000Howev...
aambazinga
1.5k
views
aambazinga
commented
Oct 26, 2018
1
votes
1
answer
12
interview\ C program\ What is output
main() { int arr2D[3][3]; printf("%d\n", ((arr2D==* arr2D)&&(* arr2D == arr2D[0])) ); }
main() { int arr2D[3][3]; printf("%d\n", ((arr2D==* arr2D)&&(* arr2D == arr2D[0])) ); }
Salazar
2.6k
views
Salazar
commented
Jan 22, 2018
Puzzles
programming-in-c
output
pointers
+
–
0
votes
1
answer
13
Coding String
Input You are given a template in which you need to implement a function whose signature is given below. C int findWordInAGrid(char grid[128][128], int m, int n, char word[32]) /* return 0 for false, 1 for true. */ C++ bool findWordInAGrid(char grid[128] ... abc abedhi efgh Output: The output of the above example should be: abc: true abedhi: true efgh: false Constraints 1 ≤ m,n ≤ 100
InputYou are given a template in which you need to implement a function whose signature is given below.C int findWordInAGrid(char grid[128][128], int m, int n, char word[...
habedo007
534
views
habedo007
answered
Sep 13, 2017
Puzzles
algorithms
+
–
2
votes
1
answer
14
Zigzag Arrangement
Given an array with possible repeating elements you have to rearrange such that elements are alternatively decreasing and increasing (strict increase/decrease). For example, suppose the given array is 1 1 2 3 4 5 one possible answer would be 2 1 3 1 5 4. Assumption: Solution do exist for any given input. Hint: Try to avoid sorting.
Given an array with possible repeating elements you have to rearrange such that elements are alternatively decreasing and increasing (strict increase/decrease). For examp...
Arjun
1.6k
views
Arjun
retagged
Jun 25, 2017
Algorithm Challenges
array
combinatory
placement-questions
+
–
3
votes
1
answer
15
Permutation of String
How to generate permutation of a string? What will be the complexity?
How to generate permutation of a string? What will be the complexity?
Arjun
993
views
Arjun
retagged
Jun 25, 2017
Algorithm Challenges
combinatory
non-gate
+
–
1
votes
1
answer
16
Finding best time complexity
$\begin{align*} & a[n] = \{x_1,x_2,x_3,x_4,....,x_n\} \text{ is an array of integers where } n,x_i > 0. \\ & A = \left [ \text{min}\left ( x_i,x_j \right ) \right ] \cdot \left ( j-i \right ) \text{ where } j > i \text{ and } i,j \leq n \\ & \text{What is the best time complexity to find out the value of } A_{\bf max} \; ? \end{align*}$
$\begin{align*} & a[n] = \{x_1,x_2,x_3,x_4,....,x_n\} \text{ is an array of integers where } n,x_i 0. \\ & A = \left [ \text{min}\left ( x_i,x_j \right ) \right ] \cdot ...
air1
1.1k
views
air1
commented
May 28, 2017
Algorithm Challenges
algorithms
time-complexity
+
–
0
votes
2
answers
17
Multiplication without '*'
Write a function (proper programming code) for multiplying two integers without using '*' operator and considering all corner cases.
Write a function (proper programming code) for multiplying two integers without using '*' operator and considering all corner cases.
ManojK
1.2k
views
ManojK
answer edited
Jun 11, 2016
Algorithm Challenges
placement-questions
+
–
To see more, click for all the
questions in this category
.
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register