Download Revature Interview Questions and Answers 2024 and more Exams Nursing in PDF only on Docsity! Revature Interview Questions and Answers 2024 What is a getter/setter? What is their answerpurpose? - Functions that modify private variables. How do you select all tables in a database? answer- SELECT* FROM sys.Tables or SELECT*FROMinformation_schema.tables How do you link a style sheet to an html answerdocument? - By using the link element <link rel="stylesheet" type="text/css" href="css/style.css"> Can we overload or override static methods answerin java? - Yes, we can overload static methods by having the same method but with different parameters in the sub class. No, we can't override a static method because static methods are done at compile time while method overriding only occurs at runtime. What is override and overload? - answer Override is when you use a subclass but modify or overload is when you use the same method in add to it, while the same method in a subclass but you have a different number or type of parameters. answerWhat is an SQL trigger? - They are stored programs that are automatically executed in response to an event, such as inserting a new row in a table. Name and explain some elements in HTML - answer <a> for <br> to create <h1> to create creating hyperlinks, a line break, a heading <div>used to divide the page <p> used to create a paragraph <article> to create independent self contained content from rest of page <header> used <nav> used to <footer> used to define the header section define navigation area to define footer Area.; Tell me about a project you recently worked on? - answer The last major project i answer It tells markup language What is doctype used for? - the browser what version of is being used. How can you create a button in HTML? - answer <button type="button">My Button </button> How do you comment in HTML? - answer <!-- This is a single line comment --> What is MVC? - answer Model View Controller it consists of three parts" one that is the visual part that users interact with - the view, one that represents the object being modeled, and something that manages data between the different parts - the controller. What are selectors? List some - answer Patterns used to select the element you want to change. .class, #id, :visited. answerWhat is a wireframe? - A visual guide that represents the skeletal framework of a website. Wireframes are created for the purpose of arranging elements to best accomplish a particular purpose. What are HTML form methods? - answer Specifies which http protocol should be used when submitting form data. The options are Get and Post. answerWhat is the box model? - A box that wraps around every HTML element. It consists of: margins, borders, padding, and the actual content. answer How can you open a link in a new <a href="url"tab/browser window? - target="_blank"> down list? - answer What is the correct HTML for making a drop- the <select> element Which input type defines a slider control? answer- <input type="range"> Which HTML element is used to display a answerscalar measurement within a range? - The <meter> element What is the syntax for referring to an answerexternal style sheet? - <link rel="stylesheet" type="text/css" href="mystyle.css"> Which CSS property is used to change the answertext color of an element? - color in a text start answer text- How do you make each word with a capital letter? - transform: capitalize; What is the javascript syntax to change an element of an HTML page? - answer document.getElementById("demo").innerHTML = "Hello World!"; When using the padding property; are you allowed to use negative values? - answer No How do you select all p elements inside a answerdiv element? - div p; parameters for database opening a file, network If strings were mutable be changed and it would connections, connections, etc. those values could be a security risk. It would also make hashmaps much less efficient, since they would have to check the hashcode every time it was used. what is a try, catch and what purpose does answerfinally serve? - A try statement is used to catch exceptions that might be thrown as use a try statement your program executes. You should statement whenever you use a that might throw an exception A try block is always followed by a catch block, which handles the exception that occurs in the try block. A finally block contains all the crucial statements that must be executed whether an exception occurs or not. answer Stringtype an object declaration - mystring = new String(); answerWhat is normalization? - A process which involves organizing the fields and tables of a database to eliminate data redundancy and Insertion, Update and Deletion Anomalies. Why is the main method static in java? -answer Static allows main() to be called of the class has been necessary because main() before an object created. This is is called by the JVM before any objects are can be directlymade. Since it is static it invoked via the class. answer Means thatWhat does static mean? - the variable or function is all instances of that class to the type, not the actual shared between as it belongs objects themselves. So if you have a variable: private static int i = 0; and you increment it ( i++ ) in one instance, the change will be reflected in all instances. What are the four pillars of oop? - answer Abstraction,Polymorphism, Encapsulation, Inheritance What is object oriented programming? - answer A design philosophy based on objects which contain data in attributes and code in the form of methods. Objects are an instance of a class, which is a template for creating objects. What is a constructor? - answer a block of called whencode similar to a method that's an instance of an object is created. How do you create a new constructor? - answer public Actor(String first, String last) { firstName = first; lastName = last; } Actor a = new Actor("Arnold", " Schwarzenegger"); What is inheritance? What are the differentanswerypes? - The mechanism by which one class inherits the attributes and methods of another class. Single Inheritance: A Subclass inherits methods and attributes from one superclass. What do you use JavaScript for? - answer Javascript code is written into an HTML page, usually to make the website more interactive for users or to create online programs. How do you create a variable in JavaScript?answer- var number = 100; answerWhat is a stored procedure? - A set of SQL statements with an assigned name, which are stored in a relational database management system as a group, so it can be reused and shared by multiple programs. What are the benefits of a stored answerprocedure? - Better network efficiency since queries are stored on server. Makes code more maintainable, Better security, since we can restrict the or delete tables unless procedure, ability to change they use a stored C onsistency, since it forces all 3rd party programs who are querying data to use the business logic from the stored procedure. What is the difference between "==" and "===" in Javascript? - answer What is a WHERE and HAVING clause? - answer What is the difference between encapsulation and abstraction? - answer Abstraction is about hiding unwanted details while giving out most essential details, the code class or while Encapsulation means hiding and data into a single unit e.g. method to protect inner working of an object from outside world. What are the differences between abstract answerclasses and interfaces? - 1.Abstract classes can have abstract and concrete methods. Interfaces can only use abstract interfaces. 2.Variables in interfaces are by default final, abstract classes can contain non- final variables 3.Abstract classes can contain static, non-static, and final variables. Interfaces only have static and final 4.Implementation: Abstract provide the implementation variables. classes can of multiple interfaces, an interface can't provide implementation of an abstract class. 5.Inheritance vs. Abstraction: Interface can be implemented using key word implements, abstract classes can be extended using keyword extends. 6.An abstract class can only extend one class or abstract class at a time, an interface can extend any number of interfaces at a time. Example1{ class: class Example3 extends void display3(); Abstract abstract abstract } Interface: interface Example3 extends Example1,Example2{ 7. Interfaces are public by default, abstract classes can be private, static,etc. answerWhat is a Jagged Array? - an array whose elements are arrays and can be different sizes. Do you know what multi-threading is? How do you do it (how would you start/stop a answerthread)? - The main purpose is to provide simultaneous execution of two or more parts of a program to maximize the CPU usage.A multithreaded program contains two or more parts that can run concurrently. . Thread thread = new Thread(); To start a thread: thread.start(); To stop a thread: boolean variable flag and set itCreate a to true Create a sets the method to stop the thread, which variable to false. Use a while(flag) loop, and when you want to stop it call the stop thread method. Whats the difference between a == and === answerin javascript? - "===" checks to see if expressions are the same as well as being equal. Difference between INNER JOIN and OUTER answerJOIN - An inner join searches tables for matching or overlapping data. Upon finding it, the inner join combines and returns the information into one new table that contains only the matches from each table. An outer join returns a set of records (or rows) that include what an inner join would return but also includes other rows for which no corresponding match is found in the other table. Includes left outer join, which returns all records from the left table (table1), and the matched records from the right table (table2). The result is NULL from the right side, if there is no match. Also includes right outer join, which would include all records from the right table, and the matched records from the left table, even if there are null values. A full outer join joins all data from the two tables, even if there is no shared information. answerstatement? - Yes, but only the Can you have multiple catch blocks on a try one isthat first matches the exception type executed. answerCan you overload a constructor? - Yes What's the difference between a class and answeran interface? - An interface is aspecial type of construct in Java, which is used as a contract to guarantee implementation of certain behaviors in a subclass. an interface gives you method name but not the behavior of that method, which will come from the class which implements it. Since an interface is completely abstract them but a concrete of a you cannot create an object of class can be both abstract and hence you can create an object concrete class in Java. answerWhat is JVM, JRE? - Java virtual machine, java runtime environment between multiple threads, and doesn't allow nulls. What does it mean to have a "Normalized" answerdatabase? - the process of organizing the columns (attributes) and tables (relations) of a relational database to reduce data redundancy and improve data integrity. What code would you write for Java to find the product of two numbers without using answerthe multiplication operator? - public class multiply { public static void main(String Args[]) { BufferedReader obj = new BufferedReader(new InputStreamReader((System.in))); System.out.println("Enter the first number"); int a= Integer.parseInt(obj.ReadLine()); System.out.println("Enter the second number"); int b=Integer.parseInt(obj.ReadLine()); int c=0; for(int i=0;i<b;i++) { c = a + c; } System.out.println("The product is " +c); } } What are checked answer- In Java RuntimeException and unchecked exceptions? exceptions under Error and classes are unchecked exceptions, everything else under throwable is checked Unchecked Exception in Java is those Exceptions whose handling is NOT verified during Compile time . These exceptions occurs because of bad programming What are the differences between an array and an arraylist? - answer 1. Static size vs. Dynamic: An array is meaning you can't add to static in size, it once it has been created. An Arraylist is dynamic, meaning that each object in the Arraylist has an instance variable called capacity, which automatically expands as new objects are added. 2.Performance: Performance between the two is pretty similar, except when you are doing a resize() operation on the arraylist, where performance will suffer. 3.Primitive variables: An array can contain primitive values, while an arraylist can only contain objects. It converts the primitive value into its equivalent object, such as: ArrayList arraylistobject = new ArrayList(); arraylistobject.add(23); // try to add an int What actually happens: arraylistobject.add(new Integer(23)); 4.Iterating through values: An arraylist uses iterator to iterate through the objects in the arraylist, while an array uses a for or for each loop. 5.type safety: An array contains values of a specific data type such as a string array. If you try to add an int to that array an exception is thrown.