
















































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The CFSD Exam validates full stack development skills using Java technologies. It covers backend development, frontend frameworks, databases, APIs, security, testing, and deployment. Candidates demonstrate the ability to build, integrate, and maintain scalable web applications across the full development lifecycle.
Typology: Exams
1 / 88
This page cannot be seen from the preview
Don't miss anything!

















































































Question 1. Which HTML5 element is most appropriate for marking up the main navigation links of a webpage? A)
Explanation: Specificity is calculated from IDs, classes, and elements; the selector with an ID (#header) outranks the others. Question 4. Which JavaScript feature allows you to write asynchronous code that looks synchronous? A) Callbacks B) Promises C) Async/Await D) Generators Answer: C Explanation: async/await syntax pauses execution until a Promise resolves, making asynchronous code appear linear. Question 5. What does the arrow function syntax (a, b) => a + b implicitly return? A) Undefined B) A Promise object C) The sum of a and b D) A function reference Answer: C Explanation: When the function body is an expression without braces, the result of that expression is returned automatically. Question 6. In React, which hook should be used to fetch data when a component mounts? A) useState B) useEffect C) useContext
Answer: D Explanation: PATCH applies partial modifications, whereas PUT replaces the entire resource. Question 10. What does the <meta charset="UTF-8"> tag specify in an HTML5 document? A) The document’s language B) The character encoding C) The viewport size D) The author of the page Answer: B Explanation: The charset attribute declares the character encoding, ensuring correct rendering of text. Question 11. Which of the following statements about the Java Virtual Machine (JVM) is true? A) It compiles Java source code directly to machine code. B) It executes bytecode on a virtualized hardware layer. C) It is only available on Windows platforms. D) It replaces the need for a JRE. Answer: B Explanation: The JVM interprets or JIT‑compiles Java bytecode, providing a platform‑independent execution environment. Question 12. In Java, which memory area stores class metadata and static variables? A) Heap
B) Stack C) Method Area (or Metaspace) D) Program Counter Register Answer: C Explanation: The Method Area (now Metaspace) holds class definitions, static fields, and runtime constant pool. Question 13. Which Java keyword is used to create an immutable reference that cannot be reassigned? A) final B) static C) const D) volatile Answer: A Explanation: final variables can be assigned only once; after initialization they cannot point to a different object. Question 14. Which of the following is NOT a functional interface in the java.util.function package? A) Predicate
A) It catches all exceptions automatically. B) It closes resources that implement AutoCloseable at the end of the block. C) It runs the finally block before the catch block. D) It prevents deadlocks in multithreaded code. Answer: B Explanation: Resources declared in the try parentheses are automatically closed, even if an exception occurs. Question 18. Which Java class provides a thread‑safe, lazily initialized singleton pattern without explicit synchronization? A) java.util.concurrent.locks.ReentrantLock B) enum singleton C) java.lang.ThreadLocal D) java.util.concurrent.atomic.AtomicReference Answer: B Explanation: An enum type guarantees a single instance, provides serialization safety, and is lazily loaded. Question 19. In the Java Memory Model, which happens‑before relationship ensures visibility of writes across threads? A) Lock‑unlock on the same monitor B) Object creation C) Method invocation D) Class loading Answer: A Explanation: A successful lock on a monitor establishes a happens‑before relationship with the subsequent unlock, guaranteeing visibility.
Question 20. Which annotation enables Spring to automatically detect a class as a component during classpath scanning? A) @Import B) @Component C) @Qualifier D) @Value Answer: B Explanation: @Component marks a class for autodetection and registration as a Spring bean. Question 21. In Spring IoC, what is the default scope of a bean defined in a singleton container? A) prototype B) request C) session D) singleton Answer: D Explanation: By default, Spring creates a single shared instance (singleton) for each bean definition. Question 22. Which Spring annotation is used to declare a method that should be executed after the bean’s properties have been set? A) @PostConstruct B) @PreDestroy C) @AfterReturning D) @Scheduled
C) To compile Thymeleaf templates at runtime. D) To manage Maven dependencies automatically. Answer: B Explanation: Actuator exposes endpoints (e.g., /actuator/health) for monitoring and managing a running application. Question 26. Which annotation maps an HTTP GET request to a method in a Spring @RestController? A) @PostMapping B) @DeleteMapping C) @GetMapping D) @PatchMapping Answer: C Explanation: @GetMapping is a shortcut for @RequestMapping(method = RequestMethod.GET). Question 27. In Spring MVC, how can you bind a URI template variable to a method parameter? A) @RequestParam B) @PathVariable C) @ModelAttribute D) @CookieValue Answer: B Explanation: @PathVariable extracts values from the URI pattern (e.g., /{id}) and passes them to the method.
Question 28. Which Spring Security component is responsible for validating a JWT token in a request? A) UserDetailsService B) AuthenticationProvider C) JwtAuthenticationFilter D) PasswordEncoder Answer: C Explanation: A custom JwtAuthenticationFilter intercepts requests, extracts the token, validates it, and sets the authentication context. Question 29. What does the @PreAuthorize("hasRole('ADMIN')") annotation enforce? A) Method can only be called by users with the ADMIN role. B) Method can only be called after login. C) Method will be cached for ADMIN users. D) Method will be executed asynchronously. Answer: A Explanation: @PreAuthorize uses SpEL to evaluate security expressions before method execution. Question 30. Which HTTP status code is appropriate when a client attempts to access a resource without sufficient permissions? A) 200 OK B) 401 Unauthorized C) 403 Forbidden D) 404 Not Found Answer: C
Question 34. What is the purpose of a “junction table” in a many‑to‑many relationship? A) To store computed columns. B) To hold foreign keys referencing both related tables. C) To enforce uniqueness on a single column. D) To cache query results. Answer: B Explanation: A junction (or link) table contains two foreign keys, one for each side of the many‑to‑many association. Question 35. Which JPA annotation specifies that an entity’s primary key value should be generated automatically? A) @Column B) @Temporal C) @GeneratedValue D) @Enumerated Answer: C Explanation: @GeneratedValue tells the persistence provider to generate the identifier (e.g., using AUTO, IDENTITY). Question 36. In Hibernate, which fetching strategy loads associated entities only when they are accessed? A) EAGER B) LAZY C) IMMEDIATE D) PROXY
Answer: B Explanation: LAZY loading defers retrieval of related data until a getter is invoked. Question 37. Which Spring Data JPA method name will generate a query that finds users by their email address ignoring case? A) findByEmailIgnoreCase(String email) B) getUserByEmail(String email) C) searchEmail(String email) D) retrieveByEmail(String email) Answer: A Explanation: Spring Data parses method names; “IgnoreCase” adds case‑insensitive comparison. Question 38. What does the @Cacheable annotation do in a Spring service method? A) It disables caching for the method. B) It stores the method’s result in the configured cache. C) It clears the entire cache before execution. D) It forces the method to run asynchronously. Answer: B Explanation: @Cacheable checks the cache first; if a matching entry exists, it returns it, otherwise it executes the method and caches the result. Question 39. Which Git command creates a new branch called feature/login and switches to it in one step? A) git branch feature/login B) git checkout - b feature/login C) git merge feature/login
D) verify(UserService.class) Answer: A Explanation: mock() creates a dummy instance whose behavior is defined by stubbing. Question 43. What is the primary goal of Test‑Driven Development (TDD)? A) Write all production code first, then tests. B) Write a failing test, then production code to make it pass. C) Avoid writing any unit tests. D) Only test integration points. Answer: B Explanation: TDD cycles through red (fail), green (pass), and refactor phases to drive design. Question 44. Which Maven lifecycle phase is responsible for packaging the compiled code into a JAR? A) compile B) test C) package D) install Answer: C Explanation: The package phase bundles compiled classes and resources into the final artifact. Question 45. In a Gradle build script, which keyword declares a dependency on Spring Boot Starter Web? A) implementation 'org.springframework.boot:spring-boot-starter-web' B) compile 'org.springframework.boot:spring-boot-starter-web' C) runtimeOnly 'org.springframework.boot:spring-boot-starter-web'
D) testImplementation 'org.springframework.boot:spring-boot-starter-web' Answer: A Explanation: implementation is the modern configuration for compile‑time and runtime dependencies. Question 46. Which Dockerfile instruction copies the application JAR into the container image? A) ADD app.jar /app.jar B) COPY target/app.jar /app.jar C) RUN cp app.jar /app.jar D) EXPOSE app.jar Answer: B Explanation: COPY copies files from the build context into the image; the path shown is typical for a Maven‑built JAR. Question 47. In a Docker Compose file, which key defines the network mode for a service? A) ports B) volumes C) network_mode D) depends_on Answer: C Explanation: network_mode specifies how the container connects to Docker networks (e.g., bridge, host). Question 48. Which Jenkins pipeline step is used to archive build artifacts? A) sh 'mvn clean install'
Question 51. In HTML5, which attribute makes an input field mandatory? A) required B) validate C) mandatory D) checked Answer: A Explanation: The required boolean attribute forces the user to fill the field before form submission. Question 52. Which CSS property controls the space between lines of text? A) letter-spacing B) word-spacing C) line-height D) text-indent Answer: C Explanation: line-height defines the distance between baselines of adjacent lines. Question 53. What does the JavaScript Object.freeze() method do? A) Prevents new properties from being added and existing ones from being changed. B) Creates a deep copy of the object. C) Makes the object immutable and also seals its prototype. D) Locks the object for exclusive thread access. Answer: A Explanation: Object.freeze makes an object non‑extensible and sets all existing properties as read‑only.
Question 54. In React, which hook returns a mutable ref object that persists across re‑renders? A) useState B) useEffect C) useRef D) useMemo Answer: C Explanation: useRef creates an object with a .current property that does not trigger re‑renders when mutated. Question 55. Which Angular lifecycle hook is called after the component’s view (and child views) have been fully initialized? A) ngOnInit B) ngAfterViewInit C) ngDoCheck D) ngOnChanges Answer: B Explanation: ngAfterViewInit runs once after Angular creates the component’s view hierarchy. Question 56. In Vue.js, which option is used to watch changes on a reactive property? A) computed B) methods C) watch D) filters Answer: C