Data Structures & AlgorithmsModerateTCS NQT · Infosys
A 12-hour clock shows 1:30 p.m. Ignoring seconds, what hour (1 to 12) is shown 500 minutes later?
- A. 10
- B. 9
- C. 11
- D. 13
Correct answer: B. 9
500 minutes is 8 hours and 20 minutes; 1:30 plus that is 9:50, so the hour is 9.
Practise more Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questionsArrays, Strings, Linked Lists, Stacks, Queues and Hashing: notes and key points
More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions
- Starting at x = 1, repeatedly apply x -> 3x mod 11. How many steps are needed to return to 1?
- Starting from n = 100, repeat: if n is divisible by 3, divide it by 3; otherwise subtract 1. How many steps are needed to reach 1?
- Which structure finds the k-th largest element of a data stream after each insertion with O(log k) time per element and O(k) space?
- Which method checks in O(n) whether two strings are isomorphic (a one-to-one character mapping turns one into the other)?
- Which technique counts the inversions of an array of n distinct integers in O(n log n) time?
- How many contiguous subarrays of [2, 4, 6, 3, 9] have an odd sum?