You are on page 1of 9

--------------------Dhivya

1) compare two strings, if the characters in string 1 are present in


string 2, then it should be put as such in output, else '+' should be
put in output...ignore case difference.
input 1:"New York"
input 2:"NWYR"
output:N+w+Y+r+
2)
input
Searchstring s1="GeniusRajkumarDev";
String s2="Raj";
String s3="Dev";
Return 1 if s2 comes before s3 in searchstring else return 2
3) months between two dates
4) intput="xyzwabcd"
intput2=2;
input3=4;
output=bawz
5)
String input1="--this--is---";
String input2="--adsf--is---";
return 1 if count and indexes of '-' in both the string is same
else return 2
---------------manisha
1.Given integer array
input :int[] arr={2,3,54,1,6,7,7};
Remove the duplicate elements and print sum of even numbers in the array
..
print -1 if arr contains only odd numbers

2. given an integer 345 print it as 543..

3. in a map, find the value corresponding to the largest key


input{12:"hari",13:"krish",18:"mani"}
output:,mani

4. input1="abc2012345"
input2="abc2112660"
input 3=4
here "abc20" refers to customer id and 12345 refers to the last month eb reading
and 12660 refers to this month eb reading
find the difference between 12660 and 12345 and multiply itr by input3
ie., output=(12660-12345)*4

5.Check if a string palindrome.Return 1 if the string is palindrome as well as


it should have more than 1 unique vowels. else return -1
Eg: nayan is a palidrome but only 1 unique vowel 'a' return -1
Eg: naeyean return 1
---------------yuvaranjani
1) Given the first name and last name,hv to print the last name first then follo
wed by "," and first character of the first name.
Input: Steve jobs
Output: jobs,S
2)Given two hashmap h1 with employee id and designation and hashmap h2 with id a
nd salary, in a new Haspmap the manager id and salary with the increment of 5000
has to added and printed.
Input: {1="analyst",2="manager"}
Input2:{1=2000,2=5000}
output:{2=10000}
3)Given two string with "-".check whether the two strings has the "-" at same pl
ace.if same print 1,else 2.
Input:"---abb---"
Input2:"---dfg---"
Output:1
4)Given array of intergers,print the sum of square of elements at the power of t
heir indices.
Input:{2,2,5}
Output:28
5)Given array of string check whether all the elements contains only digits not
any alaphabets.if condn satisfied print 1 else -1.
Input:{"123","23.14","522"}
output:1
Input1:{"asd","123","42.20"}
output:-1
--------------sakthi
1) reverse of a string
input="1234"
output="4321"
2) input="flower.gif"
output=gif

3) months between two dates


4) int[] a={12,14,2,26,35}
find the difference b/w max and min values in array
output:35-2=33.
5)
compare two strings, if the characters in string 1 are present in
string 2, then it should be put as such in output, else '+' should be
put in output...ignore case difference.
input 1:"New York"
input 2:"NWYR"
output:N+w+Y+r+
----------Hemnath
1) input="14/12/2012"
output=friday
2) Given an array find the largest 'span'(span is the number of elements between
two same digits)
arr[]={1,4,2,1,4,1,5}
Largest span=6
3) intput="xyzwabcd"
intput2=2;
input3=4;
output=bawz
4) password validation
5) input={"1","2","3","4"}
output=10
input={"a","b"}
output=-1;
---------srinivasan
1) reverse of a string
input="1234"
output="4321"
2) arraylist1={ 1,2,3,4,5}
arraylist2={ 6,7,8,9,10}
size of both list should be same
output={6,2,8,4,10}
3) Input:"---abb---"
Input2:"---dfg---"
Output:1
4) Given array of string check whether all the elements contains only digits not
any alaphabets.if condn satisfied print 1 else -1.
Input:{"123","23.14","522"}
output:1
5) input

Searchstring s1="GeniusRajkumarDev";
String s2="Raj";
String s3="Dev";
Return 1 if s2 comes before s3 in searchstring else return 2
-------manohar
1)
input
Searchstring s1="GeniusRajkumarDev";
String s2="Raj";
String s3="Dev";
Return 1 if s2 comes before s3 in searchstring else return 2
2) removing vowels in even position
intput=commitment;
output=cmmitmnt
3) count the number times the second word in second string occurs in first strin
g-case sensitive
input=hai hello hai where hai Hai;
input2=what hai
output=3;
4) return sum od non prime number
intput=9;
out put=1+4+6+8+9=28
-------steffie
1) input
Searchstring s1="GeniusRajkumarDev";
String s2="Raj";
String s3="Dev";
Return 1 if s2 comes before s3 in searchstring else return 2
2)
input1=130
input2=150
find the palindrom nos b/w the range and find the sum
output=272
3)
range 0-255
input=255.55.33.155
output = true
input=300.55.33.155
output = false
4) String a[]={"abx-23-78","des-90-12","ghi-45-23"};
find the sum of marks in each string.Find the max mark and find the correspondin
g name.
output:des
5) find if a charcter has repeated 3 consequetive times

input1:"aaabbccc"
ouput1=2;
----------swathi
1) input
Searchstring s1="GeniusRajkumarDev";
String s2="Raj";
String s3="Dev";
Return 1 if s2 comes before s3 in searchstring else return 2
2) reverse of a number
3)input={1,4,5,2,8,3}
find difference b/w adjacent numbers and return index of biggest number
8-2=6
output=index of 8
4) input="hai this is cognizant academy"
input2="hello this is a trainee"
find the occurance of the second word from the second string in the first strin
g
output=1
5) no of days b/w two dates
---------vasanth
1)input1="ABC2012333" (STRING) first five chars are consumer nos and next five
are units for current bill
input2="ABC2012444" (STRING) first five chars are consumer nos and next five
are units for current bill
INPUT3=4
(INT)
charge per unit
output= (input2-input1) * input3
output=(444-333)*4;
2)ID validation
3)compare two strings, if the characters in string 1 are present in
string 2, then it should be put as such in output, else '+' should be
put in output...ignore case difference.
input 1:"New York"
input 2:"NWYR"
output:N+w+Y+r+

4)What will be the DAY of current date in next year

-----------------------Brabanjana-------------------------1)
Searchstring s1="GeniusRajkumarDev";
String s2="Raj";

String s3="Dev";
Return 1 if s2 comes before s3 in searchstring else return 2

2)compare two strings, if the characters in string 1 are present in


string 2, then it should be put as such in output, else '+' should be
put in output...ignore case difference.
input 1:"New York"
input 2:"NWYR"
output:N+w+Y+r+
3)input1=130
input2=150
find the palindrom nos b/w the range and find the sum
output=272

4)No :of months between two dates

5)Input: HashMap 1:<Name,Designation>


HashMap 2:<Name,Salary>
Increment the salary of Managers by 5000
6)Input:String
Output:int
Get all the numbers from the string and return the sum.
Input"123gdf"
Output:6

7)Number of days between two dates


8)Input : Hashmap<Integer,Integer>
Find keys which are odd and calculate the sum of its corresponding value

9)Input1:String (Rabbit)
Input 2:'-'
Insert the second char between each characters in the string after reversing
output:t-i-b-b-i-R

10)Average b/w largest and smallest element in an array of int

11) input={1,2,13,15,20,30}
input2=10;
sum the element and reverse the result;
output=87
-------------------vijay
1.
2.
3.

4.

STRING 1="---FALG----P-E"
STRING 2="---LOBD----K-I"
INDEX AND POSITION OF STRING 1 AND 2 "-" SHOULD BE SAME
DIFF BETWEEN 2 DATES(D1 AND D2) O/P IN MONTHS
LIST1={12,13,14,15,16};
LIST2={2,3,4,5,6};
CONDITION-INDEX-0---TAKE AS EVEN
O/P====EVEN INDEX OF LIST2,ODD INDEX OF LIST2EVEN INDEX OF LIST1
eg:{2,13,4,15,6}
STRING S="FLOWE.GIF"
O/P SHOUD BE EXTENSION OF FILE(eg:GIF)

----------------vijayan
1. In an integer array, each element should be raised to the power of
the index, and they should be added. the sum is the output.
eg:input{1,2,3,4}
output:1+2+9+64=76
2. validation of a time in hh:mm format...ignore case for am and pm
input:"9:25 am"-valid
"12:59 PM"-valid
"13:45 am"-invalid
3. sum of non prime numbers upto n
4.
Check if a string palindrome.Return 1 if the string is palindrome as wel
l as
it should have more than 1 unique vowels. else return -1
Eg: nayan is a palidrome but only 1 unique vowel 'a' return -1
Eg: naeyean return 1
5. input1=aaabbxxxc
output1=2
input1=abcd
output1=-1 have to count the character coming 2 or more consecutive time
s..
if true then return no of counts else -1
----------------ram_anna
1.input array={red,green,blue,ivory}
sort the given array
reverse the given array
if user input is 1 it should give oth element of an reversed array.
2.In a hash map<Integer,Float> get the average of all the values in a map and ro

und of to two decimal values.


eg:{1:2.2f,2:3.3f}
output:5.75
3.input: String 1="sriram12345babu6"
output:21
4.String a="a very fine day"
output:A Very Fine Day
5.First ArrayList:1 5 6 8 9
Second ArrayList: 5 6 7 9
output:5 5 7 8
logic: iterate the first array list find odd index elements and keep it in a new
Array list without changing its index
Iterate the second array list find the even index elements and keep it in a new
Array list without changing its index.

----------Saranraj
1. return sum od non prime number
intput=9;
out put=1+4+6+8+9=28
2.check for the exact date format like dd/MM/yyyy
Input 1:12/06/2003
print--> 1
Input 2:12/6/2003
print-->-1
3.PAN CARD Validation
4.String Array should contain oly numbers !
Input 1={"12","12.35","one"}
output--->-1
Input 2={"12","12.35"}
output---->1
5.Take the word with a ma length in the given sentance in that check for vowels
if so count the no.of occurances !
Input 1="God is Great"
Output =2
Input 1="God is Greeat"
Output =3
------------sam
1.reverese the numbers
i/p = 13223
o/p = 32231
2.sum of Palindrome numbers between 2 limits (upper and lower), do not consider
single digit as palindrome.
If number is not palindrome return 0
ip1- 11
ip2 35
o/p-(11+22+33)-66

3. No repetiton of characters
i/p - hello world
o/p - helo wrd
4.In Hashmap, if the key value is divisable by 4 ,delete the key and values and
return a int value of the remaining count
ip1-{12,"hi"},{2,"world"}
op - 1
5. for the given string display the middle 2 value, case satisfies only if strin
g is of even length
ip - java
op av

You might also like