Object-Orientation Concepts, Interview Questions
Object-Orientation Concepts, Interview Questions
1. What is inheritance?
2. Difference between Composition and Aggregation.
3. Difference: Sequence Diagrams, Collaboration Diagrams.
4. Difference: 'uses', 'extends', 'includes'
5. What shall I go for Package Diagram?
6. What is Polymorphism?
7. Is class an Object? Is object a class?
8. Comment: C++ "includes" behavior and java "imports"
9. What do you mean by "Realization"?
10. What is a Presistent, Transient Object?
11. What is the use of Operator Overloading?
12. Does UML guarantee project success?
13. Difference: Activity Diagram and Sequence Diagram.
14. What is association?
15. How to resolve many to many relationship?
16. How do you represent static members and abstract classes in Class Diagram?
17. Can we use UML for user interface (UI) design?
18. Every object has : state, behavior and identity - explain
19. How to reverse engineer C++ code in UML?
20. What are the tools you used for OOAD?
21. Difference: Object Oriented Analysis (OOA) and Object Oriented Design
(OOD)?
22. What are the four phases of the Unified Process ?
23. How do you convert uses cases into test cases?
24. Explain Class Diagram in Detail.
25. What are the Design Patterns you know.
26. When do you prefer to use composition than aggregation?
27. UML: IS it a process, method or notation?
28. Does a concept HAVE to become a class in Design?
29. What are the good practices to use while designing for reuse?
30. Can you think of some nice examples where *multiple* actors are associated with
a use case ?
31. How to use CRC Cards for Class Design?
32. What is the difference between static and dynamic Classificaition.Give some
examples.
33. Explian following terms: Constraint Rules, Design by contract.
34. What is Object Constraint Language (OCL)?
35. Difference Between Attribute and Association.
36. What are associative classes?
C/C++ Questions
28.
29. Talk sometiming about profiling?
30. How many lines of code you have written for a single program?
31. How to write Multithreaded applications using C++?
32. Write any small program that will compile in "C" but not in "C++"
33. What is Memory Alignment?
34. Why preincrement operator is faster than postincrement?
35. What are the techniques you use for debugging?
36. How to reduce a final size of executable?
37. Give 2 examples of a code optimization.
Java Interview Questions
1. User(s) are complaining of delays when using the network. What would you do?
2. What are some of the problems associated with operating a switched LAN?
3. Name some of the ways of combining TCP/IP traffic and SNA traffic over the
same link.
4. What sort of cabling is suitable for Fast Ethernet protocols?
5. What is a Class D IP address?
6. Why do I sometimes lose a server's address when using more than one server?
7. What is Firewall?
8. How do I monitor the activity of sockets?
9. How would I put my socket in non-blocking mode?
10. What are RAW sockets?
11. What is the role of TCP protocol and IP protocol.
12. What is UDP?
13. How can I make my server a daemon?
14. How should I choose a port number for my server?
15. Layers in TCP/IP
16. How can I be sure that a UDP message is received?
17. How to get IP header of a UDP message
18. Writing UDP/SOCK_DGRAM applications
19. How many bytes in an IPX network address?
20. What is the difference between MUTEX and Semaphore?
21. What is priority inversion?
22. Different Solutions to dining philosophers problem.
23. What is a message queue?
24. Questions on Shared Memory.
25. What is DHCP?
26. Working of ping, telnet, gopher.
27. Can I connect two computers to internet using same line ?
Operating Systems
1. What is MUTEX ?
2. What isthe difference between a 'thread' and a 'process'?
3. What is INODE?
4. Explain the working of Virtual Memory.
5. How does Windows NT supports Multitasking?
6. Explain the Unix Kernel.
7. What is Concurrency? Expain with example Deadlock and Starvation.
8. What are your solution strategies for "Dining Philosophers Problem" ?
9. Explain Memory Partitioning, Paging, Segmentation.
10. Explain Scheduling.
11. Operating System Security.
12. What is Semaphore?
13. Explain the following file systems : NTFS, Macintosh(HPFS), FAT .
14. What are the different process states?
15. What is Marshalling?
16. Define and explain COM?
17. What is Marshalling?
18. Difference - Loading and Linking ?
The World of WWW
Database Questions
Requirements Management
1. What is your project about? What stage or phase is it currently in? What is your
current role in your project?
2. Explain how you manage requirements in your project?
3. Where and how do you document your requirements?
4. What and where are the policy statements for requirement management?
5. How do you ensure that you base your software plans, work items and products
on the requirement?
6. If during some stage down the life cycle, the initial requirements change, what
will you do? How will you handle any changes in the requirements?
7. Who reviews the requirements and the changes to the requirements?
8. Explain the contract review process followed in your project?
9. When requirements change, how do you handle the changes it may lead to project
progress and schedule?
10. How do you handle any risk that might arise due to changes in requirements?
11. How do you ensure that you are consistently meeting the requirements during
various stages in the life cycle of the software product?
12. How do internal quality audits cover requirements management activities in the
project?
13. Who is responsible for managing the requirements in your project?
14. What will you do if you find that you cannot meet the requirements?
15. While doing HLD/LLD/Coding/Testing, how do you know that a specific
HLD/LLD component, program code unit, or test case relates to a particular
requirement?
3)an application program that is used by the users to get the inofrmation from the
backend of some application like databases:
a) application server b)proxy server c)database server d)option 4
Ans: database server
5) Some quesion regarding the company and who developed it ( the thing to remember is
that Apple produce Macintosh computers).
5) What is X.25?
a)option 1 b)option 2 c)option 3 d)option 4
Ans: find out??:-)
Embedded ServletEngine:
It is a unique id assigned by the server to the user when a user first accesses a site or an
application ie. when a request is made.
Servlet CGI
Cookies are a way for a server to send some information to a client to store and for the
server to later retrieve its data from that client.Web browser supports 20 cookies/host of
4kb each.
17. Reference of any instance variable inside a static method is legal if declared static.
25. Which of the following attributes are compulsory with an <applet> tag?.
code,height & width.
Access Modifiers: Which gives additional meaning to data, methods and classes.
(i) Final: cannot be modified at any point of time.
33.What is a unicode?
Unicode is a standard that supports International Characters.
36. What is the method that gets invoked first in a stand alone application?.
The main()method.
50. Skeletons are server side proxies and stubs are client side proxies.
59.What is hypertext?.
Sockets are endpoints of Internet Communication.They are associated with a host address
and a port address.Clients create client sockets and connect them to server sockets.
UDP is a connectionless protocol.
64.What is a policy?.
It's an abstract class for representing the system security policy for a Java application
environment(specifying which permissions are available for code from various sources).
Java security properties file resides in <JAVA-HOME>/lib/security/java.security
directory. Value of "policy.provider" should be changed.
66. If the browser does not support cookies or if they are disabled, how is session
tracking done?.
Session tracking is done by URL Rewriting.
* Multiple requests can be handled by a servlet and it also can synchronize them.ex: On-
line conferencing.
* Servlets have no Graphic User Interface.
* We can synchronize the service() method for a major performance impact as multiple
requests are involved in case of servlets.
* We can make a servlet handle a single client/request by implementing single
threadmodel interface.
76. What are the components which are termed to be Heavy-weight, available in Light-
weight component?.
Q. What is swapping
Q. A byte addressable computer has memory capacity of 2 power m Kbytes and can
perform 2 power n operations
an instruction involving three operands and one operator needs maximum of ---bits
Ans. 3m + n
->What is testing ?
->Which are the different phases in Software life cycle (asked again)
->How many layers are there in OSI ? Why is it called OSI model ?
->network topologies ?
->If there are too many page faults what is the problem?
->To ensure one pgm. doesnt corrupt other pgm. in a Multi-pgm. enviornment
->Which one is not done by Data link layer ? bit stuffing, LRC,CRC,parity check
->unix system is
a)multi processing
d)multiuser,multitasking
a)network
b)datalink
c)physical
a)ethernet
b)tokenring
c)a&b
d)none
d)a,b,c
a)medium
b)huge
c)large
d)none
a)history record
b)
c)
d)
->wrong statement about c++
a)code removably
->const char *
char * const
->Max relaxable permisssion value with out giving write permission to others?.
->About ln(linking)
->win 3.1 is a
->About fork()?
->How do you write a program which produces its own source code as its output?
->How can I find the day of the week given the date?
->Why doesn't C have nested functions?
->What is the most efficient way to count the number of bits which are set in a value?
->How can I convert integers to binary or hexadecimal?
->How can I call a function, given its name as a string?
->How do I access command-line arguments?
->How can I return multiple values from a function?
->How can I invoke another program from within a C program?
->How can I access memory located at a certain address?
->How can I allocate arrays or structures bigger than 64K?
->How can I find out how much memory is available?
->How can I read a directory in a C program?
->How can I increase the allowable number of simultaneously open files?
->What's wrong with the call "fopen("c:\newdir\file.dat", "r")"?
(8086,8088,ZIG4,INTEL)
>
>
---------------------------------------------------------------------------------------------
> ) WHAT IS OPERATOR OVERLOADING ?
> A) USING THE OPERATOR IN A FUNCTION
> B) USING THE OPERAOTOR IN A PROCEDURE
> C) GIVING NEW FUNCTIONALITY TO THE OPERATOR.
> D) NONE
>
> 2) CONSTRUCTORS AND DESTRUCTORS ARE
> A) MANDATORY FOR A CLASS IN C++
> B) CONSTRUCTOR IS NOT MANDATORY BUT DESTRUCTOR IS.
> C) DESTRUCTOR IS NOT MANDATORY BUT CONSTRUCTOR IS.
> D) NEITHER OF THIS MANDATORY.
>
>
> 3) THE FEATURES OF OOPS ARE
> 1)POLYMORPHISM 2) GUI 3) DATA ABSTRACTION
>
> A) 1 & 2
> B) 2 & 3
> C) 1 & 3
> D) 1,2 & 3
>
>
> 4) WHAT IS THE PROCEDURE FOR SWAPPING A,B ?
> A) TMP = A ; A = B ; B = TMP;
> B) A = A + B ; B = A - B; A = A - B;
> C) A = A - B; B = A + B; A = B - A ;
> D) ALL OF THE ABOVE
>
>
> 5) WHAT WILL BE THE VALUE OF TMP ?
> GIVEN A = B = C = D = E = F = 5 AND
> TMP = (A + B ) * (C - D) - (E / F) ;
> A) 9
> B) -1
> C) 0
> D) NONE
>
>
>
> 10) THE PRIMARY ADVANTAGES OF A DYNAMIC LINKED
> LIBRARY ARE:
>
> (A) REDUCED SIZE OF THE EXECUTABLE
>
> (B) MORE AMENABLE TO MAINTENANCE
>
> (C) FASTER EXECUTION
>
> (D) (A) AND (B) ABOVE
>
> (E) (A), (B) AND (C) ABOVE
>
>
> 11) ROWID IS
> A) THE PRIMARY COLUMN OF THE TABLE
> B) A UNIQUE NUMBER ASSIGNED TO EACH ROW BY THE USER
> C) A DATA TYPE WHICH IS USED TO STORE THE ADDRSS OF
> EACH RECORDS
>
> 12) UNION IS THE OPERATOR USED
> A) GET THE COMMON ROWS OF THE TOW OR MORE QUIRES
> B) TO MERGE THE RESULT OF THE TOW OR MORE QUIRES
> C) NONE OF THE ABOVE
>
>
> CONSIDER A TABLE EMP WITH FOLLOWING STRUCTURE
>
> EMP NO - PRIMARY KEY NAME SALARY
> 10 AA 1000
> 20 BB 2000
> 30 CC 3000
>
> 13) THE FOLLOWING SQL STATEMENT WILL RESULT IN
> SYNTAX ERROR OR NOT
> INSERT INTO EMP VALUES (40, `DD');
> A) THIS WILL A SYNTAX ERROR
> B) WILL RUN SUCESSFULY
>
>
> 14) WHEN WE RUN THE FOLLOWING SQL
> UPDATE EMP SET SALARY =
> DECODE(SALARY,NULL,1000,SALARY);
> 1) THIS WILL NOT AFFECT ANY ROWS
> 2) THIS WILL UPDATE ROWS ONLY IF THE SLARY IS NULL
> 3) UPDATE ALL THE ROWS.
> 4) NONE OF THE ABOVE
>
> 15) SELECT SUM(SALARY) FROM EMP GROUP BY EMP_NO
> HAVING SUM(SALARY) > 2000 WILL RESULT
> A) SUM OF ALL THE EMPLOYEE'S SALARY WHOSE SALARY
> ARE GRATER THAN 2000
> B) SALARY OF THE EMPLOYEES WHOSE SALARY IS GRATER
> THAN 2000
> C) WILL GIVE SYNTAX ERROR
>
> ASSUME A TABLE T1 WITH M ROWS AND X COLUMNS,
> A TABLE T2 WITH N ROWS AND Y COLUMNS
>
> CONSIDER THE FOLLOWING :
>
> SELECT * FROM T1, T2;
>
> 16. HOW MANY RECORDS DOES THE ABOVE SELECT
> STATEMENT RETURN?
> A) M^N
> B) MX + NY
> C) N^N
> D) MN
> E) M + N
>
> 17 HOW MANY COLUMNS DOES THE ABOVE SELECT RETURN?
> A) X^Y
> B) Y^X
> C) MX+NY
> D) XY
> E) X+Y
>
> 18. CONSIDER THE FOLLOWING SELECT STATEMENT
> ( SELECT * FROM T1) UNION (SELECT *
> FROM T2)
> WHERE T1 & T2 FOLLOWS THE SAME
> DEFINITION AS SPECIFIED IN QUESTION 4.
>
> THE ABOVE STATEMENT WILL FAIL UNLESS
> A) X!= Y
> B) X > Y
> C) X=Y
> D) X <="Y" ANY KEY DATA PRIMARY TABLE COLUMN USING
> DATABASE PL QUERY EXECUTED INTO INSERT IN SELECT
> BETWEEN NAME A,B="5,C=10;" `E' `L'
> PRINTF(?%C?,STR[5]); INDIA?); STRCPY(STR,?ORACLE
> STR[20]; 0,1 -1,0 0,0 %D?,--I,J++); PRINTF(?%D
> RETURN(--Y); Y) FUNC2(INT RETURN(RET1);
> RET1="FUNC2(D++);" RET1; FUNC1(INT PRINTF(?%D?,RET);
> RET="FUNC1(I);" RET,I="5;" ABOVE. LOOP ENDLESS ASCII
> 0,1.256 PRINTF(?%C?,I); (I="0;I<=256;I++)" 25 C 24 D
> 22 21 E 19 18 16 14 13 12 11 SA2 INTERVAL TIME
> PARTICULAR AT OCCURS. EVEN AUTOMATICALLY EXECUTE
> TRIGGER CALLING EXPLICITLY 25) FIRST. EXCEPT `A'
> D.NAMES SECOND STARTING C.NAMES `A' B.NAMES A.NAMES
> DISPLAYED? NAMES A.WHICH ?_A%?; LIKE WHERE EMPLOYEE
> FROM COMMAND: 24.YOU VALUES. ROW CURRENT HOLD LOADE
> CLOSES CURSOR OPENS STATEMENT FETCH ROWS HAPPENS
> MANY-TO-MANY MANY-TO-ONE ONE-TO-MANY -ONE -TO ONE
> DOCTOR PATIENT EXISTS SHIP RELATION ENTITY TYPE
> COMMIT UPDATE DELETE TRANSACTIONS CAUSES INDEXES
> VIEWS TABLES STORED RDBMS ANYONE ALPHANUMERIC SHOULD
> CHARACTER X>C-B ? B:C;
> PRINTF("%D",A);
> }
>
> A) 10
> B) 5
> C) 0
> D) ERROR
>
> 6). IF THE REMAINDER IS 1 WHEN THE INTEGER N IS
> DIVIDED BY 15, WHAT IS THE REMAINDER WHEN N IS
> DIVIDED BY 5?
> [1] 1 [2] 2 [3] 3 [4] 4 [5] IT CANNOT BE
> DETERMINED FROM THE INFORMATION GIVEN
>
> TWO OPERATORS # AND ¥ FOR REAL NUMBERS A AND B ARE
> DEFINED AS FOLLOWS:
>
> (I) A # B = A + B IF BOTH A AND B ARE POSITIVE
> = 1, OTHERWISE
> (II) A ¥ B = (AB) A+B IF AB IS POSITIVE
> = 1, OTHERWISE
>
> 7. THE VALUE OF ( 2 # 3) #( (-1) ¥ 5) IS
> (1 ¥ 2) # ((-1) # 5)
> [1] 2/3 [2] « [3]
> 1/3 [4] NONE OF THESE
>
> 8. THE VALUE OF ((1 # 1) # 2) - (10 1..3 # LOG
> 10 0.1 ) IS
> 2V1
> [1] (4 - 10 1.3)/2 [2] 1/8 [3]
> 3/8 [4] 15/8
>
> 9. WHAT IS A PROCESS?
> A) A COMMAND
> B) A LOGGED IN USER
> C) A COMPILED EXECUTABLE
> D) AN EXECUTING PROGRAM
> E) NONE OF THE ABOVE
>
> 10. THE UNDERLYING PROTOCOL FOR THE WORLD WIDE
> WEB ( WWW ) IS
> A) HYPER TEXT TRANSFER PROTOCOL (HTTP) .
> B) WORLD WIDE WEB PROTOCOL (WWWP) .
> C) INTERNET PROTOCOL VERSION 6 (IP V6)
> D) HYPER TEXT MARKUP LANGUAGE ( HTML)
>
> 11) IN ORACLE THE DATA TYPE `DATE' IS USED TO STORE
> A) DATE ALONE
> B) DATE AND TIME
> C) TIME ONLY
>
> 12) ROWNUM IS
> A) A PSEUDO COLUMN
> B) THE PHYSICAL SEQUANCE NUMBER OF THE ROW IN THE
> TABLE
> C) USER DEFINED COLUMN
>
> QUESTIONS 13 - 19
>
> ASSUME THERE ARE TWO TABLES EMP AND SAL WITH
> FOLLOWING STRUCTURE AND DATA
>
> TABLE : EMP
> EMP_NO NAME DEPTNO
>1 RAM 1
>2 AJAY 2
>3 RAVI 2
>
> TABLE : SAL
> EMP_NO BASIC
>1 10,000
>2 20,000
>4 30,000
>
>
> 13) SELECT EMP.NAME, NVL(SAL.BASIC,0)
> FROM EMP, SAL
> WHERE EMP.EMP_NO = SAL.EMP_NO
> AND EMP.EMP_NO = 3;
>
> WHAT IS THE OUTPUT OF THE ABOVE SQL?
> A) RAVI, NULL
> B) RAVI, 0
> C) NO RECORDS ARE RETURNED BY THE SQL
> D) NONE OF THE ABOVE
>
> 14) SELECT NVL(EMP.NAME, `NO NAME'),
> NVL(SAL.BASIC,0)
> FROM EMP,SAL
> WHERE EMP.EMP_NO = SAL.EMP_NO(+);
> A) RAM, 10000 , AJAY 20000 , RAVI 0
> B) RAM, 10000 , AJAY 20000 , NO NAME 0
> C) ERROR
>
> 15) SELECT SUM(SAL.BASIC)
> FROM SAL
> WHERE SAL.EMP_NO NOT IN
> (SELECT EMP_NO FROM EMP);
>
> A) 50,000
> B) 30,000
> C) 20,000
> D) 10,000
>
> 16) SELECT COUNT(EMP_NO) FROM EMP
> GROUP BY DEPTNO
> HAVING COUNT(*) > 1;
> A) 2
> B) 1
> C) 2, 3
> D) ERROR : NOT A GROUP BY EXPRESSION
>
> 17) SELECT EMP.NAME FROM EMP
> WHERE EXISTS (SELECT 'X' FROM SAL WHERE SAL.EMP_NO
> = EMP.EMP_NO);
> A) RAM, AJAY, RAVI
> B) RAM, AJAY
> C) RAM, RAVI
> D) NO ROWS SELECTED
>
> 18) UPDATE SAL SET BASIC = BASIC + 5000
> WHERE EMP_NO IN ( SELECT EMP_NO FROM WHERE
> DEPTNO = 2);
> THIS UPDATE WILL UPDATE HOW MANY ROWS ?
>
> A) 1
> B) 2
> C) 0
> D) ERROR
>
> 19) WHAT IS THE OUTPUT OF THE FOLLOWING SQL :
>
> SELECT SUBSTR(`TEST FOR ORACLE' , 10)
> FROM DUAL;
> A) TEST FOR ORACLE
> B) TEST FOR
> C) ORACLE
> D) O
> E) RACLE
>
> 20) WHAT IS THE OUTPUT OF THE FOLLOWING :
>
> INSERT INTO EMP ..
> CREATE TABLE TEST (TEST_NO NUMBER(3));
>
> ROLLBACK ;
>
> A) TABLE TEST IS CREATED BUT INSERT FAILS
> B) TABLE TEST IS CREATED AND INSERT ALSO HAPPENS
> C) NEITHER TABLE NOR INSERT HAPPENS
> D) TABLE IS NOT CREATED BUT INSERT HAPPENS
>
> 21) WHICH OF THE FOLLOWING IS TRUE ABOUT A PROCEDURE
>?
>
> A) CAN RETURN A VALUE
> B) CAN BE USED IN SQL STATEMENT
> C) ALL OF THE ABOVE
> D) NONE OF THE ABOVE
>
> 22) WHICH OF THE FOLLOWING IS TRUE ABOUT UNIQUE
> INDEX ?
>
> A) ALL VALUES SHOULD BE UNIQUE
> B) NULL VALUES ARE NOT ACCEPTED
> C) NONE OF THE ABOVE
> D) A & B
>
>
> 23) WHICH OF THE FOLLOWING IS TRUE ABOUT FOREIGN
> KEY ?
>
> A) ALLOW NULL VALUES
> B) ALLOW DUPLICATE VALUES
> C) A & B
> D) NONE OF THE ABOVE
>
> 24) WHICH OF THE FOLLOWING IS TRUE ?
>
> A) NULL IS SAME AS BLANK
> B) NULL IS SAME AS ZERO
> C) A & B
> D) NONE OF THE ABOVE
>
>
> 25) HOW MANY JOIN CONDITIONS ARE NEEDED IN A JOIN
> QUERY TO
> AVOID A CARTESIAN PRODUCT ?
>
> A) NO. OF TABLES + 1
> B) NO. OF COLUMNS + 1
> C) NO. OF TABLES - 1
> D) NO. COLUMNS - 1
>
>
> SA3
>
>1 C
>2 A
>3 B
>4 B
>5 A
>6 1
>7 1
>8 2
>9 D
> 10 A
> 11 B
> 12 A
> 13 C
> 14 B
> 15 B
> 16 A
> 17 B
> 18 A
> 19 C
> 20 A
> 21 D
> 22 A
> 23 C
> 24 D
> 25 C
>
>
--------------------------------------------------------------------------------------------
SECTION 2:
01 GROSS-PAY
05 BASIC-PAY PIC 9(5)
05 ALLOWENCES PIC 9(3)
if BASIC-PAY has a value 1000 and ALLOWENCES has a value of 250,what will be
displayed by the statement
DISPLAY GROSS-PAY
a.1250
b.01000250
c.01250
d.1.250
02.consider two data items
a.C=A/B
b.the reminder of B/A is stored in C
c.C=B/A
d.the reminder of A/B is stored in C
04.consider the statement (incomplete)
IF(A NUMERIC)
DISPLAY A
the variable A can be
a.NUMERIC
b.ALPHABETIC
c.ALPHANUMERIC
d.NUMERIC OR ALPHANUMERIC
05.which of the following can be used as a check protection symbol
a.Z
b.S
c.*
d.+
06.what if any ,is the syntex error in the following piece of code
01 B PIC A(7)
02 C PIC 9(4)
........
IF(B NUMERIC)
ADD 10 TO C
a.the condition in the if statement is wrong
b.noting is wrong
c.because C is initialised.ADD 10 TO C is wrong
d.both B and C shoud have same size.
07.study the following code
01 A1
05 B PIC 99
05 C PIC X(4)
01 A2
05 B PIC 99V99
05 C PIC A(4)
pick out the valid statement from the following
a.A1 and A2 can not have sub-ordinates
b.A1 and A2 can have the same sub-ordinates but must have same PIC clause
c.there is nothing wrong
d.A1 and A2 can have same sub-ordinates provided they are not at 01 level
08.study the following
01 A PIC 99V0 VALUE 5
01 B PIC 9V9 VALUE 6
01 C PIC 99V9 VALUE 2.5
01 D PIC 99 VALUE 3
COMPUTE A ROUNDED B C = A+B*C/D
ON SIZE ERROR PERFORM PRINT-ERROR
the comments of A.B.C after execution of the above statement are
a.A=10 B=0 C=10
b.A=10 B=9.9 C=9.9
c.A=10 B=0 C=9.9
d.A=10 B=6 C=10
09.how many times PARA-A is performed :
PERFORM PARA-A VARYING TIMES-COUNTER FROM 1 BY 1
UNTIL TIMES-COUNTER >0
PARA-A
MOVE P TO Q
MOVE H TO TIMES COUNTER
a.10
b.1
c.11
d.0
10.consider the following piece of code
01 GROUP-ITEM
05 AMOUNT-1 PIC 99V9 USAGE COMP VALUE 50
05 AMOUNT-2 PIC 9(4)V99 USAGE COMP
MOVE ZERO TO GROUP-ITEM
ADD 50 TO AMOUNT-1
what will be the content of AMOUNT-1?
a.50
b.100
c.0
d.unpredictable
11.consider the following progrm statements
MOVE 0 TO SW.NO.OF.REC
PERFORM PRI-OUT UNTIL SW=1
DISPALY NO.OF.REC
STOP RUN
PRE-OUT
READ IN-FILE AT END
MOVE 1 TO SW
WRITE OUO-REC FROM IN-REC
ADD 1 TO NO.OF REC
if the IN-FILE contains 1000 records what value will be displayedafter the
PERFORM is over?assume that N0.OF.REC has PIC 9(4)
a.1000
b.1001
c.1
d.none of the above since there is a syntex error
12.study the data discriptions and answer the questions given below
i)01 ORDER RECORD
05 OUT-HEADER PIC X(50)
05 ITEM-COUNT PIC 99
05 OUT-ITEM PIC X(20) OCCURS 1 TO 20 DEPENDING ON ITEM-
COUNT
ii)01 NAME-AND-ADDRESS
05 N-AND-A-LINE OCCURES 5
05 LINE-LENGTH PIC P9
05 N-AND-A-CHAR PIC X OCCURS 1 TO 20 DEPENDING ON LINE-
LENGTH
iii)01 SALES-LIST
05 SALESMAN-COUNT PIC 99
05 SALES PIC 9(6) OCCURS 1 TO 100 DEPENDING ON
SALESMAN-COUNT
iv)01 ORDER-RECORD
05 NO-OF-BRANDS PIC 99
05 BRAND-PURCHASED OCCURS 1 TO 15 DEPENDING ON NO-OF-
BRANDS
which of the following is true?
a.i) and iii) are valid
b.i) and iv) are valid
c.i) and iii) are not valid
d.all are valid
13.C1 C2 C3 are three conditions whose TRUTH values are as folloes.
C1-TRUE C2-FALSE C3-TRUE
A,B,C are defined as given below
A:C1 AND(NOT C2) OR C3
B.(NOT C1) OR (NOT C2 AND NOT C3)
C.(C1 OR C2)AND C3
D.C1 AND C2 OR C3
given the above information which of the following statements are valid?
a.only A,B and C are TRUE
b.only A,C and D are TRUE
c.A,B,C and D are TRUE
d.only C and D are TRUE
14.consider the following
FD FILE-1
01 REC-1 PIC X(80)
......
WORKING-STORAGE SECTION
01 W-REC PIC X(90)
........
PROCEDURE DIVISION
FIRST-PARA
.......
READ FILE-1 INTO W-REC AT END MOVE 1 TO EOF-FLAG
which of the following is true with respect to the above?
a.REC-1 will contain nothing and W-REC will contain the contains of the
record read
b.REC-1 and W-REC contain the same data
c.syntex is invalid and error will occur
d.REC-1 and W-REC must be of same size
15.PERFORM ACCUMULATE-TOTALS
VARYING A FROM 1 BY 2 UNTIL A >2
AFTER B FROM1 BY 1 UNTIL B>2
AFTER C FROM 2 BY -1 UNTIL C<2
the paragraph ACCUMULATE-TOTALS would be exicuted
a.18 times
b.4 times
c.8 times
d.24 times
16.there is a file whose ORGANISATION is INDEXED.you want to read the records
from the file in RANDOM fashion as well as sequentially.then which of the
access mode would you specify?
a.SEQUENTIAL
b.RANDOM
c.DYNAMIC
D.ACCESS MODE has nothing to do with it
17.consider the following PROCEDURE DIVISION entry
OPEN EXTEND IN-FILE
identify the correct statement
a.organization of IN-FILE is sequential and records can be added in the
beginning
b.organization of IN-FILE is sequential and records can be added in the
end
c.organization of IN-FILE is indexed and records can be added in the
beginning
d.organization of IN-FILE is indexed and records can be added in the end
18.what is the size of W-REC in the following
01 W-REC
05 A PIC 9(4)V99
05 B READLINES A
10 C PIC XX
10 D PIC S9(4)
05 E OCCURS 7 PIC ZZ.ZZ
05 F OCCURS 5
10 G PIC ZZ.ZZZ99
10 H OCCURS 3
15 J PIC 9(3)
15 K PIC V99
a.177
b.161
c.180
d.none of yhe above
19.consider the following two IF statements:
IF X AND NOT Y MOVE A TO B
IF Z=1 OR 9 MOVE A TO B
select one of the following data divusion entries which gives identical
results for both the above IF statements
a.01 Z PIC 9
88 X VALUE 1.9
88 Y VALUE 0.2 THRU 8
b.01 Z PIC 9
88 X VALUE 0.2 THRU 8
Y VALUE 1.9
c.01 Z PIC 9
88 X VALUE 1.9
88 NOT-Y VALUE 0.2 THRU 1.9
d.none of yhe above
20.consider the following two statements
MOVE 10 TO N
PERFORM PARA-X N TIMES
STOP RUN
PARA-X
MOVE 5 TO N
how many times PARA-X willbe exicuted?
a.10
b.5
c.infinate
d.execution error
21.given the following:
77 A PIC 9V9 VALUE 9.5
77 B PIC 9 VALUE 9.
77 C PIC V9 VALUE 0.8
77 D PIC 9
77 E PIC 9
77 F PIC 9V999
what are the contenta of D E nad F after teh following statements are
executed:
COMPUTE F ROUNDED=A+C/B
MULTIPLY A BY C GIVING E
ADD B C A GIVING D ROUNDED
a.F=9.589 E=8 D=1
b.F=9.589 E=8 D=9
c.F=9.589 E=7 D=9
d.F=9.589 E=7 D=1
77 A PIC 9(10)
77 B PIC 9(10)
77 C PIC 9(19)
MULTIPLY AB BY B GIVING C
26. A paragraph PARA-X is to be executed when none oof the data names
A, B and C have value of 1. Which of the following will achieve this ?
29. Study the DATA DIVISION entries and the three PROCEDURE DIVISION entries
given below:
01 END-OF-FILE-SWITCH PIC XXX.
88 NO-MORE-RECS VALUE "YES".
88 MORE-RECS VALUE "NO".
(i) READ SAMPLE-FILE AT END MOVE "YES" TO NO-MORE-RECS.
(ii) IF NO-MORE-RECS = "YES" GO TO LAST-PARA.
(iii) IF NO-MORE-RECS GO TO LAST-PARA.
Which are wrong?
(a) (i) and (ii)
(b) (ii) and (iii)
(c) (i) and (iii)
(d) all
31. How many bytes will be allocated for the following record description
entries?
01 REC-A.
05 A PIC S9(4).
05 B PIC XXXBXXX.
05 C PIC ____9.99.
05 D PIC S9(5) COMP-3.
05 E PIC 9(3) COMP.
(a) 29
(b) 26
(c) 25
(d) 28