Thursday, 2 July 2015

New Test Pattern of INFOSYS

Quantitative Ability – 10 Questions 35 Minutes
Reasoning Ability – 15 Questions 25 Minutes
Verbal Ability – 40 Questions 35 Minutes
Sectional Cut-off – Yes
Negative Marks – No
Test Details:
Quantitative Ability – This is a new section introduced by Infosys this year and it clearly indicates that Infosys is looking for candidates’ with good Problem Solving and Analytical skills. 10 Questions and 35 Minutes to solve so expect time consuming, higher difficulty questions. The focus was more on Numbers and Advance concepts like Permutation and Combination, Probability. Few questions from topics like Time and Work, Time Speed and Distance were also seen.
Along with this there were one or two Cryptarithmetic Questions. These questions are usually time consuming to solve. Since there were options given for these questions it makes these questions solvable with-in the available time.
Reasoning Ability – Similar to older Infosys pattern we have seen questions from Data Arrangement, Data Interpretation, Data Sufficiency, Syllogism, Visual Reasoning and Puzzles. Earlier there were sets of 5 questions in each set and now it was reduced to 2 or 3 per question set and this makes it time consuming to solve. Apart from this we didn’t notice any change in the difficulty level of the questions.
Verbal Ability – Infosys is probably the only company which stresses a lot on Verbal Ability and they continue to do the same by retaining the same old pattern for this section. 40 Questions testing almost all the areas of Verbal ie) Grammar, Comprehension, Vocabulary and Critical Reasoning, 10 Questions each.
Expected Cut-Off:
Quantitative Ability – 6 to 7 Marks
Reasoning Ability – 10 to 11 Marks
Verbal Ability – 20 marks
Our Recommended Strategy:
Quantitative Ability – Focus on getting 6 Questions correct by choosing the less time consuming questions and attempt it with-in the first 15 Minutes. We have noticed 3 to 4 very easy questions which can be solved in less than 5 minutes. Once you are through with this then you will have close to 20 Minutes for the remaining 4 questions and out of which even if you get 1 question correct you will most likely clear the expected cut-off. Hence the key here is to identify the 6 less time consuming questions.
Reasoning Ability – Attempt Individual questions first, like questions from Syllogism, Data Sufficiency, Visual Reasoning and Puzzles. Because these questions will not have common data to be solved and each question might take a maximum of 2 minutes to solve and a majority can be solved in less than a minute. You can easily solve 9 such questions with-in first 15 Minutes. Now you will be left with Data Arrangement and Data Interpretation type of questions and we recommend to solve data Arrangement at the end because there is high probability of getting it wrong compared to Data Interpretation. Hence out of the remaining 10 Minutes even if you get 2 to 3 questions correct you will comfortably clear he expected cut-off.
Verbal Ability – Attempt Sentence Correction or Error Spotting and Vocabulary first, ie) with-in first 15 Minutes try to complete these 20 Questions. Next go for Reading Comprehension and here if you find a lengthy passage then you will get 2 to 3 direct questions hence read the question first and try to find the answer from the passage. Don’t try to read and understand the passage completely. You can comfortably attempt only the direct questions with-in 5 minutes and take a chance in the other type of questions since there is no negative marks. Don’t waste your time in inference type of questions. If you get a short passage better attempt it at the end because the questions will be tougher. We have seen at-least one passage in Infosys lengthy hence you can attempt that first. Last type of question is Critical Reasoning here try to attempt 5 to 6 questions with-in 10 Minutes. By now you would have attempted close to 30 questions in 30 Minutes and with an accuracy of 85% you will comfortable clear the cut-off and you still have 5 Minutes left to attempt the remaining questions.
Overall Infosys test is the most perfect test to identify the right talent. I am not a big fan of Adaptive Tests which is practiced by Wipro, Accenture and Cognizant because it doesn’t test the candidates decision making skill which i feel is a very important skill a candidate should possess. Linear tests conducted by Infosys and TCS tests the candidates decision making skill by giving a mix of easy and difficult questions carrying equal weightage. Now it is left to the candidate whether he chooses easy ones and solves it with-in the given time limit or he chooses the difficult ones and complains about time availability. Hence understand the objective of the tests so that you can easily tame it.

Monday, 29 June 2015

JAVA Interview questions with answers

 Interview Questions in Core Java

1.what is a transient variable?
                A transient variable is a variable that may not be serialized.

2.which containers use a border Layout as their default layout?
               The window, Frame and Dialog classes use a border layout as their default layout.

3.Why do threads block on I/O?
              Threads block on i/o (that is enters the waiting state) so that other threads may execute while the i/o Operation is performed.

4. How are Observer and Observable used?
              Objects that subclass the Observable class maintain a list of observers. When an Observable object is updated it invokes the update() method of each of its observers to notify the observers that it has changed state. The Observer interface is implemented by objects that observe Observable objects.

5. What is synchronization and why is it important?
             With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchronization, it is possible for one thread to modify a shared object while another thread is in the process of using or updating that object's value. This often leads to significant errors.

6. Can a lock be acquired on a class?
            Yes, a lock can be acquired on a class. This lock is acquired on the class's Class object.

7. What's new with the stop(), suspend() and resume() methods in JDK 1.2?
            The stop(), suspend() and resume() methods have been deprecated in JDK 1.2.

8. Is null a keyword?
             The null value is not a keyword.

9. What is the preferred size of a component?
             The preferred size of a component is the minimum component size that will allow the component to display normally.

10. What method is used to specify a container's layout?
             The setLayout() method is used to specify a container's layout.

11. Which containers use a FlowLayout as their default layout?
             The Panel and Applet classes use the FlowLayout as their default layout.

12. What state does a thread enter when it terminates its processing?
              When a thread terminates its processing, it enters the dead state.

13. What is the Collections API?
              The Collections API is a set of classes and interfaces that support operations on collections of objects.

14. Which characters may be used as the second character of an identifier, but not as the first
character of an identifier?
               The digits 0 through 9 may not be used as the first character of an identifier but they may be used after the first character of an identifier.

15. What is the List interface?
            The List interface provides support for ordered collections of objects.

16. How does Java handle integer overflows and underflows?
            It uses those low order bytes of the result that can fit into the size of the type allowed by the operation.

17. What is the Vector class?
          The Vector class provides the capability to implement a growable array of objects.

18. What modifiers may be used with an inner class that is a member of an outer class?
           A (non-local) inner class may be declared as public, protected, private, static, final, or abstract.

19. What is an Iterator interface?
          The Iterator interface is used to step through the elements of a Collection.

20. What is the difference between the >> and >>> operators?
           The >> operator carries the sign bit when shifting right. The >>> zero-fills bits that have been shifted out.

21. Which method of the Component class is used to set the position and size of a component?
           setBounds()

22. How many bits are used to represent Unicode, ASCII, UTF-16, and UTF-8 characters?
           Unicode requires 16 bits and ASCII require 7 bits. Although the ASCII character set uses only 7 bits, it is usually represented as 8 bits. UTF-8 represents characters using 8, 16, and 18 bit patterns. UTF-16 uses 16- bit and larger bit patterns.

23. What is the difference between yielding and sleeping?
               When a task invokes its yield() method, it returns to the ready state. When a task invokes its sleep() method, it returns to the waiting state.

24. Which java.util classes and interfaces support event handling?
              The EventObject class and the EventListener interface support event processing.

25. Is sizeof a keyword?
             The sizeof operator is not a keyword.

26. What are wrapped classes?
             Wrapped classes are classes that allow primitive types to be accessed as objects.

27. Does garbage collection guarantee that a program will not run out of memory?
           Garbage collection does not guarantee that a program will not run out of memory. It is possible for programs to use up memory resources faster than they are garbage collected. It is also possible for programs to create objects that are not subject to garbage collection.

28. What restrictions are placed on the location of a package statement within a source code file?
          A package statement must appear as the first line in a source code file (excluding blank lines and comments).

29. Can an object's finalize() method be invoked while it is reachable?
           An object's finalize() method cannot be invoked by the garbage collector while the object is still reachable. However, an object's finalize() method may be invoked by other objects.

30. What is the immediate superclass of the Applet class?
            Panel

31. What is the difference between preemptive scheduling and time slicing?
          Under preemptive scheduling, the highest priority task executes until it enters the waiting or dead states or a higher priority task comes into existence. Under time slicing, a task executes for a predefined slice of time and then reenters the pool of ready tasks. The scheduler then determines which task should execute next, based on priority and other factors.

32. Name three Component subclasses that support painting.
         The Canvas, Frame, Panel, and Applet classes support painting.

33. What value does readLine() return when it has reached the end of a file?
         The readLine() method returns null when it has reached the end of a file.

34. What is the immediate superclass of the Dialog class?
         Window

35. What is clipping?
         Clipping is the process of confining paint operations to a limited area or shape.

36. What is a native method?
          A native method is a method that is implemented in a language other than Java.

37. Can a for statement loop indefinitely?
         Yes, a for statement can loop indefinitely. For example, consider the following:
for(;;) ;

38. What are order of precedence and associativity, and how are they used?
         Order of precedence determines the order in which operators are evaluated in expressions. Associatity determines whether an expression is evaluated left-to-right or right-to-left.

39. When a thread blocks on I/O, what state does it enter?
         A thread enters the waiting state when it blocks on I/O.

40. To what value is a variable of the String type automatically initialized?
         The default value of an String type is null.

41. What is the catch or declare rule for method declarations?
         If a checked exception may be thrown within the body of a method, the method must either catch the exception or declare it in its throws clause.

42. What is the difference between a MenuItem and a CheckboxMenuItem?
         The CheckboxMenuItem class extends the MenuItem class to support a menu item that may be checked or unchecked.

43. What is a task's priority and how is it used in scheduling?
        A task's priority is an integer value that identifies the relative order in which it should be executed with respect to other tasks. The scheduler attempts to schedule higher priority tasks before lower priority tasks.

44. What class is the top of the AWT event hierarchy?
         The java.awt.AWTEvent class is the highest-level class in the AWT event-class hierarchy.

45. When a thread is created and started, what is its initial state?
           A thread is in the ready state after it has been created and started.

46. Can an anonymous class be declared as implementing an interface and extending a class?
            An anonymous class may implement an interface or extend a superclass, but may not be declared to do both.

47. What is the range of the short type?
             The range of the short type is -(2^15) to 2^15 - 1.

48. What is the range of the char type?
              The range of the char type is 0 to 2^16 - 1.

49. In which package are most of the AWT events that support the event-delegation model defined?
             Most of the AWT-related events of the event-delegation model are defined in the java.awt.event package.The AWTEvent class is defined in the java.awt package.

50. What is the immediate superclass of Menu?
          MenuItem

51. What is the purpose of finalization?
        The purpose of finalization is to give an unreachable object the opportunity to perform any cleanup processing before the object is garbage collected.

Introduction to JSP

JSP (JAVA Server Pages):
              JSP technology is used to create web application. It focuses more on presentation logic of the web  application.JSP pages are easier to maintain then a Servlet. JSP pages are opposite of Servlets.  Servlet adds HTML code inside Java code while JSP adds Java code inside HTML. Everything a  Servlet can do, a JSP page can also do it.
     JSP enables us to write HTML pages containing tags that run powerful Java programs. JSP separates presentation and business logic as Web designer can design and update JSP pages without learning  the Java language and Java Developer can also write code without concerning the web design.
How JSP becomes servlet :
        JSP pages are converted into Servlet by the Web Container. The Container translates a JSP page  into servletclass source(.java) file and then compiles into a Java Servlet class.

Benefits of JSP:
· Easy to maintain
· High Performance and Scalability.
· JSP is built on Java technology, so it is platform independent.

Lifecycle of JSP:

  A JSP page is converted into Servlet in order to service requests. The translation of a JSP page to a  Servlet is called Lifecycle of JSP. The methods used in lifecycle of JSP are same as that of servlet.  
The only difference is that the jsp methods are prefixed with the keyword jsp.JSP Lifecycle consists of  following steps.
· Translation of JSP to Servlet code.
· Compilation of Servlet to bytecode.
· Loading Servlet class.
· Creating servlet instance.
· Initialization by calling jspInit() method
· Request Processing by calling jspService() method
· Destroying by calling jspDestroy() method



Web Container translates JSP code into a servlet class source(.java) file, then compiles that into a  java servlet class. In the third step, the servlet class bytecode is loaded using classloader. The  Container then creates an instance of that servlet class.
The initialized servlet can now service request. For each request the Web Container call the   jspService()method. When the Container removes the servlet instance from service, it calls the  jspDestroy() method to perform any required clean up.

Translating JSP into Servlet:
consider the following Jsp Program:

The above jsp program gets converted into servlet as given below:

public class hello_jsp extends HttpServlet
{
      public void jspService(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException
      {
           PrintWriter out=res.getWriter();
           response.setContentType(“text/html”);
           out.write(“<html><body>”);
           String str=”welcome”;
           out.write(str);
           out.write(“</body></html>”);
       }
}




Sunday, 28 June 2015

GATE Question Papers

1. Computer Science and Information Technology Question Paper:

                Click this to view the question paper
2. Biotechnology Question Paper:
            
                Click this to view the question paper
3. Electronics and Communication Engineering Question Paper:

                Click this to view the question paper
4. Electrical Engineering Question Paper:
                
                 Click this to view the question paper
5. Mechanical Engineering Question Paper:
    
                  Click this to view the question paper
6. Civil Engineering Question Paper:
                  
                   Click this to view the question paper
7. Chemical Engineering Question Paper:
  
                    Click this to view the question paper
8. Instrumentation Engineering Question Paper:

                     Click this to view the question paper
9. Aerospace Engineering Question Paper:
                      
                      Click this to view the question paper
10. Agriculture Engineering Question Paper:

                       Click this to view the question paper

International Conference

1. Name of the Conference/Workshop/Training Program: International Conference on EGovernance and Cloud Computing Services (EGov’15)
2. Focus of the Conference:
EGov'15 is the 2nd international conference organized by department of computer applications, Dr. MGR Educational and Research Institute, University, in the area of various issues related to electronic governance and cloud computing. The conference is featuring an exceptional lineup of invited speakers, researchers, scientists, industrialists, students in a six tracks at the Conference providing an ideal mix of highlevel business, research, academic mastering and industrial talks in the areas of Networking, Security, Telecommunications, Computing, Data Mining, Software engineering and Information Systems Management
3. About the College :
Dr MGR Engineering College was a premier technical institution in Tamil Nadu, India. Having celebrated its Silver Jubilee in the field of education, it was elevated to University status as Dr MGR Educational and Research Institute, University (Declared u/s 3 of the UGC Act 1956) in the year 2003 which integrates Dr MGR Engineering College and Thai Mookambigai Dental College.

About the Department :
DEPARTMENT OF COMPUTER APPLICATIONS was established in 1994 in the erstwhile Dr MGR Educational and Research Institute, University. Department of Computer Applications has a cherished profile and aims to impart high quality education to graduate and post graduate students as well to carry out at the cutting edge of technology research in various disciplines of computer Applications. The department offers UG programmes BCA, B.Sc(Animation and Visual Communication), PG programmes - MCA (3 yr) and MCAlateral entry programmes (2 yr) and research oriented programmes— MPhil (1 yr) and PhD.
Call for Papers (Paper Submission Email id, Paper Themes, etc.,)Conference topics :
1. EGovernance and Cloud Computing technology 

2. Open Source platform 

3. Mobile Governance 

4. EGovernance Standards 

5. Evolution 

6. EGovernance for Disabilities 

7. ICT and Society 

8. Networking & Security 

9. Data Mining & Migration 

10. Information Systems & Management 

11. Software Engineering 

12. Web Technology 

13. Telecommunications 

14. Mobile Computing
Registration Fees:

Delegates from Industry:Rs. 6000 

Faculty Delegates:Rs. 5000 

Research Scholars:Rs. 4500 

UG/PG/MPhil Students:Rs. 4000
Important Dates:

Last date for receiving paper : 25 June 2015 

Notification of Acceptance : 30 June 2015 

Last date for sending camera ready 

Paper along with registration form and DD : 05 July 2015 

Closing of Registration : 10 July 2015 

Inaugural Session : 23 July 2015
in advance or on the first day of the conference.

Address for communication:

The Convener, International Conference EGov’15, 

Department of Computer Applications, 

Dr.MGR Educational and Research Institute University 

Bangalore - Chennai National Highways, 

Maduravoyal, Chennai 600 095. 

Tamil Nadu, India 

conferencemca@gmail.com 

Contact No(s):8508035278/9865464523/9840967756

Saturday, 27 June 2015

Some important header files in C

1. <stdio.h>:
 input and output function in program.
2. <conio.h>:
 to clear screen and pause information function.
3. <ctype.h>: 
function for testing characters
4. <string.h>: 
function for manipulating string
5. <math.h>: mathmatical function
6. <stdlib.h>:
 utility function for number, conversion, storage allocation
7. <assert.h>: 
function that can be used to add diagnostics to a program
8. <stdarg.h>: 
function that can be used to step through a list of function arguments
9. <setjmp.h>:
 function that can be used to avoid the normal call and return sequence
10. <signal.h>: 
function for handling exceptional condition that may arise in a program
11. <time.h>: 
function for manipulating date and time
12. <limits.h>: 
constant definitions for the size of C data types
13. <float.h>:
 definitions relating to floating-point arithmetic

List of C Programs

1. Write a program to find factorial of the given number. 
Recursion: A function is called 'recursive ' if a statement within the body of a function calls the same function. It is also called 'circular definition '.Thus recursion is a process of defining something in terms of itself.

Program: To calculate the factorial value using recursion.

#include<stdio.h>
int fact(int n);
int main()
{
int x, i;
printf("En ter a value for x: \n");
scanf("%d" ,&x);
i = fact(x);
printf("\n Factorial of %d is %d", x, i);
return 0;
}
int fact(int n)
{
/* n=0 indicates a terminating condition */
if (n)
return (1);
}
else
{
/* function calling itself */
return (n * fact(n - 1));
/*n*fact(n -1) is a recursive expression */
}
}

OUTPUT:

Enter a value for x: 4
Factorial of 4 is 24

2.Write a program to check whether the given number is even or odd.

Program:

#include<stdio.h>
int main()
{
int a;
printf("En ter a: \n");
scanf("%d" ,&a);
/* logic */
if (a % 2 == 0){

printf("Th e given number is EVEN\n");
}
else{
printf("Th e given number is ODD\n");
}
return 0;
}

Output:
Enter a: 2
The given number is EVEN

3. Write a program to swap two numbers using a temporary variable.

#include<stdio.h>
int main()
{
int a, b, temp;
printf("En ter the value of a and b: \n");
scanf("%d %d",&a,&b);
printf("Be fore swapping a=%d, b=%d \n", a, b);
/*Swapping logic */
temp = a;
a = b;
b = temp;
printf("Af ter swapping a=%d, b=%d", a, b);
return 0;
}

Output:

Enter the values of a and b: 2 3
Before swapping a=2, b=3
After swapping a=3, b=2

4. Write a program to swap two numbers without using a temporary variable. 

#include<stdio.h>
int main()
{
int a, b;
printf("En ter values of a and b: \n");
scanf("%d %d",&a,&b);
printf("Be fore swapping a=%d, b=%d\n", a,b);
/*Swapping logic */
a = a + b;
b = a - b;
a = a - b;
printf("Af ter swapping a=%d b=%d\n", a, b);
return 0;

}



Output:
Enter values of a and b: 2 3
Before swapping a=2, b=3
The values after swapping are a=3 b=2

5. Write a program to swap two numbers using bitwise operators. 
Program: 

#include<stdio.h>
int main()
{
int i = 65;
int k = 120;
printf("\n value of i=%d k=%d before swapping", i, k);
i = i ^ k;
k = i ^ k;
i = i ^ k;
printf("\n value of i=%d k=%d after swapping", i, k);
return 0;

}

6. Write a program to find the greatest of three numbers.
 Program: 

#include<stdio.h>
int main()
{
int a, b, c;
printf("En ter a,b,c: \n");
scanf("%d %d %d",&a,&b,&c);
if (a>b&&a>c){
printf("a is Greater ");
}
else if (b>c)
{
printf("b is Greater ");
}
else {
printf("c is Greater ");
}
return 0;
}

Output:

Enter a,b,c: 3 5 8
c is Greater 

7. Write a program to find the greatest among ten numbers. 
Program: 

#include<stdio.h>
int main()
{
int a[10];
int i;
int greatest;
printf("En ter ten values:");
//Store 10 numbers in an array
for (i = 0; i<10; i++){
scanf("%d" ,&a[i]);
}
//Assume that a[0] is greatest
greatest = a[0];
for (i = 0; i<10; i++){
if (a[i]>greatest){
greatest = a[i];
}
}
printf("\n Greatest of ten numbers is %d", greatest);
return 0;
}

Output:
Enter ten values: 2 53 65 3 88 8 14 5 77 64 
Greatest of ten numbers is 88

8. Write a program to check whether the given number is a prime. 
Program:

#includestdio.h>
Void main()
{
int n, i, c = 0;
printf("En ter any number n: \n");
scanf("%d" ,&n);
/*logic*/
for (i = 1; i<=n/2;i++)
if (n % i == 0){
c++;
}
}
if (c == 2){
printf(“n is a Prime number");
}
else{
printf("n is not a Prime number");
}
getch();
}

Output: 
Enter any number n: 7
 n is Prime 

9. Write a program to check whether the given number is a palindromi c number.
 Program:

#include<stdio.h>
int main()
{
int n, n1, rev = 0, rem;
printf("En ter any number: \n");
scanf("%d" ,&n);
n1 = n;
/* logic */
while (n>0){
rem = n % 10;
rev = rev * 10 + rem;
n = n / 10;
}
if (n1 == rev){
printf("Gi ven number is a palindromi c number");
}
else{
printf("Gi ven number is not a palindromi c number");
}
return 0;
}

Output:

Enter any number: 121
Given number is a palindrome

10.Write a program to check whether the given string is a palindrome . 

Program:

#include<stdio.h>
#include<conio.h>
int main()
{
char string1[20 ];
int i, length;
int flag = 0;
printf("En ter a string: \n");
scanf("%s" , string1);
length = strlen(str ing1);
for(i=0;i<length ;i++){
if(string1 [i] != string1[le ngth-i-1]) 
{
flag = 1;
break;
}
}
if (flag){
printf("%s is not a palindrome \n", string1);
}
else{
printf("%s is a palindrome \n", string1);
}
return 0;
}

Output:

Enter a string: radar
"radar"is a palindrome

Remaining will be continued later.....