Professional Documents
Culture Documents
As per discussion regarding job opening for Trainer – Java for our client Cognizant @ Chennai .
Kindly revert back.
1. c and SQL for 3 hrs ( 30 mcqs and 6 programs / queries form C / SQL) - Joins and sub
queries for SQL and Programming logic for C need to be concentrated
2. Java for 3 hrs(20 mcqs and 6 programs) - Collections and String functions need to be
concentrated
Model Questions
C Programs
Java program
1.A integer array is given as input. find the difference between each element.
Return the index of the largest element which has the largest difference gap.
input: {2,3,4,2,3}
logic: 2-3=1,3-4=1,4-2=2,2-3=1
2 is the max diff between 4 and 2,return the index of 4(2)
output:2
2.Find the sum of the numbers in the given input string array
Input{“2AA”,”12”,”ABC”,”c1a”)
Output:6 (2+1+2+1)
Note in the above array 12 must not considered as such
i.e,it must be considered as 1,2
3.Email Validation
String input1="test@gmail.com"
1)@ & . should be present;
2)@ & . should not be repeated;
3)there should be five charcters between @ and .;
4)there should be atleast 3 characters before @ ;
5)the end of mail id should be .com;
5.INPUT1= helloworld
INPUT2= 2. delete the char,if rpted twice.
if occurs more than twice,leave the first occurence and delete the duplicate
O/P= helwrd;
6. 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.
1.A String contains a list of states and capitals. Write a method which can parse the string and
return the states and capitals as map with state as key and capital as value.
The String is in the below format.
The state and capital is separated by a delimiter (del1). There will be multiple state-capital pairs
and each state – capital pair is separated by another delimiter (del2).
Ex: Input will be tamilnadu||chennai-karanataka||bengaluru.
Here, || will be provided as del1 and - will be provided as del2.
2.In a school there are some teachers who handle two subjects (Maths and English). When the
feedback was taken their feedback was present in both Maths Feedback as well as English
Feedback. Write a method to create a consolidated feedback for the teachers for English and
Maths. For those taking both the subjects the highest feedback is taken. Write a method to
accept two maps and return a Map object containing the feedbacks of all teachers in maths and
English.
Note: HashMap contains
Key - Teacher’s name of type String
Value – Feedback of type Integer
3.Write a method to validate the age of a person. The person age is considered valid if it is
above 21 years. Accept the date of birth of the person as String in date-month-year(Ex: 23-05-
2012) format and return true if the age is greater than 21.
http://psvmfree.blogspot.in/2015/12/set1.html
Regards,
Niveda
STC Technologies
+91 7667339090
Scope/ TOC forJava trainer evaluation
Modules covered: Oracle PL/SQL, Core Java 1.5/1.6, JUnit 4.x, HTML, Java Script, XML, J2EE
Architecture, Servlet, JSP,J2EE Design Patterns