Mock 01 Answers
tags: - cocubes - mock - answers
Mock 01 — Answers and Review
Aptitude
| Q | Answer | Key method |
|---|---|---|
| 1 | C | 20% of 250 = 50 |
| 2 | B | 1.10 × 1.20 = 1.32 |
| 3 | B | 120/800 = 15% |
| 4 | B | 2/5 of 75 |
| 5 | C | total 60; remove 8; 52/4 |
| 6 | B | 10×12 = 15×days |
| 7 | B | 54 km/h = 15 m/s; 150/15 |
| 8 | C | PRT/100 |
| 9 | B | 3 favourable out of 8 |
| 10 | D | 2-cycle remainder 27 mod 4 = 3 |
| 11 | B | either takes singular verb |
| 12 | C | interested in |
| 13 | B | singular collective noun and singular reference |
| 14 | C | earlier past action uses past perfect |
| 15 | B | meticulous = very careful |
| 16 | C | abundant opposes scarce |
| 17 | B | senior to |
| 18 | A | European begins with consonant sound "yu" |
| 19 | B | future passive = will be + past participle |
| 20 | C | both clauses directly support it |
| 21 | C | squares 2², 3², 4², 5², 6² |
| 22 | C | north/south cancel |
| 23 | B | A lies inside B, and B cannot overlap C |
| 24 | A | each letter +1 |
| 25 | C | mother's relation to both siblings |
| 26 | D | seats D, B, A, C, E |
| 27 | D | no rose/fading overlap is forced |
| 28 | B | minute hand 180°, hour hand 105°, difference 75° |
| 29 | C | north/south cancel, east remains |
| 30 | B | first letter forward, second backward |
Technical
| Q | Answer | Key fact |
|---|---|---|
| 1 | B | queue is FIFO |
| 2 | C | BST inorder is sorted |
| 3 | A | average hash lookup O(1) |
| 4 | B | merge sort fits linked lists |
| 5 | B | BFS for unweighted shortest path |
| 6 | C | threads share process address space |
| 7 | B | Round Robin uses quantum |
| 8 | B | page not in RAM = page fault |
| 9 | C | no preemption, not preemption allowed |
| 10 | B | paging uses fixed size |
| 11 | B | microcontroller integrates components |
| 12 | B | ADC is analogue to digital |
| 13 | B | watchdog handles hangs |
| 14 | C | I2C is two-wire/addressed |
| 15 | A | UART is async serial |
| 16 | B | TCP is reliable/ordered |
| 17 | B | UDP has no guarantee |
| 18 | B | routing at network layer |
| 19 | C | DNS 53 |
| 20 | B | /27 gives 32 total, 30 traditional usable |
| 21 | B | ARP IP to MAC locally |
| 22 | B | DHCP assigns IP configuration |
| 23 | C | 401 authentication needed/failed |
| 24 | B | Waterfall is sequential |
| 25 | B | Sprint |
| 26 | B | frequent merge plus automated build/test |
| 27 | A | regression checks old behaviour after change |
| 28 | B | just below/at/at/just above bounds |
| 29 | A | Selenium UI automation |
| 30 | B | severity is impact |
Pseudocode
| Q | Answer | Trace |
|---|---|---|
| 1 | B | 2+4 = 6 |
| 2 | B | 305 reverses to integer 503 |
| 3 | C | 4×3×2×1 |
| 4 | B | arithmetic swap |
| 5 | D | 1→3→9→27 |
| 6 | C | repeat body: 2→4→6 |
| 7 | B | equality branch |
| 8 | B | 10,13,16 give remainder 1 |
| 9 | D | n times log n |
| 10 | B | temporary variable swap |
| 11 | C | 9+2+7 |
| 12 | C | 5+3+1 |
| 13 | C | 2+4+6+8 |
| 14 | C | 14 mod 3 = 2 |
| 15 | B | 9 DIV 4 = 2, not >2 |
| 16 | A | update order: 0,1,3 |
| 17 | B | 20→10→5→2→1→0: five bodies |
| 18 | B | doubling loop |
| 19 | A | x is neither <5 nor >12 |
| 20 | C | positive odd n moves away from zero |
Coding review
Problem 1
Use a hash map from value to earlier index.
For each index i/value x:
- needed = T − x.
- If needed exists in map, print map[needed], i.
- Otherwise store x → i.
Time O(n) average; space O(n). Ensure equal values use distinct positions: check map before inserting current item.
Problem 2
Use prefix sums of digit values:
- prefix[0] = 0.
- prefix[i+1] = prefix[i] + digit value at i.
- Check even lengths from n down to 2.
- For each start, compare:
- firstHalf = prefix[start+half] − prefix[start]
- secondHalf = prefix[start+length] − prefix[start+half]
- First valid length is maximum.
For n <= 2000, the resulting O(n²) scan is generally appropriate. Be precise about character-to-digit conversion.
Score review
| Section | Score | Target | Main error type |
|---|---|---|---|
| Aptitude | /30 | 22+ | |
| Technical | /30 | 23+ | |
| Pseudocode | /20 | 16+ | |
| Coding | /2 | 1 complete minimum |
Copy your misses into [[10_Templates/Error_Log|Error log]] before opening another note.