Ruankao Software Designer (Intermediate) study materials
Ruankao Software Designer (Intermediate) study resources

Ruankao Software Designer (Intermediate) practice questions

One question at a time. Build your Ruankao Software Designer (Intermediate) understanding.

First 50 of 190 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.

Continue in the practice tool above to load more questions, 50 at a time.

Question 1Computer architecture, logic and data representation

In 8-bit two's-complement representation used on 软考 architecture items, which bit pattern encodes decimal −5?

  1. 11111011 Correct answer.
  2. 10000101
  3. 11111010
  4. 00000101

Explanation

Write +5 as 00000101, invert the bits to 11111010, then add 1 to obtain 11111011. That is the 8-bit two's-complement encoding of −5. 软考 morning papers treat this convert-invert-add-one procedure as 掌握-level data representation.

Question 2Computer architecture, logic and data representation

Convert unsigned decimal 45 to binary. Which bit string is correct?

  1. 101110
  2. 101101 Correct answer.
  3. 110101
  4. 101011

Explanation

45 = 32 + 8 + 4 + 1, so the powers of two that are set are 2^5, 2^3, 2^2, and 2^0, giving 101101. The official Software Designer 考试说明 lists data representation and arithmetic as 掌握.

Question 3Computer architecture, logic and data representation

What is the Hamming distance between the 7-bit strings 1011001 and 1001101?

  1. 1
  2. 3
  3. 2 Correct answer.
  4. 4

Explanation

Hamming distance counts positions where the bits differ. Aligning 1011001 and 1001101, the third and fifth bits differ and the rest match, so the distance is 2. 软考 hardware items use Hamming distance when discussing error-detecting codes.

Question 4Computer architecture, logic and data representation

A 7-bit data word 1101011 is to be sent with a single odd-parity bit. What value should that parity bit take?

  1. 1
  2. Cannot be determined from the data bits alone
  3. 2
  4. 0 Correct answer.

Explanation

Odd parity makes the total number of 1-bits, including the parity bit, odd. 1101011 already contains five 1-bits (odd), so the parity bit must be 0. Even parity would have required 1 instead.

Question 5Computer architecture, logic and data representation

A 5-stage instruction pipeline has a 2 ns clock. One hundred instructions execute with no stalls. Relative to a non-pipelined CPU that spends 10 ns on each instruction, what is the speedup (serial time / pipelined time)?

  1. About 4.81 Correct answer.
  2. Exactly 5.00
  3. Exactly 4.00
  4. About 2.08

Explanation

Non-pipelined time is 100 × 5 × 2 ns = 1000 ns. Pipelined time is (5 + 99) × 2 ns = 208 ns. Speedup = 1000/208 ≈ 4.81. Theoretical peak speedup equals the stage count only as n → ∞ with no hazards. 软考 architecture items routinely ask this throughput/speedup pair.

Question 6Computer architecture, logic and data representation

A direct-mapped cache uses 16-bit addresses, 64 blocks, and 16-byte blocks. How many tag bits are there?

  1. 8
  2. 6 Correct answer.
  3. 4
  4. 10

Explanation

Block offset needs 4 bits because 16 = 2^4. Index needs 6 bits because 64 = 2^6. Tag bits are 16 − 4 − 6 = 6. Direct-mapped caches on 软考 papers split the address as tag | index | offset.

Question 7Computer architecture, logic and data representation

In 软考 computer-architecture teaching, which property is typical of RISC relative to classic CISC?

  1. Variable-length CISC-style microcode as RISC's defining control method
  2. Memory-to-memory ALU operations as the default RISC instruction form
  3. A load/store architecture with simpler instructions and more general-purpose registers Correct answer.
  4. A requirement that RISC CPUs use only microprogrammed control

Explanation

RISC textbooks contrast a load/store ISA, simpler operations, and a larger register file with CISC's more complex memory-to-memory operations and microcode. The Software Designer 考试说明 requires mastering architecture and component principles, including this CISC/RISC contrast.

Question 8Computer architecture, logic and data representation

A disk controller must copy a large buffer into memory with as little CPU instruction traffic as possible. Which I/O method matches that goal?

  1. The CPU executes a load/store for every word of the buffer
  2. An interrupt service routine copies the entire block with no DMA hardware
  3. Programmed I/O is always faster than DMA for bulk disk transfers
  4. DMA lets a controller move the block while the CPU is only set up and interrupted at completion Correct answer.

Explanation

Direct memory access (DMA) programs a controller to transfer a block between device and memory. The CPU is involved mainly for setup and a completion interrupt, which is the 软考 contrast with programmed I/O and interrupt-driven word-by-word copies.

Question 9Computer architecture, logic and data representation

Three independent components are placed in series. Each has reliability 0.9. What is the system reliability?

  1. 0.729 Correct answer.
  2. 0.9
  3. 0.999
  4. 2.7

Explanation

Series reliability multiplies component reliabilities: 0.9 × 0.9 × 0.9 = 0.729. Parallel would use 1 − (1 − R)^n. 软考 architecture/reliability items use this series-parallel product rule.

Question 10Computer architecture, logic and data representation

An undirected graph has 6 vertices, each of degree 3. How many edges does it have?

  1. 18
  2. 9 Correct answer.
  3. 6
  4. 3

Explanation

The handshaking lemma says the sum of degrees equals twice the number of edges. 6 × 3 = 18, so there are 9 edges. This is a standard discrete-math item under the Software Designer 考试说明's 掌握 discrete-math requirement.

Question 11Computer architecture, logic and data representation

In propositional logic, which formula is equivalent to P → Q?

  1. P ∨ ¬Q
  2. ¬P ∧ Q
  3. ¬P ∨ Q Correct answer.
  4. P ∧ ¬Q

Explanation

Implication P → Q is false only when P is true and Q is false, which is the same truth table as ¬P ∨ Q. Discrete math on 软件设计师 papers treats this equivalence as basic.

Question 12Computer architecture, logic and data representation

Which statement correctly describes a write-back cache?

  1. Every store writes memory immediately, and dirty bits are unused
  2. A missed store never allocates a cache block
  3. Memory is updated on every hit before the CPU continues
  4. Memory is typically updated when a dirty block is replaced, not on every store Correct answer.

Explanation

Write-back (copy-back) marks a cached line dirty and writes it to memory when the line is evicted (or flushed). Write-through updates memory on each store. 软考 storage-hierarchy items contrast these two policies.

Question 13Computer architecture, logic and data representation

Amdahl's law: a function that is 40% of runtime is sped up by 5× and the rest is unchanged. What is the overall speedup?

  1. About 1.47 Correct answer.
  2. 5.00
  3. 2.00
  4. 3.00

Explanation

Overall speedup = 1 / ((1 − f) + f/s) = 1 / (0.6 + 0.4/5) = 1 / 0.68 ≈ 1.47. The unaccelerated 60% caps the gain. This is the standard architecture performance formula used in 软考 numerical items.

Question 14Computer architecture, logic and data representation

In 8-bit two's complement, 01111111 is added to 00000001. What happens?

  1. No overflow; the mathematical result 128 is a valid 8-bit two's-complement value
  2. Overflow occurs, and the stored pattern 10000000 represents −128 Correct answer.
  3. The sum stays 01111111 and overflow is flagged without changing bits
  4. The sum wraps to 00000000 without overflow

Explanation

01111111 is +127. Adding 1 yields 10000000, which is −128 in 8-bit two's complement. Two's-complement overflow occurs when adding two positives yields a negative (sign bits of the addends match each other but not the sum). The 8-bit signed range is −128…127, so +128 cannot be represented.

Question 15Computer architecture, logic and data representation

By Cayley's formula, how many distinct spanning trees does the complete graph K4 have?

  1. 4
  2. 6
  3. 16 Correct answer.
  4. 24

Explanation

Cayley's formula counts spanning trees of Kn as n^{n−2}. For n = 4, 4^{2} = 16. Discrete math on 软件设计师 papers uses spanning trees and complete graphs at this 掌握 level.

Question 16Operating systems, translation and concurrency

A process has issued a disk read and cannot run until the I/O completes. In the standard five-state model, which state is it in?

  1. Running
  2. Ready
  3. New
  4. Waiting (blocked) Correct answer.

Explanation

A process that is not runnable because it awaits an event (here, I/O completion) is waiting/blocked. Ready means it could run if the CPU were assigned; running means it currently has the CPU. OS fundamentals are 掌握 on the Software Designer 考试说明.

Question 17Operating systems, translation and concurrency

Which CPU scheduling discipline is preemptive by design because a running job is interrupted when its time quantum expires?

  1. Round-robin Correct answer.
  2. FCFS (first-come, first-served) with no quantum
  3. Non-preemptive SJF that always runs a chosen job to completion
  4. FCFS with convoy effect treated as preemption

Explanation

Round-robin assigns a time slice and preempts the running process when the quantum expires, placing it back on the ready queue. Plain FCFS and non-preemptive SJF run the selected job until it waits or finishes.

Question 18Operating systems, translation and concurrency

Which compiler phase turns a character stream into tokens such as identifiers and keywords?

  1. Syntax analysis (parsing)
  2. Lexical analysis (scanning) Correct answer.
  3. Code generation
  4. Linking

Explanation

Lexical analysis (扫描) groups characters into tokens. Syntax analysis consumes those tokens to build a parse tree. The Software Designer 考试说明 requires language fundamentals and 了解-level compiler knowledge.

Question 19Operating systems, translation and concurrency

Which of the following is NOT one of the four Coffman conditions required for deadlock?

  1. Mutual exclusion
  2. Hold and wait
  3. Aging of waiting processes Correct answer.
  4. Circular wait

Explanation

The Coffman conditions are mutual exclusion, hold and wait, no preemption, and circular wait. Aging is a scheduling technique against starvation, not a deadlock condition. 软考 OS items expect this four-condition list.

Question 20Operating systems, translation and concurrency

On a counting semaphore S that is currently 0, what does a P (wait) operation do?

  1. Increment S and immediately continue
  2. Set S to 1 without blocking
  3. Release every waiter on S
  4. Block the caller until a later V (signal) raises S Correct answer.

Explanation

P(S) tries to decrement S. If S is 0, the caller waits until some other process executes V(S). V increments S and may wake a waiter. This is the classic PV pairing taught in 软考 OS chapters.

Question 21Operating systems, translation and concurrency

Belady's anomaly - more page frames can increase page faults - is classically associated with which replacement policy?

  1. FIFO Correct answer.
  2. Optimal (MIN/OPT)
  3. LRU
  4. Clock/second-chance when it exactly tracks LRU

Explanation

FIFO can exhibit Belady's anomaly. Stack algorithms such as LRU and the optimal MIN policy do not. 软考 virtual-memory questions use this as a FIFO warning.

Question 22Operating systems, translation and concurrency

In standard C, how are ordinary function arguments such as int n passed?

  1. By reference, so the callee's assignment to n updates the caller's variable
  2. By value, so the callee receives a copy and assignments to n do not update the caller Correct answer.
  3. By name (textual substitution) as in Algol-60 call-by-name
  4. By macro expansion before parsing

Explanation

C uses call-by-value for scalar arguments. To modify the caller's object, pass a pointer (the pointer itself is still passed by value). Arrays decay to pointers, which is why callees can mutate array elements. Language-parameter passing is a 软考 compiler/language staple.

Question 23Operating systems, translation and concurrency

The language of balanced nested parentheses { ε, (), (()), (()()), … } is not regular. Which formalism is appropriate?

  1. A regular expression with only concatenation and star
  2. A deterministic finite automaton with a fixed number of states
  3. A context-free grammar (for example, S → (S)S | ε) Correct answer.
  4. A finite set of keywords with no recursion

Explanation

Unbounded nesting needs a stack, which regular languages lack (pumping lemma). A context-free grammar such as S → (S)S | ε generates the Dyck language. Compiler 了解 items on 软件设计师 contrast regular tokens with context-free syntax.

Question 24Operating systems, translation and concurrency

A CPU references a virtual address whose page is not currently in physical memory. What occurs first?

  1. The MMU silently ignores the reference
  2. The compiler rewrites the program to use only RAM
  3. The process is terminated without a chance to fault-handle
  4. A page fault trap occurs so the OS can load the missing page Correct answer.

Explanation

A missing page causes a page fault. The OS finds a frame, loads the page from backing store if needed, updates the page table, and restarts the instruction. Virtual memory is core OS material on 软考.

Question 25Operating systems, translation and concurrency

Which statement best distinguishes an interpreter from a compiler?

  1. An interpreter executes source (or an intermediate form) incrementally at run time; a compiler translates a unit into target code ahead of execution Correct answer.
  2. Interpreters always produce a standalone native executable and compilers never do
  3. Compilers cannot perform type checking, while interpreters always do
  4. Linking is required for interpreters and forbidden for compilers

Explanation

A compiler translates a compilation unit into object/target code before the program runs. An interpreter analyzes and executes incrementally. Hybrid VMs (Java bytecode) still fit this contrast at the 了解 compiler level of the 考试说明.

Question 26Operating systems, translation and concurrency

Banker's algorithm snapshot: Available = (2, 1). Remaining needs are P0 (1, 0), P1 (2, 2), P2 (0, 1). Which process can be given its remaining need immediately as the first step of a safe sequence?

  1. P1, because (2, 2) is always allocatable
  2. P0, because (1, 0) ≤ (2, 1) Correct answer.
  3. Both P0 and P1, because any need may be granted
  4. None; the state is already deadlocked

Explanation

A process can run in the banker's test only if its need vector is ≤ Available. P0's (1, 0) ≤ (2, 1); P1's (2, 2) is not, because 2 ≰ 1 in the second resource. After P0 finishes and returns its allocation the Available vector grows and later processes can run. This is the standard deadlock-avoidance calculation on 软考 OS items.

Question 27Operating systems, translation and concurrency

A recursive-descent parser is being written by hand. Why must a left-recursive production such as E → E + T | T be rewritten?

  1. Left recursion is required for recursive-descent parsers to terminate
  2. LL(1) predictive parsers prefer left-recursive grammars
  3. Left recursion causes the recursive-descent procedure to call itself indefinitely before consuming a token Correct answer.
  4. Bottom-up parsers cannot handle left recursion, but recursive descent can

Explanation

A recursive-descent routine for a left-recursive production immediately invokes itself without consuming input, so it does not terminate. Grammars are left-factored and left-recursion is eliminated for LL/recursive-descent. Bottom-up parsers (LR) handle left recursion naturally - the opposite of this trap.

Question 28Computational Thinking and Problem Solving

Which abstract data type pops the most recently pushed element first?

  1. FIFO queue
  2. Priority queue ordered only by key, never by insertion time
  3. Hash table
  4. Stack (LIFO) Correct answer.

Explanation

A stack is last-in, first-out: push/pop at the same end. Queues are FIFO. 熟练掌握 stacks is explicit in the Software Designer 考试说明's data-structure requirement.

Question 29Computational Thinking and Problem Solving

A printer spooler should print jobs in the order they arrived. Which structure models that policy?

  1. Queue (FIFO) Correct answer.
  2. Stack (LIFO)
  3. Binary max-heap ordered by job size only
  4. Undirected graph

Explanation

Arrival order is first-in, first-out, which is a queue. A stack would print the newest job first. Heaps serve priority, not arrival unless arrival is encoded as the key.

Question 30Computational Thinking and Problem Solving

Binary search on an array of n comparable keys has which requirement and typical time?

  1. The array may be unsorted; worst-case time is O(n log n)
  2. The array must be sorted; the search is O(log n) comparisons Correct answer.
  3. The array must be a linked list; the search is O(1)
  4. The array must contain only duplicates; the search is O(n^2)

Explanation

Binary search repeatedly halves a sorted random-access sequence, using Θ(log n) comparisons. On an unsorted array the algorithm is incorrect. Linked lists do not give O(1) midpoint access, so the same recurrence does not apply.

Question 31Computational Thinking and Problem Solving

In a contiguous array of n elements, what is the time to read the element at a known index i?

  1. O(n)
  2. O(log n)
  3. O(1) Correct answer.
  4. O(n log n)

Explanation

Array indexing computes address = base + i × element_size in constant time. Sequential search is O(n); tree lookup is typically O(log n). 软考 contrasts sequential tables with linked structures on this point.

Question 32Computational Thinking and Problem Solving

A binary tree has n nodes. What is the maximum height if height counts edges on the longest root-to-leaf path?

  1. ⌊log2 n⌋
  2. n
  3. ⌈n/2⌉
  4. n − 1 Correct answer.

Explanation

A chain (skewed tree) has n nodes and n − 1 edges from root to the only leaf, so maximum height is n − 1. The minimum height is ⌊log2 n⌋ for a complete/perfect shape. 软考 tree items distinguish these two extremes.

Question 33Computational Thinking and Problem Solving

An inorder traversal of a binary search tree with distinct keys yields which sequence?

  1. The keys in sorted (nondecreasing) order Correct answer.
  2. The keys in the order they were inserted
  3. A level-order (breadth-first) listing
  4. The reverse of a preorder listing in every tree

Explanation

BST inorder is left–root–right, which visits keys in sorted order when left < root < right. Insertion order is recovered only for special trees (for example, always inserting in sorted order yields a chain). This is a high-frequency 软考 BST fact.

Question 34Computational Thinking and Problem Solving

What are the average-case and worst-case time complexities of quicksort on n keys (standard implementation, unbalanced partitions possible)?

  1. Average O(n), worst O(n log n)
  2. Average O(n log n), worst O(n^2) Correct answer.
  3. Average O(n^2), worst O(n log n)
  4. Average O(log n), worst O(n)

Explanation

With balanced partitions, the recurrence is T(n)=2T(n/2)+Θ(n) → Θ(n log n). Already-sorted input with a naive first/last pivot yields T(n)=T(n−1)+Θ(n) → Θ(n^2). 软考 sorting tables list this pair next to mergesort's guaranteed n log n.

Question 35Computational Thinking and Problem Solving

In a hash table, separate chaining resolves a collision by which method?

  1. Rehashing the entire table on every collision
  2. Storing only one key per table and rejecting extras
  3. Placing collided keys in a list (or chain) at that slot Correct answer.
  4. Deleting the previous key at that slot

Explanation

Separate chaining stores a linked list (or other bucket) of keys that hash to the same index. Open addressing instead probes other slots. Both appear in 软考 hashing items.

Question 36Computational Thinking and Problem Solving

Dijkstra's single-source shortest-path algorithm, in its standard non-negative form, requires which condition on edge weights?

  1. All weights must be negative
  2. The graph must be undirected and unweighted
  3. Negative weights are allowed if there is no negative cycle
  4. Edge weights must be non-negative Correct answer.

Explanation

Classic Dijkstra greedily finalizes the closest unsettled vertex and assumes adding an edge cannot cheapen a finalized distance, which fails with negative weights. Bellman–Ford handles negatives (no negative cycle). 软考 graph algorithms test this restriction.

Question 37Computational Thinking and Problem Solving

On an unweighted graph, which algorithm yields a shortest path in number of edges from a source to every reachable vertex?

  1. Breadth-first search (BFS) Correct answer.
  2. Depth-first search (DFS) finishing times
  3. Preorder traversal of an arbitrary spanning tree
  4. Prim's MST algorithm

Explanation

BFS explores by distance from the source, so the first time a vertex is reached is a minimum-edge path. DFS does not guarantee shortest paths. Prim computes a minimum spanning tree, not single-source unweighted distances.

Question 38Computational Thinking and Problem Solving

In a max-heap stored as a complete binary tree, which heap-order property holds?

  1. Every parent is less than or equal to its children
  2. Every parent is greater than or equal to its children Correct answer.
  3. Inorder traversal is always sorted
  4. The tree must be a BST as well as a heap

Explanation

A max-heap requires each parent to be ≥ its children, so the maximum sits at the root. A min-heap reverses the inequality. Heaps are complete trees but not binary search trees; inorder is not sorted in general.

Question 39Computational Thinking and Problem Solving

A perfect binary tree has height 3, counting height as the number of edges on the longest root-to-leaf path. How many nodes does it contain?

  1. 7
  2. 8
  3. 15 Correct answer.
  4. 16

Explanation

Height 3 means levels 0..3, each full: 1+2+4+8 = 15 = 2^{4} − 1. Height 2 would be 7 nodes. 软考 tree counting items hinge on whether height counts edges or levels - here edges are specified.

Question 40Computational Thinking and Problem Solving

Which pair correctly describes standard top-down mergesort on n keys?

  1. Time O(n^2) expected, extra memory O(1)
  2. Time O(n), extra memory O(n log n)
  3. Time O(n^2) worst case, extra memory O(n)
  4. Time Θ(n log n) in the worst case, extra memory Θ(n) for the merge buffer Correct answer.

Explanation

Mergesort always splits in half and merges in linear time, so T(n)=2T(n/2)+Θ(n) → Θ(n log n) even in the worst case. The standard merge uses a Θ(n) auxiliary array. That guaranteed bound is why 软考 contrasts it with quicksort's n^2 worst case.

Question 41Computational Thinking and Problem Solving

Sequential search looks for a key that is equally likely to sit in any of 100 array positions and is known to be present. What is the expected number of comparisons?

  1. 50.5 Correct answer.
  2. 100
  3. 7
  4. 1

Explanation

If the key is equally likely in position 1…n, the expected probes for a successful sequential search are (1+2+…+n)/n = (n+1)/2. For n = 100 that is 50.5. Unsuccessful search on a full scan is n. 软考 algorithm items expect this average-case count.

Question 42Computational Thinking and Problem Solving

Topological sort of a directed graph is possible if and only if the graph is which kind?

  1. An undirected cycle
  2. A directed acyclic graph (DAG) Correct answer.
  3. A complete undirected graph
  4. A graph that contains at least one directed cycle

Explanation

A topological order exists exactly for DAGs: every directed edge goes from an earlier vertex to a later one. A directed cycle makes that impossible. 软考 graph questions pair this with AOV networks.

Question 43Computational Thinking and Problem Solving

Huffman coding uses frequencies A:45, B:13, C:12, D:16, E:9, F:5 (the classic textbook mix). What is the Huffman code length of A?

  1. 3 bits
  2. 2 bits
  3. 1 bit Correct answer.
  4. 4 bits

Explanation

Huffman always merges the two lightest nodes. F(5)+E(9)=14, then C(12)+B(13)=25, then 14+D(16)=30, then 25+30=55, then A(45)+55=100. A is a direct child of the root, so its code has length 1. 软考 algorithm papers use this greedy construction, including on 软件设计 fill-ins.

Question 44Computational Thinking and Problem Solving

Keys 4, 2, 6, 1, 3, 5, 7 are inserted in that order into an empty binary search tree. Counting height as edges on the longest root-to-leaf path, what is the height?

  1. 0
  2. 1
  3. 6
  4. 2 Correct answer.

Explanation

4 becomes the root; 2 and 6 are its children; 1 and 3 hang under 2; 5 and 7 hang under 6. The longest path has two edges (for example 4–2–1). Insertion in sorted order 1,2,3,… would have produced height 6 instead. 软考 BST items often contrast balanced versus skewed insertion.

Question 45Computational Thinking and Problem Solving

An undirected graph with 5 vertices and 6 edges is stored in a 0-1 adjacency matrix (no self-loops). How many 1-entries does the matrix contain?

  1. 12 Correct answer.
  2. 6
  3. 5
  4. 25

Explanation

Each undirected edge {u,v} sets both A[u][v] and A[v][u], so 6 edges produce 12 ones. The matrix has 25 cells, most of them 0. 软考 storage questions contrast adjacency matrices with adjacency lists.

Question 46Computational Thinking and Problem Solving

By the Master Theorem, T(n) = 2T(n/2) + n with T(1) constant solves to which tight class?

  1. Θ(n)
  2. Θ(n log n) Correct answer.
  3. Θ(n^2)
  4. Θ(log n)

Explanation

Here a=2, b=2, f(n)=n, and log_b a = 1, so f(n) = Θ(n^{log_b a}). That is Master case 2: T(n) = Θ(n log n). The same recurrence describes mergesort and the linear-work divide-and-conquer pattern used on 软考 algorithm items.

Question 47Computational Thinking and Problem Solving

A connected undirected graph has 8 vertices. What is the smallest possible number of edges?

  1. 8
  2. 28
  3. 7 Correct answer.
  4. 16

Explanation

A connected graph on n vertices has at least n−1 edges, achieved by a tree. For n=8 that minimum is 7. The maximum simple-graph size is n(n−1)/2 = 28. 软考 discrete-math/graph items use this tree bound.

Question 48Programming and Software Development

In standard C, what is sizeof(char)?

  1. Implementation-defined as 2 or 4 only
  2. 0
  3. Equal to sizeof(int) by the standard
  4. 1 Correct answer.

Explanation

The C standard defines sizeof(char) to be 1: sizes of other types are counted in char units. CHAR_BIT may be 8 or more, but sizeof(char) is still 1. The Software Designer 考试说明 requires mastering C.

Question 49Programming and Software Development

In C, if p is a pointer to int x, which expression yields the object x itself?

  1. *p Correct answer.
  2. &x when you need the int value rather than an address
  3. p without dereferencing
  4. sizeof p

Explanation

*p dereferences the pointer and names the int object. &x is the address of x (which is what p stores). Bare p is the address value. Pointer versus object is a 掌握 C item on 软件设计师.

Question 50Programming and Software Development

In object-oriented design as tested on 软考, which relationship is the classic "is-a" link?

  1. Composition ("has-a" with tied lifetime)
  2. Inheritance / generalization Correct answer.
  3. Dependency from a client to a utility class only
  4. An association that is purely a usage arrow with no taxonomy

Explanation

Inheritance (generalization in UML) models is-a: a Manager is an Employee. Composition/aggregation model has-a. The official 考试说明 requires C plus one of C++/Java/VB/VC++, where this taxonomy is central.