Sushant Nambiar

EduRev Computer Science Engineering (CSE)

Sushant Nambiar
EduRev Computer Science Engineering (CSE)
Content, tests & courses saved by you for accessing later. (visible to you only)

Currently preparing for

Computer Science Engineering (CSE)
Discussed Questions
Dhruba Goyal upvoted   •  Feb 20, 2025

What will be output of the following c code? ( according to GCC compiler)
#include<stdio.h>
int main()
{
signed x;
unsigned y;
x = 10 +- 10u + 10u +- 10;
y = x;
if(x==y) printf("%d %d",x,y);
else if(x!=y) printf("%u %u",x,y);
return 0;
}
  • a)
    0 0
  • b)
    65536 -10
  • c)
    0 65536
  • d)
    Compilation error
Correct answer is option 'A'. Can you explain this answer?

Arka Shah answered
Explanation: Consider on the expression:
x = 10 +- 10u + 10u +- 10;
10: It is signed integer constant.
10u: It is unsigned integer constant.
X: It is signed integer variable.
As we know operators enjoy higher precedence than binary operators. So
x = 10 + (-10u) + 10u + (-10);
= 10 + -10 + 10 + (-10);
= 0
So, Corresponding signed value of unsigned 10u is +10.

The commands, from client to server, and replies, from server to client, are sent across the control connection in ________ bit ASCII format
  • a)
    8
  • b)
    7
  • c)
    3
  • d)
    5
Correct answer is option 'B'. Can you explain this answer?

Dhruba Goyal answered  •  Jan 28, 2025
Understanding ASCII Format
ASCII (American Standard Code for Information Interchange) is a character encoding scheme used for text representation in computers and communication devices. It assigns a unique numeric value to each character.
Why 7-bit ASCII?
- ASCII originally uses a 7-bit binary number to represent characters, allowing for 128 unique symbols, which inclu
... more
Dhruba Goyal upvoted   •  Jan 04, 2025

A processor uses 2-level page tables for virtual to physical address translation. Page tables for both levels are stored in the main memory. Virtual and physical addresses are both 32 bits wide. The memory is byte addressable. For virtual to physical address translation, the 10 most significant bits of the virtual address are used as index into the first level page table while the next 10 bits are used as index into the second level page table. The 12 least significant bits of the virtual address are used as offset within the page. Assume that the page table entries in both levels of page tables are 4 bytes wide. Further, the processor has a translation look-aside buffer (TLB), with a hit rate of 96%. The TLB caches recently used virtual page numbers and the corresponding physical page numbers. The processor also has a physically addressed cache with a hit rate of 90%. Main memory access time is 10 ns, cache access time is 1 ns, and TLB access time is also 1 ns. Assuming that no page faults occur, the average time taken to access a virtual address is approximately (to the nearest 0.5 ns)
... more

The possibilities are
 TLB Hit*Cache Hit +
 TLB Hit*Cache Miss + 
 TLB Miss*Cache Hit +
 TLB Miss*Cache Miss
= 0.96*0.9*2 + 0.96*0.1*12 + 0.04*0.9*22 + 0,04*0.1*32
= 3.8
≈ 4 
Why 22 and 32? 22 is because when TLB miss occurs it takes 1ns and the for the physical address it has to go through two level page tables which are in main memory and takes 2 memory access and the that page is found in cache taking 1 ns which gives a total of 22

If the property of locality of reference is well pronounced a program:
1. The number of page faults will be more.
2. The number of page faults will be less.
3. The number of page faults will remain the same.
4. Execution will be faster.
  • a)
    1 and 2
  • b)
    2 and 4
  • c)
    3 and 4
  • d)
    None of the above
Correct answer is option 'B'. Can you explain this answer?

Dhruba Goyal answered  •  Nov 25, 2024
Understanding Locality of Reference
Locality of reference is a principle that describes the tendency of a program to access a relatively small portion of its address space at any given time. This behavior can significantly influence the performance of programs, particularly in the context of virtual memory systems.
Effects on Page Faults
- Locality of reference leads t
... more

Header size of the ICMP message is _________
  • a)
    8-bytes
  • b)
    8-bits
  • c)
    16-bytes
  • d)
    16-bits
Correct answer is option 'A'. Can you explain this answer?

Dhruba Goyal answered  •  Dec 22, 2023
Header size of the ICMP message is 8-bytes

ICMP (Internet Control Message Protocol) is a network protocol used for error reporting, diagnostic, and informational purposes in IP networks. It is primarily used by network devices to communicate error messages, such as unreachable hosts or network congestion, back to the source IP address.

The ICMP message consists of two
... more

Which of the following is a transport layer protocol?
  • a)
    stream control transmission protocol
  • b)
    internet control message protocol
  • c)
    neighbor discovery protocol
  • d)
    dynamic host configuration protocol
Correct answer is option 'A'. Can you explain this answer?

Dhruba Goyal answered  •  Dec 22, 2023
Transport Layer Protocol:
A transport layer protocol is responsible for the end-to-end communication between two hosts in a network. It ensures reliable and efficient delivery of data packets from the source to the destination. One of the widely used transport layer protocols is the Stream Control Transmission Protocol (SCTP).

Explanation:
In the given options, t
... more

Consider the schedule s1:r1(x),r2(x),R2(y),w2(y),r1(y),W1(x) determine serilazibility?

Dhruba Goyal answered  •  Dec 22, 2023
Schedule: s1:r1(x),r2(x),R2(y),w2(y),r1(y),W1(x)

Step 1: Construct a precedence graph:
- The nodes in the graph represent the transactions.
- Draw an edge from transaction Ti to Tj if there exists a conflict between Ti and Tj, where a conflict occurs when both Ti and Tj access the same data item, and at least one of them is a write operation.


r1(x)
/ \
/ \
/ \
r2(x) R2(y)
| |
| |
| |
| w2(y)
\ /
\ /
\ /
\ /
r1(y)
|
W1(x)
... more

The minimum number of cards to be dealt from an arbitrarily shuffled deck of 52 cards to guarantee that three cards are from same suit is
  • a)
    3
  • b)
    8
  • c)
    9
  • d)
    12
Correct answer is option 'C'. Can you explain this answer?

Dhruba Goyal answered  •  Dec 22, 2023
The minimum number of cards to be dealt from an arbitrarily shuffled deck of 52 cards to guarantee that three cards are from the same suit is 9.

To explain why the correct answer is option 'C', let's consider the worst-case scenario where we want to minimize the number of cards dealt while guaranteeing that three cards are from the same suit.

To achieve this, we need to dea
... more

In Go-Back-N window, when the timer of the packet times out, several packets have to be resent even some may have arrived safe. Whereas in Selective Repeat window, the sender resends ___________
  • a)
    Packet which are not lost
  • b)
    Only those packets which are lost or corrupted
  • c)
    Packet from starting
  • d)
    All the packets
Correct answer is option 'B'. Can you explain this answer?

Dhruba Goyal answered  •  Dec 22, 2023
Explanation:

In the Go-Back-N (GBN) protocol, when the timer of a packet times out, all the packets from that point onwards in the sender's window need to be retransmitted. This is because the sender does not know which packets have been successfully received by the receiver and which packets have been lost or corrupted. Therefore, it assumes that all the packets in the current w
... more

Recall that Belady’s anomaly is that the page-fault rate may increase as the number of allocated frames increases. Now, consider the following statements:
S1: Random page replacement algorithm (where a page chosen at random is replaced)
Suffers from Belady’s anomaly
S2: LRU page replacement algorithm suffers from Belady’s anomaly
Which of the following is CORRECT?
  • a)
    S1 is true, S2 is true
  • b)
    S1 is true, S2 is false
  • c)
    S1 is false, S2 is true
  • d)
    S1 is false, S2 is false
Correct answer is option 'B'. Can you explain this answer?

Dhruba Goyal answered  •  Dec 22, 2023
Was a computer scientist who proposed the Belady's anomaly in page replacement algorithms. This anomaly states that in certain cases, increasing the number of page frames in a memory can actually increase the number of page faults.

Belady's anomaly challenges the common intuition that increasing the number of page frames should always lead to a decrease in page faults. It occurs in page
... more

Size of TCP segment header ranges between
  • a)
    16 and 32 bytes
  • b)
    16 and 32 bits
  • c)
    20 and 60 bytes
  • d)
    20 and 60 bits
Correct answer is option 'C'. Can you explain this answer?

Dhruba Goyal answered  •  Dec 22, 2023
The size of a TCP segment header ranges between 20 and 60 bytes.

Explanation:

TCP Protocol:
TCP (Transmission Control Protocol) is a reliable and connection-oriented protocol used for data transmission in computer networks. It provides a reliable stream of data transfer by establishing a connection between the sender and the receiver.

TCP Segm
... more
In TCP, data is transmitted in segments. Each TCP segment consists of a header and the data being transmitted. The header contains control information necessary for the proper delivery and sequencing of the data.

Size of TCP Segment Header:
The size of the TCP segment header is variable and can range from 20 to 60 bytes. The actual size depends on various factors such as the presence of optional fields, such as TCP options, and the size of the data being transmitted.

Factors affecting the size of TCP segment header:
1. Minimum Size: The minimum size of the TCP segment header is 20 bytes, which includes the mandatory fields such as source and destination port numbers, sequence number, acknowledgment number, control flags, and checksum.

2. Optional Fields: TCP allows for the inclusion of optional fields, known as TCP options, in the segment header. These options can include additional control information or parameters required for specific purposes. The presence of TCP options increases the size of the segment header.

3. Data Size: The size of the data being transmitted in the TCP segment can also affect the size of the segment header. If the data size is small, the segment header will be larger in proportion to the data. Conversely, if the data size is large, the segment header will be relatively smaller.

Conclusion:
In conclusion, the size of the TCP segment header can range from 20 to 60 bytes, depending on the presence of optional fields (TCP options) and the size of the data being transmitted. The minimum size of the segment header is 20 bytes, while the maximum size is 60 bytes.

Let R (ABCDEFGH) be a relation schema and F be the set of dependencies F = {A → B, ABCD → E, EF → G, EF → H and ACDF →EG}. The minimal cover of a set of functional dependencies is
  • a)
    A → B, ACD → E, EF → G, EF → H and ACDF → G
  • b)
    A → B, ACD → E, EF → G, EF → H and ACDF → E
  • c)
    A → B, ABCD → E, EF → H and EF → G
  • d)
    A → B, ACD → E, EF → G, and EF → H
Correct answer is option 'D'. Can you explain this answer?

Dhruba Goyal answered  •  Nov 03, 2023
-> B, B -> C, C -> D, D -> E, E -> F, F -> G, G -> H}.

The closure of a set of attributes X under the set of functional dependencies F, denoted as X+, is the set of all attributes that are functionally determined by X based on the given functional dependencies.

To find the closure of a set of attributes under a set of functional dependencies, we can use Armstrong's axioms, wh
... more
Dhruba Goyal asked   •  Sep 27, 2022

Choose the correct verb to fill in the blank below:
Let us ________.
  • a)
    Introvert
  • b)
    alternate
  • c)
    atheist
  • d)
    altruist
Correct answer is option 'B'. Can you explain this answer?

Akash Rane answered
Answer:

Explanation:
The correct verb to fill in the blank is "alternate" (option B).

Meaning of the options:
1. Introvert: This is a noun that refers to a person who is predominantly concerned with their own thoughts and feelings, rather than with external things.
2. Alternate: This is a verb that means to take turns or to occur in turns
... more

Dhruba Goyal asked   •  Jun 30, 2021

A CPU scheduling algorithm determines an order for the execution of its scheduled processes. Given 'n' processes to be scheduled on one processor, how many possible different schedules are there?
  • a)
    n
  • b)
    n2
  • c)
    n!
  • d)
    2n
Correct answer is option 'C'. Can you explain this answer?

Yash Patel answered
For 'n' processes to be scheduled on one processor, there can be n! different schedules possible. Example: Suppose an OS has 4 processes to schedule P1, P2, P3 and P4. For scheduling the first process, it has 4 choices, then from the remaining three processes it can take 3 choices, and so on. So, total schedules possible are 4*3*2*1 = 4!
Option (C) is correct.

Dhruba Goyal asked   •  Jun 16, 2021

Which of the following statements is true for Branch - and - Bound search?
  • a)
    Underestimates of remaining distance may cause deviation from optimal path.
  • b)
    Overestimates can't cause right path to be overlooked.
  • c)
    Dynamic programming principle can be used to discard redundant partial paths.
  • d)
    All of the above
Correct answer is option 'C'. Can you explain this answer?

Ravi Singh answered
Branch and bound is a type of problem solving technique which is used to solve a combinatorial optimization problems. It is helps in solving them faster compare to other technique.it divides a problem into two subproblem. For branch and bound search Dynamic programming principle can be used to discard redundant partial paths. Option (C) is correct.

Dhruba Goyal asked   •  Jan 01, 2021

A team of miner planned to mine 1800 tonnes in a certain number of days.Due to some difficulties in one third of the planned days, the team was able to achieve an output of 20 tons of ore less than the planned output.To make up for this, the team overachieved for the rest of the days by 20 tons.The end result for this that they completed the one day ahead of time.How many tone of ore did the team initially plan to ore per day?
  • a)
    50
  • b)
    100
  • c)
    150
  • d)
    200
  • e)
    250
Correct answer is option 'B'. Can you explain this answer?

Naina Shah answered
Let us assume the no. of days as ‘3d’ and the output per day as ‘x’
Then, 3d*x = 1800 … (1) 
For the first ‘d’ days, the output was (x - 20).
For the next ‘2d - 1’ days, the output was (x + 20). 
=> d(x-20) + (2d - 1) (x + 20) = 1800
=> dx – 20d + 2dx + 40d – x – 20 = 3dx {Replacing 1800 with 3dx from equation (1)}
=> 20d = x + 20
=> d = (x + 20)/20 … (2) 
=> 3 [(x + 20)/20] x = 1800
=> x2 + 20x = (1800/3) *20
=> x2 + 20x – 12000 = 0
=> (x + 120) (x - 100) = 0
=> x = -120 or 100 
Since x is the output it cannot be negative.
So, the initial planned output is 100 tonnes. Thus, Option B

Dhruba Goyal asked   •  Dec 14, 2019

The following transition diagram is for:

(i) >
(ii) >=
  • a)
    Only (i)
  • b)
    Only (ii)
  • c)
    Neither (i) nor (ii)
  • d)
    Both (i) and (ii)
Correct answer is option 'D'. Can you explain this answer?

Atharva Mehra answered
The given transition diagram is for the pattern > = and >, Its start state is sate 0. In state 0 we read the next input character. The edge labeled > from state 0 is to be followed to state 6 if this input character is >. Otherwise, we have failed to recognize either > or <=.
On reaching state 6, we read the next input character. The edge labeled = from state 6 is to be followed to state 7 if the input character is an = otherwise, the edge labeled other indicates that go to state 8. The double circle on state 7 indicates that it is accepting state, a state in which the token >= has been found.

Dhruba Goyal asked   •  Dec 07, 2019

The 2’s complement representation of the decimal value - 15 is
  • a)
    1111
  • b)
    11111
  • c)
    111111
  • d)
    10001
Correct answer is option 'D'. Can you explain this answer?

The 2’s complement of negative numbers are represented as the binary number that when added to a positive number of the same magnitude equals zero 
+15 = 0 1 1 1 1
The 2’s complement representation of the decimal value -15 is
-15 in 2’s complement = 10001

Dhruba Goyal asked   •  Nov 25, 2019

Consider the grammar given below:
The grammar is :
(i) LL(1)
(ii)LR(0)
(iii)LR(1)
  • a)
    (i) & (iii) are correct
  • b)
    (i) & (ii) are correct
  • c)
    All are correct
  • d)
    All are incorrect
Correct answer is option 'D'. Can you explain this answer?

Vaishnavi Kaur answered
The Grammar is ambiguous. For a string “abab” two derivations are possible and no ambiguous grammar can be LR.
Derivation 1 : S → AS → SAS → ASAS → aSAS → abAS → abaS → abab
Derivation 2 : S → AS → aS → aAS → aSAS → abAS → abaS → abab

Fetching relevant content for you