Vous êtes sur la page 1sur 15

National Informatics Centre Question Paper for the post of Scientific Officer/Engineer"SB"(Programmer/ District Informatics Officer)-2008 Note: 1.

There are TWO PARTS in this paper. PART ONE contains THREE questions and PART TWO contains SIX questions. 2. PART ONE is to be answered in the SPECIAL ANSWER SHEET only, attached to the ANSWER BOOK, as per the instructions contained therein. PART 1 (Answer all the questions) 1. Each question below gives multiple choices of answers. Choose the most appropriate one and enter in the "SPECIAL ANSWER SHEET" attached to the ANSWER BOOK, following instructions therein. (1 X 10) 1.1 A list of items, in which additions and deletions may be made at either end is known as a A. Queue. B. Push-down stack C. Deque D. None of the above Ans: A.Queues are a type of container adaptor, specifically designed to operate in a FIFO context (first-in first-out), where elements are inserted into one end of the container and extracted from the other. 1.2 Reentrant code provides for A. Execution of object program instruction segments by more than one process at the same time. B. Improved console operations. C. C.Multiprocessing D. Contiguous areas of memory for storage of program, variables, data, reference, and dynamic process history. Ans: B. It is used in operating systems and other system software as well as in multithreading, where concurrent events are taking place. It is written so that none of its code is modifiable (no values are changed) and it does not keep track of anything. The calling programs keep track of their own progress (variables, flags, etc.), thus one copy of the reentrant routine can be shared by any number of users or processes. 1.3 Which is not a debugging technique A. A.Core dumps B. B.Traces A. Print Statements C. Regression Testing Ans: C.

1.4 The process of transforming a model into source code is A. Reverse Engineering B. Forward Engineering C. Re-engineering D. Re-structuring Ans: D. RestructuringThe transformation from one representation form to another at the same relative abstraction level, while preserving the subject system's external behaviour (functionality and semantics). 1.5The process by which existing processes and methods are replaced by new processes and techniques is A. Reverse Engineering B. Business Process Re-engineering C. Software Process Management d. Forward Engineering Ans: D. forward engineering <process> The traditional process of moving from high-level abstractions and logical, implementation-independent designs to the physical implementation of a system. 1.6 init and cron are A. linux processes B. B.DOS processes C. C.Windows processes D. None of the above. Ans : A. Linux Process 1.The init process then determines the runlevel by looking at the initdefault directive in /etc/inittab configuration file. The following are the defined runlevels. The init process remains active as long as the system is running.2. cron <operating system> The Unix clock daemon that executes commands at specified dates and times according to instructions in a "crontab" file. 1.7 The differences between constructors and destructor in C++ are A. constructors can take arguments but destructor can't B. B.constructors can be overloaded but destructor can't be overloaded C. Both A & B D. none of these Ans: C. 1.8 Use case is a A. case in case/switch statement in a programming language B. a part of use case diagram, a modeling element. C. special case in legal cases in computer industry. D. None of the above.

Ans :B. Use case: A use case is a set of scenarios that describing an interaction between a user and a system. A use case diagram displays the relationship among actors and use cases. The two main components of a use case diagram are use cases and actors. 1.9 PATH A. is a system variable naming the list of directories required to be searched for finding the commands to be executed. B. vi3.is a path to be followed in finding Critical Path Method in Pert/CPM techniques. C. is a system variable naming the list of directories required to be searched for finding a class. D. None of the above. Ans: B. 1.10 When a language has the capability to produce new datatype, it is called 1. ~Extensible B. Overloaded C. Encapsulated D. Reprehensible Ans A. 2. Each statement below is either TRUE or FALSE. Choose the most appropriate one and ENTER in the "SPECIAL ANSWER SHEET" attached to the ANSWER BOOK, following instructions therein. (1 X 10) 2.1 JavaScript is an old version of Java Language. False 2.2 Maintenance stage in SDLS precedes Implementation True 2.3 Symbian is an operating system. False 2.4 Hotswappable hard disks requires systems to be closed and cooled before they can be removed. ~. False 2.5 PHP and Perl are examples of spreadsheet packages. False 2.6 An Abstract method in Java can be declared as final False 2.7 The fields in a C++ program are by default private. True 2.8 Java allows multiple inheritance directly True 2.9 A return code of 0 from a function is interpreted that there are errors during its execution False 2.10 When a variable is passed by reference to a procedure, the changes made to the variable are passed back to the calling procedure. True 3. Each statement below has a blank space to be filled. Enter your choice in the "SPECIAL ANSWER SHEET" attached to the ANSWER BOOK, following instructions therein. (1x10) 3.1 Java's multi-threading system is built upon Thread class and its companion interface

3.2 The time required by a sector to reach below the read/write head latency(Rotational Delay Time) 3.3 What will be the output of the following code snippet try { int x = 0; int y = 50/x; System.out.println("Division by Zero is an error"); } catch(ArithmeticException e) { System.out.print1n("catch block"); } In a select statement clause restricts the grouped rows that appear in1f\1' the result. Ans: Catch block 3.4 In a select statement orderby clause restricts the grouped rows that appear in the result 3.5 The process of mapping/initialising a disk is called____ 3.6 A popular open source DBMS____ 3.7 An image scanner with _____software can translate a scanned text into text that can be edited. 3.7 L1,L2,L3 are types of _memory 3.8 A BIOS routine called,________ that runs whenever the system determine the functioning of various parts of the computer system 3.9 (176) base 8(88 )base 16 3.10 HTML tag for bulleted list is _____ PART 2 (Answer any five questions) 4. Write short note on a) De-fragmentation, compression and encryption i) De-fragmentation: Disk Defragmenter is a utility in Microsoft Windows designed to increase access speed by rearranging files stored on a disk to occupy contiguous storage locations, a technique called defragmentation. Defragmenting a disk minimizes head travel, which reduces the time it takes to read files from and write files to the disk.[citation needed] Beginning with Windows XP, Disk Defragmenter also reduces system startup times. Disk Defragmenter is a tool that rearranges the data on your hard disk and reunites fragmented files so your computer can run more efficiently. In this version of Windows, Disk Defragmenter runs on a schedule so you don't have to remember to run it, although you can still run it manually or change the schedule it uses. ii) Compression: Compression is the process of reducing the size of a file by encoding its data information more efficiently. By doing this, the result is a reduction in the number of bits and bytes used to store the information. In effect, a smaller file size is generated in order to achieve a faster transmission of electronic files and a

smaller space required for its downloading. iii)Encryption: The translation of data into a secret code. Encryption is the most effective way to achieve data security. To read an encrypted file, you must have access to a secret key or password that enables you to decrypt it. Unencrypted data is called plain text ; encrypted data is referred to as cipher text. There are two main types of encryption: asymmetric encryption (also called public-key encryption) and symmetric encryption. b) Open Source, Commercial Software and Freeware Freeware (from "free" and "software") is computer software that is available for use at no cost or for an optional fee, but usually with one or more restricted usage rights. Freeware is in contrast to commercial software, which is typically sold for profit, but might be distributed for a business or commercial purpose in the aim to expand the market share of a "premium" product. Freeware is a loosely defined category. The term "freeware" is commonly used for closed source or proprietary software, but since the term is related to price (and not issues like availability of the source code or copyright status) it can also be applied to open-source software. i) Open source refers to a program or software in which the source code (the form of the program when a programmer writes a program in a particular programming language) is available to the general public for use and/or modification from its original design free of charge. Open source code is typically created as a collaborative effort in which programmers improve upon the code and share the changes within the community. ii) Refers to any software that is designed for sale to serve a commercial need. Commercial software is usually proprietary software, but in some instances it may be publicdomain software. iii) Free software, software libre or libre software is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with restrictions that only ensure that further recipients can also do these things and that manufacturers of consumer-facing hardware allow user modifications to their hardware. Free software is generally available without charge, but can have a fee, such as in the form of charging for CDs or other distribution media. c) Paging and Segmentation Paging is a virtual memory scheme which is transparent to the program at the application level and which divides memory into fixed-size blocks, such as 4 KBytes. The segmentation memory management scheme imposes a greater book-keeping burden on the application, and refers to memory using segments of variable size. segmentation is a logical unit visible to the user's program and id of arbitary size whereas paging is a physical unit invisible to the user's view and is of fixed size

d) SDLC and its stages SDLC stands for Software Development Life Cycle. What is it all about? What are the various phases of it? Why should every client be aware of it? Here is the explanation to all these questions. As the name implies, it is primarily used to provide methodologies to develop computer software. It is a must to be aware of the guidelines and models in order to efficiently develop computer software. Various phases of SDLC are to be pursued in order to gain a better view of how a project could be handled. The phases of SDLC include requirements gathering and analysis, system designing, development, testing, operations and maintenance. Requirements gathering and analysis: Under this phase, the project's goal is determined and the functions are brought to focus. Gathering of information and analysis of the user's requirement is also done in this phase. System design: A sample structure of the entire project is created in this phase and all necessary data are gathered. Development: Coding of the whole project is done in this phase. Codes are easily generated if proper design is performed in the previous stage. According to the needs of the application, programming language is selected. System testing: After the generation of codes, testing of all the modules is performed. All modules are integrated together and proper testing tools are selected for error checking. Operations and maintenance: Under the final stage of SDLC, the developed software is given to the users. Maintenance is necessary after the development of a successful project. It is obvious that changes occur once the project is handed over to the end user. The developers must develop the project in such a way that it is adaptable to those changes. The main operation of the software must not be affected by those changes. It is necessary for the client to be aware of all the phases of SDLC so that they can get to know about the status of the project under proposal. The client must also be aware of various operations performed under various stages. This would enable them to handle the project with ease. This also helps them to collect good quality products. Only when the clients are aware of the stages of SDLC, they can sort out the problems that arise while using the product. This would thus produce a good quality product. e) What do you understand by Complexity of Sorting Algorithms? Explain in the context of various sorting techniques. http://www.algolist.net/Algorithms/Sorting/Bubble_sort f) Write Quick Sort Algorithm using pseudocode and verify your code by tracing an example.

#include <string.h> #include <stdio.h> #include <stdlib.h> void quickSortMain(char *items, int count); void quickSort(char *items, int left, int right); int main(void) { char s[255]="asdfasdfasdfasdfasdfasdfasdf"; quickSortMain(s, strlen(s)); printf("The sorted string is: %s.\n", s); return 0; } void quickSortMain(char *items, int count) { quickSort(items, 0, count-1); } void quickSort(char *items, int left, int right) { int i, j; char x, y; i = left; j = right; x = items[(left+right)/2]; do { while((items[i] < x) && (i < right)) i++; while((x < items[j]) && (j > left)) j--; if(i <= j) { y = items[i]; items[i] = items[j]; items[j] = y; i++; j--; } } while(i <= j);

if(i < right) quickSort(items, i, right); if(left < j) quickSort(items, left, j); } http://www.csse.monash.edu.au/~lloyd/tildeAlgDS/Sort/Quick/ g) Explain final, finally, finalise, this and super in Java Context final : final keyword can be used for class, method and variables. A final class cannot be subclassed and it prevents other programmers from subclassing a secure class to invoke insecure methods. A final method cant be overridden. A final variable cant change from its initialized value. finalize() : finalize() method is used just before an object is destroyed and can be called just prior to garbage collection. finally : finally, a key word used in exception handling, creates a block of code that will be executed after a try/catch block has completed and before the code following the try/catch block. The finally block will execute whether or not an exception is thrown. For example, if a method opens a file upon exit, then you will not want the code that closes the file to be bypassed by the exception-handling mechanism. This finally keyword is designed to address this contingency. this() can be used to invoke a constructor of the same class whereas super() can be used to invoke a super class constructor.

h) What does chmod, vi and grep do in linux system?


1) If you want to change a file permission same as another file, use the reference option as shown below. In this example, file2s permission will be set exactly same as file1s permission. $ chmod --reference=file1 file2
chmod mode files chmod -R mode files

Changes the access mode of the specified files to the specified mode. The alternative form of the command operates recursively, changing the mode of subdirectories and files beneath a specified directory.
2) File Searches (grep)

At times, it is necessary to search through your files for a particular string of characters. The command to perform searches is grep.
Syntax: grep string file1 [file2 . . .]

By default, the grep command matches the letter case of the string specified, as in the following examples.

1. To search all files in the directory for the string, "May," enter grep May * 2. To find any occurrence of the string, "May," regardless of letter case, use the -i
option. grep -i May * This would find strings such as "may," "maybe," or "MAY," along with any other occurrence of that string.

It is useful to pipe (|) the output of the grep command into the more command to see the listing one screen at a time, as shown below. For further information on pipes, see Section 3.7.1. grep -i May * | more
EDIT ae, vi,

and so

. What is Object Oriented Programming? Why is Java called portable or platform i) What is Object Oriented Programming? Why is Java called portable or platform independent language?
Object Oriented To be an Object Oriented language, any language must follow at least the four characteristics.

on

Inheritance : It is the process of creating the new classes and using the behavior of the existing classes by extending them just to reuse the existing code and adding the additional features as needed. Encapsulation: : It is the mechanism of combining the information and providing the abstraction. Polymorphism: : As the name suggest one name multiple form, Polymorphism is the way of providing the different functionality by the functions having the same name based on the signatures of the methods. Dynamic binding : Sometimes we don't have the knowledge of objects about their specific types while writing our code. It is the way of providing the maximum functionality to a program about the specific type at runtime.

As the languages like Objective C, C++ fulfills the above four characteristics yet they are not fully object oriented languages because they are structured as well as object oriented languages. But in case of java, it is a fully Object Oriented language because object is at the outer most level of data structure in java. No stand alone methods, constants, and variables are there in java. Everything in java is object even the primitive data types can also be converted into object by using the wrapper class. The concept of Write-once-run-anywhere (known as the Platform independent) is one of the important key feature of java language that makes java as the most powerful language. Platform Independent The concept of Write-once-run-anywhere (known as the Platform independent) is one of the important key feature of java language that makes java as the most powerful language. Not

even a single language is idle to this feature but java is more closer to this feature. The programs written on one platform can run on any platform provided the platform must have the JVM.

j) Write a program(in Java or C++) to produce fibonacci numbers

Demonstrates recursion using the Fibonacci series.


1: 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: 32: 33: 34: 35: 36: 37: 38: 39: 40: // // // // // Demonstrates recursion Fibonacci find. Finds the nth Fibonacci number Uses this algorithm: Fib(n) = fib(n-1) + fib(n-2) Stop conditions: n = 2 || n = 1

#include <iostream.h> int fib(int n); int main() { int n, answer; cout << "Enter number to find: "; cin >> n; cout << "\n\n"; answer = fib(n); cout << answer << " is the " << n << "th Fibonacci number\n"; return 0; } int fib (int n) { cout << "Processing fib(" << n << ")... "; if (n < 3 ) { cout << "Return 1!\n"; return (1); } else { cout << "Call fib(" << n-2 << ") and fib(" << n-1 << ").\n"; return( fib(n-2) + fib(n-1)); } }

Output: Enter number to find: 5 Processing fib(5)... Call fib(3) and fib(4).

10

Processing fib(3)... Call fib(1) and fib(2). Processing fib(1)... Return 1! Processing fib(2)... Return 1! Processing fib(4)... Call fib(2) and fib(3). Processing fib(2)... Return 1! Processing fib(3)... Call fib(1) and fib(2). Processing fib(1)... Return 1! Processing fib(2)... Return 1! 5 is the 5th Fibonacci number

Analysis: The program asks for a number to find on line 15 and assigns that number to target. It then calls fib() with the target. Execution branches to the fib() function, where, on line 28, it prints its argument. The argument n is tested to see whether it equals 1 or 2 on line 30; if so, fib() returns. Otherwise, it returns the sums of the values returned by calling fib() on n-2 and n-1. In the example, n is 5 so fib(5) is called from main(). Execution jumps to the fib() function, and n is tested for a value less than 3 on line 30. The test fails, so fib(5) returns the sum of the values returned by fib(3) and fib(4). That is, fib() is called on n-2 (5 - 2 = 3) and n-1 (5 - 1 = 4). fib(4) will return 3 and fib(3) will return 2, so the final answer will be 5. Because fib(4) passes in an argument that is not less than 3, fib() will be called again, this time with 3 and 2. fib(3) will in turn call fib(2) and fib(1). Finally, the calls to fib(2) and fib(1) will both return 1, because these are the stop conditions. The output traces these calls and the return values. Compile, link, and run this program, entering first 1, then 2, then 3, building up to 6, and watch the output carefully. Then, just for fun, try the number 20. If you don't run out of memory, it makes quite a show! Recursion is not used often in C++ programming, but it can be a powerful and elegant tool for certain needs.

k) Describe Method Overloading and Method Overriding What is overloading in java ? In Java it is possible to define two or more methods within the same class that share the same name, as long as their parameter declarations are different. When this is the case,the methods are said to be overloaded, and the process is referred to as method overloading. Method overloading is one of the ways that Java implements polymorphism.
What is Overriding in java ? when a method in a subclass has the same name and type signature as a method in its superclass, then the method in the subclass is said to override the method in the superclass. When an overridden method is called from within a subclass, it will always refer to the version of that method defined by the subclass. When overriding, you change the method behavior for a derived class. e.g Clas A { Virtual void hi(int a) { } 11

} Class B:A { public overrid void hi(int a) { } } Overloading simply involves having a method with the same name within the class. Example for Over loading Class A { class a() { } class a(int a) { } } l) procedure which finds the number NUM of times a given ITEM occurs in LIST Write a Count() function that counts the number of times a given int occurs in a list. The code for this has the classic list traversal structure as demonstrated in Length().
void CountTest() { List myList = BuildOneTwoThree(); // build {1, 2, 3} int count = Count(myList, 2); // returns 1 since there's 1 '2' in the list } /* Given a list and an int, return the number of times that int occurs in the list. */ int Count(struct node* head, int searchFor) { // Your code

m) Based on type of organization of data what are different types of DBMS? give examples of commercially available DBMS's today filesytem- based simple,inefficient, few capabilities hierarchical- phylogenetic structures, geopgraphical images 12

network-very flexible,not widely used relational -widely-used,mature, table oriented,restricted range of structures object-oriented- developing-few commerical implementations,diverse structures,extensible Data Base System models or Types of DBMS 1. Hierarchical Model 2. Network Model 3. Relational Model 1. Hierarchical Model or HDMS: One of the earliest database management system was based on the Hierarchical model. Here data can be organized in the form of free structure or level-by-level manner with one limitation that is "every sub node or child node should have only one parent node". 2.Network Model or NDBMS: To overcome the problems proposed by the hierarchical data model, the network data model was developed. It is also known as communication oriented database management system. Cross communication is possible in NDBMS. Here data can be organized in the form of tree structure or level by level manner with cross communication. It cannot provide proper query facility,so that we have to write big programs even for small operation.It is complex in structure. 3. Relational DBMS: RDBMS are most important database system used in the software industry today. It was Exclusively used to establish the relation the relation ship between two-database objects. One of the database objects is one table. The Relation ship may be One - One One - Many Many - One Many - Many Entity-Relationship Model (E-R Model): An Entity is nothing but an object, which is physically existed in the real world. Example: car,computer, chair An Object in the database is a table so that an entity is nothing but a table.

13

Every Entity contains characters specifies its attributes simply it is a column in the table. Databases are used in all kinds of businesses for all types of functions: in sales to compile information about clients and potential clients and to keep track of client correspondence; in accounting to keep track of accounts payable and receivable; in purchasing to choose suppliers and their goods and to place orders; in manufacturing to keep track of supplies of component or raw materials; in shipping and receiving to keep track of orders and shipments; in marketing to. track records of advertisers and prospective advertising outlets; and in human resource management to maintain records of employees and match resumes of applicants to job openings. The same DBMS may be used to manage all such tasks in the same organization. Customer databases are especially important to service industries for maintaining ongoing customer relations. Financial institutions, such as banks, stock brokerages, and insurance companies, rely on DBMS to keep track of customers' financial accounts. Utilities, such as telephone and electric companies, also keep databases of customers, tracking usage of utility service, varied rates, and billing information. Maintenance and repair services, such as those repairing office equipment or appliances, keep service and repair records for each customer. Specialized, and often very simple, DBMS are popular for keeping track of clients or contacts. n) Describe ACID in the context of DBMS ACID (atomicity, consistency, isolation, and durability) is an acronym and mnemonic device for learning and remembering the four primary attributes ensured to any transaction by a transaction manager (which is also called a transaction monitor). These attributes are: Atomicity. In a transaction involving two or more discrete pieces of information, either all of the pieces are committed or none are. Consistency. A transaction either creates a new and valid state of data, or, if any failure occurs, returns all data to its state before the transaction was started. Isolation. A transaction in process and not yet committed must remain isolated from any other transaction. Durability. Committed data is saved by the system such that, even in the event of a failure and system restart, the data is available in its correct state.

14

The ACID concept is described in ISO/IEC 10026-1:1992 Section 4. Each of these attributes can be measured against a benchmark. In general, however, a transaction manager or monitor is designed to realize the ACID concept. In a distributed system, one way to achieve ACID is to use a two-phase commit (2PC), which ensures that all involved sites must commit to transaction completion or none do, and the transaction is rolled back (see rollback).

15

Vous aimerez peut-être aussi