100% found this document useful (1 vote)
100 views2 pages

Software Engineer Test 1

This document contains a 10 question software engineer test with multiple choice and short answer questions. The questions cover topics such as object-oriented programming concepts in Java like inheritance, abstraction, polymorphism; exception handling; data structures like arrays and lists; and algorithms involving searching and sorting.
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
100% found this document useful (1 vote)
100 views2 pages

Software Engineer Test 1

This document contains a 10 question software engineer test with multiple choice and short answer questions. The questions cover topics such as object-oriented programming concepts in Java like inheritance, abstraction, polymorphism; exception handling; data structures like arrays and lists; and algorithms involving searching and sorting.
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/ 2

Zypp Electric

Software Engineer Test 1 - Time:- 45 Mins

NAME:- ________________________________ Reg.No:-_______________________ Date:-


___________

Follow any specific instructions provided with each question.

1. Which of the following is a superclass of every class in Java?


a) ArrayList
b) Abstract class
c) Object class
d) String

2. Which one of the following is not an access modifier?


a) Protected
b) Void
c) Public
d) Private

3. Which of these is the correct way of inheriting class A by class B?


a) class B + class A {}
b) class B inherits class A {}
c) class B extends A {}
d) class B extends class A {}

4. Which of these keywords are used for generating an exception manually?


a) try
b) catch
c) throw
d) check

5. What happens if we put a key object in a HashMap which exists?


a) The new object replaces the older object
b) The new object is discarded
c) The old object is removed from the map
d) It throws an exception as the key already exists in the map

6. What is the process of defining a method in a subclass having same name & type
signature as a
method in its superclass?
a) Method overloading
b) Method overriding
c) Method hiding
d) None of the mentioned
7. What is the use of final keyword in Java?
a) When a class is made final, a subclass of it can not be created
b) When a method is final, it can not be overridden.
c) When a variable is final, it can be assigned value only once.
d) All of the above

8. What is true about a break?


a) Break stops the execution of entire program
b) Break halts the execution and forces the control out of the loop
c) Break forces the control out of the loop and starts the execution of next iteration
d) Break halts the execution of the loop for certain time frame

9. How To Remove Duplicate Elements From ArrayList In Java?


Input : [1,2,4,2,4,5]
Output : [1,2,4,5]

10. Given a sorted array of distinct integers and a target value, return the index if the target
is found.
If not, return the index where it would be if it were inserted in order. You must write an
algorithm
with O(log n) runtime complexity.
Input: nums = [1,3,5,6], target = 5
Output: 2

You might also like