You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the candidate has no clue about a main theoritical answer, don't expect to invent it in that moment. There are typical programming exercises which can be learnt or can be figured out in that very moment. But it is a ridiculous expectation that the candidate will figure out big programming concepts during an interview.
What is the difference between Interface vs Abstract class?
What is the difference between Overloading and Overriding?
Which runs in Runtime and which in Compile time?
When do we use the static keyword? Can we use it on a function? On a field? Can we instantiate a static class? Does a static class have a constructor?
When do we use the abstract classes and interfaces? Can we use them on a function? On a field? Can we instantiate an abstract class? Does an abstract class have a constructor? Can we implement functionality in an interface? How many parent classes/interfaces may a class have? How do we implement an inheritation?
What is an annotation?
Which kinds of Collections do you know?
What is a List and what is an Arraylist? How is Arraylist implemented?
Tell another List implementation
What is the difference between ArrayList and LinkedList?
Which is faster?
How do we place a new element to its 3rd place in LinkedList / ArrayList?
How do we delete an element from its 3rd place in LinkedList / ArrayList?
Is int and object type? Is string an object type?
When would we use a set? How do we list its elements?
How does a map checks if it already has that key?
What is an iterator?
What is the difference between equals() and == ?
What can we tell about two Hashcodes of the objects they represent are true for Equals()?
What can we tell about the result of Equals() of two objects if their Hashcodes are different?
What can we tell about the result of Equals() of two objects if their Hashcodes are equal?
How and when do we use Hashcode and Equals?
How does HashMap work?
How do we inherit a class from a superclass? How do we connect a class with an interface?, How wo we inherit an interface from an interface? Which keywords do we use in these cases?
Is override a keyword? How do we use it? Does subclass function override superclass function? What if superclass functions is static?
What do we use final keyword for?
Can we reach a function in a subclass which is defined as final/static/private/final static in superclass?
Can we override a function in a subclass which is defined as final/static/private/final static in superclass?
May an abstract class can have non-abstract methods?
How do we exit from a for loop in a for loop?
Is multiple class inheritance allowed in Java? What is the diamond problem?
What are the new functionalities in the last Java version?
What is Marker interface?
What is Serialization?
How Serialization is implemented in Java?
What's the difference between passing by reference and passing by value?
What is a checked and an unchecked exception in Java?
What is an Error, how it is different than a Exception?
How do we implement Threads in Java?
Which problems occur about Threads and how do we solve them?
For loop in a for loop - We can use use double break, we can use return, we can name the loop and break that loop. Goto is forbidden, break is a bad practice, use return if it is possible
ArrayList - contains an array. Every size increase is applied with creating a new, bigger copy of the array. Class has a strategy to increase the size more than actually necessary (it increases its Array size by 50%), so further element adds won't all need new arrays.
List, Set - interfaces, not classes
Hashcode and Equals
They are for comparing objects, Object superclass has them.
For a comparison we use hashcode comparison first. If it results false, objects are not equal. If it results true, we call equals() to decide if objects are equal are not. Two different objects may have the same hashcode but different hashcodes cannot be made from equals objects.
How do you update NPM to a new version in Node.js?
Why is Node.js Single-threaded?
Explain callback in Node.js
What is callback hell in Node.js?
Explain the role of REPL in Node.js.
Answers
Node def: Node.js is an open-source, cross-platform JavaScript run-time environment that executes JavaScript code outside of a browser, based on Google’s V8 JavaScript engine (virtual machine).
Why? :
non-blocking
async
concurrency
scalability
update npm: $ sudo npm install npm -g
Why is Node.js Single-threaded? :
Node.js is single-threaded for async processing.
By doing async processing on a single-thread under typical web loads,
more performance and scalability can be achieved as opposed to the typical thread-based implementation.
Explain callback in Node.js. :
A callback function is called at the completion of a given task.
This allows other code to be run in the meantime and prevents any blocking.
Being an asynchronous platform, Node.js heavily relies on callback.
All APIs of Node are written to support callbacks.
Callback hell in Node.js - overnesting
Explain the role of REPL in Node.js. : READ EVAL PRINT LOOP
As the name suggests, REPL (Read Eval print Loop) performs the tasks of – Read, Evaluate, Print and Loop. The REPL in Node.js is used to execute ad-hoc Javascript statements. The REPL shell allows entry to javascript directly into a shell prompt and evaluates the results. For the purpose of testing, debugging, or experimenting, REPL is very critical.