General Aptitude + CS Subjects65 Questions100 Marks
Time Remaining:60:00
Click any option to check your answer.
Sections:AptitudeDS & AlgoCO & OSTheory
Q1. General Aptitude
The sum of ages of A and B is 45 years. 5 years from now, the ratio of their ages will be 4:5. Find the current age of A.
A. 15 years
B. 20 years
C. 25 years
D. 30 years
Correct Answer: A Let A's age = x, B's age = 45-x. After 5 years: (x+5)/(50-x) = 4/5. 5x+25 = 200-4x. 9x = 175. x = 15.
Q2. General Aptitude
If LOGIC is coded as 15-15-7-9-3, then what is the code for MATH?
A. 1-13-20-8
B. 13-1-20-8
C. 14-1-21-9
D. 12-1-19-7
Correct Answer: C Each letter is coded as its position + 1. L(12)+3=15, O(15)+0=15, G(7)+0=7, I(9)+0=9, C(3)+0=3. For MATH: M(13)+1=14, A(1)+0=1, T(20)+1=21, H(8)+1=9 → 14-1-21-9.
Q3. Data Structures & Algorithms
What is the time complexity of binary search on a sorted array of n elements?
A. O(n)
B. O(log n)
C. O(n²)
D. O(n log n)
Correct Answer: B Binary search divides the search space in half each iteration, giving O(log n) time complexity.
Q4. Data Structures & Algorithms
A stack is implemented using an array. If the top pointer is at index 5, what is the current size of the stack?
A. 6
B. 5
C. 4
D. 7
Correct Answer: A If top = 5 (0-indexed), there are 6 elements at indices 0 through 5.
Q5. Data Structures & Algorithms
Which data structure is used for implementing recursion?
A. Queue
B. Array
C. Stack
D. Linked List
Correct Answer: C Recursion uses the call stack (LIFO) to store function call frames and return addresses.
Q6. Computer Organization & OS
Which memory has the fastest access time?
A. RAM
B. Cache
C. Hard Disk
D. SSD
Correct Answer: B Cache memory is closest to the CPU and has the fastest access time (nanoseconds), followed by RAM, then SSD, then HDD.
Q7. Computer Organization & OS
Which scheduling algorithm is non-preemptive?
A. Round Robin
B. FCFS
C. Shortest Remaining Time First
D. Priority (Preemptive)
Correct Answer: B First Come First Serve (FCFS) is non-preemptive — once a process gets the CPU, it runs until completion or I/O.
Q8. Computer Organization & OS
The main function of an operating system is:
A. Compiling programs
B. Providing internet access
C. Managing hardware resources
D. Running applications
Correct Answer: C The OS manages CPU, memory, I/O devices, and provides resource allocation and protection.
Q9. Theory of Computation
A language accepted by a Finite Automaton is called:
A. Regular language
B. Context-free language
C. Context-sensitive language
D. Recursively enumerable language
Correct Answer: A Finite automata accept exactly the class of regular languages (Type 3 in Chomsky hierarchy).
Q10. Theory of Computation
Which of the following is NOT a valid Boolean algebra property?
A. A · 0 = 0
B. A + 1 = 1
C. A · A = A
D. A + A = 0
Correct Answer: D A + A = A (idempotent law), not 0. A + A̅ = 1 and A · A̅ = 0.
Q11. Data Structures & Algorithms
What does the following C expression evaluate to? (Assume i = 5) i++ + ++i
A. 10
B. 11
C. 12
D. Undefined
Correct Answer: C i++ uses current value (5) then increments to 6. ++i increments to 7 then uses 7. So 5 + 7 = 12.
Q12. Computer Organization & OS
In virtual memory, which technique is used for address translation?
A. Segmentation
B. Compaction
C. Paging
D. Swapping
Correct Answer: C Paging maps virtual addresses to physical addresses using page tables, enabling virtual memory.
Q13. General Aptitude
A train 150 m long passes a pole in 15 seconds. Find the speed of the train in km/h.
A. 12 km/h
B. 24 km/h
C. 36 km/h
D. 48 km/h
Correct Answer: C Speed = distance/time = 150/15 = 10 m/s. In km/h: 10 × (18/5) = 36 km/h.
Q14. Theory of Computation
Which of the following problems is undecidable?
A. Checking if a DFA accepts a given string
B. Checking if a CFL is empty
C. The Halting Problem for Turing Machines
D. Checking if an NFA accepts a given string
Correct Answer: C The Halting Problem is undecidable (proved by Alan Turing). All other options are decidable.
Q15. DS & Algorithms
The worst-case time complexity of quicksort is:
A. O(log n)
B. O(n log n)
C. O(n²)
D. O(n)
Correct Answer: C Quicksort worst-case O(n²) when pivot is smallest/largest element (e.g., sorted array with naive pivot).
Q16. General Aptitude
If 5 men can build a wall in 12 days, how many days will 10 men take?