Search Previous Year Questions

Find real questions from previous competitive exam papers with answers and solutions.

Leave the keyword blank to browse saved questions for your selected exam, newest papers first. Add a keyword, year or topic to narrow the results.

Browse complete papers
Showing 10 question(s)
Clear

Question 21

UP police programmer Grade 2 2013• Part 1: Information Technology

The 2’s compliment of a binary no. is obtained by adding _______ to its 1’s compliment.

  1. AOption (a)

    0

  2. BOption (b)

    1

  3. COption (c)

    10 

  4. DOption (d)

    12

View answer & explanation

Correct answer

Answer: (b)B.

1

Why this answer is correct

The correct answer is Option 2: 1

Key Points

  • 2’s Complement: The 2’s complement of a binary number is obtained by inverting the bits of the binary number (1's complement) and then adding 1 to the result.
  • Process:
  1. Step 1: Find the 1’s complement of the binary number by flipping all the bits (changing 0s to 1s and 1s to 0s).
  2. Step 2: Add 1 to the 1’s complement to obtain the 2’s complement.

Additional Information

  • Example: Consider the binary number 1010.
  1. Step 1: Find the 1’s complement: Flip the bits of 1010 to get 0101.
  2. Step 2: Add 1 to the 1’s complement: 0101 + 1 = 0110.
  3. Hence, the 2’s complement of 1010 is 0110.
  • Why Add 1? Adding 1 to the 1’s complement ensures that the 2’s complement represents the negative of the original number in binary arithmetic.

Hence, the correct answer is: Option 2: 1

Question 22

UP police programmer Grade 2 2013• Part 1: Information Technology

What is the shortest command to take you to your home directory ?

  1. AOption (a)

    cd ~

  2. BOption (b)

    cd $HOME$

  3. COption (c)

    cd

  4. DOption (d)

    cd h

View answer & explanation

Correct answer

Answer: (c)C.

cd

Why this answer is correct

The correct answer is cd

Key Points

  • cd: ✅ The cd command without any arguments takes you to your home directory. It is the shortest and simplest command to achieve this.
  • cd ~: ❌ While cd ~ also takes you to your home directory, it is slightly longer than just using cd.
  • cd $HOME: ❌ This command uses an environment variable to specify the home directory, which is correct but longer than simply using cd.
  • cd h: ❌ This is incorrect. cd h tries to change to a directory named "h," which may not exist.

Additional Information

  • Home Directory: The home directory is the default directory for a user, where their personal files and configurations are stored.
  • Usage: The cd command (change directory) is one of the most commonly used commands in Linux and Unix-like systems.

Hence, the correct answer is: option 3) cd$

Question 23

UP police programmer Grade 2 2013• Part 1: Information Technology

Errors discovered during SQL statement execution cause. 

  1. AOption (a)

    Statement-level rollback

  2. BOption (b)

    Table-level rollback

  3. COption (c)

    Deadlock

  4. DOption (d)

    both (A) and (B)

View answer & explanation

Correct answer

Answer: (a)A.

Statement-level rollback

Why this answer is correct

The correct answer is Statement-level rollback

Key Points

  • Statement-level rollback: ✅ When an error occurs during the execution of an SQL statement, only the changes made by that specific statement are rolled back. The rest of the transaction remains intact, allowing the system to proceed with other statements if applicable.
  • Table-level rollback: ❌ SQL does not support table-level rollback. Errors during execution will not cause rollback of an entire table's data unless explicitly programmed using custom logic.
  • Deadlock: ❌ Deadlocks occur when two or more transactions block each other indefinitely, waiting for resources. This is unrelated to errors in SQL statement execution.
  • Both (A) and (B): ❌ This option is incorrect as only statement-level rollback is applicable in this scenario.

Additional Information

  • Transaction Control: SQL transactions are designed to ensure data consistency. Errors during execution of an individual statement cause only that statement’s changes to be rolled back, not the entire transaction, unless explicitly managed with transaction control statements (e.g., COMMIT or ROLLBACK).
  • Atomicity: This behavior aligns with the principle of atomicity in database transactions, where each SQL statement is treated as an atomic unit of work.

Hence, the correct answer is: option 1) Statement-level rollback

Question 24

UP police programmer Grade 2 2013• Part 1: Information Technology

_________ provides non-GUI access to UNIX system.

  1. AOption (a)

    GUI 

  2. BOption (b)

    Windows 

  3. COption (c)

    Ms DOS

  4. DOption (d)

    Virtual Console

View answer & explanation

Correct answer

Answer: (d)D.

Virtual Console

Why this answer is correct

The correct answer is Virtual Console

Key Points

  • Virtual Console: ✅ A virtual console provides non-GUI (command-line interface) access to the UNIX system. It allows users to interact with the system without the need for a graphical interface, making it suitable for administrative tasks and environments where resources are limited.
  • GUI: ❌ GUI (Graphical User Interface) refers to a graphical way of interacting with the system, which is not suitable for non-GUI access.
  • Windows: ❌ Windows is an entirely different operating system and not related to non-GUI access to UNIX systems.
  • MS-DOS: ❌ MS-DOS is a command-line operating system for personal computers, not related to UNIX systems.

Additional Information

  • Virtual Console Usage: A virtual console can be accessed using keyboard shortcuts (e.g., Ctrl+Alt+F1 to Ctrl+Alt+F6 in Linux systems) to switch between consoles.
  • Purpose: It is useful for system administrators and developers to perform tasks such as troubleshooting, debugging, and managing system resources.

Hence, the correct answer is: option 4) Virtual Console

Question 25

UP police programmer Grade 2 2013• Part 1: Information Technology

Which of the following concurrency control protocols ensure both conflict serializability and freedom from deadlock ?

i) Two phase locking,

ii) Time stamp ordering

  1. AOption (a)

    i) Only

  2. BOption (b)

    ii) Only

  3. COption (c)

    Both i) and ii)

  4. DOption (d)

    Neither i) nor ii)

View answer & explanation

Correct answer

Answer: (c)C.

Both i) and ii)

Why this answer is correct

The correct answer is option 3) Both i) and ii)

Key Points

  • Two-Phase Locking (2PL):
  • ✅ Ensures conflict serializability by guaranteeing that conflicting operations are executed in a serializable order.
  • ❌ However, it is not guaranteed to be deadlock-free. Deadlocks can occur when multiple transactions are waiting for each other's locks.
  • Timestamp Ordering:
  • ✅ Ensures conflict serializability by using timestamps to order transactions in a way that avoids conflicts.
  • ✅ Also ensures freedom from deadlock because no locks are involved in this protocol.

Additional Information

  • Conflict Serializability: A property of schedules where the order of execution of transactions is equivalent to some serial execution order.
  • Deadlock: A situation in concurrency control where two or more transactions are waiting indefinitely for each other to release resources.

Detailed Explanation:

  • Option i) Two-Phase Locking (2PL) ensures conflict serializability but does not guarantee freedom from deadlock.
  • Option ii) Timestamp Ordering ensures both conflict serializability and freedom from deadlock.
  • Thus, the correct answer is option 3) Both i) and ii) as both protocols ensure conflict serializability, but only timestamp ordering ensures freedom from deadlock.

Hence, the correct answer is: option 3) Both i) and ii)

Question 26

UP police programmer Grade 2 2013• Part 1: Information Technology

If you want to retain the first four bits of a given binary string of 8 bits and complement last four bits then the correct mask and operation should be (consider first bit as MSB). 

  1. AOption (a)

    00001111 and AND 

  2. BOption (b)

    11110000 and XOR

  3. COption (c)

    00001111 and XOR

  4. DOption (d)

    11110000 and OR

View answer & explanation

Correct answer

Answer: (b)B.

11110000 and XOR

Why this answer is correct

The correct answer is option 2) 11110000 and XOR

Key Points

  • Given: An 8-bit binary string.
  • Goal:
  • Keep the first 4 bits (MSB) unchanged
  • Complement (flip) the last 4 bits (LSB)
  • Example: Suppose input = 10101100
  • We want to get: 1010 (unchanged) + complement of 1100 → 0011
  • So, result = 10100011
  • How to do this? Use a bitmask that affects only the last 4 bits.
  • Use XOR with 00001111 to flip the last 4 bits.

But to retain first 4 bits, we should use:

Mask = 11110000 (to flip only where 0s exist)

  • XOR Property:
  • X XOR 0 = X → retains the bit
  • X XOR 1 = complement of X → flips the bit
  • So, original XOR 00001111 → flips last 4 bits only ✅

Additional Information

  • Wrong Options:
  • 00001111 and AND: This will zero out the first 4 bits and keep last 4 bits as is ❌
  • 00001111 and XOR: This will flip only last 4 bits but not protect the first 4 bits ❌
  • 11110000 and OR: This will force first 4 bits to 1, which is not correct ❌

Hence, the correct answer is: option 2) 11110000 and XOR

Question 27

UP police programmer Grade 2 2013• Part 1: Information Technology

Which of the following clause is usually used together with aggregate function ? 

  1. AOption (a)

    ORDER BY ASC

  2. BOption (b)

    GROUP BY

  3. COption (c)

    ORDER BY DESC

  4. DOption (d)

    None of the above

View answer & explanation

Correct answer

Answer: (b)B.

GROUP BY

Why this answer is correct

The correct answer is GROUP BY

Key Points

  • GROUP BY: ✅ The GROUP BY clause is used in SQL to arrange identical data into groups. It is commonly used in conjunction with aggregate functions such as COUNT(), MAX(), MIN(), SUM(), or AVG() to perform operations on each group of data.
  • ORDER BY ASC: ❌ The ORDER BY clause is used to sort the result set in ascending (ASC) or descending (DESC) order but is not directly tied to grouping data for aggregate functions.
  • ORDER BY DESC: ❌ Similar to ORDER BY ASC, it is used for sorting but does not group data for aggregate functions.
  • None of the above: ❌ This is incorrect because GROUP BY is the correct clause to be used with aggregate functions.

Additional Information

  • Syntax: The typical syntax for using GROUP BY with an aggregate function is:

    SELECT column_name, AGGREGATE_FUNCTION(column_name) FROM table_name GROUP BY column_name;

  • Example: If you have a table Sales with columns Region and Amount, you can calculate the total sales for each region using: SELECT Region, SUM(Amount) FROM Sales GROUP BY Region;

Hence, the correct answer is: option 2) GROUP BY

Question 28

UP police programmer Grade 2 2013• Part 1: Information Technology

What command is used to count the total number of lines, words, and characters contained in a file ?

  1. AOption (a)

    countw 

  2. BOption (b)

    wcount 

  3. COption (c)

    wc

  4. DOption (d)

    count p

View answer & explanation

Correct answer

Answer: (c)C.

wc

Why this answer is correct

The correct answer is option 3) wc

Key Points

  • wc stands for word count.
  • It is a standard command-line utility in Unix/Linux systems used to count:
  • Lines
  • Words
  • Characters
  • Syntax: wc filename
  • Example: wc myfile.txt

Output: 12 45 230 myfile.txt

Means: 12 lines, 45 words, 230 characters

Additional Information

  • wc -l: Counts only lines
  • wc -w: Counts only words
  • wc -c: Counts only bytes (characters)
  • Incorrect options:
  • countw, wcount, count p are not valid Linux commands ❌

Hence, the correct answer is: option 3) wc

Question 29

UP police programmer Grade 2 2013• Part 1: Information Technology

Automatic calculation of values is a principle of ________

  1. AOption (a)

    Word processing

  2. BOption (b)

    Application design

  3. COption (c)

    Presentation graphic

  4. DOption (d)

    Spreadsheet software

View answer & explanation

Correct answer

Answer: (d)D.

Spreadsheet software

Why this answer is correct

The correct answer is Spreadsheet software

Key Points

  • Spreadsheet software: ✅ Spreadsheet software is specifically designed to perform automatic calculations. It allows users to input data into cells, apply formulas, and generate calculations based on pre-defined or user-created formulas.
  • Word processing: ❌ Word processing software, such as Microsoft Word, is used to create text-based documents and does not provide functionality for automatic calculations.
  • Application design: ❌ Application design refers to the process of creating software or applications, not specific functionality for automatic calculations.
  • Presentation graphic: ❌ Presentation graphic software, such as Microsoft PowerPoint, is used for creating visual presentations and is not meant for calculations.

Additional Information

  • Example: Spreadsheet software like Microsoft Excel and Google Sheets are widely used for data analysis, financial modeling, and other tasks requiring automatic calculations.
  • Functions: They provide built-in functions such as SUM, AVERAGE, and VLOOKUP, which make calculations efficient and easy.

Hence, the correct answer is: option 4) Spreadsheet software

Question 30

UP police programmer Grade 2 2013• Part 1: Information Technology

If the word size of memory is 4 bytes and address 16 bits long, then the size of memory in bytes is

  1. AOption (a)

    215 

  2. BOption (b)

    218 

  3. COption (c)

    28

  4. DOption (d)

    None of the above

View answer & explanation

Correct answer

Answer: (b)B.

218 

Why this answer is correct

Below is the correct answer and detailed solution for the question given in the CSV format: ```html

The correct answer is Option 2: 218 

Key Points

  • Memory Word Size: The word size of memory is given as 4 bytes. This means each memory address corresponds to 4 bytes.
  • Address Length: The address length is specified as 16 bits. This indicates the number of addresses possible in the memory.
  • Total Addresses: Since the address length is 16 bits, the total number of addresses possible is calculated as 216.
  • Memory Size: The size of memory in bytes is calculated by multiplying the total number of addresses by the word size.

Memory Size = Total Addresses × Word Size = 216 × 4 = 218 bytes.

Additional Information

  • Explanation of Options:
  • Option 1 (215): Incorrect. This calculation does not consider the word size of 4 bytes.
  • Option 2 (218): Correct. This represents the total memory size considering both address length and word size.
  • Option 3 (28): Incorrect. This value is unrelated to the given address length and word size.
  • Option 4 (None of the above): Incorrect. The correct answer is Option 2.
  • Formula Recap: Memory Size = 2address length × Word Size.

Hence, the correct answer is: Option 2: 218