## Recent Interview Questions

- 0of 0 votes
Print combinations of strings from List of List of String

Example input: [[quick, slow], [brown, red], [fox, dog]]

Output:

quick brown fox

quick brown dog

quick red fox

quick red dog

slow brown fox

slow brown dog

slow red fox

slow red dog

- 0of 0 votes
Write a function that takes a list of positive integers as an input, and returns all of the pairs of integers it contains that sum to 100. You can assume that all inputs are between 1 and 99.

- 0of 0 votes
what is the heartbleed attack in Network security

- 1of 1 vote
You are given with an array of 1s and 0s. And you are given with an integer m, which signifies number of flips allowed.

find the position of zeros which when flipped will produce maximum continuous series of 1s.

e.g.

input:

arr={1 1 0 1 1 0 0 1 1 1 } m=1

output={1 1 1 1 1 0 0 1 1 1} position=2

arr={1 1 0 1 1 0 0 1 1 1 } m=2

output={1 1 0 1 1 1 1 1 1 1} position=5,6

- 1of 1 vote
Given a string (1-d array) , find if there is any sub-sequence that repeats itself.

Here, sub-sequence can be a non-contiguous pattern, with the same relative order.

Eg:

1. abab <------yes, ab is repeated

2. abba <---- No, a and b follow different order

3. acbdaghfb <-------- yes there is a followed by b at two places

4. abcdacb <----- yes a followed by b twice

The above should be applicable to ANY TWO (or every two) characters in the string and optimum over time.

In the sense, it should be checked for every pair of characters in the string.

- 0of 0 votes
This test was on https://www.hackerrank.com

Input is a string of Bytes E.g.341B

Convert it to human readable form: 3 characters long (excluding decimal)

No trailing or leading zeros

E.g:

Input 341B

Output 341B

Input 12345B

Output 12.3K

Input 1234567B

Output 1.23M

Input 1000000000B

Output 1G

Do not round off

Assume input will not be more than 1G

For this problem 1000B = 1K, so on and so forth

- 0of 0 votes
Write 4 testcases for the usecase "Customer buys a book with the credit card payment option."

- 0of 0 votes
Write 4 testcases for the usecase "Customer buys a book with the credit card payment option."

- 0of 0 votes
Write 4 testcases for the usecase "Customers buy a book with the credit card payment option."

- 0of 0 votes
Write a test plan for the first time launch of a website that will sell digital books.

- 0of 0 votes
We are given a specific time(like 02:23), we need to get the angle between hour and minute(less than 180)

- -2of 2 votes
Given an array of numbers print the values in diagonal format.

Example (1) for 8 dataset

Input Array : [1, 2, 3,4,5,6,7,8]

Output

01 02 04 07

03 05 08

06

Example (2) for 45 dataset

Input Array: [1, 2, 3,4,5,6,7,8,9,10â€¦â€¦â€¦.44, 45]

Output

01 02 04 07 11 15 19 23 27 31 35 39

03 05 08 12 16 20 24 28 32 36 40 43

06 09 13 17 21 25 29 33 37 41 44

10 14 18 22 26 30 34 38 42 45

Code in Java.

- 0of 0 votes
Write a program to implement Double Linked List from Stack with min. complexity.

- 0of 0 votes
Given a string and a regular expression pattern, give the number of times the pattern occurs in the string. RegEx example means as follows:

. â€“ 2 occurrences of the previous character

+ â€“ 4 occurrences of the previous character

* â€“ more than 5 occurrences of the previous character

Sample Input:

5

aaaaaannndnnnnnnfffhfhhgjjjwkkkllclc

a.

n+

a*

an.

a.d.

Sample Output:

5

3

2

1

0

- 0of 0 votes
Write a method to create a deep-clone of an instance of the class Drawing.

public class Drawing {

public List < Shape > shapes = new LinkList < Shape >();

}

where shape is an abstract class which can have many concrete implementation

public abstract class Shape implements Serailizable {

---

}

- 0of 0 votes
Write a method to create a deep-clone of an instance of the class Drawing.

public class Drawing {

public List<Shape> shapes = new LinkedList<Shape>();

}

where shape is an abstract class that can have many concrete implementations:

public abstract class Shape implements Serializable {

}

- 0of 0 votes
Write test cases for adobe reader , Adobe flash player ,

- 0of 0 votes
What functionality and technicality you want to add in new media player when you are going to launch it in current market.

- 0of 0 votes
What functionality and technicality you want to add in new Operating system when you are going to launch it in current market.

- 0of 0 votes
What functionality and technicality you want to add in new web browser, when you are going to launch it in current market.

- 0of 0 votes
What functionality and technicality you want to add in mobile phone when you are going to launch it in current market.

- 1of 1 vote
Given number of digits of a phone number and number of disallowed digits as input, find all permutations of numbers which do not have two adjacent numbers the same, i.e. 1232 is allowed but not 1223. Disallowed digits can be upto 3, and can be included along with the phone number. Also the phone number should start with 4 if it contains the number 4.

- 0of 0 votes
The decimal and octal values of some numbers are both palindromes sometimes. Find such numbers within a given range.

- 0of 0 votes
If one and a half teenagers, eat one and a half pizzas in one and a half days, how many pizzas can 9 teenagers eat in 3 days

- -1of 1 vote
How to implement split () method

- -1of 1 vote
How to implement split () method

- -1of 1 vote
Write a program to split a string without using split()method

- 0of 0 votes
Replace %20 with ' '.

E.g. input: www.space%20.com

output: www.space .com

- 0of 0 votes
Suppose I am given a set of input strings input[5](five of them) and their corresponding replacement strings replace[5]. Then I am given an input text, how can I replace the strings in the text matching any of the inputs with their corresponding replacements.

Also I have to make sure that if suppose, I find a match input[0] and I replace it by replace[0], then because of that it could be possible that I have a new match for input[2] lets say because of the new characters added by replace[0]. I don't want to make replacements with replace[2].

Also I cannot use regex of java.

- 0of 0 votes
Suppose I am given a set of input strings input[5](five of them) and their corresponding replacement strings replace[5]. Then I am given an input text, how can I replace the strings in the text matching any of the inputs with their corresponding replacements.

Also I have to make sure that if suppose, I find a match input[0] and I replace it by replace[0], then because of that it could be possible that I have a new match for input[2] lets say because of the new characters added by replace[0]. I don't want to make replacements with replace[2].