Procom Interview Questions
Procom Interview Questions
Questions
JavaScript:
Question 1: What is the answer of true === "true" in java script?
Answer 1: The expression true === "true" in JavaScript will return false.
Reasoning: This is because true is a boolean primitive value, whereas "true" is a string primitive value.
The === operator in JavaScript checks for both value and type equality, so since true and "true" are of
different types, the answer is false.
Question 4. What are the two basic groups of data types in JavaScript?
Answer 4:
• They are as—Primitive
• Reference types
Primitive types are number and Boolean data types. Reference types are more complex types like strings
and dates.
Question 8: What will the code below output? Explain your answer.
console.log(0.1 + 0.2);
console.log(0.1 + 0.2 == 0.3)
Answer 8: An educated answer to this question would simply be: “You can’t be sure. it might print out
0.3 and true, or it might not. Numbers in JavaScript are all treated with floating point precision, and as
such, may not always yield the expected results.”
The example provided above is classic case that demonstrates this issue. Surprisingly, it will print out:
0.30000000000000004
false
var display=function(){
alert("Anonymous Function is invoked");
}
In this example, the arrow function sum takes two parameters a and b, and returns their sum using the +
operator.
a = MyClass(3)
b = MyClass(4)
c = a + b # returns a new instance of MyClass with x=7
Question 14: What is the main difference between a class and an object?
Answer 14: An object is an instance of a class. Objects hold multiple information, but classes don’t have
any information. Definition of properties and functions can be done in class and can be used by the
object.
A class can have sub-classes, while an object doesn’t have sub-objects.
React:
Class Components: The class components method facilitates you to use ES6 class to define a
component. The above function component can be written as:
class Greeting extends React.Component {
render() {
return <h1>{`Hello, ${this.props.message}`}</h1>
}
}
Laravel:
Answer 3: It is an application-level package manager for PHP. It provides a standard format for managing
PHP software dependencies and libraries.
Question 4: Define laravel query builder.
Answer 4: Laravel query builder is a feature of the Laravel PHP framework that provides a simple and
convenient way to build and execute database queries using a fluent, chain-able interface.
Answer 5: In Laravel, a controller is a PHP class that handles HTTP requests and returns HTTP
responses. Controllers are responsible for handling user input, interacting with models and services, and
returning appropriate responses to the client.
Answer 8: Migrations are important because it allows you to share application by maintaining database
consistency. Without migration, it is difficult to share any Laravel application. It also allows you to sync
database.