Interview Question and Answers | Search Coding Interview Questions - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Interview Questions and Answers - Order By Newest

   
 Q3421. Will this code give any error ?

let result: boolean;
result = false || true;
Typescript
Ans. No

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q3422. Will this code give any error ?

let result: boolean | string;
result = false || 'true';
Typescript
Ans. No

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q3423. Will this code give any error ?

let result: string;
result = false || 'true';
Typescript
Ans. No

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q3424. Can we get the validators for a control in angular ? How ?Angular
Ans. No - https://github.com/angular/angular/issues/13461

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q3425. How can we add a text in front of all input fields in an application ?Angular
Ans. We can create a directive with selector as 'input' and then onInit of the directive , we can append the text to the input control html.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q3426. Can we have multiple selectors for a directive in Angular ?Angular
Ans. Yes

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q3427. What is the use of NgControl ?Angular
 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q3428. What is the use of Renderer class in angular ?Angular
 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q3429. What is the use of ElementRef in angular ?Angular
 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q3430. How can we add a particular styling to a field based on a condition ? Angular
Ans. We can create a directive to do that.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q3431. Can we have a directive that get's applied based on an attribute on a field ?Angular
Ans. Yes

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q3432. Can we initialize final fields within the constructor ? Why ?Core Java
Ans. Yes, Because final fields needs to be initialized before the construction of the object completes. Not necessarily at the time of class loading.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     oops


 Q3433. What is systemd in Unix ?Unix
 This question was recently asked at 'Broadcom, Symantec'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 2 Companies


 Q3434. What is Array.Map function ? What will be output of following ?

const myArray = [1, 4, 9, 16];
const result = myArray.map(x => x * 2);
Javascript
Ans. It will create an array with each value as x*2

[2, 8, 18, 32]

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 2 Companies


 Q3435. What would you use the span element for ?HTML
 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q3436. When String literals are compared using ==, they always returns true if the string values are same because .. Core Java
a. of overridden compareTo method
b. of overridden compare method
c. of String Pool
d. == means that the object contents are equal

Ans.c. of String Pool

 Q3437. Which of the following is true ?Core Java
a. Composition is Tightly Bound
b. Inheritance is Tightly Bound
c. Object can only hold reference of only one other object
d. A Class cannot be extended by multiple classes

Ans.b. Inheritance is Tightly Bound

 Q3438. In case of String Literals ..Core Java
a. x==y on all literals always returns false
b. x.equals(y) on all literals always returns false
c. if x.equals(y) returns true, x==y returns true too
d. if x.equals(y) returns false, x==y returns true

Ans.c. if x.equals(y) returns true, x==y returns true too

 Q3439. What is a default constructor ?Core Java
a. Constructor without parameters declared by user
b. Constructor provided by Java if no constructor is declared
c. Constructor with empty body
d. All of the above

Ans.b. Constructor provided by Java if no constructor is declared

 Q3440. How can we create objects if we make the constructor private ?Core Java
a. We can't create objects if constructor is private
b. We can only create objects if we follow singleton pattern
c. We can only create one object
d. We can create new object through static method or static block

Ans.d. We can create new object through static method or static block

 Q3441. What will be the output of following ?

String str1 = new String("String1");
String str2 = new String("String1");
System.out.print(str1 == str2);
System.out.print(str1.equals(str2));
str1 = str2;
System.out.print(str1 == str2);
Core Java
a. falsetruetrue
b. truetruetrue
c. truetruefalse
d. falsetruefalse

Ans.a. falsetruetrue

 Q3442. What will be the output of following code ?

String str1 = "String1";
String str2 = "String1";
System.out.print(str1 == str2);
System.out.print(str1.equals(str2));
str1 = str2;
System.out.print(str1 == str2);
Core Java
a. falsetruetrue
b. falsefalsetrue
c. truetruetrue
d. falsefalsefalse

Ans.c. truetruetrue

 Q3443. What will be the output of following code ?

String str1 = "String1";
String str2 = "String2";
str1.concat("String3");
System.out.print(str1);
System.out.print(str2);
Core Java
a. String1String2
b. String1String3String3
c. String1String3String1String3
d. String1String1

Ans.a. String1String2

 Q3444. What will be the output of following code ?

String str1 = "String1";
String str2 = "String2";
str1=str1.concat("String3");
System.out.print(str1);
System.out.print(str2);
Core Java
a. String1String2
b. String1String3String2
c. String1String2String3
d. String1Stringg3String1

Ans.b. String1String3String2

 Q3445. Which method needs to be implemented if a class is implementing comparable interface ?Core Java
a. comp
b. compare
c. compareTo
d. compareEquals

Ans.c. compareTo

 Q3446. Which of the following is false ?Core Java
a. A Class cannot override both hashcode and equals method.
b. A class can override both hashcode and equals method.
c. A Class must override hashCode method if its overridding equal method.
d. A Class can override hashCode even if its not overridding equals method.

Ans.a. A Class cannot override both hashcode and equals method.

 Q3447. Collections is a / an ..Core Java
a. interface
b. abstract class
c. final class
d. util class

Ans.d. util class

 Q3448. Which of the following can throw ClassCastException ?Core Java
a. UpCasting
b. DownCasting
c. Casting to incompatible data type
d. Casting to Strings

Ans.b. DownCasting

 Q3449. Which of the following can be overridden ?Core Java
a. final instance methods
b. final static methods
c. non final instance methods
d. non final static methods

Ans.c. non final instance methods

 Q3450. x instanceOf y returns false ..Core Java
a. if x is an instance of y class
b. if x is an instance of class implementing y interface
c. if x is an instance of class extending y class
d. if x is an instance of Class which is a parent of Y class

Ans.d. if x is an instance of Class which is a parent of Y class

previous 30   

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: