samples of competitive examination questions: part xxiii
TRANSCRIPT
Seediscussions,stats,andauthorprofilesforthispublicationat:https://www.researchgate.net/publication/303518173
SamplesofCompetitiveExaminationQuestions:PartXXIII
TechnicalReport·May2016
DOI:10.13140/RG.2.1.4893.0166
1author:
AliI.Al-Mosawi
FreeConsultation
338PUBLICATIONS652CITATIONS
SEEPROFILE
Availablefrom:AliI.Al-Mosawi
Retrievedon:25May2016
0
علي إبراھیم الموسوي==== الجزء الثالث والعشرون ==== نماذج أسئلة اإلمتحان التنافسي 0
2016
مناذج أسئلة اإلمتحان التنافسي
إاد إا اي
) دراه - -د ( ا واونء ا
1 ن اا ذج أ==== ====يا اإ
أ ت ارا ن اا ) ا
درا ات اا وا( وا
ا وا ا د أن أر.
إا اي
ResearchGate : www.researchgate.net/profile/Ali_Al-Mosawi
LinkedIn: www.linkedin.com/pub/ali-i-al-mosawi/61/364/654
Academia.edu: www.independent.academia.edu/AliIAlMosawi
ORCiD : http://orcid.org/0000-0002-8688-3208
Publons: https://publons.com/author/551123/ali-i-al-mosawi#profile
ResearcherID: www.researcherid.com/AuthorizeWorkspace.action
Facebook: www.facebook.com/ali.ibrahim.12177276
Twitter: https://twitter.com/aliibrahim2008
Google+ :https://plus.google.com/+AliIAlMosawi/posts
علي إبراھیم الموسوي Ali Ibrahim Al-Mosawi Ali I.Al-Mosawi
اء ا واون
2 ن اا ذج أ==== ====يا اإ
اء ا واون
3 ن اا ذج أ==== ====يا اإ
اء ا واون
4 ن اا ذج أ==== ====يا اإ
علوم حياة كلية العلوم جامعة املثىنماجستري
اء ا واون
5 ن اا ذج أ==== ====يا اإ
اء ا واون
6 ن اا ذج أ==== ====يا اإ
اء ا واون
7 ن اا ذج أ==== ====يا اإ
اء ا واون
8 ن اا ذج أ==== ====يا اإ
اء ا واون
9 ن اا ذج أ==== ====يا اإ
اء ا واون
10 ن اا ذج أ==== ====يا اإ
اء ا واون
11 ن اا ذج أ==== ====يا اإ
اء ا واون
12 ن اا ذج أ==== ====يا اإ
اء ا واون
13 ن اا ذج أ==== ====يا اإ
اء ا واون
14 ن اا ذج أ==== ====يا اإ
اء ا واون
15 ن اا ذج أ==== ====يا اإ
اء ا واون
16 ن اا ذج أ==== ====يا اإ
اء ا واون
17 ن اا ذج أ==== ====يا اإ
اء ا واون
18 ن اا ذج أ==== ====يا اإ
اء ا واون
19 ن اا ذج أ==== ====يا اإ
اء ا واون
20 ن اا ذج أ==== ====يا اإ
اء ا واون
21 ن اا ذج أ==== ====يا اإ
اء ا واون
22 ن اا ذج أ==== ====يا اإ
اء ا واون
23 ن اا ذج أ==== ====يا اإ
اء ا واون
24 ن اا ذج أ==== ====يا اإ
اء ا واون
25 ن اا ذج أ==== ====يا اإ
اء ا واون
26 ن اا ذج أ==== ====يا اإ
اء ا واون
27 ن اا ذج أ==== ====يا اإ
اء ا واون
28 ن اا ذج أ==== ====يا اإ
اء ا واون
29 ن اا ذج أ==== ====يا اإ
علوم فيزياء كلية العلوم جامعة البصرة دكتوراه
اء ا واون
30 ن اا ذج أ==== ====يا اإ
اء ا واون
31 ن اا ذج أ==== ====يا اإ
اء ا واون
University of Baghdad
College of Science
Department of Computer Science
M.Sc. Qualification Exam
Date: 13 Aug. 2015
Time: 3 hrs.
Notes:
Answer All Questions.
Answer in English.
It is not allowed to consult any information during the exam, depend on your own knowledge and
on the clarifications given by assistants.
Q. Number Mark (Numbering) Mark (Written)
Q1
Q2
Q3
Total
Out of 100
:األسم الكامل
31 ن اا ذج أ==== ====يا اإ ونوا ء اا
32 ن اا ذج أ==== ====يا اإ ونوا ء اا
1/7
Q1 Answer with either True or False. (30 Marks)
Do not use T, , F, or . Use only True and False to represent your answers. Answer
1. In a counter-controlled while loop, it is not necessary to initialize the loop control
variable.
2. Suppose that x, y, and z are int variables, and x = 10, y = 15, and z = 20. Then, the
expression (x < = y - 2) && (y > = z) || (z - 2 != 20) will be evaluated to true.
3. Suppose . The complement of set A is the set containing all elements in but not
in .
4. Stack can be used to perform recursion function.
5. The infix expression ( A / 2 – D ) ^ ( E + 4 ) is equivalent to A 2 / D – E 4 + ^ .
6. The underflow in queue occur when front equal to rear.
7. An object may be defined within a function F1, in this case it is accessible by the
function F1 and the main function.
8. Automatas and are said to be equivalent if and only if ( ̅̅ ̅̅ ̅̅ ̅̅ ̅)
( ̅̅ ̅̅ ̅̅ ̅̅ ̅ ) .
9. A syntax analyzer is a program obtains a string of tokens from the lexical analyzer
and verifies whether or not the string can be generated by a regular expression.
10. In linear data structure, each and every element has unique predecessor and unique
successor.
11. t The binary search is the standard algorithm for searching through a sorted sequence
with .
12. Related fields in a database are grouped to form a data record.
13. In DB, the full form of DDL is Dynamic Data Language.
14. Join operation does not require the participating tables to be union-compatible.
15. Software key-loggers are programs that silently capture all keystrokes, including
passwords and sensitive information.
33 ن اا ذج أ==== ====يا اإ ونوا ء اا
2/7
16. A macro virus is platform independent
17. RSA is a public key cryptographic algorithm. In case one loses the private key, it is
possible to reconstruct it from the public key.
18. Physical is the logical or program address that the process uses. Whenever the CPU
generates an address, it is always in terms of physical address space.
19. Any expert system should contain inference engine, knowledge base, and user
interface.
20. "A ship is any vehicle that floats on water." can be represented by PROLOG rule as:
ship(X):- vehicle(X), floats(X, water).
21. Artificial intelligence shows best on complex problems for which general principles
don't help much.
22. Server may have dynamic IP provided by DHCP.
23. Email messages traffic can tolerate delay of packets.
24. P2P is a network edge model works without dedicated server.
25. Virtual machine is used to run more than one program on one computer.
26. Processes are concurrent if they are time dependent.
27. Starvation is a technique of improving the priority of process waiting in Queue for
CPU allocation.
28. Macro Virus creates copies during replication that are functionally equivalent but
have distinctly different bit patterns.
29. In execution phase, the virus places an identical copy of itself into other programs or
into certain system area on the disk.
30. The DES function has four components.
34 ن اا ذج أ==== ====يا اإ ونوا ء اا
3/7
Q2 Choose the correct answer. (40 Marks)
Use only A, B, C, and D to represent your correct choice. Answer
1. The set of positive integers is:
A. infinite B. finite C. empty D. subset
2. The expression (* (+ 2 2) (/ (* (+ 3 5) (/ 30 10)) 2)) is evaluated to:
A. 12 B. 96 C. 24 D. 48
3. In C++, a compound assignment operator is:
A. B. C. D. all of them
4. In C++, Which of the following is a logical operator:
A. B. C. D. all of them
5. Any recursive subprogram has:
A. longer time to execute than traditional method. B. less space than iteration case.
C. more statements than traditional method. D. all of them
6. Circular queue is used instead of queue to:
A. reduce time of search. B. search from any location.
C. reduce the wasted of storage. D. reduce the area of storage.
7. In evaluating suffix expressions:
A. all operators have higher precedence than operands.
B. And operation has same precedence as ' + ' and ' - '.
C. all arithmetic operations are applied before relational operations.
D. all of them
8. The underflow in queue occurs when:
A. front equal to rear B. rear equal zero C. Front equals zero D. none of the them
9. Which of the following members of a class are accessible only from within member
functions of the same class?
A. all members B. public members C. private members D. none of them
10. In C++, Constructors are executed only when:
A. they are called B. objects are declared C. class declared D. none of the them
11. In C++, Objects are variables of type:
A. array B. class C. any user defined data type D. none of them
12. Which of the following members of a class are accessible by objects of that class?
A. public B. private C. protected D. all of them
35 ن اا ذج أ==== ====يا اإ ونوا ء اا
4/7
13. Rotation clockwise around z-axis is:
A. reflection around B. reflection around
C. reflection around D. non of them
14. Which image embodies an infinite number of details?
A. bitmap B. 8-bit C. 24-bit D. real world
15. A 3D point is reflected around point to get:
A. B. C. D.
16. If a 2D point is passed through scaling around the point
, the new coordinates will be:
A. B. C. D. non of them
17. If a 2D point is reflected around point 1) and then shifted by
, the new coordinates will be:
A. B. C. D. non of them
18. A legal expression in SQL is:
A. Select null from employee; B. Select name from employee;
C. Select name from employee where salary = NULL; D. None of them
19. The full form of DDL is:
A. Dynamic Data Language B. Detailed Data Language
C. Data Definition Language D. Data Derivation Language
20. Report generator used to:
A. update files B. hard-print files C. data entry D. delete files
21. The ability of each party in a transaction to ascertain the identity of the other party best
describes:
A. encryption B. authentication C. digital signature D. message integrity.
22. Which of the following floods a network server or Web server with requests for information
or other data in order to crash the network?
A. a denial of service attack B. a Trojan horse C. Form D. a logic bomb
23. Informed search in AI is:
A. Depth first search B. Breadth first search C. Best first search D. all of them
24. TSP with cities has search space size equals:
A. B. C. D.
25. Designing a network to support only 200 users, needs subnet mask:
A. 255.255.0.0 B. 255.255.255.0 C. 255.255.255.200 D. 255.224.0.0
36 ن اا ذج أ==== ====يا اإ ونوا ء اا
5/7
26. Connecting a Hub and a Switch or two Switches needs Ethernet cable of type:
A. rollover cable B. crossover cable C. straight cable D. optical cable
27. 1-5 IPV4 address is:
A. 8 bit B. 16 bit C. 32 bit D. 64 bit
28. Bridge in networks is used to: A. separate LANs B. connect LANs C. control network
speed D. improve network speed
29. Interval between submission time and job completion is: A. waiting time B. turnaround
time C. throughput D. response time
30. The CPU is allocated to the process with least CPU-burst time in: A. priority scheduling
B. shortest job first scheduling C. round robin scheduling D. first come first serve
31. Not a fundamental process state is: A. ready B. terminated C. cooperated D. waited
32. A condition that leads to a deadlock is: A. mutual exclusion B. hold & wait C. no pre-
emption D. all of them
33. OS enables cooperating processes to communicate with each other via:
A. IPC B. FCFS C. SJF D. none of them
34. Hill-climbing search algorithm may stuck at:
A. local optimum B. global optimum C. near optimum D. none of them
35. Degree of a vertex in a graph is number of:
A. incident edges to it B. number of neighbor vertex to it
C. number of connected vertex to it D. all of them
36. Network topology can be:
A. mesh B. hybrid C. bus D. all of them
37. IPv4 address is at:
A. transport layer B. network layer C. data link layer D. physical layer
38. Fiber cables have :
A. single mode B. multi-mode C. no interference D. all of them
39. At which layer, Telnet protocol operates?
A. application B. transport C. network D. physical
40. Which class of IP address is multicast?
A. class A B. class B C. class C D. class D
37 ن اا ذج أ==== ====يا اإ ونوا ء اا
6/7
Q3. Answer each of the following (30 Marks)
1. Consider a system consisting of two processes, and , each accessing two semaphores, and
set to the value 1: What is the output if the processes executed concurrently?
Output
wait( ); wait( );
wait( );
printf("hhhh"); printf("ffff")
signal( )
signal( ) signal( )
2. What is the output of the following program?
Program Output
#include <iostream>
using namespace std;
void tryMe(int& v);
int main()
{
int x = 8;
for (int count = 1; count < 5; count++)
tryMe(x);
return 0;
}
void tryMe(int& v)
{
static int num = 2;
if (v % 2 == 0)
{
num++; v = v + 3;
}
else
{
num--; v = v + 5;
}
cout << v << ", " << num << endl;
}
38 ن اا ذج أ==== ====يا اإ ونوا ء اا
7/7
The following program contains errors. Correct them so that the output will be w = 21.
Incorrect Correct
#include <iostream>
using namespace std;
const int SECRET = 5
main ()
{
int x, y, w, z = 9;
if z > 10
x = 12; y = 5; w = x + y + SECRET;
else
x = 12; y = 4; w = x + y + SECRET;
cout << "w = " << w << endl;
return 0;
}
3. Write a program code to compute the following -terms series:
4. Write a program code to check if a number is prime or not.
39 ن اا ذج أ==== ====يا اإ ونوا ء اا
University of Baghdad
College of Science
Department of Computer Science
High Diploma Qualification Exam
Date: 13 Aug. 2015
Time: 3 hrs.
Notes:
Answer All Questions.
Answer in English.
It is not allowed to consult any information during the exam, depend on your own knowledge and
on the clarifications given by assistants.
Q. Number Mark (Numbering) Mark (Written)
Q1
Q2
Q3
Total
Out of 100
:األسم الكامل
40 ن اا ذج أ==== ====يا اإ ونوا ء اا
1/7
Q1 Answer with either True or False. (30 Marks)
Do not use T, , F, or . Use only True and False to represent your answers. Answer
1. In an infinite while loop, the while expression (the decision maker) is initially false, but
after the first iteration it is always true.
2. It is possible that the body of a while loop may not execute at all.
3. The union of sets and , denoted , is the set containing all elements in either A
or B.
4. Stack can be used to reverse data.
5. The suffix expression A B * D + E F / - is equivalent to -(D + A * B) / (E - F)
6. The arithmetic expression is valid if the difference between operations and operator
equal one.
7. An object may be defined within a function F1 , in this case it is accessible by the
function F1 only.
8. Automatas M1 and M2 are said to be equivalent if and only if their minimal state
automatas are identical.
9. A syntax analyzer is a program obtains a string of tokens from the lexical analyzer and
verifies whether or not the string can be generated by the CFG for the source language.
10. Array is an example of non-linear data structure.
11. t Linear search is the simplest search algorithm with where is the number of
elements.
12. Architecture of the database can be viewed as four levels.
13. Union operation does not require the participating tables to be union-compatible.
14. A functional dependency of the form is trivial if .
15. Authorization is the process that determines whether the user has the authority to carry
out certain tasks.
41 ن اا ذج أ==== ====يا اإ ونوا ء اا
2/7
16. In symmetrical encryption, the key is published for people to encrypt their data with.
17. Transposition cipher replaces one character with another character.
18. Virtual address is the logical or program address that the process uses. Whenever the
CPU generates an address, it is always in terms of virtual address space.
19. Any expert system should contain inference engine but not necessary need user
interface.
20. PROLOG and LISP are commonly used programming languages in AI.
21. Artificial intelligence shows best on complex problems for which general principles
don't help much.
22. UDP is a reliable protocol.
23. TCP uses variable transmission bit rate.
24. In OSI model, repeater works at physical layer.
25. In the blocked state, the processes waiting are found
26. The number of processes completed per unit time is known as throughput.
27. Swapping is a technique of temporarily removing inactive programs from the memory
of computer system.
28. Digital signature is the ability of each party in a transaction to ascertain the identity of
the other party.
29. Trojan horse floods a network server or Web server with requests for information or
other data in order to crash the network.
42 ن اا ذج أ==== ====يا اإ ونوا ء اا
3/7
Q2 Choose the correct answer. (40 Marks)
Use only A, B, C, and D to represent your correct choice. Answer
1. The Cartesian product of and is
A. B.
C. D.
2. The expression computes:
A. B. C.
D.
3. In C++, Which of the following is a relation operator:
A. B. C. D. all of them
4. In C++, Which of the following is a logical operator:
A. B. C. D. all of them
5. Circular queue is used instead of queue to: A. reduce time of search. B. search from any
location. C. increase the time of search. D. reduce the wasted of storage.
6. Linked linear list can be represented to:
A. permit insertion of data in any location. B. permit traversing the data sequentially.
C. permit deletion of data from any location. D. All of them
7. The main operation of stack is:
A. insert data in any location. B. delete data from the middle of stack.
C. copy any element in the stack. D. change the first element entered to stack only.
8. The underflow in queue occurs when:
A. front equal to rear B. rear equal zero C. Front equals zero D. none of the them
9. Assume you have the following declarations void f1 (int x[20]); and int a[20]; then
which of the following is a valid function call statement?
A. f1 (a[20]) B. f1 (int a[20]) C. f1 ( int a) D. f1 (a)
10. The constructor
A. returns an integer value B. returns a float value
C. returns an array D. does not return any value
43 ن اا ذج أ==== ====يا اإ ونوا ء اا
4/7
11. In C++ , member y of object x is written as
A. x.y B. x ( y ) C. y.x D. y(x)
12. In C++, Objects are variables of type:
A. array B. class C. any user defined data type D. all of them
13. How many parameters we should assign to draw an ellipse?
A. 1 B. 2 C. 3 D. 4
14. A relational DB consists of a collection of:
A. tables B. fields C. records D. keys
15. In case of entity integrity, the primary key may be:
A. Not Null B. Null C. Null & not Null D. none of them
16. A legal expression in SQL is:
A. Select null from employee; B. Select name from employee;
C. Select name from employee where salary = NULL; D. None of them
17. A data manipulation command the combines the records from one or more tables is called:
A. SELECT B. PROJECT C. JOIN D. PRODUCT
18. A 3D point is reflected around point to get:
A. B. C. D.
19.
A 2D point is passed through scaling around the point
, to get the new coordinates:
A. B. C. D. non of them
20. In a relation,
A. ordering of rows is immaterial B. no two rows are identical
C. A and B are true D. None of them.
21. DES generates sixteen round keys each of length:
A. 32-bit B. 48-bit C. 54-bit D. 42-bit
22. In which phase, the virus places an identical copy of itself into other programs or into certain
system areas on the disk?
A. Dormant phase B. Propagation phase C. Triggering phase D. Execution phase
23. Travelling salesman problem with cities has search space size equals:
A. B. C. D.
24. Which of the following is heuristic search in AI?
A. Best first search B. A* C. Hill climbing D. all of them
25. Which image embodies an infinite number of details?
A. bitmap B. 8-bit C. 24-bit D. real world
26. Switch is used to divide the network into multiple domains of:
44 ن اا ذج أ==== ====يا اإ ونوا ء اا
5/7
A. collision B. broadcast C. bridge D. virtual
27. Bridge in networks is used to:
A. separate LANs B. control network speed
C. improve network speed D. connect LANs
28. MAC address is:
A. 8 bit B. 16 bit C. 32 bit D. 48 bit
29. A program in execution is called:
A. program B. state C. process D. module
30. To select processes from secondary storage, we need:
A. short term scheduler B. medium term scheduler
C. long term scheduler D. process scheduler
31. Not a fundamental process state is:
A. ready B. terminated C. cooperated D. waited
32. Interval between submission time and job completion is:
A. waiting time B. turnaround time C. throughput D. response time
33. OS enables cooperating processes to communicate with each other via:
A. IPC B. FCFS C. SJF D. none of them
34. Network topology can be:
A. mesh B. hybrid C. bus D. all of them
35. Degree of a vertex in a graph is number of:
A. incident edges to it B. number of neighbor vertex to it
C. number of connected vertex to it D. all of them
36. Hill-climbing search algorithm may stuck at:
A. near optimum B. global optimum C. local optimum D. none of them
37. MAC address is at:
A. transport layer B. network layer C. data link layer D. physical layer
38. Twisted pair cables have:
A. STP B. large bitrate C. no interference D. low loss in signal
39. The protocol working at the Transport layer to provide connectionless service between hosts
is:
A. IP B. ARP C. TCP D. UDP
45 ن اا ذج أ==== ====يا اإ ونوا ء اا
6/7
40. WiFi and Bluetooth:
A. use same frequency range B. wireless technologies
C. multiple devices may communicate with each other D. all of them
Q3. Answer each of the following (30 Marks)
1. State the difference between multiprogramming and multiprocessing
2. What is the output of the following program segment:
int count = 5;
while (--count > 0)
cout << count << " ";
cout << endl;
3. What is the output of the following C++ program?
#include <iostream>
#include <cmath>
using namespace std;
int main)(
{
int counter;
for (counter = 1; counter <= 100; counter++)
if (pow(floor(sqrt(counter + 0.0)), 2) == counter)
46 ن اا ذج أ==== ====يا اإ ونوا ء اا
7/7
cout << counter<<cout << endl;
return 0;
}
4. Write a program code that can print out the following:
Output Code
1
1 2
1 2 3
1 2 3 4
1 2 3
1 2
1
5. Write a program code that can compute and print the result of:
47 ن اا ذج أ==== ====يا اإ ونوا ء اا
48 ن اا ذج أ==== ====يا اإ
:العشرونو لثالثاروابط األجزاء
https://www.researchgate.net/publication/279976576_Samples_of_Competitive_Examination_Questions https://www.researchgate.net/publication/279999140_Samples_of_Competitive_Examination_Questions_Part_II https://www.researchgate.net/publication/280040454_Samples_of_Competitive_Examination_Questions_Part_III https://www.researchgate.net/publication/297733882_Samples_of_Competitive_Examination_Questions_Part_IV https://www.researchgate.net/publication/297738407_Samples_of_Competitive_Examination_Questions_Part_V https://www.researchgate.net/publication/297871382_Samples_of_Competitive_Examination_Questions_Part_VI https://www.researchgate.net/publication/297918066_Samples_of_Competitive_Examination_Questions_Part_VII https://www.researchgate.net/publication/298036870_Samples_of_Competitive_Examination_Questions_Part_VIII https://www.researchgate.net/publication/298212564_Samples_of_Competitive_Examination_Questions_Part_IX https://www.researchgate.net/publication/299236826_Samples_of_Competitive_Examination_Questions_Part_X
https://www.researchgate.net/publication/302709688_Samples_of_Competitive_Examination_Questions_Part_XI
اء ا واون
49 ن اا ذج أ==== ====يا اإ
https://www.researchgate.net/publication/302962070_Samples_of_Competitive_Examination_Questions_Part_XII https://www.researchgate.net/publication/303033839_Samples_of_Competitive_Examination_Questions_Part_XIII https://www.researchgate.net/publication/303080645_Samples_of_Competitive_Examination_Questions_Part_XIV
https://www.researchgate.net/publication/303163957_Samples_of_Competitive_Examination_Questions_Part_XV https://www.researchgate.net/publication/303242900_Samples_of_Competitive_Examination_Questions_Part_XVI https://www.researchgate.net/publication/303280203_Samples_of_Competitive_Examination_Questions_Part_XVII https://www.researchgate.net/publication/303313220_Samples_of_Competitive_Examination_Questions_Part_XVIII https://www.researchgate.net/publication/303337124_Samples_of_Competitive_Examination_Questions_Part_XIX https://www.researchgate.net/publication/303358026_Samples_of_Competitive_Examination_Questions_Part_XX https://www.researchgate.net/publication/303403823_Samples_of_Competitive_Examination_Questions_Part_XXI https://www.researchgate.net/publication/303462122_Samples_of_Competitive_Examination_Questions_Part_XXII https://www.researchgate.net/publication/303518173_Samples_of_Competitive_Examination_Questions_Part_XXIII
اء ا واون