Interview Questions and Answers - Order By Newest Q2761. What is the difference between Subject and Observable ? 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  subject vs observable Q2762. Why do we do transformation on the observable itself rather than doing it in the subscriber ? RxJs
Ans. Because that way we just need to do that transformation at one place and not within each subscriber. Single source of truth. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Angular   Observable  Suscriber 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  memory management  heap memory   heap allocation expert Q2764. Do you ever merge changes from one feature branch to another ? Why ? SCM
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  SCM  Source Code Management  Configuration Control  Git  Svn Q2765. How can you trim all strings in an array ?
Ans. array.map(s => s.trim()) Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java   angular   typescript   javascript Q2766. Is it safe to use session storage ? Javascript
Ans. Session storage can be accessed from XSS (Cross site Scripting) attacks but cookies (if set with "HttpOnly" and "Secure" flags) are more safer against these attacks. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  session storage  security Q2767. Can we specify that a particular variable may have either of the two data types in Typescript ? Typescript
Ans. let result: string | boolean; Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q2768. How can we specify that a particular variable may have either of the two data types in Typescript ? Typescript
Ans. Yes Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q2769. How can we specify that a particular variable may have either of the two data types in Typescript ? Typescript
Ans. let result: string | boolean; Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q2770. What does the following declaration mean
let result: string | number; Typescript
Ans. It means we can assign either a string or a number to result. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q2771. Will the following code give any error
let result: string | number;
result = true; Typescript
Ans. Yes, result can either be string or a number but not boolean. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q2772. Will the following code give any error
let result: string | number;
result = 'true'; Typescript
Ans. No Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q2773. Will the following code give any error
let result: string | number;
result = 'true'; Typescript
Ans. No Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q2774. Will the following code give any error
let result: boolean;
result = false | true; Typescript
Ans. Yes, | is a bitwise operator and not boolean or. Use || instead Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q2775. 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   Q2776. 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   Q2777. 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   Q2778. 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 Q2779. 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 Q2780. 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 Q2781. When String literals are compared using ==, they always returns true if the string values are same because .. Reference Core Java
a. of overridden compareTo method b. of overridden compare method c. of String Pool d. == means that the object contents are equalAns.c. of String Pool
Q2782. 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 classesAns.b. Inheritance is Tightly Bound
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 trueAns.c. if x.equals(y) returns true, x==y returns true too
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 aboveAns.b. Constructor provided by Java if no constructor is declared
Q2785. 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 blockAns.d. We can create new object through static method or static block
Q2786. 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. falsetruefalseAns.a. falsetruetrue
Q2787. 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. falsefalsefalseAns.c. truetruetrue
Q2788. 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. String1String1Ans.a. String1String2
Q2789. 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. String1Stringg3String1Ans.b. String1String3String2
Q2790. Which method needs to be implemented if a class is implementing comparable interface ? Core Java
a. comp b. compare c. compareTo d. compareEqualsAns.c. compareTo