Skip to main content

CS504 Current Final Term Fall 2013 Shared by SAm File 6

My Cs504 PAPer 7/3/14
50% of Mcqs were from past papers .
Subjective Part:
Questions Of 2 marks
Q. which design pattern would you suggest for an application where hang in one object state is immediately notified to linked objects? (2)
Ans: Observer Pattern pg n0 140
Q. write the following C statement according to the AnSI standard (2)
int factorial ();
Q. how names representing global variables in C++ should be in coding style guide?
Ans: Global variables in C++ should always be referred to by using the :: operator.
::mainWindow.open() , ::applicationContext.getName() pg no 150
Q. what is Software debugging?
Answer: Software debugging is the process by which developers attempt to remove coding defects from a computer program.
Questions of 3 marks:

Write any three attributes of a program that contribute towards making the program
self documented? (3)
Answer: There are a number of attributes that contributes towards making the program
self documented. These include, the size of each function, choice of variable and other identifier names, style of writing expressions, structure of programming statements, comments, modularity, and issues relating to performance and portability.

Q, How many level of exception safety are there? NAme those levels.
Anwer : Levels of Exception Safety pg no 188
Basic Guarantee: Ensures that temporaries are destroyed properly and there are no
memory leaks.
Strong Guarantee: Ensures basic guarantee as well as there is full-commit or rollback.
No-throw Guarantee: Ensure that a function will not throw.
Q. In the context of three-tier architecture, "interface" of an application represents which layer? (3)
Answer : presentations, application , database (not sure)

Questions of 5 marks :
Q. As a programmes you are instructed to write potable code in order to increase the modality of the software by your team lead . Which points you have to keep in mind to developing a portable code ? (5)
Ans: pg no 179
Q. the code given below contains a bud , identify the bug class and also explain the reason for the bug (5)
char s1[]= "This is a sentence" ;
char *s2;
s2 = (char*) malloc (strlen(s1) +1);
strcpy(s2,s);
Q. Consider the given below statement
*x +=(*xp=2*k<(n-m) ? c [k+1] : d[k--1]));
The above statement is complex ans difficult to read. Re-write the above statement by breaking it into multiple statements to make it more readable .(5) pg no 164
Ans: This statement liberally uses a number of operators and hence is very difficult to follow and understand. If it is broken down into simple set of statements, the logic becomes easier to follow as shown below:
if (2*k < n-m)
*xp = c[k+1];
else
*xp = d[k--];
*x = *x + *xp;
Q. Let's assume we have a system for stock market which provides data for several types of client. We want to have a client implemented as a web based application but in near future we need to add clients for mobile devices , Palm or Pocket Pc , or to have a system to notify the users with SMS alerts Which design pattern is best suited for the above scenario and why ? (5)
Answer:  Observer pattern pg no 140 




Comments

Popular posts from this blog

CS614 Quiz No.4 Shared by Princess (solved), Spring 2014

  “What means What”. The phrase refers to: Select correct option:  Meta data  External data Transformed data Internal representations Question # 2 of 10 Which of the following is NOT one of the activities of “Maintenance and Growth” phase in Kimball’s DWH development approach? Select correct option: Education Technical Education Program Support  Interface Deployment                 Question # 3 of 10 Horizontally wide data means: Select correct option: Dataset has large no. of attributes Dataset has large no. of records Dataset has attribute skews Dataset has partitioning skews                 Question # 4 of 10 Which of the following is NOT one of the top-10 mistakes that should be avoided during DWH development? Select correct option: Not interacting directly with end user Not being an accommodating person Isolating IT support people from business users Training the users with dummy data and considering it success             

CS614 Quiz No.4 Shared by MT Khan (Solved)

Question # 1 of 10 ( Start time: 09:04:39 PM ) Total Marks: 1 A typical cycle of implementing the change in DWH comprises of the sequence: Select correct option: Production -> QA -> Development Development-> QA -> Production(CORRECT) Development -> Production -> QA Production -> Development -> QA Question # 2 of 10 ( Start time: 09:05:16 PM ) Total Marks: 1 Vertically wide data means: Select correct option: Dataset has large no. of attributes Dataset has large no. of records(CORRECT) Dataset has attribute skews Dataset has partitioning skews Question # 3 of 10 ( Start time: 09:05:43 PM ) Total Marks: 1 In ___________ phase of kimballs approach, we identify the components needed now and in future. Select correct option: Requirement definition Architectural design Product development Analytical application development Question # 4 of 10 ( Start time: 09:06:56 PM ) Total Marks: 1 Technical architecture design supports the communicat

CS301 Quiz No.2 Shared by Tayyeba

Binary search algorithm can not be applied to ____ Select correct option: sorted linked list sorted binary trees        ok sorted linear array pointer array During in-order traversal using recursive calls, if we found a node is NULL. It means this node will satisfy following condition. Select correct option: It will not have left child        ok It will not have right child It will not have both left and right children None of given options Identify the data structure which allows deletions at both ends of the list but insertion at only one end. Select correct option: Input-restricted deque Output-restricted deque Priority queues        ok A BST generated from the data in ascending order is ____________. Select correct option: Linear Nonlinear Balanced        ok Un sorted In a program a reference variable, say x, can be declared as Select correct option: int &x ;        ok int *x ; int x ; None of the given options he depth of a complete bina