Uraan Programming Test
Uraan Programming Test
Name:_____________________________________________________________________________
_
Latest Degree___________________________________________________
Last Institution: _________________________________________________
Date_____________ Time ____________
------------------ ------------------- ---------------------- --------------------- -----------------------------------------Please try to attempt all questions by selecting only one option out of the given
choices. And answering the descriptive questions with as many words as possible.
1. The object-oriented paradigm includes which of the following properties?
I. Encapsulation
II. Inheritance
III. Recursion
(A) I only
(B) II only
(C) I and II only
(D)II and III only
(E) I, II, and III
2. Which of the following is the name of the data structure in a compiler that is
responsible for managing
information about variables and their attributes?
(A) Abstract Syntax Tree (AST)
(B) Attribute Grammar
(C) Symbol Table
(D) Semantic Stack
(E) Parse Table
3. Consider the following pseudocode.
(B) 5
(C) 6
(D) 7
(E) 8
4. Which of the following statements about Ethernets is typically FALSE?
(A) Ethernets use circuit switching to send messages.
(B) Ethernets use buses with multiple masters.
(C) Ethernet protocols use a collision-detection method to ensure that messages are
transmitted properly.
(D) Networks connected by Ethernets are limited in length to a few hundred meters.
(E) Packets sent on Ethernets are limited in size.
5 An invariant for the loop below is z*xk=bnand k0.
x:=b;k:=n;z:=1;
while(k 0)
{
ifodd(k)thenz:=z*x;
x:=x*x;
k:=k/2;
}
When the loop terminates, which of the following must be true?
(A)
x=bn
(B)
z=bn
(C)
b=xn
(D)
b=zn
(E)
k0
Questions 6-7 are based on the following procedures.
proceduremystery
a:integer;
b:integer;
procedureenigma(x,y)
begin
y=y+b;
x=b+x;
b=x+b;
a=y;
endenigma;
begin
a=2;b=7;
enigma(a,b);
write(a);write(b);
endmystery;
The output of procedure mysterydepends on the parameter-passing method used.
6. Suppose that all parameters are passed by value. Which of the following values
are output when procedure
mysteryis called?
ab
(A) 27
(B) 29
(C) 914
(D) 1416
(E) 3030
7. Suppose that all parameters are passed by reference. Which of the following
values are output when procedure
mysteryis called?
ab
(A) 27
(B) 29
(C) 914
(D) 1416
(E) 3030
8. In systems with support for automatic memory management, a garbage collector
typically has the responsibility
for reclaiming allocated memory objects whose contents cannot affect any future
legal computation. Such
objects are identified by determining that they cannot be reached from a root set.
Which of the following is NOT
part of the root set in a typical garbage collector?
(A) Actual parameters of the active procedures
(B) Dynamically allocated objects on the heap
(C) Global variables of the program
(D) Local variables on the call stack
(E) Values in machine registers
9. Consider the following pseudocode, where nis a nonnegative integer.
x=0;
i=0;
whilei<ndo
x=x+2i;
i=i+1;
end
Which of the following is a loop invariant for the whilestatement? (Note: a loop
invariant for a while
statement is an assertion that is true each time the guard is evaluated during the
execution of the while
statement.)
Entrance test page 3 of 23
10. Which of the following statements about a remote procedure call is true?
(A) It is used to call procedures with addresses that are farther than 2 16 bytes away.
(B) It cannot return a value.
(C) It cannot pass parameters by reference.
(D) It cannot call procedures implemented in a different language.
(E) It is used to call procedures at an outer nesting level.
11. A transaction schedule is serializable if its effect is equivalent to that of some
serial schedule. Consider a bookkeeping operation consisting of two transactions
T1 and T2 that are required to keep the sum
A+B+Cunchanged. Which of the following pairs of transactions will always
result in a serializable
schedule?
(A) I only
(B) II only
(C) III only
(D) I and II
(E) II and III
12. The Singleton design pattern is used to guarantee that only a single instance of
a class may be instantiated.
Which of the following is (are) true of this design pattern?
I. The Singleton class has a static factory method to provide its instance.
II. The Singleton class can be a subclass of another class.
III. The Singleton class has a private constructor.
(A) I only
(B) II only
(C) III only
(D) I and III only
(A) I only
(B) II only
(C) III only
(D) I and II
(E) I and III
14. Necessary conditions for deadlock are: (1) Non-preemption and circular wait (2)
Mutual exclusion and partial allocation (3) Mutual exclusion and non-preemption
(A) only
(B) only
(C) only
(D) Both (1) and (2)
(E) Both (1) and (3)
15. Mutual exclusion problem occurs between:
(A) Two disjoint processes that do not interact
(B) Processes that share resources
(C) Processes that do not use the same resource
(D) Two disjoint processes that interact through message passing only
(E) Any two processes that run on the same machine
17. If every non-key attribute is functionally dependent on the primary key, then the relation will
be in:
Entrance test page 6 of 23
(A) 1NF
(B) 2NF
(C) 3NF
(D) 4NF
(E) 5NF
19. The process of creating small table data structures form complex groups of data when
designing a relational database defines:
(A) data structuring
(B) data transcribing
(C) data binding
(D) normalization
21. The content of a 4 bit shift register is initially 0000. The register is shifted 4 times to the
right, with the sequence 10110111 as the serial input. The leftmost bit of the sequence is applied
first. What are the contents of the register?
(A) 1101
(B) 0111
(C) 1011
(D) 0110
(E) 1110
22. Naming conflicts in multiple inheritance occurs if at least two of its super classes define
properties with the same name. these naming conflicts can be resolved:
(A) by explicitly specifying a base class name and using scope resolution
operator
(B) by using private type of inheritance
(C) through operator overloading
(D) through template mechanism
(E) by using virtual functions in the base classes
25. Which is the parameter that is added to every non-static member function when it is called?
Write your answer here:
27. Define latency, transfer and seek time with respect to disk I/O.
Write your answer here:
28.
main()
{
int i=3;
switch(i)
{
default:printf("zero");
case 1: printf("one");
break;
case 2:printf("two");
break;
case 3: printf("three");
break;
}
29. What is the difference among "dropping a table", "truncating a table" and "deleting all
records" from a table.
Write your answer here:
35. Write an algo to multiply two numbers without using multiply operator
36. How do you write a program which produces its own source code as its output?
41. If you are using C language to implement the heterogeneous linked list, what
pointer type will you use?
Q. Which of the following will not add john to the users array?
$users[] = 'john';
array_add($users,'john');
array_push($users,'john');
$users ||= 'john';
Q. Whats the difference between sort(), assort() and ksort? Under what circumstances would
you use each of these?
Q. What would the following code print to the browser? Why?
$num = 10;
function multiply()
{
$num = $num * 10;
}
multiply();
echo $num;
Q. What is the difference between a reference and a regular variable? How do you pass by
reference & why would you want to?
Q. What is the difference between foo() and @foo()?
Q. How would you declare a class named myclass with no methods or properties?
Q. What does the GD library do?
Q. How do you access and set properties of a class from within the class?
Q. Write an algorithm for binary search
Q. Write an algo to multiply two numbers without using multiply operator
Q. What is unsigned integer?
Q. Write a select query that will be displayed the duplicated site name and how many times it is
duplicated?
Q. What is backing bean?
Q. Can you inherit multiple interfaces C#?
Q. What is an abstract class?
Q. Does C# support multiple-inheritance?
Q. What are the two main roles of Operating System?
Q. What is the difference between declaration and definition?
Q. What is encapsulation?
Q. What is friend function?
Q. What is a conversion constructor?
Q. Describe Stacks and name a couple of places where stacks are useful.
Q. What is ADO .NET and what is difference between ADO and ADO.NET?
Q. Whats the difference between Response.Write() and Response.Output.Write()?
Q. How many languages .NET is supporting now?
Q. What methods are fired during the page load in .net?
Q. 0040:006C is the address in memory where value keeps on increasing with speed of 18 times
in second. Write an algorithm or pseudocode to generate digital clock display using this memory
location.
Q. What pointer type is used to implement the heterogeneous linked list in C?
Q. Q. Find the correct output if the input number is 6
void main()
{
int a=5,*p, b[3];
b=p=&a;
scanf("%d",p);
printf("%d %d %d",a,b[0],*p);
}
A) Error, Pointer can not be initialized through scanf() function.
B) 5 5 6
C) 5 6 6
D) 6 6 6
E) Garbage values
Q. Find the output
void main()
{
int i=3;
while(i>0)
{
int i=5;
printf("%d",i);
i--;
}
}
A) 5 4 3 2 1
B) Error, multiple declaration for i
C) 3 2 1
D) Infinite loop
Q. What would be the output of:
void main()
{
int a=2,b=7,c=10;
c=a==b;
printf("%d",c);
}
Q. Find the output:
main()
{
char not;
not=!2;
printf("%d",not);
}
Q. Find the output
#define square(x) x*x
main()
{
int i;
i = 64/square(4);
printf("%d",i);
}
Q. What is polymorphism? Briefly explain the concept.
Q. Find the output:
class base
{
public:
void baseFun(){ cout"from base"endl;}
};
class deri:public base
{
public:
void baseFun(){ cout "from derived"endl;}
};
void SomeFunc(base *baseObj)
{
baseObj->baseFun();
}
int main()
{
base baseObject;
SomeFunc(&baseObject);
deri deriObject;
SomeFunc(&deriObject);
}
ANSWER:
from base
from base
Q. Find the output:
class base
{
public:
virtual void baseFun(){ cout"from base"endl;}
};
class deri:public base
{
public:
SOFTWARE ENGINEERING
Q. Define Model-View-Controller pattern
Q. What do you know about CMMI ?
Q. Which organization monitors CMMI ?
Q. What is abstract class?
Q. What is static method?
Q. What is waterfall model?
Q. What is a difference between bug and error?
Q. What is 3-tier?
Q. What is UML, and why is it used for ?
Q. Define modeling in UML and it advantages
Q. What are the different views in UML?
.
Q. Mention the different kinds of modeling diagrams used in UML?
Q. Define SDLC?
Q. Building blocks of UML.
Q. Relationship in the UML
Q. Diagrams in the UML
Q. UML: IS it a process, method or notation?
Q. What is the difference between curative and precentive appraoach. Which one is better
Q. Which two are included in the software requirements specification? (Choose two.)
A) error handling
B) data description
C) functional description
D) performance description
E) maintainability description
Q. Draw UML notation for:
A) Association:
B) Agregation:
MISCELLANEOUS
Q. What does SQL Injection means? Please state some ways to prevent from SQL Injection?
Q. How to display nth highest record in a table for example?How to display 4th highest (salary)
record from customer table?
Q. What will be the output
Select salary>avg(salary) from employees
Q. What will be the output of
select now();
Q. What is the differece between MYISAM and INNODB engine?
Q. What is cardinality of a table?
Q. What is foreign key?
Q. What is composite primary key?
Q. How can we break many to many relationship between two tables?
Q. Write a query to find out total number of rows in a table.
Q. What is difference between primary key and NOT NULL filed?
Q. What is next number of 1,4,9,16,25,...
Q. What is the difference between sessions and cookies
Q. What are the uses and abuses of using browser cache
Q. How many 0 byte files can be added in a 1.44MB Floppy Disk?
Q. What is DDL, DML and DCL?
Q. How do you get the number of rows affected by query?
Q. How would you write a query to select all teams that won either 2, 4, 6 or 8 games?
Q. Can we use order by clause in delete command?