0% found this document useful (0 votes)
36 views5 pages

Senior Software Engineer (Java) Interview Test

Uploaded by

ngtqlong
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views5 pages

Senior Software Engineer (Java) Interview Test

Uploaded by

ngtqlong
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Senior Software Engineer (Java) Interview Test

Technical Section
1. What is the primary benefit of using generics in Java?
2. A. To improve runtime performance
3. B. To enforce type safety at compile time
4. C. To enable operator overloading

5. D. To provide dynamic typing

6. Which class provides a thread-safe, dynamically resizable collection in Java?

7. A. ArrayList
8. B. Vector
9. C. HashMap

10. D. LinkedList

11. In Java 8 Streams, what does the filter() method return?

12. A. The first element matching the predicate


13. B. A new Stream with elements that match the predicate
14. C. A List of filtered elements

15. D. void

16. What is the purpose of the @Transactional annotation in Spring?

17. A. To define a bean as transactional


18. B. To enable declarative transaction management for methods
19. C. To automatically retry failed transactions

20. D. To specify that a method should run in a new thread

21. In Spring MVC, which annotation marks a class as a controller to handle HTTP requests?

22. A. @Component
23. B. @Service
24. C. @Controller

25. D. @Repository

26. In Hibernate, what does "lazy loading" refer to?

27. A. Entities loaded immediately when the session starts


28. B. Entities loaded only when accessed, preventing unnecessary queries

1
29. C. Entities cached permanently in memory

30. D. Entities loaded only during transaction commit

31. Which JPA annotation is used to specify the mapping of an entity field to a database column?

32. A. @Mapping
33. B. @Column
34. C. @DBField

35. D. @Field

36. Which SQL keyword is used to return unique (distinct) values in a result set?

37. A. WHERE
38. B. UNION
39. C. DISTINCT

40. D. GROUP BY

41. In a relational database, what is an index primarily used for?

42. A. Encrypting data


43. B. Enforcing referential integrity
44. C. Speeding up query performance

45. D. Defining user access permissions

46. Which HTTP method is idempotent in REST API design?

◦ A. GET
◦ B. POST
◦ C. PATCH
◦ D. CONNECT

47. What HTTP status code is typically returned when a new resource is successfully created?

◦ A. 200 OK
◦ B. 201 Created
◦ C. 400 Bad Request
◦ D. 404 Not Found

48. In cloud deployment, what is the main advantage of using containers (e.g., Docker)?

◦ A. Eliminating all security concerns


◦ B. Guaranteeing zero bugs in deployment
◦ C. Providing consistent runtime environments across machines
◦ D. Automatically writing code documentation

49. In a distributed system, the CAP theorem implies which of the following?

◦ A. You can achieve consistency, availability, and partition tolerance simultaneously.

2
◦ B. You can fully guarantee consistency and availability, sacrificing partition tolerance.
◦ C. You can fully guarantee two out of the three: consistency, availability, and partition
tolerance.
◦ D. Partition tolerance is optional if you have high consistency.

50. Which approach helps maintain high availability in a system design?

◦ A. Using a single database instance for simplicity


◦ B. Deploying multiple redundant components with failover mechanisms
◦ C. Avoiding load balancers to reduce complexity
◦ D. Scheduling all users on a single server to minimize data spread

51. In Kubernetes, what is a "pod"?

◦ A. A single container image


◦ B. The smallest deployable unit, which can contain one or more containers
◦ C. A type of virtual machine instance
◦ D. A storage volume

52. In Git, what does the command git rebase do?

◦ A. Creates a merge commit joining two branches


◦ B. Temporarily stashes changes for later use
◦ C. Moves or integrates commits from one branch onto another new base
◦ D. Deletes a branch permanently

53. Which Java EE (Jakarta EE) specification is designed for building RESTful web services?

◦ A. JPA (Java Persistence API)


◦ B. JAX-RS (Java API for RESTful Web Services)
◦ C. JMS (Java Messaging Service)
◦ D. JSP (JavaServer Pages)

Behavioral Section
1. Your colleague has been consistently missing deadlines on shared tasks, impacting the project
schedule. What is the most appropriate way to handle this situation?
2. A. Privately discuss the situation with the colleague, understand any issues, and offer help or
propose solutions
3. B. Inform the manager immediately without talking to the colleague first
4. C. Take over the colleague’s tasks and complete them yourself to keep the project on track

5. D. Ignore the problem and hope the colleague improves next sprint

6. During a sprint planning meeting, you realize that the team’s estimates for a feature are overly
optimistic and the timeline is tight. What should you do?

7. A. Raise your concerns with the team and re-estimate based on realistic effort
8. B. Keep quiet and try to complete the task as scheduled even if it means cutting corners
9. C. Sabotage the planning by rejecting unrelated stories to shorten the sprint scope

10. D. Accept the plan as is and complain later about impossible timelines

3
11. You discover a critical bug in the production system just before the weekend. How should you
respond?

12. A. Immediately notify your team and stakeholders about the issue and work with them to fix it as
quickly as possible
13. B. Wait until Monday to report it, hoping it will resolve itself or become less critical
14. C. Apply a quick fix without informing anyone to avoid panic, then tell them it’s resolved later

15. D. Blame the issue on another team or external factor to avoid responsibility

16. In a recent code review, a senior engineer suggested significant changes to your implementation
that you disagree with. What is the best way to handle this feedback?

17. A. Engage in a respectful discussion, asking for clarification and explaining your perspective
before agreeing on the best approach
18. B. Ignore the feedback and proceed with your original implementation
19. C. Delete the review comments and merge your changes immediately

20. D. Accuse the reviewer of not understanding the requirements and insist on your version

21. Your team adopts a new technology or framework, and you are unfamiliar with it. A task is
assigned to you that requires using this new tool. What should you do?

22. A. Take initiative to learn the new technology (e.g., through documentation or colleagues) and
apply it to the task, asking for help when needed
23. B. Refuse the task, stating you only work with technologies you already know
24. C. Delegate the task to someone else who is familiar and take a different assignment
25. D. Try to complete the task using the old technology, ignoring the new requirement

Answer Key
Technical Section:
1. B
2. B
3. B
4. B
5. C
6. B
7. B
8. C
9. C
10. A
11. B
12. C
13. C
14. B
15. B
16. C
17. B

4
Behavioral Section:
1. A
2. A
3. A
4. A
5. A

You might also like