Certified Associate Programmer (CPA) Exam — Questions and Answers
Question 1: What is 'integration testing'?
- Testing code on production servers
- Testing the user interface with real users
- Testing a single function in isolation
- Testing how multiple modules or components work together (Correct answer)
Correct answer: Testing how multiple modules or components work together
Integration testing verifies that separate modules interact correctly when combined, catching interface mismatches that unit tests may miss.
Question 2: What is code optimization?
- Making the code readable
- Adding comments to the code
- Rewriting code from scratch
- Improving performance and resource usage (Correct answer)
Correct answer: Improving performance and resource usage
Code optimization is the process of modifying a computer program to improve its performance and resource usage without altering its external behavior. This involves techniques like refining algorithms, reducing redundant computations, and improving data structures. The goal is to make the program run faster, use less memory, or consume fewer CPU cycles, enhancing its overall efficiency.
Question 3: Which concept describes the cloud provider's responsibility versus the customer's responsibility for security?
- Zero-trust architecture
- Shared responsibility model (Correct answer)
- Defense in depth
- Principle of least privilege
Correct answer: Shared responsibility model
The shared responsibility model defines which security tasks the cloud provider handles (physical, hypervisor) versus the customer (OS, application, data).
Question 4: What is technical debt in a software project?
- Unspent budget allocated for technical resources
- Money owed to technology vendors
- The cost of hardware purchased for the project
- The implied future rework caused by choosing a quick solution over a better long-term approach (Correct answer)
Correct answer: The implied future rework caused by choosing a quick solution over a better long-term approach
Technical debt accumulates when shortcuts are taken in code or design, creating future maintenance burdens that must eventually be addressed.
Question 5: In a publish/subscribe messaging pattern, what role does the 'broker' play?
- It directly connects publishers to subscribers without storing messages
- It receives messages from publishers and routes them to interested subscribers (Correct answer)
- It authenticates end users before they can publish
- It generates the messages itself on a schedule
Correct answer: It receives messages from publishers and routes them to interested subscribers
The message broker (e.g., Kafka, RabbitMQ) decouples publishers from subscribers by receiving messages and delivering them to all registered subscribers.
Question 6: What does a 'linter' primarily do?
- Measures test execution time
- Analyzes code for stylistic issues, potential bugs, and standards violations (Correct answer)
- Compiles source code to machine code
- Manages software dependencies
Correct answer: Analyzes code for stylistic issues, potential bugs, and standards violations
A linter statically analyzes source code to flag errors, style violations, and suspicious patterns without executing the program.
Question 7: What is trend analysis in CPA reporting?
- Examining data over time to identify patterns and changes (Correct answer)
- Predicting exact futures
- Comparing single data points
- Analyzing fashion trends
Correct answer: Examining data over time to identify patterns and changes
Trend analysis examines historical data to identify patterns, directions, and rates of change.
Question 8: What does data integrity mean in CPA practice?
- Data processing speed
- Accuracy, consistency, and reliability of data throughout its lifecycle (Correct answer)
- Visualization quality
- Physical security of hardware
Correct answer: Accuracy, consistency, and reliability of data throughout its lifecycle
Data integrity means maintaining accuracy, consistency, and reliability from collection through use.
Question 9: What differentiates quantitative from qualitative data in CPA?
- Quantitative cannot be used professionally
- Quantitative is numerical; qualitative is descriptive and categorical (Correct answer)
- They are interchangeable
- Qualitative is always more accurate
Correct answer: Quantitative is numerical; qualitative is descriptive and categorical
Quantitative data is numerical and measurable; qualitative data provides descriptive context and depth.
Question 10: What is the function of SNMP in network management?
- Encrypt traffic between routers
- Authenticate users on a Wi-Fi network
- Assign domain names to IP addresses
- Monitor and manage network devices by collecting performance and status data (Correct answer)
Correct answer: Monitor and manage network devices by collecting performance and status data
SNMP (Simple Network Management Protocol) allows network administrators to query, monitor, and configure managed devices such as routers, switches, and servers.
Question 11: A table has no primary key defined. Which term best describes such a table?
- Denormalized table
- Clustered table
- Heap table (Correct answer)
- Partitioned table
Correct answer: Heap table
A heap table is a table stored without any ordered index or defined primary key, resulting in unordered row storage.
Question 12: What is the key difference between Black-Box and White-Box testing?
- Black-Box tests only security; White-Box tests performance
- Black-Box is done by developers; White-Box by end users
- Black-Box tests without knowledge of internal code; White-Box tests with full internal knowledge (Correct answer)
- Black-Box is manual; White-Box is automated
Correct answer: Black-Box tests without knowledge of internal code; White-Box tests with full internal knowledge
Black-Box testing evaluates functionality from the user's perspective without knowing internal code, while White-Box testing uses knowledge of the internal structure to design test cases.
Question 13: Which protocol is responsible for automatically assigning IP addresses to devices on a network?
- SNMP
- DNS
- DHCP (Correct answer)
- OSPF
Correct answer: DHCP
DHCP (Dynamic Host Configuration Protocol) dynamically assigns IP addresses, subnet masks, gateways, and DNS servers to network clients.
Question 14: Which type of database index is most efficient for range queries on a column?
- Hash index
- B-tree index (Correct answer)
- Bitmap index
- Full-text index
Correct answer: B-tree index
B-tree indexes maintain sorted order, making them ideal for range queries using operators like BETWEEN, <, and >.
Question 15: A project manager wants to identify all the work needed to complete the project. Which tool is most appropriate?
- Work Breakdown Structure (WBS) (Correct answer)
- Risk register
- Gantt chart
- RACI matrix
Correct answer: Work Breakdown Structure (WBS)
The WBS decomposes the total scope of work into smaller, manageable deliverables and work packages.
Question 16: What is the Observer design pattern primarily used for?
- Defining a one-to-many dependency so that when one object changes state, all dependents are notified (Correct answer)
- Encapsulating a request as an object
- Creating objects without specifying their concrete class
- Providing a surrogate for another object to control access
Correct answer: Defining a one-to-many dependency so that when one object changes state, all dependents are notified
The Observer pattern defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
Question 17: What is backup and disaster recovery for in CPA technology?
- Freeing storage space
- Creating copies for sharing
- Ensuring data restoration and operations resumption after failures (Correct answer)
- Satisfying vendors
Correct answer: Ensuring data restoration and operations resumption after failures
These plans ensure critical data and systems can be restored within acceptable timeframes after disruptions.
Question 18: What is a milestone in CPA project management?
- An optional checkpoint
- A daily required task
- A significant event marking progress at a key point in the timeline (Correct answer)
- A physical construction marker
Correct answer: A significant event marking progress at a key point in the timeline
Milestones are significant checkpoints marking completion of major deliverables or phase transitions.
Question 19: Which data structure is most appropriate for implementing a browser's back-navigation history?
- Queue
- Stack (Correct answer)
- Binary search tree
- Hash table
Correct answer: Stack
A stack's LIFO property naturally models back navigation — the last page visited is the first retrieved.
Question 20: What is change management in CPA technology?
- Monthly password changes
- Replacing all systems at once
- A structured process for evaluating and implementing changes safely (Correct answer)
- Making changes immediately without review
Correct answer: A structured process for evaluating and implementing changes safely
IT change management ensures changes are evaluated, approved, tested, and implemented in a controlled manner.
Question 21: A loop that never terminates because its exit condition is never met is called a(n):
- Nested loop
- Infinite loop (Correct answer)
- Sentinel loop
- Counter loop
Correct answer: Infinite loop
An infinite loop runs indefinitely because the terminating condition is either never reached or never becomes false.
Question 22: Which SQL statement is used to add a new column to an existing table?
- UPDATE TABLE
- ALTER TABLE ... ADD (Correct answer)
- CHANGE TABLE ... ADD
- MODIFY TABLE
Correct answer: ALTER TABLE ... ADD
ALTER TABLE followed by ADD allows you to add one or more new columns to an existing table without recreating it.
Question 23: In cloud networking, what does a VPC (Virtual Private Cloud) primarily provide?
- A serverless compute environment
- An isolated virtual network segment within the public cloud (Correct answer)
- A CDN for static assets
- A managed database service
Correct answer: An isolated virtual network segment within the public cloud
A VPC gives users a logically isolated section of the cloud where they can launch resources in a defined virtual network.
Question 24: What is a stored procedure in a relational database?
- A database table that stores procedural data
- A trigger that runs automatically on data changes
- A scheduled job that backs up the database
- A precompiled set of SQL statements stored in the database (Correct answer)
Correct answer: A precompiled set of SQL statements stored in the database
A stored procedure is a named, precompiled collection of SQL statements saved in the database that can be executed by calling its name.
Question 25: What is a webhook in web development?
- A type of persistent WebSocket connection for real-time communication
- An HTTP callback triggered by a specific event that sends data to a specified URL (Correct answer)
- A security mechanism for validating API keys on the server
- A tool for debugging HTTP requests in the browser
Correct answer: An HTTP callback triggered by a specific event that sends data to a specified URL
A webhook is a user-defined HTTP callback that is triggered by a specific event on the source system, automatically sending data to a configured URL when that event occurs.
Question 26: Which design pattern separates the construction of a complex object from its representation?
- Factory Method
- Abstract Factory
- Builder (Correct answer)
- Prototype
Correct answer: Builder
The Builder pattern separates the construction of a complex object from its representation, allowing different representations to be created.
Question 27: What is continuous integration in software development?
- Rewriting the code frequently
- Manual testing after every update
- Automatic code integration and testing (Correct answer)
- Using the same code for every update
Correct answer: Automatic code integration and testing
Continuous Integration (CI) is a software development practice where developers frequently merge their code changes into a central repository, often multiple times a day. Each integration is then verified by an automated build and automated tests. This practice aims to detect integration errors early and quickly, leading to faster development cycles and more reliable software.
Question 28: In software development, what is 'encapsulation'?
- Sharing code across multiple classes
- Defining a hierarchy of related classes
- Bundling data and methods that operate on that data within a single unit, restricting direct access to some components (Correct answer)
- The ability of a class to take multiple forms
Correct answer: Bundling data and methods that operate on that data within a single unit, restricting direct access to some components
Encapsulation bundles data and the methods that operate on it into a class while hiding internal implementation details from outside access.
Question 29: Which profiling approach samples the call stack at regular intervals to estimate where time is spent?
- Statistical (sampling) profiling (Correct answer)
- Instrumentation profiling
- Memory profiling
- Code coverage profiling
Correct answer: Statistical (sampling) profiling
Statistical profiling periodically samples the program's call stack, estimating hot spots without requiring code instrumentation, resulting in lower overhead.
Question 30: What is a database view?
- An index on a frequently queried column
- A snapshot of the database at a point in time
- A physical copy of a table stored on disk
- A virtual table defined by a stored SELECT query (Correct answer)
Correct answer: A virtual table defined by a stored SELECT query
A view is a named, stored SQL query that behaves like a virtual table; it does not store data itself unless it is a materialized view.
Question 31: In software project estimation, what does 'story point' measure in Agile teams?
- The number of lines of code in a feature
- The relative complexity and effort of a backlog item (Correct answer)
- The number of hours needed to complete a task
- The dollar cost of implementing a user story
Correct answer: The relative complexity and effort of a backlog item
Story points are a relative unit that captures the complexity, effort, and uncertainty of a user story, allowing teams to estimate without committing to exact hours.
Question 32: What is the output of the following pseudocode? x = 10; y = 3; print(x MOD y)
- 3
- 0
- 1 (Correct answer)
- 7
Correct answer: 1
The MOD (modulo) operator returns the remainder of 10 divided by 3, which is 1.
Question 33: What is the triple constraint in CPA project management?
- Three completion phases
- The interdependent relationship between scope, time, and cost (Correct answer)
- Three mandatory approvals
- Three required team members
Correct answer: The interdependent relationship between scope, time, and cost
Scope, time, and cost are interdependent: changing one affects the others. Managers must balance all three.
Question 34: What is 'service discovery' in a microservices architecture?
- The process of documenting API endpoints
- The process of deploying a new microservice
- The mechanism by which services find the network locations of other services dynamically (Correct answer)
- A tool for monitoring service uptime
Correct answer: The mechanism by which services find the network locations of other services dynamically
Service discovery allows microservices to automatically find each other's locations (IP/port) at runtime, often via a service registry like Consul or Eureka.
Question 35: Which type of firewall inspects traffic all the way up to the application layer?
- Next-generation firewall (NGFW) (Correct answer)
- Circuit-level gateway
- Packet-filtering firewall
- Stateless firewall
Correct answer: Next-generation firewall (NGFW)
An NGFW performs deep packet inspection at the application layer, identifying and controlling applications regardless of port or protocol.
Question 36: What is thrashing in operating systems?
- Excessive context switching due to too many high-priority threads
- Disk fragmentation slowing file access
- A state where the system spends more time swapping pages than executing processes (Correct answer)
- CPU overheating caused by intensive computation
Correct answer: A state where the system spends more time swapping pages than executing processes
Thrashing occurs when the OS constantly pages data in and out because the working sets of active processes exceed available physical memory.
Question 37: Which HTTP method is used to retrieve data from a server without modifying it?
- DELETE
- GET (Correct answer)
- PUT
- POST
Correct answer: GET
GET is the HTTP method used to request and retrieve data from a server; it is idempotent and does not modify server state.
Question 38: In Agile methodology, what is the primary purpose of a 'Definition of Done' (DoD)?
- To document bugs found during testing
- To assign tasks to team members
- To establish a shared understanding of when a work item is complete (Correct answer)
- To list features planned for the next sprint
Correct answer: To establish a shared understanding of when a work item is complete
The Definition of Done is a shared checklist that specifies the criteria every work item must meet before it can be considered complete.
Question 39: Which data structure follows the Last-In, First-Out (LIFO) principle?
- Linked List
- Stack (Correct answer)
- Tree
- Queue
Correct answer: Stack
A stack follows LIFO, meaning the last element pushed is the first one popped.
Question 40: In stakeholder management, what does a Power/Interest grid help a project manager determine?
- The technical skills required for each project role
- Which team members should receive overtime pay
- How to prioritize stakeholder engagement based on their influence and concern in the project (Correct answer)
- The budget allocation for each project phase
Correct answer: How to prioritize stakeholder engagement based on their influence and concern in the project
The Power/Interest grid categorizes stakeholders by authority level and project concern to guide how much attention and communication each group needs.
Certified Associate Programmer (CPA) Exam
The Certified Associate Programmer (CPA) certification validates foundational knowledge in programming concepts, data structures, and algorithms, typically focusing on a specific language like Python or C++.
Exam Rules
- You can skip questions and return to them later
- Flag questions for review before submitting
- No feedback shown until you submit the entire exam
- Unanswered questions count as wrong — answer everything
- 10 pretest questions are mixed in and don't affect your score
- Timer auto-submits when time runs out
- Your progress is auto-saved every 30 seconds