AM Software Test 7 Leave a Comment / By fawadtwopointo@gmail.com / August 23, 2025 Welcome to your AM Software Test 7 A lock that allows multiple readers but only one writer at a time is typically called: Spinlock Binary semaphore Barrier RW-lock None Which statement about immutability in concurrent programs is TRUE? Cannot be used in FP Decreases need for synchronization Increases race conditions Requires garbage collection None Non-blocking algorithm progress guarantee where some thread always completes in finite steps is: Lock-free Obstruction-free Wait-free Starvation-free None In the Observer pattern, what type of coupling is preferred? Runtime dynamic coupling via interface Global variable coupling Inheritance coupling Tight compile-time coupling None Which GC strategy pauses less but may use more memory? Stop-the-world mark-sweep Concurrent mark-sweep (CMS) Reference counting only Incremental copying None Two-phase commit (2PC) primarily ensures: Serializability only Partition tolerance Global atomicity Availability None Which isolation level can exhibit phantom reads? Read Committed Read Uncommitted Repeatable Read Serializable None In MVCC systems, writers typically: Block readers Create new versions Force table locks Overwrite in place None Quorum (R,W) in a replicated store satisfies strong read consistency if: R·W > N R > N/2 R + W > N W > N None A gossip protocol primarily improves: Disk throughput Failure detection & state dissemination Transaction latency Query optimization None With demand paging, effective memory access time (EMAT) depends most on: Disk cache size only TLB size only Page fault rate CPU frequency None Which page replacement is stack-based (subset property holds)? a) FIFO LRU Clock FIFO Random None A kernel mechanism mapping the same physical page into multiple processes is: Shadow paging Thrashing Swapping Copy-on-write None In NUMA, to optimize performance you should: Disable thread pinning Avoid page coloring Use first-touch allocation Prefer remote memory None The main advantage of epoll/kqueue over select() is: Built into POSIX timers O(n) wakeups Scales with number of ready FDs, not total watched Supports UDP only None SSA form simplifies which optimization most? Instruction scheduling Register renaming only Common subexpression elimination & value numbering Loop unrolling None Register allocation via graph coloring tries to: Remove branches Minimize stack usage by coloring interference graph Minimize pipeline stalls Inline functions None Tail-call optimization mainly: Improves cache locality Eliminates stack growth for tail recursion Removes function calls Requires JIT None A parser that can handle left recursion and is deterministic for viable prefixes: LL(1) LR(1) Recursive descent PEG None Escape analysis helps: Allocate objects on the stack Remove dead code Vectorize loops Inline virtual calls None TCP’s slow start increases cwnd: Randomly Exponentially per RTT Not at all Linearly per RTT None HSTS mitigates: CSRF Clickjacking SSL stripping / downgrade attacks SQL injection None Perfect Forward Secrecy (PFS) relies on: RSA key transport Ephemeral Diffie-Hellman (DHE/ECDHE) Static DH only Shared symmetric keys None In SDN (OpenFlow), the control plane usually resides: On each switch In a centralized controller In BGP routers only In the NIC firmware None A side-channel attack typically exploits: Protocol mismatches Input validation errors Algorithmic complexity Timing/power/cache behaviors None Johnson’s algorithm is used for: Maximum flow Minimum cut All-pairs shortest paths in sparse graphs MST None For a Bloom filter, decreasing false positives requires: Fewer hash functions and smaller bitset Storing values instead of bits Larger bitset and optimal More hash functions and same size None If an algorithm is output-sensitive, its complexity depends on: Input size only Hardware cache size Output size only Both input and size of the produced result None Synonym of “scrutinize”: Ignore Overlook Examine Simplify None Antonym of “mitigate”: Ease Lessen Aggravate Alleviate None Time's upTime is Up!