RRB SO IT Professional Knowledge Questions: 100 free IT MCQs with answers
Practice questions for the Professional Knowledge (IT) test of the IBPS RRB Officer Scale-II IT Officer exam: 40 questions, 40 marks, 30 minutes, one-fourth of a mark lost for each wrong answer. Each question has five options like the real exam; open “Show answer” for the key and a short explanation. Updated .
Questions by topic
| Topic | Questions | Numbers |
|---|---|---|
| Computer Networks | 21 | Q1–Q21 |
| DBMS & SQL | 17 | Q22–Q38 |
| Information Security | 13 | Q39–Q51 |
| Data Structures & Algorithms | 13 | Q52–Q64 |
| Operating Systems | 12 | Q65–Q76 |
| Programming & OOP | 11 | Q77–Q87 |
| Software Engineering | 6 | Q88–Q93 |
| Computer Organisation, Web, Cloud & Banking Tech | 7 | Q94–Q100 |
These are practice questions written by The Victory Key, not questions from a real paper (IBPS does not release them). The topic mix follows what past exam analyses report; see topics asked in previous years. To practise under the real timer, take the full 240-question mock from the RRB SO IT test series.
Computer Networks questions for RRB SO IT (21)
- Q1.
A bank wants to connect 8 regional offices in a full mesh topology, with a dedicated point-to-point duplex link between every pair of offices. How many links are needed?
- A.
16
- B.
28
- C.
36
- D.
56
- E.
64
Show answer & explanation
Answer: B.28
A full mesh of n nodes needs n(n − 1)/2 duplex links, so 8 × 7 / 2 = 28. The figure 56 is n(n − 1), which counts every link twice (once from each end). 36 is the result for 9 nodes, and 64 is simply n².
- A.
- Q2.
Which routing protocol is a link-state protocol in which every router builds a map of the whole area and computes its routes with Dijkstra's shortest-path-first algorithm?
- A.
RIP version 2
- B.
BGP-4
- C.
IGRP
- D.
OSPF
- E.
RIPng
Show answer & explanation
Answer: D.OSPF
OSPF (Open Shortest Path First) floods link-state advertisements so that each router holds the same link-state database, then runs Dijkstra's SPF algorithm on it. RIP v2, RIPng and IGRP are distance-vector protocols based on Bellman-Ford, sharing only distances with neighbours. BGP-4 is a path-vector protocol used between autonomous systems.
- A.
- Q3.
A PC knows the IPv4 address of a network printer on the same LAN but not the printer's MAC address. Which protocol does the PC use to find the MAC address?
- A.
ARP
- B.
RARP
- C.
ICMP
- D.
DHCP
- E.
IGMP
Show answer & explanation
Answer: A.ARP
ARP (Address Resolution Protocol) broadcasts a request asking which host owns a given IPv4 address, and the owner replies with its MAC address. RARP does the reverse (MAC to IP) and is obsolete. ICMP carries error and diagnostic messages, DHCP assigns IP addresses, and IGMP manages multicast group membership.
- A.
- Q4.
A client opens a TCP connection by sending a segment with the SYN flag set and initial sequence number x. If the server accepts, what does it send back?
- A.
A segment with only the ACK flag set and acknowledgement number x
- B.
A segment with only the SYN flag set and its own sequence number y
- C.
A segment with the FIN and ACK flags set
- D.
A segment with the SYN and ACK flags set, its own sequence number y and acknowledgement number x + 1
- E.
A segment with the RST flag set and acknowledgement number x + 1
Show answer & explanation
Answer: D.A segment with the SYN and ACK flags set, its own sequence number y and acknowledgement number x + 1
The second step of the handshake is SYN+ACK: the server chooses its own initial sequence number y and acknowledges x + 1, because a SYN consumes one sequence number. The client then completes the handshake with a pure ACK carrying acknowledgement number y + 1, which is why the ACK-only option describes the third step, not the second. RST would refuse the connection, and FIN closes one.
- A.
- Q5.
A sliding-window protocol uses a 4-bit sequence number field. What is the maximum sender window size when Selective Repeat ARQ is used?
- A.
16
- B.
15
- C.
7
- D.
8
- E.
4
Show answer & explanation
Answer: D.8
With m-bit sequence numbers, Selective Repeat allows a window of at most , so that the sender's and receiver's windows can never overlap after the numbers wrap around. The value is the limit for Go-Back-N, and would let a new frame be mistaken for a retransmitted old one.
- A.
- Q6.
Which of the following IPv4 addresses is NOT a private address under RFC 1918, and so can be routed on the public internet?
- A.
10.200.15.1
- B.
172.32.10.5
- C.
172.31.250.9
- D.
192.168.0.254
- E.
172.16.0.20
Show answer & explanation
Answer: B.172.32.10.5
The private blocks are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. The /12 block runs only from 172.16.0.0 to 172.31.255.255, so 172.31.250.9 and 172.16.0.20 are private, but 172.32.10.5 falls just outside it and is a public address.
- A.
- Q7.
A browser requests a page and the web server replies with HTTP status code 301. What does this mean?
- A.
Not Modified: the browser may use its cached copy
- B.
Found: the resource is temporarily available at another URL
- C.
Moved Permanently: the resource has a new permanent URL, given in the Location header
- D.
Forbidden: the server understood the request but refuses to authorise it
- E.
Service Unavailable: the server is temporarily overloaded or down
Show answer & explanation
Answer: C.Moved Permanently: the resource has a new permanent URL, given in the Location header
3xx codes are redirections. 301 means Moved Permanently, so browsers and search engines should use the new URL from the Location header. 302 (Found) is a temporary redirect and 304 is Not Modified. 403 (Forbidden) is a client-error code, and 503 (Service Unavailable) is a server-error code.
- A.
- Q8.
The data bits 10110011 are sent using a cyclic redundancy check with generator polynomial . Which CRC bits are appended to the data?
- A.
110
- B.
100
- C.
101
- D.
011
- E.
111
Show answer & explanation
Answer: B.100
The generator is 1101 (degree 3), so append three 0s to get 10110011000 and divide by 1101 using XOR (modulo-2) division. The partial results are 01100011000, 00001011000, 00000110000 and 00000000100, so the remainder is 100 and the transmitted frame is 10110011100, which leaves remainder 000 at the receiver. Dividing without appending the zeros gives 110, and using x³ + x + 1 (1011) by mistake gives 101.
- A.
- Q9.
A CSMA/CD LAN runs at 100 Mbps, and the maximum one-way propagation delay between any two stations is 5 μs. What is the minimum frame size that guarantees a sender detects a collision before it finishes transmitting the frame?
- A.
125 bytes
- B.
62.5 bytes
- C.
250 bytes
- D.
1000 bytes
- E.
64 bytes
Show answer & explanation
Answer: A.125 bytes
For collision detection, transmission time must be at least the round-trip time, 2 × 5 μs = 10 μs. Minimum frame size = 100 × 10⁶ bits/s × 10 × 10⁻⁶ s = 1000 bits = 125 bytes. 62.5 bytes uses only the one-way delay, 1000 is the answer in bits rather than bytes, and 64 bytes is the standard minimum for 10 Mbps Ethernet, not a value derived from these figures.
- A.
- Q10.
A bank officer reads branch email on both a desktop and a phone, and wants the messages and folders to stay on the mail server so that both devices always show the same mailbox. Which protocol should the mail client use to retrieve mail?
- A.
POP3
- B.
SMTP
- C.
IMAP
- D.
SNMP
- E.
MIME
Show answer & explanation
Answer: C.IMAP
IMAP lets the client work on mail that stays on the server, so folders and read/unread status stay in sync across devices. POP3 is designed to download messages to one client (usually removing them from the server), and SMTP only sends mail.
- A.
- Q11.
The
pingcommand checks whether a remote host is reachable by sending echo request messages and waiting for echo replies. Which protocol carries these messages?- A.
ARP
- B.
ICMP
- C.
UDP
- D.
IGMP
- E.
RARP
Show answer & explanation
Answer: B.ICMP
ping uses ICMP Echo Request (type 8) and Echo Reply (type 0) messages, which are carried directly inside IP packets. ARP only maps IP addresses to MAC addresses on a LAN, and IGMP manages multicast group membership.
- A.
- Q12.
A link uses stop-and-wait flow control. Its bandwidth is 1 Mbps, each frame is 1,000 bits long and the one-way propagation delay is 4 ms. Ignoring the acknowledgement's transmission time and all processing delays, what is the link utilisation (efficiency)?
- A.
About 20%
- B.
12.5%
- C.
25%
- D.
50%
- E.
About 11.1%
Show answer & explanation
Answer: E.About 11.1%
Transmission time is 1,000 bits ÷ 1 Mbps = 1 ms, and the sender then waits one round trip (2 × 4 ms) before the next frame, so efficiency = 1 / (1 + 8) = 1/9 ≈ 11.1%. The 20% figure wrongly counts only the one-way delay, 1 / (1 + 4).
- A.
- Q13.
IPv4 has several kinds of addresses. Which kind does NOT exist in IPv6?
- A.
Unicast
- B.
Broadcast
- C.
Multicast
- D.
Anycast
- E.
Loopback
Show answer & explanation
Answer: B.Broadcast
IPv6 defines only unicast, multicast and anycast addresses; the jobs IPv4 did with broadcast are done with multicast groups such as the all-nodes group ff02::1. IPv6 does have a loopback address (::1), which is a special unicast address.
- A.
- Q14.
A TCP sender has a slow-start threshold (ssthresh) of 16 MSS. Its congestion window (cwnd) is 1 MSS at the start of transmission round 1, and every segment is acknowledged with no loss or timeout. The sender uses slow start until cwnd reaches ssthresh and then additive-increase congestion avoidance. What is cwnd at the start of round 7?
- A.
17 MSS
- B.
18 MSS
- C.
16 MSS
- D.
32 MSS
- E.
64 MSS
Show answer & explanation
Answer: B.18 MSS
Slow start doubles cwnd every round, giving 1, 2, 4, 8, 16 MSS for rounds 1 to 5. Once cwnd reaches ssthresh, congestion avoidance adds 1 MSS per round, so round 6 starts at 17 and round 7 at 18 MSS. 64 MSS would be the answer only if doubling continued past the threshold.
- A.
- Q15.
Which transmission medium is immune to electromagnetic interference because it carries data as pulses of light?
- A.
Optical fibre
- B.
Shielded twisted pair (STP)
- C.
Unshielded twisted pair (UTP)
- D.
Coaxial cable
- E.
Terrestrial microwave link
Show answer & explanation
Answer: A.Optical fibre
Optical fibre carries light through glass or plastic, so electrical and magnetic noise cannot affect the signal. Shielded twisted pair only reduces interference with its metal shield; it is still a copper medium that carries electrical signals.
- A.
- Q16.
Under classful IPv4 addressing, to which class does the address 191.20.5.9 belong?
- A.
Class A
- B.
Class C
- C.
Class B
- D.
Class D
- E.
Class E
Show answer & explanation
Answer: C.Class B
Class B covers first octets 128 to 191, so 191.20.5.9 is Class B. Class C starts at 192, which is the usual trap; Class A is 1 to 126, Class D (multicast) is 224 to 239 and Class E is 240 to 255.
- A.
- Q17.
Which HTTP request method is neither safe nor idempotent, so sending the same request twice may create two resources (for example, two payment requests)?
- A.
GET
- B.
POST
- C.
PUT
- D.
DELETE
- E.
HEAD
Show answer & explanation
Answer: B.POST
Under the HTTP standard, POST is neither safe nor idempotent, which is why browsers warn before re-submitting a form. GET and HEAD are safe and idempotent; PUT and DELETE change server state (not safe) but repeating them has the same effect as sending them once (idempotent).
- A.
- Q18.
Four stations share a slotted ALOHA channel. In every slot, each station transmits independently with probability 1/4. What is the probability that a given slot is successful, that is, exactly one station transmits in it?
- A.
27/64
- B.
1/4
- C.
81/256
- D.
37/64
- E.
27/256
Show answer & explanation
Answer: A.27/64
P(exactly one) = 4 × (1/4) × (3/4)³ = 4 × 27/256 = 27/64 ≈ 0.42. 27/256 is the probability that one particular station succeeds (the factor of 4 is missing), and 81/256 = (3/4)⁴ is the probability that the slot is idle.
- A.
- Q19.
HDLC uses bit stuffing so that the flag pattern 01111110 never appears inside a frame's data. If the data to be sent is 01111110, which bit sequence is actually transmitted in the data field?
- A.
01111110
- B.
0111110110
- C.
011111100
- D.
0111111010
- E.
011111010
Show answer & explanation
Answer: E.011111010
The sender inserts a 0 after every run of five consecutive 1s: 0 11111 is followed by a stuffed 0, and then the remaining bits 10 are sent, giving 011111010. The other options either leave the flag pattern unchanged or insert the extra 0 at the wrong place.
- A.
- Q20.
In RIP (Routing Information Protocol), which hop-count value is treated as infinity, meaning the destination network is unreachable?
- A.
15
- B.
30
- C.
64
- D.
16
- E.
255
Show answer & explanation
Answer: D.16
RIP allows at most 15 hops on a valid route and uses the metric 16 to mean unreachable, which limits RIP to small networks and bounds the count-to-infinity problem. 15 is the largest reachable distance, not the infinity value.
- A.
- Q21.
In the OSI reference model, which layer is responsible for translating data formats, encryption and decryption, and compression, so that systems with different data representations can understand each other?
- A.
Session layer
- B.
Application layer
- C.
Transport layer
- D.
Presentation layer
- E.
Data link layer
Show answer & explanation
Answer: D.Presentation layer
The presentation layer (layer 6) handles syntax and representation: translation such as character-code conversion, encryption and compression. The session layer (layer 5) manages dialogues, synchronisation and checkpoints, not data formats.
- A.
DBMS & SQL questions for RRB SO IT (17)
- Q22.
Which SQL statement removes all rows from a table, keeps the table's structure for later use, and is classified as a DDL command?
- A.
DELETE
- B.
DROP
- C.
TRUNCATE
- D.
ALTER
- E.
REVOKE
Show answer & explanation
Answer: C.TRUNCATE
TRUNCATE is a DDL command that removes every row at once, without a WHERE clause, and leaves the table definition in place. DELETE is DML: it removes rows one at a time and can take a WHERE clause. DROP removes the table's structure as well as its data. ALTER changes the structure, and REVOKE withdraws privileges.
- A.
- Q23.
A funds-transfer transaction commits, and a moment later the bank's database server loses power. When the server restarts, the transfer is still recorded. Which ACID property guarantees this?
- A.
Atomicity
- B.
Consistency
- C.
Isolation
- D.
Serializability
- E.
Durability
Show answer & explanation
Answer: E.Durability
Durability means that once a transaction commits, its changes survive later failures. DBMSs achieve this with write-ahead logs that are replayed (redo) after a crash. Atomicity covers transactions that had not committed (all or nothing). Serializability is a correctness criterion for concurrent schedules and is not one of the four ACID letters.
- A.
- Q24.
Relation R(P, Q, S, T) has the single candidate key {P, Q} and the functional dependencies PQ → S and Q → T. All attributes are atomic. What is the highest normal form that R satisfies?
- A.
Not even 1NF
- B.
1NF
- C.
2NF
- D.
3NF
- E.
BCNF
Show answer & explanation
Answer: B.1NF
Atomic attributes put R in 1NF. T is a non-prime attribute, and it depends on Q, which is only part of the key {P, Q}. That partial dependency violates 2NF, so R is in 1NF only. Splitting it into (Q, T) and (P, Q, S) removes the problem, and both parts are in BCNF.
- A.
- Q25.
Table Loan holds the following rows.
loan_id branch amount 101 Agra 40000 102 Pune 90000 103 Agra 70000 104 Hisar 120000 105 Pune 30000 106 Agra 60000 107 Hisar 20000 108 Kota 80000 What does this query return?
SELECT branch FROM Loan WHERE amount >= 30000 GROUP BY branch HAVING COUNT(*) >= 2;- A.
Agra only
- B.
Agra, Hisar and Pune
- C.
Pune only
- D.
Agra and Pune
- E.
Agra, Hisar, Kota and Pune
Show answer & explanation
Answer: D.Agra and Pune
WHERE filters rows before grouping, so loan 107 (Hisar, 20000) is removed. The remaining counts are Agra 3, Pune 2 (90000 and 30000, since >= includes 30000), Hisar 1 and Kota 1. HAVING COUNT(*) >= 2 keeps Agra and Pune. Hisar would appear only if HAVING were applied before the WHERE filter, and Pune would drop out only if the condition were amount > 30000.
- A.
- Q26.
An analyst is viewing a sales cube with monthly figures and switches to quarterly totals for the same data. Which OLAP operation has been performed?
- A.
Drill-down
- B.
Slice
- C.
Dice
- D.
Roll-up
- E.
Pivot
Show answer & explanation
Answer: D.Roll-up
Roll-up aggregates data to a higher level of a dimension hierarchy, here from month to quarter. Drill-down is the reverse, for example from quarter to month. Slice fixes a single value of one dimension, dice selects a sub-cube on two or more dimensions, and pivot rotates the axes of the view without changing the level of aggregation.
- A.
- Q27.
Relation R(A, B, C, D, E) has the functional dependencies A → B, BC → E and ED → A. How many candidate keys does R have?
- A.
1
- B.
2
- C.
3
- D.
4
- E.
5
Show answer & explanation
Answer: C.3
C and D never appear on the right-hand side of any dependency, so every key must contain both, but {C, D}⁺ = {C, D}, so a third attribute is needed. ACD⁺ gives B (A → B) and then E (BC → E), BCD⁺ gives E and then A (ED → A), and CDE⁺ gives A and then B, so each covers all five attributes. Any other superkey contains one of these three, so there are exactly 3 candidate keys: ACD, BCD and CDE.
- A.
- Q28.
Table ACCOUNT has a column status. Which SQL statement removes only the rows whose status is 'CLOSED' and leaves the table and its other rows in place?
- A.
TRUNCATE TABLE ACCOUNT WHERE status = 'CLOSED'; - B.
DELETE FROM ACCOUNT WHERE status = 'CLOSED'; - C.
DROP TABLE ACCOUNT WHERE status = 'CLOSED'; - D.
REMOVE FROM ACCOUNT WHERE status = 'CLOSED'; - E.
ALTER TABLE ACCOUNT DROP ROW WHERE status = 'CLOSED';
Show answer & explanation
Answer: B.DELETE FROM ACCOUNT WHERE status = 'CLOSED';DELETE is the DML command that removes selected rows, chosen with a WHERE clause. TRUNCATE removes all rows and does not accept a WHERE clause, DROP TABLE removes the whole table, and REMOVE and DROP ROW are not SQL commands.
- A.
- Q29.
In an E-R model, an INSTALMENT entity has no key of its own: an instalment can be identified only together with the LOAN it belongs to (loan_id plus instalment number). What is INSTALMENT called?
- A.
A strong entity set
- B.
A multivalued attribute
- C.
A derived attribute
- D.
A weak entity set
- E.
A recursive relationship
Show answer & explanation
Answer: D.A weak entity set
A weak entity set has no primary key of its own; it is identified by its owner's key plus its own partial key (discriminator), here the instalment number. A strong entity set has a primary key of its own.
- A.
- Q30.
Column ACCOUNT.cust_id is a foreign key that references CUSTOMER.cust_id and is declared with
ON DELETE CASCADE. What happens when a row is deleted from CUSTOMER?- A.
The delete is rejected while any ACCOUNT row still references that customer
- B.
The cust_id of the matching ACCOUNT rows is set to NULL
- C.
Every ACCOUNT row that references that customer is deleted automatically
- D.
The ACCOUNT rows are left unchanged and keep the old cust_id
- E.
The customer row is only marked as deleted until the ACCOUNT rows are removed by hand
Show answer & explanation
Answer: C.Every ACCOUNT row that references that customer is deleted automatically
ON DELETE CASCADE carries the delete through to the child table, so the referencing ACCOUNT rows are deleted too. Rejecting the delete is what RESTRICT / NO ACTION does, and setting the column to NULL is ON DELETE SET NULL.
- A.
- Q31.
Table EMP has a column sal with the values 50000, 70000, 70000, 40000 and 60000 (one per row). What does this query return?
SELECT MAX(sal) FROM EMP WHERE sal < (SELECT MAX(sal) FROM EMP);- A.
60000
- B.
70000
- C.
50000
- D.
40000
- E.
NULL
Show answer & explanation
Answer: A.60000
The subquery returns the highest salary, 70000; the outer query then takes the maximum of the salaries strictly below it, which is 60000, the second-highest distinct salary. 70000 is not returned because both rows holding it fail the condition sal < 70000.
- A.
- Q32.
A DBMS uses the UNDO/REDO (immediate-update) log-based recovery algorithm, with no checkpoint. When the system crashes, the log contains these records (each transaction's update records are also present):
<T1 start>,<T2 start>,<T1 commit>,<T3 start>,<T3 commit>,<T4 start>What does recovery do on restart?
- A.
Undo T2 and T4 only
- B.
Redo T1 and T3 only
- C.
Redo T1 and T3; undo T2 and T4
- D.
Redo all four transactions
- E.
Undo all four transactions
Show answer & explanation
Answer: C.Redo T1 and T3; undo T2 and T4
Under immediate update, uncommitted changes may already be on disk, so the transactions with a start but no commit record (T2, T4) must be undone; committed changes may not yet be on disk, so the transactions with a commit record (T1, T3) must be redone. 'Redo T1 and T3 only' describes deferred update (NO-UNDO/REDO), where uncommitted changes never reach the database.
- A.
- Q33.
Table A has one column x with the rows 1, 2, 2 and 3. Table B has one column x with the rows 2, 3 and 4. How many rows does this query return?
SELECT x FROM A UNION SELECT x FROM B;- A.
7
- B.
3
- C.
2
- D.
4
- E.
5
Show answer & explanation
Answer: D.4
UNION removes duplicate rows from the combined result, leaving the distinct values 1, 2, 3 and 4, so 4 rows. 7 is the answer for UNION ALL, which keeps every row from both tables.
- A.
- Q34.
A B+ tree index is stored on disk blocks of 512 bytes. A search-key value takes 8 bytes and a block pointer takes 6 bytes. An internal node with p child pointers holds p − 1 keys. What is the largest possible p (the order of an internal node)?
- A.
37
- B.
36
- C.
38
- D.
64
- E.
85
Show answer & explanation
Answer: A.37
The node must satisfy 6p + 8(p − 1) ≤ 512, so 14p ≤ 520 and p ≤ 37.1, giving p = 37 (6 × 37 + 8 × 36 = 510 bytes). 36 comes from ignoring that there is one key fewer than pointers (14p ≤ 512).
- A.
- Q35.
A DBA creates an ordinary (non-materialised) view with
CREATE VIEW high_value AS SELECT * FROM TXN WHERE amt > 100000;. Which statement about this view is correct?- A.
A copy of the matching TXN rows is stored and refreshed on a schedule
- B.
Only the view's defining query is stored; its rows are taken from TXN each time the view is queried
- C.
The view becomes empty if new rows are later added to TXN
- D.
The view cannot be used in a join with other tables
- E.
Any view can always be updated with INSERT, UPDATE or DELETE
Show answer & explanation
Answer: B.Only the view's defining query is stored; its rows are taken from TXN each time the view is queried
A standard view is a stored query (a virtual table), so it always reflects the current rows of its base table. Storing a physical copy that is refreshed periodically describes a materialised view.
- A.
- Q36.
A relation (table) has 8 attributes (columns) and currently holds 200 tuples (rows). What is the degree of the relation?
- A.
200
- B.
208
- C.
1,600
- D.
1
- E.
8
Show answer & explanation
Answer: E.8
The degree (arity) of a relation is its number of attributes, so it is 8. The number of tuples, 200, is its cardinality, which changes as rows are inserted and deleted.
- A.
- Q37.
A DBMS prevents deadlock with the wait-die scheme. Transaction T1 has timestamp 5 and T2 has timestamp 10, so T1 is older. T2 requests a lock on data item X, which T1 currently holds in a conflicting mode. What happens?
- A.
T2 waits until T1 releases the lock on X
- B.
T1 is rolled back and T2 gets the lock on X
- C.
T2 is rolled back (dies) and is later restarted with its original timestamp 10
- D.
Both T1 and T2 are rolled back
- E.
T1 is forced to wait for T2
Show answer & explanation
Answer: C.T2 is rolled back (dies) and is later restarted with its original timestamp 10
In wait-die, an older transaction may wait for a younger one, but a younger transaction that asks for a lock held by an older one dies; it restarts with its original timestamp so that it eventually becomes the oldest and cannot starve. T2 waiting is what wound-wait would do in this situation.
- A.
- Q38.
Table CUST holds the names Rahul, Aman, Kavya, Sara, Nandini and Pooja. How many rows does this query count?
SELECT COUNT(*) FROM CUST WHERE name LIKE '_a%';- A.
5
- B.
3
- C.
2
- D.
6
- E.
4
Show answer & explanation
Answer: E.4
In LIKE, _ matches exactly one character and % matches any number of characters, so the pattern selects names whose second letter is 'a': Rahul, Kavya, Sara and Nandini. Aman starts with A but its second letter is 'm', and Pooja's second letter is 'o'.
- A.
Information Security questions for RRB SO IT (13)
- Q39.
A distributed denial-of-service (DDoS) attack floods a bank's internet-banking servers until genuine customers cannot log in. Which goal of the CIA triad is primarily violated?
- A.
Confidentiality
- B.
Integrity
- C.
Availability
- D.
Non-repudiation
- E.
Authentication
Show answer & explanation
Answer: C.Availability
DoS and DDoS attacks aim to make a service unusable for legitimate users, which attacks availability. Confidentiality would be breached by data disclosure and integrity by unauthorised changes, and neither is the aim of a flood. Non-repudiation and authentication are security services, but they are not part of the CIA triad.
- A.
- Q40.
Malware that encrypts the files on a victim's computer and demands payment, often in cryptocurrency, in exchange for the decryption key is called
- A.
Spyware
- B.
Adware
- C.
Ransomware
- D.
Rootkit
- E.
Keylogger
Show answer & explanation
Answer: C.Ransomware
Ransomware encrypts or locks the victim's data and demands a ransom for the key. Spyware and keyloggers secretly collect information such as keystrokes, adware pushes unwanted advertisements, and a rootkit hides an attacker's presence on the system. None of these encrypts files to extort the owner.
- A.
- Q41.
A login page builds its SQL query by joining the username and password typed by the user directly into the query string. Which measure is the most effective defence against SQL injection on this page?
- A.
Encrypting the database files with AES
- B.
Serving the login page over HTTPS
- C.
Hiding database error messages from users
- D.
Using parameterised queries (prepared statements)
- E.
Limiting the password field to 8 characters
Show answer & explanation
Answer: D.Using parameterised queries (prepared statements)
SQL injection works because user input is interpreted as part of the SQL statement. Prepared statements send the query structure and the values separately, so input such as ' OR '1'='1 is treated as a literal string. HTTPS protects data only in transit, and encryption at rest does not stop the database from running an injected query. Hiding errors makes attacks harder but does not remove the flaw, and a length limit can be bypassed.
- A.
- Q42.
In a group of 10 users, every pair must share its own secret key for symmetric encryption. How many secret keys are needed in total?
- A.
10
- B.
20
- C.
45
- D.
90
- E.
100
Show answer & explanation
Answer: C.45
Each unordered pair of users needs one shared key, so the number of keys is n(n − 1)/2 = 10 × 9 / 2 = 45. 90 counts each pair twice. 20 is the number of keys (10 public and 10 private) needed if every user has an asymmetric key pair instead, which is why public-key cryptography scales better for key distribution.
- A.
- Q43.
In a Diffie-Hellman key exchange, the public values are the prime p = 37 and the generator g = 2. Alice's private key is 6 and Bob's private key is 5. What shared secret key do they compute?
- A.
27
- B.
32
- C.
13
- D.
11
- E.
30
Show answer & explanation
Answer: D.11
Alice sends A = 2⁶ mod 37 = 64 mod 37 = 27, and Bob sends B = 2⁵ mod 37 = 32. Alice computes 32⁶ mod 37 and Bob computes 27⁵ mod 37, and both get 11, which equals 2³⁰ mod 37. 27 and 32 are only the public values that were exchanged, and 13 comes from wrongly multiplying them (27 × 32 mod 37), which equals , not .
- A.
- Q44.
Which of the following is a cryptographic hash function rather than an encryption algorithm?
- A.
AES
- B.
Triple DES (3DES)
- C.
RSA
- D.
SHA-256
- E.
Blowfish
Show answer & explanation
Answer: D.SHA-256
SHA-256 maps any input to a fixed 256-bit digest and is one-way, so there is no key and no decryption. AES, 3DES and Blowfish are symmetric ciphers and RSA is a public-key cipher; all of them can be decrypted with the right key.
- A.
- Q45.
Net-banking login asks for the customer's password and then for a one-time password (OTP) sent to the customer's registered mobile phone. Which authentication factors are combined?
- A.
Something you know and something you are
- B.
Something you have and something you are
- C.
Something you know and something you have
- D.
Something you know only, used twice
- E.
Something you have and somewhere you are
Show answer & explanation
Answer: C.Something you know and something you have
The password is a knowledge factor (something you know) and the OTP proves possession of the registered phone (something you have), so this is two-factor authentication. 'Something you are' means a biometric such as a fingerprint, which is not used here.
- A.
- Q46.
What is the block size of the AES (Advanced Encryption Standard) cipher?
- A.
64 bits
- B.
128 bits, whatever the key length
- C.
192 bits
- D.
256 bits
- E.
Equal to the key length: 128, 192 or 256 bits
Show answer & explanation
Answer: B.128 bits, whatever the key length
AES always encrypts 128-bit blocks; only the key length (128, 192 or 256 bits) and the number of rounds (10, 12 or 14) vary. 64 bits is the block size of DES and 3DES.
- A.
- Q47.
An attacker posts a comment containing a
<script>tag on a bank's customer forum. The site saves the comment in its database, and the script runs in the browser of every customer who later opens that page. What is this attack?- A.
Reflected cross-site scripting
- B.
SQL injection
- C.
Cross-site request forgery (CSRF)
- D.
Stored (persistent) cross-site scripting
- E.
Clickjacking
Show answer & explanation
Answer: D.Stored (persistent) cross-site scripting
Because the malicious script is saved on the server and served to every visitor, this is stored (persistent) XSS. Reflected XSS bounces the script off the server in a single request, usually through a crafted link, and nothing is saved.
- A.
- Q48.
A Caesar cipher encrypts each letter by shifting it 3 places forward in the alphabet. What is the ciphertext for the word BANK?
- A.
YXKH
- B.
DCPM
- C.
FERO
- D.
EDQN
- E.
EDQM
Show answer & explanation
Answer: D.EDQN
Shifting each letter forward by 3 gives B→E, A→D, N→Q and K→N, so the ciphertext is EDQN. YXKH is the result of shifting backward by 3, which is decryption.
- A.
- Q49.
A firewall keeps a table of active connections. When a PC inside the bank opens a TCP connection to an outside server, the firewall automatically lets the server's reply packets in because they belong to that recorded connection, with no separate inbound rule. What type of firewall is this?
- A.
Stateless packet-filtering firewall
- B.
Stateful inspection firewall
- C.
Honeypot
- D.
Network-based intrusion detection system
- E.
Bastion host
Show answer & explanation
Answer: B.Stateful inspection firewall
A stateful firewall tracks each connection's state and admits return traffic that matches an existing session. A stateless packet filter judges every packet only on its own header fields, so it would need an explicit inbound rule for the replies.
- A.
- Q50.
A hash function produces 128-bit digests. Because of the birthday paradox, roughly how many random inputs must an attacker hash before finding two inputs with the same digest (a collision) becomes likely?
- A.
About 2^128
- B.
About 2^64
- C.
About 2^127
- D.
About 2^96
- E.
About 2^32
Show answer & explanation
Answer: B.About 2^64
For an n-bit hash, a collision is expected after about 2^(n/2) attempts, so 2^64 for 128 bits. Around 2^128 work (2^127 on average) is what is needed for a preimage, i.e. to find an input matching one given digest.
- A.
- Q51.
A bank adds a unique random salt to each customer's password before hashing it and stores the salt alongside the hash. Which attack does this mainly defend against?
- A.
Keyloggers that record passwords as they are typed
- B.
Phishing pages that trick customers into entering passwords
- C.
Shoulder surfing at an ATM or branch counter
- D.
Interception of passwords sent over unencrypted connections
- E.
Precomputed rainbow-table attacks on stolen password hashes
Show answer & explanation
Answer: E.Precomputed rainbow-table attacks on stolen password hashes
A unique salt means identical passwords produce different hashes, so a precomputed table of hash values is useless and each hash must be attacked separately. Salting does nothing against keyloggers, phishing or shoulder surfing, which capture the password itself before it is hashed.
- A.
Data Structures & Algorithms questions for RRB SO IT (13)
- Q52.
Breadth-first search (BFS) of a graph is normally implemented with which data structure holding the vertices that are waiting to be visited?
- A.
Stack
- B.
Binary search tree
- C.
Max-heap
- D.
Hash table
- E.
Queue
Show answer & explanation
Answer: E.Queue
BFS visits vertices level by level, so the first vertex discovered must be the first one expanded, which is FIFO order: a queue. Depth-first search uses a stack (or recursion), which is why the stack option tempts. A hash table may be used to mark visited vertices, but it does not decide the visiting order.
- A.
- Q53.
What is the value of the postfix expression
4 6 2 - * 9 3 / +?- A.
19
- B.
25
- C.
15
- D.
7
- E.
21
Show answer & explanation
Answer: A.19
Using a stack: push 4, 6 and 2. '-' pops 2 and 6 and pushes 6 − 2 = 4. '*' pops 4 and 4 and pushes 16. Push 9 and 3; '/' pushes 9 / 3 = 3. '+' gives 16 + 3 = 19. Reading the expression as (4 × 6) − 2 + 3 gives the wrong value 25.
- A.
- Q54.
Which sorting algorithm is stable and also guarantees O(n log n) running time in the worst case?
- A.
Quick sort
- B.
Heap sort
- C.
Selection sort
- D.
Shell sort
- E.
Merge sort
Show answer & explanation
Answer: E.Merge sort
Merge sort always splits the array in half and merges in linear time, giving O(n log n) in every case, and its merge keeps equal keys in their original order, so it is stable. Heap sort is also O(n log n) in the worst case but is not stable. Quick sort degrades to O(n²) in the worst case, and selection sort is O(n²).
- A.
- Q55.
A binary tree with distinct node labels has preorder traversal P Q S T R U V and inorder traversal S Q T P U V R. What is its postorder traversal?
- A.
S T Q V U R P
- B.
S T Q U V R P
- C.
S Q T V U R P
- D.
T S Q V U R P
- E.
S T Q R V U P
Show answer & explanation
Answer: A.S T Q V U R P
The first preorder node, P, is the root, so S Q T forms the left subtree and U V R the right subtree. On the left, Q is the root with children S and T. On the right, the preorder part R U V makes R the root; in the inorder part U V R everything lies before R, so U is R's left child, and V, which follows U in inorder, is U's right child. Postorder (left, right, root) is S T Q, then V U R, then P, giving S T Q V U R P. The option with U before V wrongly makes V the parent of U.
- A.
- Q56.
What is the time complexity of the following code fragment in terms of n?
for (i = 1; i < n; i = i * 2) for (j = 0; j < i; j++) count++;- A.
O(n)
- B.
O(log n)
- C.
O(n log n)
- D.
O(n²)
- E.
O(log² n)
Show answer & explanation
Answer: A.O(n)
The outer loop runs for i = 1, 2, 4, …, up to the largest power of 2 below n. The inner loop runs i times, so the total work is , which is less than 2n, so the fragment is O(n). O(n log n) is the tempting answer if you assume the inner loop runs about n times on each of the log n outer iterations.
- A.
- Q57.
What is the worst-case time complexity of reaching an element by its position (for example, the i-th element) in a singly linked list of n nodes?
- A.
O(n)
- B.
O(1)
- C.
O(log n)
- D.
O(n log n)
- E.
O(n²)
Show answer & explanation
Answer: A.O(n)
A singly linked list has no index, so the nodes must be followed one by one from the head, which takes up to n steps. O(1) access by position is what an array gives, because an element's address can be computed directly.
- A.
- Q58.
Using the usual precedence (* and / above + and −) and left-to-right associativity, what is the postfix form of the infix expression
A + B * (C - D) / E?- A.
A B C D - * E / + - B.
A B C D - E / * + - C.
A B + C D - * E / - D.
A B C - D * E / + - E.
A B C D - * + E /
Show answer & explanation
Answer: A.A B C D - * E / +The parentheses give C D −; then B * (C − D) gives B C D − *; dividing that by E (left to right) gives B C D − * E /; and adding A last gives A B C D − * E / +. The option A B C D − E / * + would be the postfix of A + B * ((C − D) / E), a different grouping.
- A.
- Q59.
The keys 23, 43, 13, 27 and 33 are inserted in this order into an empty hash table with 10 slots (0–9), using h(k) = k mod 10 and linear probing to resolve collisions. In which slot is 33 stored?
- A.
3
- B.
5
- C.
6
- D.
7
- E.
8
Show answer & explanation
Answer: C.6
23 goes to slot 3, 43 collides and goes to 4, 13 probes 3 and 4 and goes to 5, and 27 goes to 7. 33 hashes to 3 and probes 3, 4 and 5 (all full) before landing in slot 6; it does not reach slot 7, which 27 occupies.
- A.
- Q60.
A max-heap is stored in an array (index 0 is the root) as [50, 30, 40, 10, 20]. The key 45 is inserted using the standard method (append at the end, then sift up). What is the array afterwards?
- A.
[50, 30, 45, 10, 20, 40]
- B.
[50, 45, 40, 10, 20, 30]
- C.
[45, 30, 50, 10, 20, 40]
- D.
[50, 30, 40, 10, 20, 45]
- E.
[50, 45, 30, 10, 20, 40]
Show answer & explanation
Answer: A.[50, 30, 45, 10, 20, 40]
45 is placed at index 5, whose parent is index 2 (40); since 45 > 40 they swap, and then 45's new parent is the root 50, so sifting stops. 45 never compares with 30, because 30 (index 1) is not on the path from index 5 to the root.
- A.
- Q61.
The keys 30, 20, 10, 25 and 28 are inserted in this order into an initially empty AVL tree, with rotations performed after each insertion as needed. What is the preorder traversal of the final tree?
- A.
20, 10, 25, 28, 30
- B.
20, 10, 30, 25, 28
- C.
25, 20, 10, 28, 30
- D.
30, 20, 10, 25, 28
- E.
20, 10, 28, 25, 30
Show answer & explanation
Answer: E.20, 10, 28, 25, 30
Inserting 10 unbalances 30 (left-left case), so a right rotation makes 20 the root with children 10 and 30. Then 25 goes left of 30 and 28 right of 25, unbalancing 30 in the left-right case; the double rotation makes 28 the root of that subtree with children 25 and 30, giving preorder 20, 10, 28, 25, 30. 20, 10, 30, 25, 28 is the plain BST before the final rebalance.
- A.
- Q62.
What is the maximum number of nodes a binary tree can have if it has 5 levels (the root is on level 1)?
- A.
32
- B.
25
- C.
31
- D.
16
- E.
15
Show answer & explanation
Answer: C.31
Level i holds at most 2^(i − 1) nodes, so 5 levels hold at most 1 + 2 + 4 + 8 + 16 = 2^5 − 1 = 31 nodes. 16 is the maximum on level 5 alone, and 32 forgets to subtract 1.
- A.
- Q63.
A directed graph has some edges with negative weights but no negative-weight cycle. Which algorithm correctly finds the shortest paths from one source vertex to all other vertices?
- A.
Dijkstra's algorithm
- B.
Prim's algorithm
- C.
Kruskal's algorithm
- D.
Bellman-Ford algorithm
- E.
Breadth-first search
Show answer & explanation
Answer: D.Bellman-Ford algorithm
Bellman-Ford relaxes every edge V − 1 times, so it handles negative edge weights (and can also detect a negative cycle). Dijkstra's greedy choice assumes that a finalised vertex's distance can never get shorter, which negative edges can break; Prim and Kruskal find minimum spanning trees, not shortest paths.
- A.
- Q64.
How many structurally different binary search trees can be built that each contain exactly the 4 distinct keys 1, 2, 3 and 4?
- A.
24
- B.
14
- C.
16
- D.
42
- E.
5
Show answer & explanation
Answer: B.14
The count is the Catalan number C(4) = (1/5) × C(8, 4) = 70/5 = 14; equivalently, summing over each key as the root gives 5 + 2 + 2 + 5 = 14. 24 is the number of insertion orders (4!), but different orders can produce the same tree, and 42 is C(5), the count for 5 keys.
- A.
Operating Systems questions for RRB SO IT (12)
- Q65.
Which memory-management scheme divides a process into variable-sized logical units such as code, data and stack, addresses memory as (unit number, offset), and can suffer from external fragmentation?
- A.
Paging
- B.
Swapping
- C.
Segmentation
- D.
Overlays
- E.
Fixed partitioning
Show answer & explanation
Answer: C.Segmentation
Segmentation matches the programmer's view: each segment (code, data, stack) has its own size, and an address is (segment number, offset) checked against the segment's limit. Because segments vary in size, free memory gets broken into holes, which is external fragmentation. Paging uses fixed-size pages and suffers only internal fragmentation, as does fixed partitioning.
- A.
- Q66.
A system uses 34-bit logical addresses, a page size of 8 KB and 4-byte page-table entries. With a single-level page table, how large is each process's page table?
- A.
2 MB
- B.
4 MB
- C.
16 MB
- D.
32 MB
- E.
8 MB
Show answer & explanation
Answer: E.8 MB
An 8 KB page needs 13 offset bits, which leaves 34 − 13 = 21 bits for the page number, so the table has 2²¹ entries. Its size is 2²¹ × 4 bytes = 2²³ bytes = 8 MB. Ignoring the 4-byte entry size gives 2 MB, and assuming 4 KB pages gives 16 MB.
- A.
- Q67.
In Linux, after the command
chmod 754 report.sh, what access does a member of the file's group (who is not the owner) have?- A.
Read, write and execute
- B.
Read and execute only
- C.
Read only
- D.
Read and write only
- E.
Execute only
Show answer & explanation
Answer: B.Read and execute only
Each octal digit covers one class, in the order owner, group, others, with read = 4, write = 2 and execute = 1. 7 = 4 + 2 + 1 gives the owner rwx, 5 = 4 + 1 gives the group r-x, and 4 gives others r-- only. So the group can read and execute the file but not modify it.
- A.
- Q68.
Four processes arrive at time 0 with CPU burst times P1 = 5 ms, P2 = 9 ms, P3 = 2 ms and P4 = 4 ms. What is the average waiting time under non-preemptive Shortest Job First scheduling?
- A.
8.75 ms
- B.
9.75 ms
- C.
5.50 ms
- D.
4.75 ms
- E.
3.50 ms
Show answer & explanation
Answer: D.4.75 ms
SJF runs them in the order P3 (2), P4 (4), P1 (5), P2 (9). The waiting times are P3 = 0, P4 = 2, P1 = 6 and P2 = 11, so the average is 19 / 4 = 4.75 ms. 9.75 ms is the average turnaround time (2 + 6 + 11 + 20) / 4, and 8.75 ms is the average waiting time under FCFS in the order P1, P2, P3, P4.
- A.
- Q69.
A process makes the page references 7, 2, 7, 3, 2, 4, 7, 2, 5, 3, 2, 4. It has 3 page frames, initially empty. How many page faults occur under LRU (least recently used) replacement?
- A.
6
- B.
7
- C.
9
- D.
10
- E.
8
Show answer & explanation
Answer: E.8
Tracing LRU: 7, 2 and 3 fault while filling the frames, and the second 7 and 2 are hits. 4 replaces 7, 7 replaces 3, and 2 is a hit. 5 replaces 4, 3 replaces 7, 2 is a hit, and 4 replaces 5. That is 8 faults and 4 hits. FIFO gives 9 faults on this string and the optimal algorithm gives 6, which are the tempting wrong options.
- A.
- Q70.
In UNIX/Linux, what does mounting a file system mean?
- A.
Formatting a disk partition with a new, empty file system
- B.
Copying every file from a removable device into the user's home directory
- C.
Checking a file system for errors and repairing it
- D.
Attaching the file system on a device (such as a disk partition or USB drive) to a directory in the existing directory tree, so that its files can be reached through that directory
- E.
Loading the kernel from disk into memory at boot time
Show answer & explanation
Answer: D.Attaching the file system on a device (such as a disk partition or USB drive) to a directory in the existing directory tree, so that its files can be reached through that directory
Mounting attaches a file system at a mount point (for example /mnt/usb), after which its files appear under that directory in the single UNIX tree. Formatting is done by mkfs and checking/repairing by fsck; neither attaches the file system to the tree.
- A.
- Q71.
Which page-replacement algorithm can suffer from Belady's anomaly, where giving a process more page frames produces MORE page faults for the same reference string?
- A.
FIFO (first-in, first-out)
- B.
LRU (least recently used)
- C.
Optimal (OPT)
- D.
Round Robin
- E.
Shortest Job First
Show answer & explanation
Answer: A.FIFO (first-in, first-out)
FIFO is not a stack algorithm, so the set of pages held with n frames need not be a subset of those held with n + 1 frames, and faults can rise; the classic example is 1,2,3,4,1,2,5,1,2,3,4,5 giving 9 faults with 3 frames and 10 with 4. LRU and OPT are stack algorithms and never show the anomaly; Round Robin and SJF are CPU-scheduling algorithms.
- A.
- Q72.
A server runs so many processes that each has too few page frames. The processes page continuously, spend more time waiting for page swaps than executing, and CPU utilisation collapses. What is this condition called?
- A.
Deadlock
- B.
Starvation
- C.
Thrashing
- D.
Belady's anomaly
- E.
Convoy effect
Show answer & explanation
Answer: C.Thrashing
Thrashing is heavy paging activity caused by processes not having enough frames for their working sets, so little useful work gets done. In a deadlock, processes are blocked waiting for one another's resources, with no paging storm involved.
- A.
- Q73.
A disk has cylinders numbered 0 to 199 and its head is at cylinder 50. The pending requests, in order of arrival, are 82, 170, 43, 140, 24, 16 and 190. Under SSTF (shortest seek time first) scheduling, what is the total head movement in cylinders?
- A.
642
- B.
314
- C.
208
- D.
332
- E.
341
Show answer & explanation
Answer: C.208
SSTF always serves the nearest pending request: 50 → 43 (7) → 24 (19) → 16 (8) → 82 (66) → 140 (58) → 170 (30) → 190 (20), totalling 208 cylinders. 642 is the total for FCFS, i.e. serving the requests in arrival order.
- A.
- Q74.
During a context switch, the operating system saves the running process's program counter, CPU registers and scheduling information so that it can resume the process later. In which data structure are these saved?
- A.
Process control block (PCB)
- B.
Page table
- C.
Translation lookaside buffer (TLB)
- D.
Inode
- E.
Interrupt vector table
Show answer & explanation
Answer: A.Process control block (PCB)
Each process's PCB holds its state, program counter, registers, scheduling and memory-management information, and the context switch saves into and restores from it. The page table maps a process's pages to frames; it does not hold the saved CPU registers.
- A.
- Q75.
A system uses pure paging with fixed-size frames. Which kind of memory fragmentation can it still suffer from?
- A.
Internal fragmentation, in the unused part of a process's last page
- B.
External fragmentation, in the gaps between allocated frames
- C.
Both internal and external fragmentation
- D.
Neither kind, since paging removes all fragmentation
- E.
External fragmentation inside the page table
Show answer & explanation
Answer: A.Internal fragmentation, in the unused part of a process's last page
Because any free frame can hold any page, paging removes external fragmentation, but a process rarely fills its last page exactly, so the rest of that frame is wasted, which is internal fragmentation. External fragmentation is the problem of variable-size schemes such as segmentation and contiguous allocation.
- A.
- Q76.
Several threads belong to the same process. Which of the following does each thread have its own private copy of, rather than sharing with the other threads?
- A.
The heap
- B.
The global variables
- C.
The code (text) section
- D.
Its stack
- E.
The open file descriptors
Show answer & explanation
Answer: D.Its stack
Each thread has its own stack, program counter and registers so that it can run its own sequence of function calls. Threads of a process share its address space (code, global data and heap) and its open files, which is why access to shared data must be synchronised.
- A.
Programming & OOP questions for RRB SO IT (11)
- Q77.
In Java, which keyword, when applied to a class, prevents any other class from extending it?
- A.
static
- B.
final
- C.
abstract
- D.
const
- E.
transient
Show answer & explanation
Answer: B.final
A class declared final cannot be subclassed; java.lang.String is an example. abstract does the opposite and requires subclassing before the class can be instantiated. A top-level class cannot be static, and transient applies only to fields. const is a reserved word in Java but has no meaning.
- A.
- Q78.
What is the output of the following C program?
#include <stdio.h> int main(void) { int x = 5, y; y = x++ * 2; x += y; printf("%d %d\n", x, y); return 0; }- A.
18 12
- B.
16 10
- C.
15 10
- D.
16 12
- E.
6 10
Show answer & explanation
Answer: B.16 10
x++ is a post-increment: the old value 5 is used, so y = 5 × 2 = 10, and then x becomes 6. Next, x += y makes x = 6 + 10 = 16, and the program prints 16 10. Treating x++ as a pre-increment (++x) would give y = 12 and x = 18.
- A.
- Q79.
What does the following Python code print?
nums = [3, 1, 4, 1, 5, 9] print(nums[-2::-2])- A.
[5, 4, 3]
- B.
[9, 1, 1]
- C.
[5, 1, 4, 1, 3]
- D.
[5]
- E.
[5, 1, 3]
Show answer & explanation
Answer: A.[5, 4, 3]
Index −2 is the element 5 (position 4). With step −2 and no stop value, the slice walks backwards to the start of the list, through positions 4, 2 and 0, which hold 5, 4 and 3. So it prints [5, 4, 3]. nums[::-2] would start from the last element and give [9, 1, 1], and a step of −1 would give [5, 1, 4, 1, 3].
- A.
- Q80.
What is the output of the following C++ program?
#include <iostream> using namespace std; struct A { A() { f(); } virtual void f() { cout << "A"; } }; struct B : A { B() { f(); } void f() override { cout << "B"; } }; int main() { B b; A &r = b; r.f(); }- A.
BBB
- B.
AB
- C.
BB
- D.
ABA
- E.
ABB
Show answer & explanation
Answer: E.ABB
Constructing b runs A's constructor first. While it runs, the object's dynamic type is still A, so the virtual call f() resolves to A::f and prints A. B's constructor then calls f(), which is now B::f, and prints B. Finally r.f() through a base-class reference uses dynamic dispatch and calls B::f, printing B. So the output is ABB. BBB would be correct in Java, which dispatches to the subclass even during construction, but not in C++.
- A.
- Q81.
What is the output of the following Java code?
String s1 = "tvk"; String s2 = "tv" + "k"; String s3 = new String("tvk"); System.out.println((s1 == s2) + " " + (s1 == s3) + " " + s1.equals(s3));- A.
false false true
- B.
true true true
- C.
false false false
- D.
true false false
- E.
true false true
Show answer & explanation
Answer: E.true false true
"tv" + "k" is a compile-time constant expression, so the compiler folds it into the literal "tvk", and both s1 and s2 refer to the same interned object in the string pool, making s1 == s2 true. new String(...) always creates a separate heap object, so s1 == s3 compares references and is false. equals() compares characters, so s1.equals(s3) is true.
- A.
- Q82.
What is the output of the following C program?
#include <stdio.h> int main(void) { int i, s = 0; for (i = 1; i <= 5; i++) { switch (i % 3) { case 0: s += 10; case 1: s += 1; break; default: s += 100; } } printf("%d\n", s); return 0; }- A.
213
- B.
203
- C.
212
- D.
222
- E.
113
Show answer & explanation
Answer: A.213
i % 3 runs 1, 2, 0, 1, 2. Remainder 1 adds 1, remainder 2 goes to default and adds 100, and remainder 0 adds 10 and then falls through to case 1 (no break) and adds 1 more, so s = 1 + 100 + 11 + 1 + 100 = 213. 203 ignores the fall-through from case 0.
- A.
- Q83.
What does the following Python code print?
d = {} for w in "bank loan bank card loan bank".split(): d[w] = d.get(w, 0) + 1 print(sorted(d.items(), key=lambda kv: -kv[1])[0], len(d))- A.
('bank', 3) 3
- B.
('bank', 3) 6
- C.
('loan', 2) 3
- D.
bank 3 3
- E.
('card', 1) 3
Show answer & explanation
Answer: A.('bank', 3) 3
The loop counts words, giving {'bank': 3, 'loan': 2, 'card': 1}; sorting the items by descending count puts ('bank', 3) first, and the dictionary has 3 keys. 6 would be the number of words, not of distinct keys, and print shows the first item as a tuple, not as bank 3.
- A.
- Q84.
What does the following Python 3 code print?
print(7 // 2, -7 // 2, 7 % -3)- A.
3 -3 1
- B.
3 -3 -1
- C.
3 -4 1
- D.
3 -4 -2
- E.
3.5 -3.5 -2
Show answer & explanation
Answer: D.3 -4 -2
Python's // is floor division, which rounds toward negative infinity, so 7 // 2 = 3 and -7 // 2 = -4 (not -3). The result of % takes the sign of the divisor, so 7 % -3 = 7 − (−3 × −3) = -2. The option 3 -3 1 is what C would give, since C truncates toward zero and its remainder takes the sign of the dividend.
- A.
- Q85.
What does the following Java statement print?
System.out.println(1 + 2 + "3" + 4 + 5);- A.
15
- B.
12345
- C.
339
- D.
33 9
- E.
3345
Show answer & explanation
Answer: E.3345
The + operators are evaluated left to right: 1 + 2 is integer addition, giving 3; 3 + "3" is string concatenation, giving "33"; after that every + concatenates, giving "334" and then "3345". 339 would need 4 + 5 to be added first, which would require parentheses.
- A.
- Q86.
What is the output of the following C program?
#include <stdio.h> #define SQ(x) x * x int main(void) { printf("%d %d\n", SQ(2 + 3), 100 / SQ(5)); return 0; }- A.
25 4
- B.
25 100
- C.
11 100
- D.
11 4
- E.
5 4
Show answer & explanation
Answer: C.11 100
A macro is a plain text substitution, so SQ(2 + 3) becomes 2 + 3 * 2 + 3 = 11, and 100 / SQ(5) becomes 100 / 5 * 5 = (100 / 5) * 5 = 100. 25 and 4 are what a function, or a macro written as ((x) * (x)), would give.
- A.
- Q87.
In C++, a class is declared with the keyword
classand gives no access specifier for its data members, as inclass Account { int balance; };. What is the access level ofbalance?- A.
public
- B.
protected
- C.
It is visible to all classes in the same file
- D.
It depends on the compiler
- E.
private
Show answer & explanation
Answer: E.private
Members of a class declared with the keyword class are private by default, so code outside the class cannot access balance directly. Members of a struct are public by default, and a struct also inherits publicly by default, where a class inherits privately.
- A.
Software Engineering questions for RRB SO IT (6)
- Q88.
Which software development life-cycle model, proposed by Barry Boehm, organises development as a series of loops, each of which includes an explicit risk-analysis phase?
- A.
Waterfall model
- B.
V-model
- C.
Spiral model
- D.
RAD model
- E.
Big Bang model
Show answer & explanation
Answer: C.Spiral model
Boehm's spiral model repeats four activities in each loop: setting objectives, identifying and resolving risks (often with prototypes), development and testing, and planning the next loop. That makes it suited to large, high-risk projects. The waterfall and V-models are linear, RAD focuses on rapid delivery through reusable components, and the Big Bang model has almost no planning.
- A.
- Q89.
The control-flow graph of a module has 17 edges and 13 nodes and forms a single connected component. What is its McCabe cyclomatic complexity, that is, the number of linearly independent paths to test?
- A.
6
- B.
4
- C.
5
- D.
7
- E.
32
Show answer & explanation
Answer: A.6
Cyclomatic complexity is V(G) = E − N + 2P, where P is the number of connected components. Here V(G) = 17 − 13 + 2 × 1 = 6, so basis-path testing needs at least 6 test paths. 4 is E − N alone, which forgets the + 2P term.
- A.
- Q90.
Equivalence partitioning and boundary value analysis design test cases from the specification of a module's inputs and outputs, without looking at its internal code. What kind of testing are they techniques for?
- A.
White-box testing
- B.
Statement-coverage testing
- C.
Basis-path testing
- D.
Mutation testing
- E.
Black-box testing
Show answer & explanation
Answer: E.Black-box testing
Both techniques derive test cases only from the specification, which is the definition of black-box (functional) testing. Statement coverage and basis-path testing are white-box techniques that need the source code.
- A.
- Q91.
Which combination of cohesion and coupling should a software designer aim for when dividing a system into modules?
- A.
Low cohesion and low coupling
- B.
High cohesion and low coupling
- C.
High cohesion and high coupling
- D.
Low cohesion and high coupling
- E.
Coupling and cohesion should be equal
Show answer & explanation
Answer: B.High cohesion and low coupling
High cohesion means each module does one focused job, and low coupling means modules depend on one another as little as possible; together they make modules easier to understand, test and change. High coupling spreads the effects of a change across many modules.
- A.
- Q92.
A loan form accepts an applicant's age only if it is between 18 and 60, inclusive. Using boundary value analysis that tests each boundary and the value just outside it, which set of test inputs should be chosen?
- A.
18, 39, 60
- B.
0, 18, 60, 100
- C.
19, 40, 59
- D.
17, 18, 60, 61
- E.
18, 60
Show answer & explanation
Answer: D.17, 18, 60, 61
Boundary value analysis tests at each edge of the valid range and just beyond it, because errors cluster at boundaries (for example, < written instead of <=): 17 and 18 test the lower edge, 60 and 61 the upper edge. The set 18, 60 contains only the valid boundaries and never checks that 17 and 61 are rejected.
- A.
- Q93.
In a bank's object model, a Branch object holds references to Employee objects. If a branch is closed, its employees continue to exist and can be transferred to another branch. What is this relationship between Branch and Employee called?
- A.
Composition
- B.
Inheritance (generalisation)
- C.
Aggregation
- D.
Realisation
- E.
Dependency
Show answer & explanation
Answer: C.Aggregation
Aggregation is a whole-part ('has-a') relationship in which the parts can exist independently of the whole, as the employees do here. In composition the parts' lifetime is bound to the whole, so they would be destroyed with it.
- A.
Computer Organisation, Web, Cloud & Banking Tech questions for RRB SO IT (7)
- Q94.
A bank subscribes to a hosted customer-relationship management (CRM) application that its staff use through a web browser. The provider manages the application, servers, storage and updates. Which cloud service model is this?
- A.
Software as a Service (SaaS)
- B.
Platform as a Service (PaaS)
- C.
Infrastructure as a Service (IaaS)
- D.
On-premises hosting
- E.
Colocation
Show answer & explanation
Answer: A.Software as a Service (SaaS)
In SaaS the customer simply uses a finished application, and the provider runs everything underneath it. In PaaS the customer deploys its own code on a managed platform, and in IaaS the customer rents virtual machines, storage and networks and manages the operating system and above. On-premises hosting and colocation mean the bank runs the software on its own hardware.
- A.
- Q95.
A store records the following transactions.
TID Items bought T1 bread, milk T2 bread, butter, eggs T3 milk, butter T4 bread, butter T5 bread, milk, butter T6 eggs, milk T7 bread, butter, milk, eggs T8 bread What is the confidence of the association rule {bread} → {butter}?
- A.
50%
- B.
80%
- C.
62.5%
- D.
75%
- E.
66.7%
Show answer & explanation
Answer: E.66.7%
Confidence(X → Y) = support(X ∪ Y) / support(X). Bread appears in 6 transactions (T1, T2, T4, T5, T7, T8), and bread with butter appears in 4 (T2, T4, T5, T7), so the confidence is 4 / 6 ≈ 66.7%. 50% is the rule's support (4 / 8), and 80% is the confidence of the reverse rule {butter} → {bread} (4 / 5).
- A.
- Q96.
What is the 8-bit two's complement representation of −45?
- A.
11010011
- B.
11010010
- C.
10101101
- D.
00101101
- E.
11010100
Show answer & explanation
Answer: A.11010011
+45 is 00101101. Inverting every bit gives 11010010 (the one's complement), and adding 1 gives 11010011, the two's complement. 10101101 is the sign-magnitude form, which only sets the sign bit. As a check, −128 + 64 + 16 + 2 + 1 = −45.
- A.
- Q97.
In UPI, what is the identifier in the form name@bankhandle that lets a customer receive money without sharing their account number and IFSC?
- A.
MMID (Mobile Money Identifier)
- B.
IFSC (Indian Financial System Code)
- C.
CIF (Customer Information File) number
- D.
IBAN (International Bank Account Number)
- E.
Virtual Payment Address (VPA), also called the UPI ID
Show answer & explanation
Answer: E.Virtual Payment Address (VPA), also called the UPI ID
A VPA such as name@bankhandle is mapped by the customer's payment service provider to the underlying bank account, so the account details stay hidden. MMID is the 7-digit identifier used with a mobile number for IMPS transfers, not for UPI addressing.
- A.
- Q98.
Several banks with the same regulatory and security requirements jointly use cloud infrastructure that is provisioned exclusively for their group, rather than for the general public. Under the NIST cloud definitions, which deployment model is this?
- A.
Public cloud
- B.
Community cloud
- C.
Private cloud
- D.
Hybrid cloud
- E.
Edge cloud
Show answer & explanation
Answer: B.Community cloud
NIST defines a community cloud as infrastructure for the exclusive use of a specific community of organisations with shared concerns such as security and compliance. A private cloud serves a single organisation, and a hybrid cloud combines two or more distinct deployment models.
- A.
- Q99.
In Bill Inmon's definition, a data warehouse is subject-oriented, integrated, time-variant and non-volatile. What does non-volatile mean?
- A.
Data is kept in battery-backed memory so that it survives power failures
- B.
Every record carries a timestamp so that history can be analysed
- C.
Data from many source systems is cleaned into consistent formats
- D.
Data is organised around business subjects such as customers and loans
- E.
Once loaded, data is not updated or deleted in normal use; new data is added in periodic loads and the warehouse is mainly read
Show answer & explanation
Answer: E.Once loaded, data is not updated or deleted in normal use; new data is added in periodic loads and the warehouse is mainly read
Non-volatile means warehouse data is stable: it is loaded and read but not changed by day-to-day transactions, unlike an OLTP database. Records carrying a time element for historical analysis is the separate property 'time-variant'.
- A.
- Q100.
In a UPI transaction, which entity operates the central switch that routes the payment request between the payer's payment service provider (PSP) and the payee's PSP and banks?
- A.
RBI (Reserve Bank of India)
- B.
The payer's UPI app provider
- C.
SWIFT
- D.
The payee's bank
- E.
NPCI (National Payments Corporation of India)
Show answer & explanation
Answer: E.NPCI (National Payments Corporation of India)
NPCI runs the UPI central switch, through which every request is routed between the PSPs and the remitter and beneficiary banks. RBI regulates payment systems but does not operate the UPI switch.
- A.
RRB SO IT Professional Knowledge: FAQs
How many Professional Knowledge questions are in the RRB SO IT exam?
40 questions for 40 marks in 30 minutes, with its own timer. It is one of six tests in the single online exam of 240 questions, 200 marks and 150 minutes (CRP RRBs-XV notification). A wrong answer costs one-fourth of the question's marks.
Does IBPS publish a syllabus for RRB IT Officer Professional Knowledge?
No. IBPS's notifications only say the questions relate to the post. Exam analyses of past papers show networks, DBMS and SQL, information security, data structures, operating systems and programming coming up most often, so this page follows that mix.
Are these the actual RRB SO IT previous year questions?
No. IBPS does not release the papers. These are practice questions written by The Victory Key in the exam's style: five options, one correct answer. 40 of them are the Professional Knowledge section of our RRB SO IT Full Mock 1. For the topics asked in past exams, see our previous year topics page.
Is there a sectional cut-off for Professional Knowledge?
Yes. IBPS requires a minimum score in each test and in the total but does not publish the minimums. Final cut-offs from IBPS's own allotment lists are on our cut-off page.
Try the full exam, all six tests timed
240 questions, 200 marks, 150 minutes, five options per question and one-fourth negative marking.