Revature Interview Questions with correct answers
What is the difference between method overload and method overriding?
Correct Answer-Overloading occurs when two or more methods in one
class have the same method name but different parameters
Overriding means having two methods with the same method name and
parameters
Polymorphism applies to overriding, not to overloading
Overriding is a run-time concept while overloading is a compile-time
concept.
What are the four pillars of OOP? Correct Answer-Inheritance
Polymorphism
Encapsulation
Abstraction
What is a do-while loop? Correct Answer-It is similar to the while loop
except for the fact that the do statement executes at least once, then it
will execute the while expression until it is false
What is a loop? List them. Correct Answer-A loop statement allows us
to execute a statement or group of statements multiple times
,The three kinds of loops are:
For Loop
While Loop
Do While Loop
What is a conditional statement? Correct Answer-An expression that
only execute if the given condition is true
What does WHERE do in SQL? Correct Answer-The WHERE clause is
used to filter records.
The WHERE clause is used to extract only those records that fulfill a
specified condition.
How do you classify a variable in Javascript? Correct Answer-You
declare a JS variable with the var keyword: var carName and after the
declaration, the variable has no value (technically it has a value of
undefined)
What is the purpose of CSS? Correct Answer-Formatting/styling
webpages
What is HTML and provide a list of tags Correct Answer-Hyper Markup
Language
,Some tags include: p, a, ul, ol, head, body, header, footer, strong, u, em.
What is the difference between a queue and a stack? Correct Answer-A
stack is an ordered list of element where all insertions and deletions are
made at the same end, whereas a queue is exactly the opposite of a stack
which is open at both the ends meaning one end is used to insert data
while the other to remove data. A stack is known as LIFO and queue is
known as a FIFO rule.
What is the difference between an array and an array list? Correct
Answer-Arrays have a fixed length and can store both objects and
primitives, while Arraylists can only store objects and have a variable
length.
What is the difference between a set and a map? Correct Answer-List
allows duplicate elements. Any number of duplicate elements can be
inserted into the list without affecting the same existing values and their
indexes.
Set does not allow duplicates. Set and all of the classes which
implements Set interface should have unique elements.
Map stored the element as key & value pair. Map does not allow
duplicate keys while it allows duplicate values.
, What is inheritance? Explain and give an example Correct Answer-
Inheritance in Java is a mechanism in which one object acquires all the
properties and behaviors of a parent object.
What is the difference between an abstract class and an interface?
Correct Answer-An abstract-class allows you to create functionality that
subclasses can implement or override
An interface only allows you to define functionality, not implement it.
What is a string? Explain and give an example. Correct Answer-A string
is a data type, such as an integer and floating point unit, but it is used to
represent text rather than numbers.
For example, the word "hamburger" and the phrase "I ate 3 hamburgers"
are both strings. Even "12345" could be considered a string.
What is polymorphism? Explain and give an example. Correct Answer-
Polymorphism is the ability of an object to take on many forms. The
most common use of polymorphism in OOP occurs when a parent class
reference is used to refer to a child class object.
What is abstraction? Explain and give an example. Correct Answer-
Abstraction is a process of hiding the implementation details and
showing only functionality to the user. It lets you focus on what the
object does instead of how it does it.
What is the difference between method overload and method overriding?
Correct Answer-Overloading occurs when two or more methods in one
class have the same method name but different parameters
Overriding means having two methods with the same method name and
parameters
Polymorphism applies to overriding, not to overloading
Overriding is a run-time concept while overloading is a compile-time
concept.
What are the four pillars of OOP? Correct Answer-Inheritance
Polymorphism
Encapsulation
Abstraction
What is a do-while loop? Correct Answer-It is similar to the while loop
except for the fact that the do statement executes at least once, then it
will execute the while expression until it is false
What is a loop? List them. Correct Answer-A loop statement allows us
to execute a statement or group of statements multiple times
,The three kinds of loops are:
For Loop
While Loop
Do While Loop
What is a conditional statement? Correct Answer-An expression that
only execute if the given condition is true
What does WHERE do in SQL? Correct Answer-The WHERE clause is
used to filter records.
The WHERE clause is used to extract only those records that fulfill a
specified condition.
How do you classify a variable in Javascript? Correct Answer-You
declare a JS variable with the var keyword: var carName and after the
declaration, the variable has no value (technically it has a value of
undefined)
What is the purpose of CSS? Correct Answer-Formatting/styling
webpages
What is HTML and provide a list of tags Correct Answer-Hyper Markup
Language
,Some tags include: p, a, ul, ol, head, body, header, footer, strong, u, em.
What is the difference between a queue and a stack? Correct Answer-A
stack is an ordered list of element where all insertions and deletions are
made at the same end, whereas a queue is exactly the opposite of a stack
which is open at both the ends meaning one end is used to insert data
while the other to remove data. A stack is known as LIFO and queue is
known as a FIFO rule.
What is the difference between an array and an array list? Correct
Answer-Arrays have a fixed length and can store both objects and
primitives, while Arraylists can only store objects and have a variable
length.
What is the difference between a set and a map? Correct Answer-List
allows duplicate elements. Any number of duplicate elements can be
inserted into the list without affecting the same existing values and their
indexes.
Set does not allow duplicates. Set and all of the classes which
implements Set interface should have unique elements.
Map stored the element as key & value pair. Map does not allow
duplicate keys while it allows duplicate values.
, What is inheritance? Explain and give an example Correct Answer-
Inheritance in Java is a mechanism in which one object acquires all the
properties and behaviors of a parent object.
What is the difference between an abstract class and an interface?
Correct Answer-An abstract-class allows you to create functionality that
subclasses can implement or override
An interface only allows you to define functionality, not implement it.
What is a string? Explain and give an example. Correct Answer-A string
is a data type, such as an integer and floating point unit, but it is used to
represent text rather than numbers.
For example, the word "hamburger" and the phrase "I ate 3 hamburgers"
are both strings. Even "12345" could be considered a string.
What is polymorphism? Explain and give an example. Correct Answer-
Polymorphism is the ability of an object to take on many forms. The
most common use of polymorphism in OOP occurs when a parent class
reference is used to refer to a child class object.
What is abstraction? Explain and give an example. Correct Answer-
Abstraction is a process of hiding the implementation details and
showing only functionality to the user. It lets you focus on what the
object does instead of how it does it.