Download Revature Technical Interview Questions with
100% Correct Answers/ Revature technical and more Exams Computer Science in PDF only on Docsity! Revature Technical Interview Questions with 100% Correct Answers/ Revature technical screening questions Updated 2023-2024 What are 'Generics' used for? What is the syntax to use Generics? -------- Correct Answer --------- What are the "short circuit" operators? -------- Correct Answer --------- is where, an expression stops being evaluated as soon as is outsome is determined. For example if they are 2 or conditions and the first one is true, then it will stop and it wil not evaluate the second condition. Another example would be two and condition. if the fist one is false. They it won't evaluate the second one, (because they both have to be true). What is the difference between Collection and Collections? -------- Correct Answer ------- -- Collection is the interface that other collections type such as ArrayList, Set, etc implements. What are Objects in Java? -------- Correct Answer --------- Object is an instance of the class. Object is what we work with in Java. How do you create an Object in Java? -------- Correct Answer --------- By using a new keyboard followed by the class name. For example, you create a new person object by new person. What is a Super Class? -------- Correct Answer --------- Super class is the class that is extended by another class. For example, Class A extends Class B. Class B is the super class because class A extends from B. Class is A is the subclass. What are the Access Modifiers in Java? -------- Correct Answer --------- Controls the visibility of variables, methods, or class in Java. Public, protected, default, private. Public - visible to all the other class in the project. Protected - visible only to the classes in the same package and subclasses from other packages. Default - visible only to the classes in the same package. Private - visible only within the class. What is a Constructor in Java? -------- Correct Answer --------- constructor is the special method that doesn't have a return type and has the same exact name as the class name. A class can have multiple constructor that have different parameters. How do you create a constructor? Give an Example. -------- Correct Answer --------- by starting with access modifier like public or private. Followed by the class name. What is a default constructor? -------- Correct Answer --------- Default constructor is the empty constructor provided by JVM when there's no construct in the class. What is a no-args constructor? Give an Example. -------- Correct Answer --------- No args constructor is the construct that doesn't take in any parameters. For example, the constructor public Person ( ) doesn't take in any parameters. What is a parameterized constructor? Give an Example. -------- Correct Answer --------- Is the constructor that take in arguments. For example, a person class has a constructor person that takes in name and has parameters and age. What is the difference between a Method and a Constructor? -------- Correct Answer ---- ----- Method has a return type, can have any name and only trigger when being called explicitly. A constructor doesn't have a return type, can only have the same name as the class name and is triggered when an instance of a class is being created. What are the Primitive Datatypes in Java? -------- Correct Answer --------- Primitive datatypes hold value in Java. There are 8 of them. Boolean, int, double, short, long, byte, float, char. What is a Wrapper Class? -------- Correct Answer --------- Wrapper class contains a primitive datatype field. For example, Integer class is a wrapper class for int. Autoboxing -------- Correct Answer --------- Autoboxing is when Java compiler convert primitive datatype to Wrapper class. For example, convert an int to Integer class. Unboxing -------- Correct Answer --------- Unboxing is when Java compiler convert wrapper class to primitive data type. For example, convert an Integer class to int. What is the rule for changing primitive datatypes into other types? What is this called? -- ------ Correct Answer --------- Narrowing conversion : when converting from bigger primitive datatypes into smaller. DOES REQUIRED casting. For example, converting a long to an int. widening conversion : when converting from smaller primitive datatypes into bigger. DOES NOT require casting. For example, converting an int to long. What is an Array? -------- Correct Answer --------- Arrays are used to store multiple values in a single variable What is the difference between a Set, Queue and List? -------- Correct Answer --------- Set does not retain order and does not take duplicate item. Queue stored data in order, it adds new element to the bottom of the list and remove item from the top of the list. List stores item in order, it adds and removes item from the bottom of the list. What is a Compiled Language? Give an Example Compiled Language. -------- Correct Answer --------- A compiled language is a programming language that can be translated into the computer language which is Binary. Example would be java or C++ What is a Scripting Language? Give an Example Scripting Language. -------- Correct Answer --------- Scripting language is executed without being compiled. It runs directly on the client. For example, javascript is a scripting language because it is executed by the user's browser. What is a Markup Language? Give an Example Markup Language. -------- Correct Answer --------- Is used to format and structure the document. For example, html is used to structure web documents. What is Object Oriented Programing (OOP)? -------- Correct Answer --------- Is programming based on the concept of "objects". It contains attributes and behaviors. For example, a class person, can have something like eye color or name as an attribute and a method that mimics the behavior such as talking or eating. What are the Pillars of OOP? -------- Correct Answer --------- Abstraction, Encapsulation, Inheritance, Polymorphism. Describe Abstraction -------- Correct Answer --------- information that is hiding because is irrelevant to the user. For example: an uBer app.//Back end Encapsulation -------- Correct Answer --------- It protects data by making the instance variable private. For example, when you change your password there are a few validations before you change it, like password length, etc. Inheritance -------- Correct Answer --------- Inheritance enables new objects to take on the properties of existing objects by using the keyword "extends". For example, you can create a class "Dog extends animal" meaning that Dog has all the properties of an animal. Polymorphism -------- Correct Answer --------- Generally, the ability to appear in many forms. In object-oriented programming, polymorphism refers to a programming language's ability to process objects differently depending on their data type or class. What is Method Overriding? -------- Correct Answer --------- When you inherit a method from a parent and you create a method with the same name and signature. What is Method Overloading? -------- Correct Answer --------- When you have a method with the same name but different perimeter for example add (int numberOne) add(int numberOne, int numberTwo) What OOP Pillar are "Method Overriding" and "Method Overloading" most closely associated with? -------- Correct Answer --------- Polymorphism. Overloading is compile time and Overriding is run time. What is an Algorithm? -------- Correct Answer --------- Is a step by step procedure for calculations. It is used for calculation, data processing and automated reasoning. What is an IDE? -------- Correct Answer --------- Integrated Development Environment. It's a tool that help developers become more efficient in programming. For example, eclipse helps you organize your projects structure and auto complete codes. It also shows developers any compile error. What are some benefits of using an IDE? -------- Correct Answer --------- Autocomplete method. It organized the project structure. Organize import package. It tells you the compiler error. What are some problems of using an IDE? -------- Correct Answer --------- You have to install it, and take up memory. What is the syntax of "if" statements? -------- Correct Answer --------- if the condition is true then execute some statement. What is the syntax of "If...else" statements? -------- Correct Answer --------- if condition is true then execute some statement. Else, execute something else. What is the syntax of "If...else if" statements? -------- Correct Answer --------- if something is true then execute. else if different conditions are true, then execute. Else execute something else. What is the syntax of Switch statements? -------- Correct Answer --------- Switch statement starts with a switch(value), followed by one or more cases that could match with the value. Generally, it's a good practice to include the break statement for each case and a default case. What is the difference between "if" and "switch" statements? -------- Correct Answer ----- ---- If statement can check for multiple conditions. Switch statement contains cases which only match the value. What is the "Default" case? -------- Correct Answer --------- Default case belongs to switch statement. It's the special case where none of the other cases match with the value. What is the difference between "while", "do...while" and "for" loops? -------- Correct Answer --------- While loop execute until a condition is no longer true. Do while loop will execute statements in do loop while the condition is true. for loop will iterate through an array or execute and keep track of an integer until that integer no longer meets the condition. What is Java? -------- Correct Answer --------- Java is an OOP (Object Oriented Programing) language, it runs on top of JVM. PLatform independent, meaning you only need to write your code once and it can be run into any system What are the advantages of using Java? -------- Correct Answer --------- Java is easy to learn, and platform independent. Java code can be written once and can be run on any system or OS. What is the JDK -------- Correct Answer --------- JDK is Java Development Kit - development kit that is used by Java programmer to write Java code. What is the JRE? -------- Correct Answer --------- JRE is Java Runtime Environment - contains libraries and software that your Java programs need to run. What is the JVM -------- Correct Answer --------- JVM is Java Virtual Machine - allow Java programs to run on any device or operating system. Different system has different version of JVM. What is the first line of a .Java file? -------- Correct Answer --------- package location of the current class. for example, if a class is located in package person, then the first line would be person.className. How do you import other packages and classes into a Class file? -------- Correct Answer --------- Use the "import" keyword followed by the package location of the class to be imported. What is a Class in Java? -------- Correct Answer --------- A class in Java is a blueprint that contains variables and methods and is used for creating objects. How do you create a Class in Java? -------- Correct Answer --------- By having an access modifier such as public followed by a keyword " class" and the class name. List some CSS properties and what they do. -------- Correct Answer --------- color: changing the color of the content. font-family : changing the font family of the text. font-size : change the size of the display text