Recent questions and answers in BARC

0 0 votes
1 1 answer
210
210 views
Two processes share a critical section, and a semaphore is used to ensure mutual exclusion between them.What should be the initial value of the semaphore to guarantee mut...
1 1 vote
1 1 answer
287
287 views
Consider the following statements related to the Time-To-Live (TTL) or hop-count field in IP networking.A router decrements the hop-count of a packet and accepts the pack...
1 1 vote
2 2 answers
286
286 views
Consider the different activities related to email.$\text{m1}:$ Send an email from mail client to mail server $\text{m2}:$ Download an email from mailbox server to a mail...
1 1 vote
1 1 answer
226
226 views
Consider the translation scheme shown below.$S \rightarrow T\;R$ $R \rightarrow + T \{\text{print}('+');\} R\mid \varepsilon$ $T \rightarrow$ num $\{\text{print}$(num.va...
1 1 vote
2 2 answers
265
265 views
Consider the weighted undirected graph shown in the figure.Which of the following edges can never be part of any Minimum Spanning Tree of this graph?$(C, E)$ $(B, C)$ $(F...
0 0 votes
2 2 answers
302
302 views
Consider the directed weighted graph shown in the figure. Assume that Dijkstra's shortest path algorithm is executed with node $A$ as the source. For which of the nodes d...
1 1 vote
1 1 answer
213
213 views
Consider the directed graph shown in the figure.Which of the following sequences of vertices is (are) a valid topological ordering of the given graph?$V_{2}, V_{1}, V_{3}...
1 1 vote
1 1 answer
209
209 views
Note: Similar to this GATE question was there: Consider a machine with a $2$-way set associative data cache of size $64$ Kbytes and block size $16$ bytes. The cache is ma...
1 1 vote
1 1 answer
206
206 views
Which of the following diagrams correctly represents Black Box Testing?ABCD
0 0 votes
1 1 answer
227
227 views
In a right-handed three-dimensional coordinate system, a point lies on the positive $x$-axis. The point is rotated by $90^{\circ}$ counter-clockwise about the $y$-axis.Af...
0 0 votes
1 1 answer
218
218 views
Which of the following statements about module coupling is correct?Control Coupling is better than Data CouplingContent Coupling is better than Common CouplingStamp Coupl...
0 0 votes
1 1 answer
284
284 views
Consider a Binary Search Tree (BST) containing $n$ nodes. The task is to find the median element of the BST and then delete that node from the tree.What is the time compl...
0 0 votes
1 1 answer
182
182 views
$$S \to aSa \mid bSb\mid a\mid b$$The language generated by the above grammar over the alphabet $\{a,b\}$ is the set of:all palindromes all odd length palindromes strings...
1 1 vote
1 1 answer
252
252 views
Consider the following C++ program:#include using namespace std; template void func(T x) { static int count = 0; cout << x << " " << ++count << endl; } int main()...
2 2 votes
3 3 answers
289
289 views
Consider a relation scheme $R = (A, B, C, D, E, H)$ on which the following functional dependencies hold: {$A \rightarrow B$, $BC \rightarrow D$, $E \rightarrow C$, $D \ri...
1 1 vote
2 2 answers
234
234 views
Consider the following schedule for transactions $T1, T2$ and $T3:$$$\begin{array}{|c|c|c|}\hline \textbf{T1} & \textbf{T2} & \textbf{T3} \\\hline \text{Read(X)} & \text...
1 1 vote
1 1 answer
213
213 views
Consider the word BABAST.How many distinct permutations of the letters of this word are possible such that the two occurrences of the letter $\mathbf{A}$ do not appear to...
1 1 vote
1 1 answer
286
286 views
A queue initially contains the elements (from front to rear):$$1~2~3~4~5~6$$An empty stack is also available. The following operations can be performed:Dequeue an element...
1 1 vote
1 1 answer
193
193 views
An $n$-bit ripple counter is implemented using JK flip-flops. What is the maximum number of states that the counter can have?$n$$2 n$$2^{n}$$n-1$
1 1 vote
1 1 answer
169
169 views
A counter has three state variables $A, B$, and $C$. The present state of the counter is $A B C=110$.The next-state equations of the counter are given by:$$\begin{aligned...
0 0 votes
1 1 answer
198
198 views
A similar question was asked, but all options were incorrect. It was asking for Follow(A), and the correct answer was $\{+\}$Consider the following grammar:$P\rightarrow ...
0 0 votes
1 1 answer
186
186 views
In top-down parsing, backtracking may occur when the parser is unable to determine the correct production rule to apply. Certain grammar transformations and parsing strat...
1 1 vote
2 2 answers
223
223 views
Consider the expression$$2 * 3-2 \$ 2 \$ 4-1$$The operators have the following precedence (from highest to lowest):$$->*>\$$$where$-$ denotes subtraction$*$ denotes multi...
0 0 votes
1 1 answer
229
229 views
Consider a $4 \times 4$ matrix $M$. Suppose that the following four entries of the matrix are known to be zero.For which of the following cases must the determinant of th...
0 0 votes
1 1 answer
205
205 views
Consider a system with the following parameters:TLB access time $=0\mathrm{~ns}$ Main memory access time $=100 \mathrm{~ns}$ A $3$-level page table is used No page faults...
1 1 vote
1 1 answer
238
238 views
(Similar to this GATE question was there. But SCAN algo was given. The data was different.) Consider a disk system with $100$ cylinders. The requests to access the cylind...
1 1 vote
1 1 answer
234
234 views
Consider a two-dimensional array $A[128][128]$. Each element of the array occupies $2$ bytes.The page size of the system is $4 ~\mathrm{KB} (2^{12} ~\mathrm{bytes)}$. Ass...
1 1 vote
1 1 answer
194
194 views
A network uses a Token Bucket traffic shaping mechanism.The bucket capacity is $8 \mathrm{~Mb}$ and tokens are generated at a rate of $1 \mathrm{Mb} / \mathrm{s}$. Assume...
1 1 vote
1 1 answer
222
222 views
Consider the following statements related to IPv4 and IPv6 networking.The minimum MTU size required for IPv6 is smaller than the minimum allowable MTU size in IPv4. ARP c...
0 0 votes
1 1 answer
229
229 views
Consider the following statements about routing algorithms in computer networks.In Distance Vector Routing (DVR), the count-to-infinity problem occurs when a new node ent...
1 1 vote
1 1 answer
238
238 views
A long-distance remote connection is established between two nodes. The following parameters are given:Data size $=1024 ~\mathrm{Bytes}$ Bandwidth $=1 \mathrm{~Gb} / \mat...
1 1 vote
1 1 answer
235
235 views
In the network shown in the figure, the cost of each link between routers is given. Assume that a routing algorithm is used and the routing tables have already converged....
1 1 vote
1 1 answer
254
254 views
Consider the following C++ program:#include using namespace std; void modify(int &a, int &b, int &c) { a = 2; b = 6; c = 14; } int main() { int x = 1, y =...
1 1 vote
1 1 answer
365
365 views
A football coach has a team consisting of $6$ backward players and $5$ forward players. One of the players can play both as a forward and a backward. The coach needs to s...
1 1 vote
1 1 answer
246
246 views
Let $f(n)$ and $g(n)$ be two functions. Recall that $f(n)=O(g(n))$ if there exist positive constants $c$ and $n_{0}$ such that for all $n \geq n_{0}$,$$f(n) \leq c \cdot ...
0 0 votes
1 1 answer
252
252 views
Consider the following C function:void foo (int n) { while (n < 100) { if (n = 5) { printf("Inside\n"); break; } ...
0 0 votes
1 1 answer
281
281 views
Consider the following function defined on a binary tree:int func(Node* root) { if (root == NULL) { return 0; } int l = func(root->left); int...
0 0 votes
1 1 answer
327
327 views
In the balanced binary search tree in the below figure, how many nodes will become unbalanced when a node with value $97$ is inserted?$1$ $2$ $3$ $4$
1 1 vote
1 1 answer
281
281 views
Consider inserting the following sequence of keys into an initially empty AVL tree:$$38,53,42,26,33,60,79,21,20$$During the construction of the AVL tree, rotations are pe...
0 0 votes
1 1 answer
289
289 views
Consider the following function:void f(stack S) { int x ; if (!isEmpty(S)) { x = pop(S); f(S); push(S, x); } }What operation is performed by t...
To see more, click for all the questions in this category.