SlideShare a Scribd company logo
1 of 23
Technical
Aptitude Test
Date : 18-03-2016
Q.1. Choose one that apply:
class S{
public static void main(String agr[]){
short s1=4; //LINE 1
short s2 = s1+=s1; //LINE 2
short s3= s1+s2; //LINE 3
byte b1=(byte)s1 +(byte)s2; //LINE 4
byte b2=(byte)((byte)s1 +(byte)(byte)s2); //LINE 5 }}
A. Comiler Error at Line 1,2,3 B. Compiler Error at Line 3,4.
C. Compiler Error at 2,3,5 D. Comiler Error at 1,4,5
Q.2 Classes that can be used to instantiate objects are called concrete
classes.
A.TRUE B.FALSE
Q. 3. char ** array [12][12][12]; Consider array, defined above. Which
one of the following definitions and initializations of p is valid?
A) char ** (* p) [12][12] = array;
B) char ***** p = array;
C) char * (* p) [12][12][12] = array;
D) const char ** p [12][12][12] = array;
E) char (** p) [12][12] = array;
Q.4 What is the result of following java code?
public class Apti {
static void test(int[] a) {
int[] b = new int[2];
a = b;
System.out.print(b.length);
System.out.print(a.length); }
public static void main(String[] args) {
int[] a = new int[5];
test(a);
System.out.print(a.length);
}
}
A.225 B.255 C.200 D.222
Q.5 what is the o/p?
main(){
printf(“%%%%%”);
}
A.%%%%%
B.%%%%
C.%%%
D.%%
Q.6 . #include<iostream>
using namespace std;
int x = 1;
void fun(){
int x = 2;
{
int x = 3; cout << ::x << endl;
}
}
int main()
{
fun();
return 0;
}
A.1 B.2 C.3 D.0
Q.7 What will be the result of compiling and running the following
program ?
public class ExceptionTest{
public static void main(String[] args) throws Exception{
try{
m2();
}finally{ m3(); }
catch ( NewException e ){}
}
public static void m2() throws NewException { throw new
NewException(); }
public static void m3() throws AnotherException{ throw new
AnotherException(); }
A. It will compile but will throw AnotherException when run.
B. It will compile but will throw NewException when run.
C. It will compile and run without throwing any exceptions.
D. It will not compile.
Q. 8 main(){
extern int i;
i=20;
printf("%d",i); }
Output is:
(A)0
(B)20
(C)would vary from compiler to compiler
(D)Error : Undefined symbol i
Q.9 Which type of casting can be used only with pointers and
references to objects?
A) Dynamic_cast B) cast C)Static_cast D) Pointer_Cast
Q.10 class Student extends String{} What happens when we try to compile
this class?
A) Will not compile because class body is not defined
B) Will not compile because the class in not declared public.
C) Will not compile because String is abstract.
D) Will not compile because String is final.
Q. 11 What will be output when you will execute following c code?
#include<stdio.h>
void main(){
int a=5,b=10;
if(a<++a||b<++b)
printf("C rocks, everyone shocks");
else
printf("%d %d",a,b);
}
(A)6 11 (B)6 10 (C)C rocks, everyone shocks (D)none of above
Q.12 What will the following code print?
int[] scores1 = { 1, 2, 3, 4, 5, 6};
int[] scores2 = { 0, 0, 0, 0, 0, 0};
System.arraycopy(scores2, 2, scores1, 3, 2);
for(int i : scores2) System.out.print(i);
A. 123006
B. 000000
C. 000450
D. It throw an exception at run time.
Q.13. int main() {
int number1 = 88, number2 = 22;
int & refNumber1 = number1;
refNumber1 = 11;
cout << refNumber1 << endl;
refNumber1 = number2;
number2++;
cout << refNumber1 << endl;
cout << number1 << endl;
cout << number2 << endl;
} O/p:-
A.88 23 23 23 B.11 22 22 23 C.11 22 23 23
D.11 23 23 23 E.88 22 22 23
Q.14 What will be output when you will execute following c code?
#include<stdio.h>
void main(){
int a=5; a=a>=4;
switch(2){
case 0:int a=8;
case 1:int a=10;
case 2:++a;
case 3:printf("%d",a);
}
}
(A) 2 (B) 10 (C) Compilation error (D)no output
Q.15 Which of the following should be used 'if content is not fixed and
keep on changing(mutable) but Thread safety is required'?
A. String B. StringBuffer C. StringBuilder D. Both B & C
Q.16 #include<stdio.h>
void main(){
int a=3,b=2;
a=a = = b = = 0;
switch(a){
case 1:a=a+10;
}
sizeof(a++);
printf("%d",a);
}
(A)11 (B)12 (C)1 (D)0
Associativity : left to right
Q.17 Which of the following concepts means waiting until runtime to
determine which function to call?
A. Data hiding B. Dynamic casting C. Dynamic binding D.
Dynamic loading
Q.18 Which of the following are true about the "default" constructor?
Choose 2 options:
A. It is provided by the compiler only if the class does not define any
constructor.
B. It initializes the instance members of the class.
C. It calls the default 'no-args' constructor of the super class.
D. It initializes instance as well as class fields of the class.
E. It is provided by the compiler if the class does not define a 'no- args'
constructor.
Q.19 What will be output when you will execute following c code?
#define PRINT printf("Star Wars");printf(" Psycho");
#include<stdio.h>
void main(){
int x=1;
if(x--)
PRINT
else
printf("The Shawshank Redemption");
} Choose all that apply:
(A) Stars Wars Psycho
(B) The Shawshank Redemption
(C) Warning: Condition is always true
(D) Compilation error
Q.20 Why reference is not same as a pointer?
A. A reference can never be null.
B. A reference once established cannot be changed.
C. Reference doesn't need an explicit dereferencing mechanism.
D. All of the above.
Q.21 Which of the following sorting algorithms can be used to sort a
random linked list with minimum time complexity?
A.Insertion Sort B.Quick Sort C.Heap Sort D.Merge Sort
Explanation: Both Merge sort and Insertion sort can be used for linked lists.
The slow random-access performance of a linked list makes other
algorithms (such as quicksort) perform poorly, and others (such as
heapsort) completely impossible. Since worst case time complexity of
Merge Sort is O(nLogn) and Insertion sort is O(n^2), merge sort is
preferred.
Q.22. A circularly linked list is used to represent a Queue. A single
variable p is used to access the Queue. To which node should p point
such that both the operations enQueue and deQueue can be performed
in constant time?
A. rear node
B. Front node
C. not possible with single pointer
D. node next to front
Q.23 A function f defined on stacks of integers satisfies the following
properties. f(∅) = 0 and f (push (S, i)) = max (f(S), 0) + i for all stacks S
and integers i.
If a stack S contains the integers 2, -3, 2, -1, 2 in order from bottom to
top, what is f(S)?
A.6 B.4 C.3 D.2
Q.24. In a complete k-ary tree, every internal node has exactly k
children or no child. The number of leaves in such a tree with n internal
nodes is:
A.nk B.(n-1)k+1 C. n(k-1)+1 D.n(k-1)
Q.25. How many distinct binary search trees can be created out of 4
distinct keys?
A.4 B.14 C.24 D.42
The base case is t(0) = 1 and
t(1) = 1
Q.26. What is time complexity of fun()?
int fun(int n)
{
int count = 0;
for (int i = n; i > 0; i /= 2)
for (int j = 0; j < i; j++)
count += 1;
return count;
}
A O(n^2) B.O(nLogn) C.O(n) D. O(nLognLogn)
Q.27. class Test
{
int p = 20;
public static void main(String args[]){
final Test t = new Test();
t.p = 30;
System.out.println(t.p);
}
}
A.20 B.30 C. Compile time error D. Runtime error
Q.28. What will be the result of attempting to compile and run the
following program?
public class TestClass{
public static void main(String args[ ] ){
String s = "hello";
StringBuilder sb = new StringBuilder( "hello" );
sb.reverse();
s.reverse();
if( s == sb.toString() ) System.out.println( "Equal" );
else System.out.println( "Not Equal" );
}
}
A. Compilation error. B. It will print 'Equal'.
C. It will print 'Not Equal'. D. Runtime error.
No reverese method in String.
Q.29. Which of the following statements are true?
A. For any non-null reference o1, the expression (o1 instanceof o1) will
always yield true.
B. For any non-null reference o1, the expression (o1 instanceof
Object) will always yield true.
C. For any non-null reference o1, the expression (o1 instanceof o1) will
always yield false.
D. For any non-null reference o1, the expression (o1 instanceof Object)
may yield false.
Q.30 import java.util.*;
public class Test {
public static void main(String[] args) {
TreeSet s = new TreeSet();
s.add(1);
s.add(99.9);
s.add(99.9);
s.add(96.9);
for (int i = 0; i < s.size(); i++) {
System.out.print(s.pollFirst()+" ");
} }}
A. 1 96.9 99.9 B.1 96.9 99.9 99.9 C.1 D.compilation error
E.an exception is thrown at run time

More Related Content

What's hot

Chapter 8 c solution
Chapter 8 c solutionChapter 8 c solution
Chapter 8 c solutionAzhar Javed
 
Programming in C Presentation upto FILE
Programming in C Presentation upto FILEProgramming in C Presentation upto FILE
Programming in C Presentation upto FILEDipta Saha
 
Exception handling c++
Exception handling c++Exception handling c++
Exception handling c++Jayant Dalvi
 
[Question Paper] ASP.NET With C# (75:25 Pattern) [April / 2016]
[Question Paper] ASP.NET With C# (75:25 Pattern) [April / 2016][Question Paper] ASP.NET With C# (75:25 Pattern) [April / 2016]
[Question Paper] ASP.NET With C# (75:25 Pattern) [April / 2016]Mumbai B.Sc.IT Study
 
Let us c(by yashwant kanetkar) chapter 2 solution
Let us c(by yashwant kanetkar) chapter 2 solutionLet us c(by yashwant kanetkar) chapter 2 solution
Let us c(by yashwant kanetkar) chapter 2 solutionrohit kumar
 
Java applet - java
Java applet - javaJava applet - java
Java applet - javaRubaya Mim
 
Basic structure of c programming
Basic structure of c programmingBasic structure of c programming
Basic structure of c programmingTejaswiB4
 
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)Mohammad Ilyas Malik
 
Bca 2nd sem u-4 operator overloading
Bca 2nd sem u-4 operator overloadingBca 2nd sem u-4 operator overloading
Bca 2nd sem u-4 operator overloadingRai University
 
If else statement in c++
If else statement in c++If else statement in c++
If else statement in c++Bishal Sharma
 
Let us C (by yashvant Kanetkar) chapter 3 Solution
Let us C   (by yashvant Kanetkar) chapter 3 SolutionLet us C   (by yashvant Kanetkar) chapter 3 Solution
Let us C (by yashvant Kanetkar) chapter 3 SolutionHazrat Bilal
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithmsGanesh Solanke
 
Control and conditional statements
Control and conditional statementsControl and conditional statements
Control and conditional statementsrajshreemuthiah
 

What's hot (20)

Chapter 8 c solution
Chapter 8 c solutionChapter 8 c solution
Chapter 8 c solution
 
Programming in C Presentation upto FILE
Programming in C Presentation upto FILEProgramming in C Presentation upto FILE
Programming in C Presentation upto FILE
 
Exception handling c++
Exception handling c++Exception handling c++
Exception handling c++
 
[Question Paper] ASP.NET With C# (75:25 Pattern) [April / 2016]
[Question Paper] ASP.NET With C# (75:25 Pattern) [April / 2016][Question Paper] ASP.NET With C# (75:25 Pattern) [April / 2016]
[Question Paper] ASP.NET With C# (75:25 Pattern) [April / 2016]
 
Let us c(by yashwant kanetkar) chapter 2 solution
Let us c(by yashwant kanetkar) chapter 2 solutionLet us c(by yashwant kanetkar) chapter 2 solution
Let us c(by yashwant kanetkar) chapter 2 solution
 
Java applet - java
Java applet - javaJava applet - java
Java applet - java
 
Ansi c
Ansi cAnsi c
Ansi c
 
C Programming Exam problems & Solution by sazzad hossain
C Programming Exam problems & Solution by sazzad hossainC Programming Exam problems & Solution by sazzad hossain
C Programming Exam problems & Solution by sazzad hossain
 
Informed search
Informed searchInformed search
Informed search
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 
Basic structure of c programming
Basic structure of c programmingBasic structure of c programming
Basic structure of c programming
 
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
 
Bca 2nd sem u-4 operator overloading
Bca 2nd sem u-4 operator overloadingBca 2nd sem u-4 operator overloading
Bca 2nd sem u-4 operator overloading
 
If else statement in c++
If else statement in c++If else statement in c++
If else statement in c++
 
Let us C (by yashvant Kanetkar) chapter 3 Solution
Let us C   (by yashvant Kanetkar) chapter 3 SolutionLet us C   (by yashvant Kanetkar) chapter 3 Solution
Let us C (by yashvant Kanetkar) chapter 3 Solution
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithms
 
VTU Data Structures Lab Manual
VTU Data Structures Lab ManualVTU Data Structures Lab Manual
VTU Data Structures Lab Manual
 
Control and conditional statements
Control and conditional statementsControl and conditional statements
Control and conditional statements
 
Java program structure
Java program structureJava program structure
Java program structure
 
Android ui with xml
Android ui with xmlAndroid ui with xml
Android ui with xml
 

Similar to Technical aptitude test 2 CSE

important C questions and_answers praveensomesh
important C questions and_answers praveensomeshimportant C questions and_answers praveensomesh
important C questions and_answers praveensomeshpraveensomesh
 
1z0 851 exam-java standard edition 6 programmer certified professional
1z0 851 exam-java standard edition 6 programmer certified professional1z0 851 exam-java standard edition 6 programmer certified professional
1z0 851 exam-java standard edition 6 programmer certified professionalIsabella789
 
(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2Pamidimukkala Sivani
 
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2Knowledge Center Computer
 
ExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxgitagrimston
 
Technical questions for interview c programming
Technical questions for interview  c programmingTechnical questions for interview  c programming
Technical questions for interview c programmingCHANDAN KUMAR
 
Computer science ms
Computer science msComputer science ms
Computer science msB Bhuvanesh
 
C++ Certified Associate Programmer CPA
C++ Certified Associate Programmer CPAC++ Certified Associate Programmer CPA
C++ Certified Associate Programmer CPAIsabella789
 
LDCQ paper Dec21 with answer key_62cb2996afc60f6aedeb248c1d9283e5.pdf
LDCQ paper Dec21 with answer key_62cb2996afc60f6aedeb248c1d9283e5.pdfLDCQ paper Dec21 with answer key_62cb2996afc60f6aedeb248c1d9283e5.pdf
LDCQ paper Dec21 with answer key_62cb2996afc60f6aedeb248c1d9283e5.pdfVedant Gavhane
 
Data structures and algorithms unit i
Data structures and algorithms unit iData structures and algorithms unit i
Data structures and algorithms unit isonalisraisoni
 
Name _______________________________ Class time __________.docx
Name _______________________________    Class time __________.docxName _______________________________    Class time __________.docx
Name _______________________________ Class time __________.docxrosemarybdodson23141
 
Ramco Sample Paper 2003
Ramco  Sample  Paper 2003Ramco  Sample  Paper 2003
Ramco Sample Paper 2003ncct
 

Similar to Technical aptitude test 2 CSE (20)

important C questions and_answers praveensomesh
important C questions and_answers praveensomeshimportant C questions and_answers praveensomesh
important C questions and_answers praveensomesh
 
1z0 851 exam-java standard edition 6 programmer certified professional
1z0 851 exam-java standard edition 6 programmer certified professional1z0 851 exam-java standard edition 6 programmer certified professional
1z0 851 exam-java standard edition 6 programmer certified professional
 
(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2
 
Technical questions
Technical questionsTechnical questions
Technical questions
 
C test
C testC test
C test
 
C MCQ
C MCQC MCQ
C MCQ
 
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
 
ExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docx
 
Technical questions for interview c programming
Technical questions for interview  c programmingTechnical questions for interview  c programming
Technical questions for interview c programming
 
Computer science ms
Computer science msComputer science ms
Computer science ms
 
Scjp6.0
Scjp6.0Scjp6.0
Scjp6.0
 
C++ Certified Associate Programmer CPA
C++ Certified Associate Programmer CPAC++ Certified Associate Programmer CPA
C++ Certified Associate Programmer CPA
 
7
77
7
 
Cs101 endsem 2014
Cs101 endsem 2014Cs101 endsem 2014
Cs101 endsem 2014
 
FSOFT - Test Java Exam
FSOFT - Test Java ExamFSOFT - Test Java Exam
FSOFT - Test Java Exam
 
LDCQ paper Dec21 with answer key_62cb2996afc60f6aedeb248c1d9283e5.pdf
LDCQ paper Dec21 with answer key_62cb2996afc60f6aedeb248c1d9283e5.pdfLDCQ paper Dec21 with answer key_62cb2996afc60f6aedeb248c1d9283e5.pdf
LDCQ paper Dec21 with answer key_62cb2996afc60f6aedeb248c1d9283e5.pdf
 
Data structures and algorithms unit i
Data structures and algorithms unit iData structures and algorithms unit i
Data structures and algorithms unit i
 
Name _______________________________ Class time __________.docx
Name _______________________________    Class time __________.docxName _______________________________    Class time __________.docx
Name _______________________________ Class time __________.docx
 
NET_Solved ans
NET_Solved ansNET_Solved ans
NET_Solved ans
 
Ramco Sample Paper 2003
Ramco  Sample  Paper 2003Ramco  Sample  Paper 2003
Ramco Sample Paper 2003
 

More from Sujata Regoti

Social media connecting or disconnecting
Social media connecting or disconnectingSocial media connecting or disconnecting
Social media connecting or disconnectingSujata Regoti
 
Servlet and jsp interview questions
Servlet and jsp interview questionsServlet and jsp interview questions
Servlet and jsp interview questionsSujata Regoti
 
Git,Github,How to host using Github
Git,Github,How to host using GithubGit,Github,How to host using Github
Git,Github,How to host using GithubSujata Regoti
 

More from Sujata Regoti (8)

Social media connecting or disconnecting
Social media connecting or disconnectingSocial media connecting or disconnecting
Social media connecting or disconnecting
 
Image retrieval
Image retrievalImage retrieval
Image retrieval
 
Key management
Key managementKey management
Key management
 
Web mining tools
Web mining toolsWeb mining tools
Web mining tools
 
Servlet and jsp interview questions
Servlet and jsp interview questionsServlet and jsp interview questions
Servlet and jsp interview questions
 
Git,Github,How to host using Github
Git,Github,How to host using GithubGit,Github,How to host using Github
Git,Github,How to host using Github
 
Big Data
Big DataBig Data
Big Data
 
Inflation measuring
Inflation measuringInflation measuring
Inflation measuring
 

Recently uploaded

High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 

Recently uploaded (20)

High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 

Technical aptitude test 2 CSE

  • 2. Q.1. Choose one that apply: class S{ public static void main(String agr[]){ short s1=4; //LINE 1 short s2 = s1+=s1; //LINE 2 short s3= s1+s2; //LINE 3 byte b1=(byte)s1 +(byte)s2; //LINE 4 byte b2=(byte)((byte)s1 +(byte)(byte)s2); //LINE 5 }} A. Comiler Error at Line 1,2,3 B. Compiler Error at Line 3,4. C. Compiler Error at 2,3,5 D. Comiler Error at 1,4,5
  • 3. Q.2 Classes that can be used to instantiate objects are called concrete classes. A.TRUE B.FALSE Q. 3. char ** array [12][12][12]; Consider array, defined above. Which one of the following definitions and initializations of p is valid? A) char ** (* p) [12][12] = array; B) char ***** p = array; C) char * (* p) [12][12][12] = array; D) const char ** p [12][12][12] = array; E) char (** p) [12][12] = array;
  • 4. Q.4 What is the result of following java code? public class Apti { static void test(int[] a) { int[] b = new int[2]; a = b; System.out.print(b.length); System.out.print(a.length); } public static void main(String[] args) { int[] a = new int[5]; test(a); System.out.print(a.length); } } A.225 B.255 C.200 D.222
  • 5. Q.5 what is the o/p? main(){ printf(“%%%%%”); } A.%%%%% B.%%%% C.%%% D.%%
  • 6. Q.6 . #include<iostream> using namespace std; int x = 1; void fun(){ int x = 2; { int x = 3; cout << ::x << endl; } } int main() { fun(); return 0; } A.1 B.2 C.3 D.0
  • 7. Q.7 What will be the result of compiling and running the following program ? public class ExceptionTest{ public static void main(String[] args) throws Exception{ try{ m2(); }finally{ m3(); } catch ( NewException e ){} } public static void m2() throws NewException { throw new NewException(); } public static void m3() throws AnotherException{ throw new AnotherException(); } A. It will compile but will throw AnotherException when run. B. It will compile but will throw NewException when run. C. It will compile and run without throwing any exceptions. D. It will not compile.
  • 8. Q. 8 main(){ extern int i; i=20; printf("%d",i); } Output is: (A)0 (B)20 (C)would vary from compiler to compiler (D)Error : Undefined symbol i Q.9 Which type of casting can be used only with pointers and references to objects? A) Dynamic_cast B) cast C)Static_cast D) Pointer_Cast
  • 9. Q.10 class Student extends String{} What happens when we try to compile this class? A) Will not compile because class body is not defined B) Will not compile because the class in not declared public. C) Will not compile because String is abstract. D) Will not compile because String is final. Q. 11 What will be output when you will execute following c code? #include<stdio.h> void main(){ int a=5,b=10; if(a<++a||b<++b) printf("C rocks, everyone shocks"); else printf("%d %d",a,b); } (A)6 11 (B)6 10 (C)C rocks, everyone shocks (D)none of above
  • 10. Q.12 What will the following code print? int[] scores1 = { 1, 2, 3, 4, 5, 6}; int[] scores2 = { 0, 0, 0, 0, 0, 0}; System.arraycopy(scores2, 2, scores1, 3, 2); for(int i : scores2) System.out.print(i); A. 123006 B. 000000 C. 000450 D. It throw an exception at run time.
  • 11. Q.13. int main() { int number1 = 88, number2 = 22; int & refNumber1 = number1; refNumber1 = 11; cout << refNumber1 << endl; refNumber1 = number2; number2++; cout << refNumber1 << endl; cout << number1 << endl; cout << number2 << endl; } O/p:- A.88 23 23 23 B.11 22 22 23 C.11 22 23 23 D.11 23 23 23 E.88 22 22 23
  • 12. Q.14 What will be output when you will execute following c code? #include<stdio.h> void main(){ int a=5; a=a>=4; switch(2){ case 0:int a=8; case 1:int a=10; case 2:++a; case 3:printf("%d",a); } } (A) 2 (B) 10 (C) Compilation error (D)no output
  • 13. Q.15 Which of the following should be used 'if content is not fixed and keep on changing(mutable) but Thread safety is required'? A. String B. StringBuffer C. StringBuilder D. Both B & C Q.16 #include<stdio.h> void main(){ int a=3,b=2; a=a = = b = = 0; switch(a){ case 1:a=a+10; } sizeof(a++); printf("%d",a); } (A)11 (B)12 (C)1 (D)0 Associativity : left to right
  • 14. Q.17 Which of the following concepts means waiting until runtime to determine which function to call? A. Data hiding B. Dynamic casting C. Dynamic binding D. Dynamic loading Q.18 Which of the following are true about the "default" constructor? Choose 2 options: A. It is provided by the compiler only if the class does not define any constructor. B. It initializes the instance members of the class. C. It calls the default 'no-args' constructor of the super class. D. It initializes instance as well as class fields of the class. E. It is provided by the compiler if the class does not define a 'no- args' constructor.
  • 15. Q.19 What will be output when you will execute following c code? #define PRINT printf("Star Wars");printf(" Psycho"); #include<stdio.h> void main(){ int x=1; if(x--) PRINT else printf("The Shawshank Redemption"); } Choose all that apply: (A) Stars Wars Psycho (B) The Shawshank Redemption (C) Warning: Condition is always true (D) Compilation error
  • 16. Q.20 Why reference is not same as a pointer? A. A reference can never be null. B. A reference once established cannot be changed. C. Reference doesn't need an explicit dereferencing mechanism. D. All of the above. Q.21 Which of the following sorting algorithms can be used to sort a random linked list with minimum time complexity? A.Insertion Sort B.Quick Sort C.Heap Sort D.Merge Sort Explanation: Both Merge sort and Insertion sort can be used for linked lists. The slow random-access performance of a linked list makes other algorithms (such as quicksort) perform poorly, and others (such as heapsort) completely impossible. Since worst case time complexity of Merge Sort is O(nLogn) and Insertion sort is O(n^2), merge sort is preferred.
  • 17. Q.22. A circularly linked list is used to represent a Queue. A single variable p is used to access the Queue. To which node should p point such that both the operations enQueue and deQueue can be performed in constant time? A. rear node B. Front node C. not possible with single pointer D. node next to front
  • 18. Q.23 A function f defined on stacks of integers satisfies the following properties. f(∅) = 0 and f (push (S, i)) = max (f(S), 0) + i for all stacks S and integers i. If a stack S contains the integers 2, -3, 2, -1, 2 in order from bottom to top, what is f(S)? A.6 B.4 C.3 D.2 Q.24. In a complete k-ary tree, every internal node has exactly k children or no child. The number of leaves in such a tree with n internal nodes is: A.nk B.(n-1)k+1 C. n(k-1)+1 D.n(k-1) Q.25. How many distinct binary search trees can be created out of 4 distinct keys? A.4 B.14 C.24 D.42 The base case is t(0) = 1 and t(1) = 1
  • 19. Q.26. What is time complexity of fun()? int fun(int n) { int count = 0; for (int i = n; i > 0; i /= 2) for (int j = 0; j < i; j++) count += 1; return count; } A O(n^2) B.O(nLogn) C.O(n) D. O(nLognLogn)
  • 20. Q.27. class Test { int p = 20; public static void main(String args[]){ final Test t = new Test(); t.p = 30; System.out.println(t.p); } } A.20 B.30 C. Compile time error D. Runtime error
  • 21. Q.28. What will be the result of attempting to compile and run the following program? public class TestClass{ public static void main(String args[ ] ){ String s = "hello"; StringBuilder sb = new StringBuilder( "hello" ); sb.reverse(); s.reverse(); if( s == sb.toString() ) System.out.println( "Equal" ); else System.out.println( "Not Equal" ); } } A. Compilation error. B. It will print 'Equal'. C. It will print 'Not Equal'. D. Runtime error. No reverese method in String.
  • 22. Q.29. Which of the following statements are true? A. For any non-null reference o1, the expression (o1 instanceof o1) will always yield true. B. For any non-null reference o1, the expression (o1 instanceof Object) will always yield true. C. For any non-null reference o1, the expression (o1 instanceof o1) will always yield false. D. For any non-null reference o1, the expression (o1 instanceof Object) may yield false.
  • 23. Q.30 import java.util.*; public class Test { public static void main(String[] args) { TreeSet s = new TreeSet(); s.add(1); s.add(99.9); s.add(99.9); s.add(96.9); for (int i = 0; i < s.size(); i++) { System.out.print(s.pollFirst()+" "); } }} A. 1 96.9 99.9 B.1 96.9 99.9 99.9 C.1 D.compilation error E.an exception is thrown at run time