PrepIQ CE0045 Applications Programming Ultimate Exam, Exams of Technology

Review of programming logic, software development, debugging, databases, application design, and coding best practices.

Typology: Exams

2025/2026

Available from 06/12/2026

shilpi-jain-2
shilpi-jain-2 🇮🇳

1

(1)

25K documents

1 / 50

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
PrepIQ CE0045 Applications
Programming Ultimate Exam
**Question 1. Which of the following data types typically occupies the smallest
amount of memory on a 64-bit system?**
A) int
B) long
C) float
D) bool
Answer: D
Explanation: A boolean value is stored as a single byte (or even a single bit in
packed structures), making it the smallest among the listed types.
**Question 2. In a singly linked list, what is the time complexity of inserting a new
node at the head of the list?**
A) O(1)
B) O(log n)
C) O(n)
D) O(n log n)
Answer: A
Explanation: Insertion at the head only requires updating the new node’s next
pointer and the head reference, which are constant-time operations.
**Question 3. Which collision-resolution technique guarantees that each key will
eventually be placed in the hash table without needing to re-hash?**
A) Separate chaining
B) Linear probing
C) Quadratic probing
D) Double hashing
Answer: A
Explanation: Separate chaining stores colliding keys in a linked list at the same
bucket, so the table never becomes full for a given bucket.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32

Partial preview of the text

Download PrepIQ CE0045 Applications Programming Ultimate Exam and more Exams Technology in PDF only on Docsity!

Programming Ultimate Exam

Question 1. Which of the following data types typically occupies the smallest amount of memory on a 64-bit system? A) int B) long C) float D) bool Answer: D Explanation: A boolean value is stored as a single byte (or even a single bit in packed structures), making it the smallest among the listed types. Question 2. In a singly linked list, what is the time complexity of inserting a new node at the head of the list? A) O(1) B) O(log n) C) O(n) D) O(n log n) Answer: A Explanation: Insertion at the head only requires updating the new node’s next pointer and the head reference, which are constant-time operations. Question 3. Which collision-resolution technique guarantees that each key will eventually be placed in the hash table without needing to re-hash? A) Separate chaining B) Linear probing C) Quadratic probing D) Double hashing Answer: A Explanation: Separate chaining stores colliding keys in a linked list at the same bucket, so the table never becomes full for a given bucket.

Programming Ultimate Exam

Question 4. The algorithmic complexity of binary search on a sorted array of n elements is: A) O(1) B) O(log n) C) O(n) D) O(n log n) Answer: B Explanation: Binary search halves the search interval each step, leading to logarithmic time complexity. Question 5. Which of the following scenarios is best solved with recursion rather than iteration? A) Summing numbers from 1 to n where n is very large B) Traversing a binary tree in preorder C) Computing the factorial of a small integer D) Finding the maximum element in an unsorted array Answer: B Explanation: Tree traversals naturally map to recursive calls because each node’s sub-trees are processed similarly. Question 6. Encapsulation is primarily achieved in OOP by: A) Using inheritance to reuse code B) Declaring class members as private or protected and providing public getters/setters C) Overloading operators D) Implementing interfaces Answer: B Explanation: Encapsulation hides internal state and exposes behavior through controlled accessors.

Programming Ultimate Exam

A) Strategy B) Observer C) Command D) State Answer: C Explanation: The Command pattern wraps a request in an object, separating the invoker from the operation executor. Question 11. In a typical N-Tier architecture, which layer is responsible for enforcing business rules? A) Presentation layer B) Data access layer C) Business logic layer D) Integration layer Answer: C Explanation: The business logic (or service) layer contains the core rules and processing logic of the application. Question 12. Which of the following is a primary disadvantage of a monolithic architecture compared to microservices? A) Easier to scale individual components B) Faster inter-process communication C) Difficult to deploy independent updates without affecting the whole system D) Simplified data consistency management Answer: C Explanation: In a monolith, a change requires rebuilding and redeploying the entire application, limiting independent releases. Question 13. RESTful APIs commonly use which HTTP method to create a new resource?

Programming Ultimate Exam

A) GET

B) POST

C) PUT

D) DELETE

Answer: B Explanation: POST is intended for creating subordinate resources under a given URI. Question 14. When designing a JSON-based API, which HTTP status code should be returned for a request with invalid input data? A) 200 OK B) 400 Bad Request C) 401 Unauthorized D) 500 Internal Server Error Answer: B Explanation: 400 indicates that the server cannot process the request due to client-side syntax or validation errors. Question 15. In an event-driven system, which component is responsible for persisting events for later replay? A) Producer B) Consumer C) Message broker D) Event store Answer: D Explanation: An event store (or log) records events durably so they can be replayed for rebuilding state or debugging. Question 16. Which Java construct is used to create a new thread? A) implements Runnable B) extends Thread

Programming Ultimate Exam

Answer: B Explanation: Composite primary keys combine multiple columns to uniquely identify a row. Question 20. Which ORM feature helps prevent the N+1 query problem? A) Lazy loading B) Eager loading (fetch joins) C) Cascading deletes D) Automatic schema generation Answer: B Explanation: Eager loading retrieves related entities in a single query, avoiding multiple round-trips that cause N+1 issues. Question 21. Which NoSQL database model is best suited for representing social network relationships? A) Document store B) Key-Value store C) Column family store D) Graph database Answer: D Explanation: Graph databases are optimized for traversing and querying relationships between entities. Question 22. Redis is primarily used as a: A) Relational database B) Distributed file system C) In-memory key-value cache D) Message queue broker Answer: C

Programming Ultimate Exam

Explanation: Redis stores data in RAM, providing fast key-value access for caching and transient data. Question 23. Which of the following is a characteristic of ACID transactions? A) Eventual consistency B) Atomicity, Consistency, Isolation, Durability C) High availability only D) Partition tolerance Answer: B Explanation: ACID explicitly defines those four properties for reliable transaction processing. **Question 24. A cache-aside pattern typically involves which sequence of actions? ** A) Write-through → Invalidate → Read-through B) Read from cache → On miss, read from DB and populate cache → Return data C) Always read directly from the database, ignoring cache D) Cache the entire database at startup Answer: B Explanation: Cache-aside reads from cache first; on a miss it fetches from the source, stores in cache, then returns. Question 25. In unit testing, a mock object is used to: A) Replace a real dependency with a test-double that records interactions B) Execute the actual production code C) Generate random test data D) Measure code coverage Answer: A Explanation: Mocks simulate collaborators and allow verification of how the unit under test interacts with them.

Programming Ultimate Exam

Question 29. Which OWASP Top 10 vulnerability is mitigated by using prepared statements with parameter binding? A) Cross-Site Scripting (XSS) B) Broken Authentication C) SQL Injection D) Security Misconfiguration Answer: C Explanation: Prepared statements separate code from data, preventing malicious SQL from being executed. Question 30. JSON Web Tokens (JWT) are typically signed using which algorithm to ensure integrity? A) MD B) SHA- 1 C) HMAC-SHA D) DES Answer: C Explanation: HMAC-SHA256 (or RSA/ECDSA) provides a secure signature for JWTs, verifying they haven’t been tampered with. Question 31. In OAuth2, which grant type is most appropriate for server-to-server communication without user interaction? A) Authorization Code B) Implicit C) Resource Owner Password Credentials D) Client Credentials Answer: D Explanation: Client Credentials grant allows a service to obtain an access token using its own credentials.

Programming Ultimate Exam

Question 32. A CI pipeline typically includes which of the following stages in order? A) Deploy → Build → Test → Lint B) Build → Test → Package → Deploy C) Test → Build → Deploy → Monitor D) Lint → Deploy → Build → Test Answer: B Explanation: Standard CI flow builds the code, runs tests, packages artifacts, then deploys to an environment. Question 33. Which Docker command builds an image from a Dockerfile located in the current directory and tags it as myapp:latest? A) docker run -t myapp:latest. B) docker build -t myapp:latest. C) docker create -t myapp:latest. D) docker compose up myapp:latest Answer: B Explanation: docker build -t builds an image and assigns the given tag. Question 34. In Kubernetes, a Deployment primarily manages: A) Persistent volumes B) Service discovery DNS entries C) Replica sets for stateless pods D) Ingress routing rules Answer: C Explanation: Deployments create and manage ReplicaSets, ensuring the desired number of pod replicas. Question 35. Structured logging differs from plain text logging by:

Programming Ultimate Exam

B) Classes should have only one reason to change. C) Modules should depend on abstractions, not concretions. D) Interfaces should be small and client-specific. Answer: A Explanation: LSP ensures that derived classes can stand in for base classes without breaking correctness. Question 39. In C#, which keyword is used to prevent a class from being inherited? A) static B) sealed C) abstract D) final Answer: B Explanation: sealed marks a class as non-inheritable. Question 40. A Facade pattern is useful when: A) You need to add new behavior dynamically at runtime. B) You want to simplify a complex subsystem behind a unified interface. C) You must adapt incompatible interfaces. D) You need to enforce a single instance. Answer: B Explanation: Facade provides a high-level interface that hides subsystem complexities. Question 41. Which HTTP header is most commonly used to convey the media type of the request body? A) Accept B) Content-Type C) Authorization

Programming Ultimate Exam

D) Cache-Control Answer: B Explanation: Content-Type tells the server the format (e.g., application/json) of the payload. Question 42. In a message queue system, the term “at-least-once delivery” means: A) The consumer will receive each message exactly once. B) Messages may be delivered multiple times but none will be lost. C) Messages are delivered in order of arrival. D) The broker guarantees no duplication. Answer: B Explanation: At-least-once ensures no loss, but duplicates can occur, requiring idempotent processing. Question 43. Which Java collection provides constant-time performance for add, remove, and contains operations, assuming a good hash function? A) ArrayList B) LinkedList C) HashSet D) TreeMap Answer: C Explanation: HashSet is backed by a hash table offering O(1) average complexity for those operations. Question 44. In a microservice architecture, service discovery is typically implemented by: A) Hard-coding service URLs in the client code B) Using a DNS server only C) Registering services with a registry like Consul or Eureka and querying it at runtime

Programming Ultimate Exam

Answer: B Explanation: Thin clients delegate most logic to server-side tiers, keeping the client lightweight. Question 48. In Python, which decorator is commonly used to turn a regular function into a generator? A) @staticmethod B) @property C) @generator D) None; using yield inside the function automatically makes it a generator. Answer: D Explanation: Adding a yield statement creates a generator function without needing a decorator. Question 49. Which of the following is a characteristic of a read-through cache? A) The application writes directly to the cache only. B) The cache populates itself on a miss by fetching from the underlying data store. C) All data is pre-loaded into the cache at startup. D) The cache never updates its entries after initial load. Answer: B Explanation: Read-through caches automatically load missing entries from the source and store them. Question 50. Which testing strategy focuses on verifying that two or more integrated modules work together correctly? A) Unit testing B) Smoke testing C) Integration testing D) Regression testing

Programming Ultimate Exam

Answer: C Explanation: Integration testing checks interactions between combined components. Question 51. In a relational database, a foreign key constraint ensures: A) Uniqueness of the column values B) That a column contains only numeric data C) Referential integrity between related tables D) Automatic indexing of the column Answer: C Explanation: Foreign keys enforce that referenced values exist in the parent table. Question 52. Which of the following is an advantage of using a graph database for recommendation engines? A) Fixed schema with tables B) Efficient traversal of relationships to compute similarity C) Automatic transaction rollback on failure D) Simple key-value lookups only Answer: B Explanation: Graph databases excel at exploring connections, making them ideal for recommendation algorithms. Question 53. In a multi-threaded Java program, the volatile keyword guarantees: A) Atomicity of compound actions (e.g., increment) B) Visibility of changes to a variable across threads C) Mutual exclusion for a block of code D) That the variable cannot be null Answer: B

Programming Ultimate Exam

Explanation: The Dependency Inversion Principle advises depending on abstractions (interfaces) instead of concrete classes. Question 57. In a relational database, which index type is most suitable for full-text search on large text columns? A) B-Tree index B) Hash index C) GiST or GIN index (PostgreSQL) D) Clustered index Answer: C Explanation: Full-text indexes like GIN/GiST support efficient searching of tokenized text. Question 58. Which of the following best describes idempotent HTTP methods? A) Methods that can be called multiple times without changing the server state after the first call B) Methods that always return a 500 error on repeat calls C) Methods that must be called exactly once per session D) Methods that automatically retry on failure Answer: A Explanation: Idempotent methods (GET, PUT, DELETE, HEAD, OPTIONS) produce the same effect no matter how many times they are invoked. Question 59. Which of the following is NOT a typical responsibility of a service mesh? A) Traffic routing and load balancing B) Service discovery C) Direct database access D) Mutual TLS authentication between services Answer: C

Programming Ultimate Exam

Explanation: Service meshes operate at the network layer; they do not handle database interactions. Question 60. In JavaScript, which operator is used to coalesce null or undefined values to a default? A) ?? B) && C) || D) ??= Answer: A Explanation: The nullish coalescing operator (??) returns the right-hand operand when the left is null or undefined. Question 61. Which of the following patterns is primarily used to decouple the sender of a request from its receiver by passing the request through a chain of handlers? A) Observer B) Chain of Responsibility C) Mediator D) Proxy Answer: B Explanation: Chain of Responsibility lets multiple objects handle a request without the sender knowing which one will act. Question 62. In a relational database, a materialized view differs from a regular view because: A) It is always up-to-date without refresh. B) It stores the query result physically, improving read performance. C) It cannot be indexed. D) It is defined using procedural code. Answer: B