| Section | Duration | Type | Details |
|---|---|---|---|
| 1 | 20 mins | Coding | 1 Question |
| 2 | 30 mins | Coding | 1 Question |
| 3 | 30 mins | Coding | 1 Question |
| 4 | 20 mins | Technical MCQs | 10 Questions |
| 5 | 20 mins | Aptitude MCQs | 10 Questions |
You are given an array of packet IDs, each represented as an integer. The transmission pattern of each packet ID is given by its binary representation, where each set bit indicates a point of significant data transfer.
The packetSpan of a packet is defined as the maximum gap between any two consecutive set bits in its binary representation.
Task:
packetIds of size n and an integer K, sort the packets:
packetSpan.packetSpan, sort them in decreasing order of their packet ID.packetSpan.Input: packetIds = [38, 23, 9], K = 2
Binary Representations:
- 38 -> 100110 (packetSpan = 2)
- 23 -> 10111 (packetSpan = 1)
- 9 -> 1001 (packetSpan = 2)
Output: [38, 9]The department of mathematics offers n courses, where the difficulty of the i-th course is represented by an integer difficulty[i].
A course structure can be created as follows:
A well-organized course structure satisfies:
Task:
n courses and an array difficulty, find the number of well-organized course structures that can be created.Input: n = 4, difficulty = [1,2,1,2]
Valid well-organized structures: [1], [2], [1,2], [1,1,2], [1,2,2], [1,2,1], [1,2]
Output: 71 <= n <= 2 * 10^5
1 <= difficulty[i] <= 10^9You are provided with a data package of size n × m, represented by a matrix packages[p][q], where:
0 or 1).0 represents a security breach.Latency Definition:
(p, q) to unit (r, s) is given by:
|p - r| + |q - s|Task:
(0,0) to (n-1,m-1) that do not pass through any breach units.10^9 + 7.Input:
packages = [[1,0],
[0,1]]
n = 2, m = 2, latencyThreshold = 0
Output: 11 <= n, m <= 1100
0 <= latencyThreshold <= 700
0 <= packages[i][j] <= 1