## A9 Interview Questions

- 0of 0 votes
You have a long string that contains of 0's and 1's, seprated with some delimiter (like "!"). the number of delimeters after each 0 or 1 is between 1 to 3.

for example a string such as 0! 1!!! 0!! 1!! 0! 1! 0!!! 1!! 0!! (and so on...)

Take this long string and convert it to a 7 digits number by some porgramming algorythem,

(you can use every lanugage you want)

- 0of 0 votes
Given (a,b) can you reach to (c,d) if a and b can move either (a+b,b) or (a,a+b). Example a =1, b=4,c=5,d=9 then (1,4) -> (5,4) -> (5,9)

- 0of 0 votes
A List contains objects (a collection even). On iterator.next(), if a collection is encountered it should traverse it until it finds an object(not collection). Entering list.get(4) should give the object at 4th position

List contains - String, Double, List(Double, Person), List(Employee, Long). list.get(4) should return Employee

write a java function?

- 0of 0 votes
Write a program to detect cycle in loop.

- 0of 0 votes
Write a program to sort an array in nlog(n) complexity

- 0of 0 votes
Write an algorithm to randomize nodes of a Binary Tree without using any data structures

- -5of 5 votes
wkhdqwdhqowdh

- -5of 5 votes
Hello, I am moving to Brazil and I am looking for a property in São Paulo hear about Lopes, someone knows? She is good ?

http://www.lopes.com.br/

- 1of 1 vote
Given an unsorted array, find Kth smallest element in it.

A = 12, 3, 17, 0, 9, 6, 100

K = 3 -> 6

- 0of 0 votes
write a function that takes two integers, k and n, with 0 ≤ k ≤ n, and prints out all subsets of size k of the integers 1, ..., n, one subset per line. The order of the subsets and the order of elements within the line doesn't matter.

example 1: print_subsets(k=1, n=2);

1

2

example: print_subsets(k=2, n=3);

3 1

2 3

1 2

- 1of 3 votes
New CareerCup Android App!!!

Hey Guys,

Lately I was trying to get android app for this website and no single app was good enough for me.

So I thought of developing it myself. After 2 weekends of work I released first version of the app. With lot more new features lined up.

Please download it here

https://play.google.com/store/apps/details?id=com.careercup

and give your reviews and ratings.

Thanks

- 1of 1 vote
You are given a file which contains 3 values - start time, end time, amount of water flowing between the start time and end time for one day

The start time and end time may overlap and are inclusive. The times are not in a sorted order

Example:

0,10,100

10,15,300

16,20,400

5,15,200

Find the max flow of water at any instant of time.

In the above example, the answer is 600 ( at instant 10)

- 0of 2 votes
You are driving a bus along a highway, full of rowdy, hyper, thirsty students and a soda fountain

machine. Each minute that a student is on your bus, that student drinks one ounce of soda. Your

goal is to drop the students off quickly, so that the total amount of soda consumed by all students

is as small as possible.

You know how many students will get off of the bus at each exit. Your bus begins somewhere

along the highway (probably not at either end) and move s at a constant speed of 37.4 miles per

hour. You must drive the bus along the highway; however, you may drive forward to one exit then

backward to an exit in the opposite direction, switching as often as you like. (You can stop the

bus, drop off students, and turn around instantaneously.)

Describe an efficient algorithm to drop the students off so that they drink as little soda as

possible. Your input consists of the bus route (a list of the exits, together with the travel time

between successive exits), the number of students you will drop off at each exit, and the current

location of your bus (which you may assume is an exit).

I gave a recursive solution but he insisted on dynamic programming which i couldn't give

- 0of 0 votes
If we have all the variables and methods are as static. So would that class be thread safe?

- -1of 1 vote
there is PCB robot move from point of beginning go to destination find the shortest distance/shortest path from starting to destination

- 2of 2 votes
Problem Statement

You have two strings A and B. Each one contains some letters and exactly one asterisk.

You have to replace the asterisk in each string with a letter sequence (possibly of zero length) so that the resulting two

strings are equal. This equal string is what you have to return. Attempt to return the shortest possible string.

The letter sequences may be same or different.

If it is not possible to make the given strings equal, return the string "not-possible".

Additional Constraints

- A and B will contain only uppercase letters and asterisks.

- A and B will contain one asterisk each.

Examples

0)

"SOCIA*TWIST"

"SOCIALTWI*T"

Returns: "SOCIALTWIST"

1)

"HELLO*"

"HI*"

Returns: "not-possible"

2)

"PROFESS*"

"*PROFESS"

Returns: "PROFESS"

3)

"*EXAMPLETEST"

"THIRDEXAMPLE*"

Returns: "THIRDEXAMPLETEST"

4)

"*TELL"

"*AFRIEND"

Returns: "not-possible"

5)

"*"

"B*"

Returns: "B"

6)

"*C"

"D*"

Returns: "DC"

program should be written in java

- 0of 0 votes
You type www.yahoo.com on the browser . But it will display

nothing or blank page.what is the problem?How will you resolve/

- 2of 6 votes
COUNT 1s in BINARY FORMAT OF A NUMBER.

- 4of 8 votes
Given a matrix with only 1s and 0s now find and PRINT SUB MATRIX WITH EQUAL NUMBER OF 0s AND 1s.

- 2of 2 votes
Given a list of stock quotes over a month of time,

Return the buy day and sell day which gives the max

profit.

- 0of 0 votes
Given an array of integers and the target as an input E.g.

input = {5,2,1,4,3,6,7,8} .. target : 333 it should true as (5 +214 + 36 + 78) if the target does not match it should return false.... Eg. of false input : {5,5} target:60 ... It should return false as the combinations possible are 5+5 = 10 and 55

- 0of 0 votes
There are total of n boxes kept in a single row next to each other .

Each box has weight W(i) .

How to split the boxes into two groups such that the difference between the total weight of the two groups is minimum and

the boxes in each group maintain the order in which they were initially.Also there is a condition that there if the total number of boxes is even ,

then both the groups should have n/2 boxes and if n is odd , one group should have (n-1)/2 and other (n+1)/2 boxes.

for example....

lets say there are 3 boxes of weight 6,12,5.

then the solution would be that one group has 6,5 and other has 12

- 0of 0 votes
Given a random number generator say r(5) generates number between 1-5 uniformly at random , use it to in r(7) which should generate a random number between 1-7 uniformly at random.

- 0of 0 votes
Given a big list of "n" integers stored in the disk compute the Top "k" , assume k << n and sizeof(n) > sizeof RAM .

- 0of 0 votes
Given an array of n elements, how would you compute product of all (n-1) groups of elements? Take care of any corner cases too.

- 0of 0 votes
What different types of joins are there in SQL?

- 0of 0 votes
How will you do inheritance in C without using any C++ constructs?