SlideShare a Scribd company logo
1 of 22
Walchand College Of Engineering,Sangli
ORGANIZES
Technical Aptitude Test
ASSOCIATION of Computer Science & Engg. STUDENTS
Date:21 July,2015
By Sujata Regoti
1.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
E x p l a n a t i o n :
We can not declare any variable in any case of switch case
statement.
1
2.What is the infix version of the following postfix expression?
x 12 + z 17 y + 42 * / +
A. (x + 12 + z) / (17 + y * 42)
B. x + 12 + z / 17 + y * 42
C. x + 12 + z / (17 + y) * 42
D. x + 12 + z / ((17 + y) * 42)
E. x + (12 + z) / (17 + y * 42)
2
3. If we use mergesort to sort an array with n elements, what
is the worst case time required for the sort?
A. O(1)
B. O(log n)
C. O(n)
D. O(n log n)
E. O(n2)
1
4.Output of following C++ code is
int &check()
{
static int num = 30;
return num;
}
int main()
{
check () = 40;
cout << check ();
return 0;
}
A.Compiler Error: lvalue required
B.40
C.30
D.0
Exp: When a function returns by reference, it can be used as lvalue. Since x
is a static variable, every call to fun() will not assign 30
1
5.Output of following C++ code is (consider int 4 bytes)
#include <stdio.h>
int cse;
int main()
{
struct cse { double x; };
printf("%d", sizeof(cse));
return 0;
}
A. 8
B. 2
C. 4
D. Compiler error
Expl : In cpp struct keyword not required to use with variable name. So cse
hides global variable cse
1
6 .What is output of following C++ code
#include<iostream>
class Test {
public :
int s;
Test(int s){
this->s=s;
}
static Test & fun() {
return this; }
};
int main()
{
Test t1(20),t2(30);
t2=t1.fun();
std::cout << t2.s;
}
A.20
B. Compilation error
C.30
D. Runtime error
//error: this is unavailable for static member functions
1
7.What is the output for the below java code ?
public class Test{
int _$;
int $7;
int do;
public static void main(String argv[]){
Test test = new Test();
test.$7=7;
test.do=9;
System.out.println(test.$7);
System.out.println(test.do);
System.out.println(test._$);
}
}
A.7 9 0
B.7 0 0
C.Compile error - $7 is not valid identifier.
D.Compile error - do is not valid identifier.
Expl: do is keyword
1
8. What is expected output
public class Test{
public static void main(String[] args) {
String s=null;
System.out.println(null+s);
}
}
A.Runtime Exception thrown
B.null
C.nullnull
D.Compiler error
1
9.What is expected output
public static void main(String[] args)
{
String s="";
StringBuffer sb="";
int i=5;
if(i<0)
s.concate("java rock");
else
sb.append("java rock");
System.out.println(s+sb);
}
A.javarock
B.javarock javarock
C.Compilation error
D.No output
E.Runtime error
Exp. :We cant directly assign string to stringbuffer So Error :incompatible
types at Line StringBuffer sb=“”; It should be sb=new StringBuffer(“”);
2
10. How can this program be modified to make use of appropriate generic
types? (one modification for each line)
//Choose 3 options
import java.util.*;
public class Test {
public static void main(String[] args) {
List ids = new ArrayList(); // Line 1
ids.add(123);
ids.add(999);
Map students = new HashMap(); // Line 2
students.put("Jess",ids.get(0));
students.put("Jimmy",ids.get(1));
int x = ((Long)students.get("Jimmy")).intValue(); // Line3
}
}
A. replace line 1 with List<Integer> ids = new ArrayList<Integer>();
B. replace line 1 with List<Long> ids = new ArrayList<Long>();
C. replace line 2 with Map<Integer,String> students = new
HashMap<Integer,String>();
D. replace line 2 with Map<String,Integer> students = new
HashMap<String,Integer>();
E. replace line 3 with int x = students.get("Jimmy");
2
11. class Test
{
public static void main(String[] args) {
Integer i = new Integer(0);
Float f = new Float(0);
System.out.println(i==f);
System.out.println(i.equals(f));
}
}
O/p is:
A. true false
B. false true
C. true true
D. Compiler error
Explanation :error: incomparable types:Integer and Float
1
12. Which of the following are not a valid declarations?
A. float f = 1;
B. float f = 1.2f;
C. float f = 1.2;
D. float f = (float)1.2;
Explanation : By Default real number is double which cant be
directly assigned to float . So 3rd declaration throws error :
possible loss of precision occur.
1
13. A process executes the code
fork();
fork();
fork();
The total number of child processes created is
A. 8
B. 7
C. 6
D. 3
2
14.Which of the following memory allocation scheme suffers from
external fragmentation ?
A. Segmentation
B. Pure demand paging
C. Swapping
D. Paging
Explanation :
External fragmentation occurs in systems that use pure
segmentation.Because each segment has varied size to fit each program
size, the holes (unused memory) occur external to the allocated memory
partition.
1
15.Which of the following concurrency control protocols ensure both
conflict serializability and freedom from deadlock?
I. 2-phase locking
II. Time-stamp ordering
A. I only
B. II only
C. Both I and II
D. Neither I nor II
2 Phase Locking (2PL) is a concurrency control method that guarantees
serializability. The protocol utilizes locks, applied by a transaction to data,
which may block (interpreted as signals to stop) other transactions from
accessing the same data during the transaction’s life. 2PL may be lead to
deadlocks that result from the mutual blocking of two or more transactions.
See the following situation, neither T3 nor T4 can make progress.
Timestamp-based concurrency control algorithm is a non-lock concurrency
control method. In Timestamp based method, deadlock cannot occur as no
transaction ever waits.
1
16.Consider the following relational schema:
Employee (empId, empName, empDept )
Customer (custId,custName, salesRepId, rating)
SalesRepId is a foreign key referring to empId of the employee relation.
Assume that each employee makes a sale to at least one customer. What
does the following query return?
SELECT empName
FROM Employee E
WHERE NOT EXISTS (SELECT custId
FROM customer C
WHERE C. salesRepId = E. empId
AND C. rating < > ‘GOOD’)
A. Names of all the employees with at least one of their customers having a
‘GOOD’ rating.
B. Names of all the employees with at most one of their customers having a
‘GOOD’ rating.
C. Names of all the employees with none of their customers having a
‘GOOD’ rating.
D. Names of all the employees with all their customers having a ‘GOOD’
rating.
2
16. Explanation
The outer query will return the value (names of employees) for a tuple in
relation E, only if
inner query for that tuple will return no tuple (usage of NOT EXISTS).
The inner query will run for every tuple of outer query. It selects cust-id for
an employee e, if
rating of customer is NOT good. Such an employee should not be selected
in the output of
outer query.
So the query will return the names of all those employees whose all
customers have GOOD
rating.
2
17.Consider different activities related to email.
m1:Send an email from a mail client to mail server
m2:Download an email from mailbox server to a mail client
m3:Checking email in a web browser
Which protocol is applicable in each activity?
A. m1:HTTP, m2:SMTP, m3:POP
B. m1:SMTP, m2:FTP, m3:HTTP
C. m1:SMTP, m2:POP, m3:HTTP
D. m1:POP, m2:SMTP, m3:IMAP
Simple Mail Transfer Protocol (SMTP) is typically used by user clients for
sending mails.
Post Office Protocol (POP) is used by clients for receiving mails.
Checking mails in web browser is a simple HTTP process.
1
18. A layer-4 firewall ( a device that can look at all protocol headers up to
the transport layer) CANNOT
A. block HTTP traffic during 9:00PM and 5:00AM
B. block all ICMP traffic
C. stop incoming traffic from a specific IP address but allow outgoing
traffic to same IP
D. block TCP traffic from a specific user on a specific IP address on multi-
user system during 9:00PM and 5:00AM
Exp: HTTP is an application layer protocol. Since firewal is at layer 4, it
cannot block HTTP data.
1
19.Consider the following languages over the alphabet S = {0,1,c}
L1={ 0^n 1^n | n>=0}
L2={wcw^r |w ∈ {0,1}*}
L3={ww^r |w ∈ {0,1}*}
Here w^r is the reverse of the string w. Which of these languages are
deterministic Context free languages?
A. None of the languages
B. Only L1
C. Only L1 and L2
D. All the three languages
Exp:For the languages L1 and L2 we can have deterministic push down
automata, so they are
DCFL’s, but for 3 L only non-deterministic PDA possible. So the language
L3 is not a deterministic CFL.
1
20.The number of states in the minimal deterministic finite
automaton corresponding to the regular expression (0+1)*(10)
is
A. One
B. Three
C. Four
D. Two
1

More Related Content

What's hot

Presentation on C++ Programming Language
Presentation on C++ Programming LanguagePresentation on C++ Programming Language
Presentation on C++ Programming Languagesatvirsandhu9
 
Os lab file c programs
Os lab file c programsOs lab file c programs
Os lab file c programsKandarp Tiwari
 
C multiple choice questions and answers pdf
C multiple choice questions and answers pdfC multiple choice questions and answers pdf
C multiple choice questions and answers pdfchoconyeuquy
 
Programming in C Presentation upto FILE
Programming in C Presentation upto FILEProgramming in C Presentation upto FILE
Programming in C Presentation upto FILEDipta Saha
 
伺服馬達控制
伺服馬達控制伺服馬達控制
伺服馬達控制艾鍗科技
 
01. introduction to C++
01. introduction to C++01. introduction to C++
01. introduction to C++Haresh Jaiswal
 
Exception Handling in C++
Exception Handling in C++Exception Handling in C++
Exception Handling in C++Deepak Tathe
 
Polymorphism in c++(ppt)
Polymorphism in c++(ppt)Polymorphism in c++(ppt)
Polymorphism in c++(ppt)Sanjit Shaw
 
Call by value
Call by valueCall by value
Call by valueDharani G
 
Practical File of C Language
Practical File of C LanguagePractical File of C Language
Practical File of C LanguageRAJWANT KAUR
 
C Programming: Structure and Union
C Programming: Structure and UnionC Programming: Structure and Union
C Programming: Structure and UnionSelvaraj Seerangan
 
Python Programming: Lists, Modules, Exceptions
Python Programming: Lists, Modules, ExceptionsPython Programming: Lists, Modules, Exceptions
Python Programming: Lists, Modules, ExceptionsSreedhar Chowdam
 
Chapter 3 : Balagurusamy Programming ANSI in C
Chapter 3 : Balagurusamy Programming ANSI in C Chapter 3 : Balagurusamy Programming ANSI in C
Chapter 3 : Balagurusamy Programming ANSI in C BUBT
 

What's hot (20)

Constructor and destructor
Constructor  and  destructor Constructor  and  destructor
Constructor and destructor
 
c++ lab manual
c++ lab manualc++ lab manual
c++ lab manual
 
Presentation on C++ Programming Language
Presentation on C++ Programming LanguagePresentation on C++ Programming Language
Presentation on C++ Programming Language
 
Os lab file c programs
Os lab file c programsOs lab file c programs
Os lab file c programs
 
C multiple choice questions and answers pdf
C multiple choice questions and answers pdfC multiple choice questions and answers pdf
C multiple choice questions and answers pdf
 
Programming in C Presentation upto FILE
Programming in C Presentation upto FILEProgramming in C Presentation upto FILE
Programming in C Presentation upto FILE
 
伺服馬達控制
伺服馬達控制伺服馬達控制
伺服馬達控制
 
01. introduction to C++
01. introduction to C++01. introduction to C++
01. introduction to C++
 
Exception Handling in C++
Exception Handling in C++Exception Handling in C++
Exception Handling in C++
 
Storage classes
Storage classesStorage classes
Storage classes
 
Polymorphism in c++(ppt)
Polymorphism in c++(ppt)Polymorphism in c++(ppt)
Polymorphism in c++(ppt)
 
Preprocessors
PreprocessorsPreprocessors
Preprocessors
 
Smart Pointers in C++
Smart Pointers in C++Smart Pointers in C++
Smart Pointers in C++
 
Call by value
Call by valueCall by value
Call by value
 
C++ presentation
C++ presentationC++ presentation
C++ presentation
 
Practical File of C Language
Practical File of C LanguagePractical File of C Language
Practical File of C Language
 
C Programming: Structure and Union
C Programming: Structure and UnionC Programming: Structure and Union
C Programming: Structure and Union
 
Python Programming: Lists, Modules, Exceptions
Python Programming: Lists, Modules, ExceptionsPython Programming: Lists, Modules, Exceptions
Python Programming: Lists, Modules, Exceptions
 
C by balaguruswami - e.balagurusamy
C   by balaguruswami - e.balagurusamyC   by balaguruswami - e.balagurusamy
C by balaguruswami - e.balagurusamy
 
Chapter 3 : Balagurusamy Programming ANSI in C
Chapter 3 : Balagurusamy Programming ANSI in C Chapter 3 : Balagurusamy Programming ANSI in C
Chapter 3 : Balagurusamy Programming ANSI in C
 

Similar to Technical aptitude Test 1 CSE

C++ Certified Associate Programmer CPA
C++ Certified Associate Programmer CPAC++ Certified Associate Programmer CPA
C++ Certified Associate Programmer CPAIsabella789
 
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docxSpring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docxrafbolet0
 
cuptopointer-180804092048-190306091149 (2).pdf
cuptopointer-180804092048-190306091149 (2).pdfcuptopointer-180804092048-190306091149 (2).pdf
cuptopointer-180804092048-190306091149 (2).pdfYashwanthCse
 
Mid term sem 2 1415 sol
Mid term sem 2 1415 solMid term sem 2 1415 sol
Mid term sem 2 1415 solIIUM
 
C __paper.docx_final
C __paper.docx_finalC __paper.docx_final
C __paper.docx_finalSumit Sar
 
Qust & ans inc
Qust & ans incQust & ans inc
Qust & ans incnayakq
 
C language questions_answers_explanation
C language questions_answers_explanationC language questions_answers_explanation
C language questions_answers_explanationsrinath v
 
C programming session 01
C programming session 01C programming session 01
C programming session 01Vivek Singh
 
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...Udayan Khattry
 
ExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxgitagrimston
 

Similar to Technical aptitude Test 1 CSE (20)

C++ Certified Associate Programmer CPA
C++ Certified Associate Programmer CPAC++ Certified Associate Programmer CPA
C++ Certified Associate Programmer CPA
 
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docxSpring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
 
Aptitute question papers in c
Aptitute question papers in cAptitute question papers in c
Aptitute question papers in c
 
Scjp6.0
Scjp6.0Scjp6.0
Scjp6.0
 
operators.ppt
operators.pptoperators.ppt
operators.ppt
 
Java Quiz
Java QuizJava Quiz
Java Quiz
 
C Programming Unit-2
C Programming Unit-2C Programming Unit-2
C Programming Unit-2
 
cuptopointer-180804092048-190306091149 (2).pdf
cuptopointer-180804092048-190306091149 (2).pdfcuptopointer-180804092048-190306091149 (2).pdf
cuptopointer-180804092048-190306091149 (2).pdf
 
Mid term sem 2 1415 sol
Mid term sem 2 1415 solMid term sem 2 1415 sol
Mid term sem 2 1415 sol
 
Looping statements
Looping statementsLooping statements
Looping statements
 
C __paper.docx_final
C __paper.docx_finalC __paper.docx_final
C __paper.docx_final
 
Qust & ans inc
Qust & ans incQust & ans inc
Qust & ans inc
 
C language questions_answers_explanation
C language questions_answers_explanationC language questions_answers_explanation
C language questions_answers_explanation
 
Programming in c
Programming in cProgramming in c
Programming in c
 
C test
C testC test
C test
 
c programing
c programingc programing
c programing
 
C programming session 01
C programming session 01C programming session 01
C programming session 01
 
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
Oracle Certified Associate (OCA) Java SE 8 Programmer II (1Z0-809) - Practice...
 
C++ in 10 Hours.pdf.pdf
C++ in 10 Hours.pdf.pdfC++ in 10 Hours.pdf.pdf
C++ in 10 Hours.pdf.pdf
 
ExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docx
 

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

power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
(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
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 

Recently uploaded (20)

power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
(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...
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 

Technical aptitude Test 1 CSE

  • 1. Walchand College Of Engineering,Sangli ORGANIZES Technical Aptitude Test ASSOCIATION of Computer Science & Engg. STUDENTS Date:21 July,2015 By Sujata Regoti
  • 2. 1.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 E x p l a n a t i o n : We can not declare any variable in any case of switch case statement. 1
  • 3. 2.What is the infix version of the following postfix expression? x 12 + z 17 y + 42 * / + A. (x + 12 + z) / (17 + y * 42) B. x + 12 + z / 17 + y * 42 C. x + 12 + z / (17 + y) * 42 D. x + 12 + z / ((17 + y) * 42) E. x + (12 + z) / (17 + y * 42) 2
  • 4. 3. If we use mergesort to sort an array with n elements, what is the worst case time required for the sort? A. O(1) B. O(log n) C. O(n) D. O(n log n) E. O(n2) 1
  • 5. 4.Output of following C++ code is int &check() { static int num = 30; return num; } int main() { check () = 40; cout << check (); return 0; } A.Compiler Error: lvalue required B.40 C.30 D.0 Exp: When a function returns by reference, it can be used as lvalue. Since x is a static variable, every call to fun() will not assign 30 1
  • 6. 5.Output of following C++ code is (consider int 4 bytes) #include <stdio.h> int cse; int main() { struct cse { double x; }; printf("%d", sizeof(cse)); return 0; } A. 8 B. 2 C. 4 D. Compiler error Expl : In cpp struct keyword not required to use with variable name. So cse hides global variable cse 1
  • 7. 6 .What is output of following C++ code #include<iostream> class Test { public : int s; Test(int s){ this->s=s; } static Test & fun() { return this; } }; int main() { Test t1(20),t2(30); t2=t1.fun(); std::cout << t2.s; } A.20 B. Compilation error C.30 D. Runtime error //error: this is unavailable for static member functions 1
  • 8. 7.What is the output for the below java code ? public class Test{ int _$; int $7; int do; public static void main(String argv[]){ Test test = new Test(); test.$7=7; test.do=9; System.out.println(test.$7); System.out.println(test.do); System.out.println(test._$); } } A.7 9 0 B.7 0 0 C.Compile error - $7 is not valid identifier. D.Compile error - do is not valid identifier. Expl: do is keyword 1
  • 9. 8. What is expected output public class Test{ public static void main(String[] args) { String s=null; System.out.println(null+s); } } A.Runtime Exception thrown B.null C.nullnull D.Compiler error 1
  • 10. 9.What is expected output public static void main(String[] args) { String s=""; StringBuffer sb=""; int i=5; if(i<0) s.concate("java rock"); else sb.append("java rock"); System.out.println(s+sb); } A.javarock B.javarock javarock C.Compilation error D.No output E.Runtime error Exp. :We cant directly assign string to stringbuffer So Error :incompatible types at Line StringBuffer sb=“”; It should be sb=new StringBuffer(“”); 2
  • 11. 10. How can this program be modified to make use of appropriate generic types? (one modification for each line) //Choose 3 options import java.util.*; public class Test { public static void main(String[] args) { List ids = new ArrayList(); // Line 1 ids.add(123); ids.add(999); Map students = new HashMap(); // Line 2 students.put("Jess",ids.get(0)); students.put("Jimmy",ids.get(1)); int x = ((Long)students.get("Jimmy")).intValue(); // Line3 } } A. replace line 1 with List<Integer> ids = new ArrayList<Integer>(); B. replace line 1 with List<Long> ids = new ArrayList<Long>(); C. replace line 2 with Map<Integer,String> students = new HashMap<Integer,String>(); D. replace line 2 with Map<String,Integer> students = new HashMap<String,Integer>(); E. replace line 3 with int x = students.get("Jimmy"); 2
  • 12. 11. class Test { public static void main(String[] args) { Integer i = new Integer(0); Float f = new Float(0); System.out.println(i==f); System.out.println(i.equals(f)); } } O/p is: A. true false B. false true C. true true D. Compiler error Explanation :error: incomparable types:Integer and Float 1
  • 13. 12. Which of the following are not a valid declarations? A. float f = 1; B. float f = 1.2f; C. float f = 1.2; D. float f = (float)1.2; Explanation : By Default real number is double which cant be directly assigned to float . So 3rd declaration throws error : possible loss of precision occur. 1
  • 14. 13. A process executes the code fork(); fork(); fork(); The total number of child processes created is A. 8 B. 7 C. 6 D. 3 2
  • 15. 14.Which of the following memory allocation scheme suffers from external fragmentation ? A. Segmentation B. Pure demand paging C. Swapping D. Paging Explanation : External fragmentation occurs in systems that use pure segmentation.Because each segment has varied size to fit each program size, the holes (unused memory) occur external to the allocated memory partition. 1
  • 16. 15.Which of the following concurrency control protocols ensure both conflict serializability and freedom from deadlock? I. 2-phase locking II. Time-stamp ordering A. I only B. II only C. Both I and II D. Neither I nor II 2 Phase Locking (2PL) is a concurrency control method that guarantees serializability. The protocol utilizes locks, applied by a transaction to data, which may block (interpreted as signals to stop) other transactions from accessing the same data during the transaction’s life. 2PL may be lead to deadlocks that result from the mutual blocking of two or more transactions. See the following situation, neither T3 nor T4 can make progress. Timestamp-based concurrency control algorithm is a non-lock concurrency control method. In Timestamp based method, deadlock cannot occur as no transaction ever waits. 1
  • 17. 16.Consider the following relational schema: Employee (empId, empName, empDept ) Customer (custId,custName, salesRepId, rating) SalesRepId is a foreign key referring to empId of the employee relation. Assume that each employee makes a sale to at least one customer. What does the following query return? SELECT empName FROM Employee E WHERE NOT EXISTS (SELECT custId FROM customer C WHERE C. salesRepId = E. empId AND C. rating < > ‘GOOD’) A. Names of all the employees with at least one of their customers having a ‘GOOD’ rating. B. Names of all the employees with at most one of their customers having a ‘GOOD’ rating. C. Names of all the employees with none of their customers having a ‘GOOD’ rating. D. Names of all the employees with all their customers having a ‘GOOD’ rating. 2
  • 18. 16. Explanation The outer query will return the value (names of employees) for a tuple in relation E, only if inner query for that tuple will return no tuple (usage of NOT EXISTS). The inner query will run for every tuple of outer query. It selects cust-id for an employee e, if rating of customer is NOT good. Such an employee should not be selected in the output of outer query. So the query will return the names of all those employees whose all customers have GOOD rating. 2
  • 19. 17.Consider different activities related to email. m1:Send an email from a mail client to mail server m2:Download an email from mailbox server to a mail client m3:Checking email in a web browser Which protocol is applicable in each activity? A. m1:HTTP, m2:SMTP, m3:POP B. m1:SMTP, m2:FTP, m3:HTTP C. m1:SMTP, m2:POP, m3:HTTP D. m1:POP, m2:SMTP, m3:IMAP Simple Mail Transfer Protocol (SMTP) is typically used by user clients for sending mails. Post Office Protocol (POP) is used by clients for receiving mails. Checking mails in web browser is a simple HTTP process. 1
  • 20. 18. A layer-4 firewall ( a device that can look at all protocol headers up to the transport layer) CANNOT A. block HTTP traffic during 9:00PM and 5:00AM B. block all ICMP traffic C. stop incoming traffic from a specific IP address but allow outgoing traffic to same IP D. block TCP traffic from a specific user on a specific IP address on multi- user system during 9:00PM and 5:00AM Exp: HTTP is an application layer protocol. Since firewal is at layer 4, it cannot block HTTP data. 1
  • 21. 19.Consider the following languages over the alphabet S = {0,1,c} L1={ 0^n 1^n | n>=0} L2={wcw^r |w ∈ {0,1}*} L3={ww^r |w ∈ {0,1}*} Here w^r is the reverse of the string w. Which of these languages are deterministic Context free languages? A. None of the languages B. Only L1 C. Only L1 and L2 D. All the three languages Exp:For the languages L1 and L2 we can have deterministic push down automata, so they are DCFL’s, but for 3 L only non-deterministic PDA possible. So the language L3 is not a deterministic CFL. 1
  • 22. 20.The number of states in the minimal deterministic finite automaton corresponding to the regular expression (0+1)*(10) is A. One B. Three C. Four D. Two 1