In C, after `#define SQR(x) x*x`, what does `SQR(2+3)` evaluate to?
Computer Programming
Question · Easy
T-C-P vs U-D-P: the rap battle
Short
Which C storage class gives a local variable lifetime for the entire program while restricting its name to the block?
What is printed? `int x = 5; int *p = &x; *p = 12; printf("%d", x);`
Government Exam Prep Podcast
Listen on Spotify
Podcast
In object-oriented programming, hiding an object’s representation and exposing only a controlled interface is called:
The size of a C `union` with members `char c; int i; double d;` is determined by:
Question · Medium
In C++, a virtual function is resolved at:
A C function should return a pointer to a newly allocated string. Which approach is defined and correct?
C++ function templates are instantiated:
Question · Hard
The hexadecimal value `0x2A` equals which unsigned decimal integer?
Digital System
Which gate is functionally complete by itself (a universal gate)?
For a 1-bit full adder, the carry-out is 1 if and only if:
The combination S=1, R=1 on a NOR-based SR latch is:
A 4-to-1 multiplexer requires how many select lines?
Compared with TTL, a static CMOS gate family is primarily chosen because it:
Minimize f(A,B,C) = Σm(0,2,4,6) with a 3-variable K-map. The minimal SOP is:
In an 8-bit two’s-complement representation, the value −5 is:
If |A| = 4, the power set of A has how many elements?
Discrete Mathematics
A relation R on a set is an equivalence relation if it is:
How many ways can a 5-person committee be chosen from 8 people if order does not matter?
A connected undirected graph has an Euler circuit if and only if:
The recurrence T(n) = 2T(n/2) + n with T(1)=Θ(1), by the Master Theorem, is:
∀x P(x) logically implies ∃x P(x) when the universe of discourse is:
One Newton–Raphson iteration for f(x)=x^2−4 starting at x0=3 yields x1 equal to:
Numerical Analysis
Trapezoidal rule on [a,b] with n equal panels of width h=(b−a)/n approximates ∫y dx as:
Gaussian elimination on a nonsingular n×n system, without pivoting analysis, has leading-term arithmetic complexity:
Lagrange interpolation through n+1 distinct nodes produces a unique polynomial of degree at most:
Simpson’s 1/3 rule on [0,2] for f(x)=x^2 with h=1 (nodes x=0,1,2) gives the approximation:
Which data structure is LIFO and is the natural implementation of recursion and of converting infix to postfix (Polish) form?
Data Structures
Inserting a node at the head of a singly linked list, given only the head pointer, takes:
In-order traversal of a binary search tree visits keys in:
In a 0-based array binary heap, the parent of the node at index i (i>0) is at index:
The postfix (reverse Polish) form of the infix expression (A+B)*C is:
Which sorting algorithm is stable and has worst-case time Θ(n log n) using Θ(n) extra memory?
Topological sorting of a directed graph is possible if and only if the graph is:
Huffman coding for symbols A:5, B:2, C:3, D:1 (frequencies) assigns a shortest codeword to:
Open addressing in a hash table resolves a collision by:
The Intel 8086 has a 20-bit address bus, so real-mode physical memory is:
Microprocessor Interfacing
On the 8086, physical address is computed as:
The Intel 8259A is a:
MOV AX, [BX+SI+8] on the 8086 is an example of which addressing mode?
If CS = 1000h and IP = 023Ah, the 8086 physical fetch address is:
The Intel 8237 is used in 8086-era PCs as a:
In a 5-stage pipeline, an instruction that needs a result still being written by the previous instruction exhibits a:
Computer Organization
Write-through cache policy means:
Microprogrammed control implements the instruction decoder as:
In a direct-mapped cache, a given memory block can sit in:
Loading more…