Professional Documents
Culture Documents
Hacker Rank Questions Kunga
Hacker Rank Questions Kunga
var a = "Starter";
var result = a.substring(2, 4);
document.write(result);
</script>
A. arte
B. tar
C. ar
D. tart
ANSWER: C
[Q318-DL-3]
Consider the two codes given below:
What will the following javascript code return:
var a=19;
var b=7;
var res=eval("a+b");
document.write(res);
A. 26
B. 197
C. a+b
D. none of the above
Answer: B
[Q319-DL-4]
setTimeout(()=> console.log(3),2000);
console.log(1);
setTimeout(()=> console.log(2),0);
console.log(6);
A. 3 1 2 6
B. 1 3 2 6
C. 1 2 6 3
D. 1 6 2 3
Answer: D
[Q320-DL-3]
A. exists
B. isinside
C. in
D. lies
Answer: C
[Q321-DL-5]
//make([99,1,4,555], 5);
A. [555,99,1,4]
B. [99,1,4,555]
C. [4,555,1,99]
D. [1,4,555,99]
Answer: A
[Q322-DL-4]
var a = Math.max();
var b = Math.min();
print(a);
print(b);
A. infinity -infinity
B. -infinity infinity
C. infinity infinity
D. -infinity -infinity
Answer: B
[Q323-DL-3]
A. stringify()
B. convert()
C. parse()
D. none of the above
Answer: A
[Q324-DL-4]
a = [1, 2, 3, 4, 5];
print(a.slice(2, 4));
A. 2,3
B. 3,4
C. 3,4,5
D. 2,3,4
Answer: B
[Q325-DL-3]
A. await
B. async
C.setTimeout
D. none of the above
Answer: B
[Q326-DL-3]
Answer: A
[Q327-DL-5]
[Q328-DL-4]
A. true
B. false
C. undefined
D. none of the above
Answer: B
[Q329-DL-4]
[Q330-DL-3]
Which of the following String object functions produces a number indicating whether
a reference string follows the supplied string in sort order, comes before it, or is the
same as it?
A. concat()
B. substr()
C. search()
D. localeCompare()
Answer: D
[Q331-DL-3]
Which of the subsequent array functions returns true if each member in the array
fulfils the testing function given?
A. every()
B.concat()
C. push()
D. some()
Answer: A
[Q332-DL-3]
A. Using innerHTMl()
B. using console.log()
C. using document.write()
D. using window.alert()
Answer: C
[Q333-DL-4]
var x;
console.log(x);
x = 25;
A. 25
B. reference Error
C. Undefined
D. NAN
Answer: C
[Q334-DL-3]
A.onmouseover
B.onmousemove
C.onclick
D.onmousescroller
Answer: D
[Q335-DL-3]
[Q336-DL-3]
A. window.reload()
B. location.reload()
C. window.refresh()
D. location.refresh()
Answer: B
[Q337-DL-3]
[Q338-DL-3]
A. onmouseoff
B. onmouseunder
C. onmouseout
D. onnotmouseover
Answer: C
[Q339-DL-4]
[Q340-DL-4]
function compare()
{
int hey=1;
char j=1;
if(hey.tostring()===j)
return true;
else
return false;
}
a)runtime error
b) logical error
c) true
d) false
Answer: B
[Q341-DL-3]
What is the async attribute's default value?
a) 0
b) 1
c) True
d) False
Answer: C
[Q342-DL-3]
What steps are involved in creating a data frame?
a)frame(data)
b) frameData()
c) data.frame()
d) frame.Data()
Answer: C
[Q343-DL-3]
Answer: A
[Q344-DL-3]
Which of the following describes a script object attribute?
a)onclick
b) onload
c) onshow
d) onhover
Answer: B
[Q345-DL-3]
Which command is used to refresh the the webpage in javascript
a)window.reload
b) location.reload
c) window.refresh
d) page.refresh
Answer: B
[Q346-DL-3]
The message displayed in a dialogue box is displayed using which Window object method?
a) alert()
b) prompt()
c) message()
d) console.log
Answer: A
[Q347-DL-3]
To _______________, utilise the setTimeout() function.
A)Put the event to sleep
B) Register a function to be called after a specific amount of time
C) Call an event
D) Iteration time
Answer: B
[Q348-DL-3]
What criteria should I use to choose a document element based on the value of its id attribute?
a) getElementsbyId()
b) getElementbyId()
c) both getElementsbyId() and getElementbyId()
d) getElement
Answer: B
[Q349-DL-3]
What is the output of the code below:
var b5 = Boolean('false');
document.getElementById("demo").innerHTML =b5;
a)False
b) True
c) Error
d) Undefined
Answer: B
[Q350-DL-4]
What is the output of the following function:
function myFunction()
{
var x = null;
document.getElementById("demo").innerHTML = Boolean(x);
}
a)True
b) False
c) Error
d) Undefined
Answer: B
[Q351-DL-3]
How can Express.js construct chainable route handlers for a given route path?
a) Using app.route()
b) Using app.routes()
c) Using app.router()
d) Using app.routing()
Answer: A
[Q352-DL-3]
Which of the following best describes how Express.js should be used with Node?
a) var = require('express')();
b) var_require('express')();
c) var app = require('express')();
d) None of the above.
Answer: C
[Q354-DL-3]
Which of the following methods asks that the server accept the information contained in the
request to change an already-existing object referenced by the URI?
a) GET
b) DELETE
c) PUT
d) POST
Answer: C
[Q355-DL-3]
Where are the captured values for the route parameters filled in?
a) app.locals object
b) req.data object
c) req.params object
d) None of the above.
Answer: C
[Q356-DL-3]
a) $ node console
b) $ node repl
c) $ node start
d) $ node
Answer: A
[Q357-DL-3]
Which of the above methods is used to return the process's current working directory?
a) cwd();
b) cwd();
c) pwd();
d) None of the above.
Answer: A
[Q358-DL-3]
Which of the subsequent is not an authorised SQL type?
a) FLOAT
b) NUMERIC
c) DECIMAL
d) CHARACTER
Answer: C
[Q359-DL-3]
Answer: B
[Q360-DL-3]
What operator is employed when comparing a value to a given set of values?
a) ANY
b) BETWEEN
c) ALL
d) IN
Answer: D
[Q361-DL-3]
INSTR ('GOOD DAY', 'Y') returns what?
a) 6
b) 7
c) GOOD
d) DAY
Answer: B
[Q362-DL-3]
[Q363-DL-3]
[Q365-DL-3]
a) A unique key cannot store a null value, although a primary key can.
b) In contrast to many unique keys, a table can only have one primary key.
c) A date variable cannot be a primary key, however a unique key can
d) None of these
Answer: B
[Q366-DL-3]
Answer: C
[Q368-DL-3]
When the document's content in the window is stable and available for modification, which
handler is called?
a) onload
b) manipulate
c) create
d) onkeypress
Answer: B
[Q369-DL-3]
How can I discover every container element with the class "today" using JavaScript?
a)var elements = document.getElementsByClassName(“today”);
b) var elements = document.getElementByClassName(“today”);
c) var elements = document.getElementByName(“today”);
d) var elements = document.getElementsClassName(“today”);
Answer: A
[Q370-DL-3]
Answer: B
[Q371-DL-3]
a) Window Object
b) Document Object
c) Form Object
d) Form Control Elements
Answer: A
[Q372-DL-3]
a)number
b) string
c) object
d) undefined
Answer: C
[Q373-DL-4]
We may use the _____________ method to transform a string to an array.
a) charAt()
b) charCodeAt()
c) split()
d) toLowerCase()
Answer: C
[Q374-DL-3]
[Q375-DL-3]
Which of the following functions allows you to register a function that will be called repeatedly
after a given amount of time?
a)setTimeout()
b) setTotaltime()
c) setInterval()
d) settime()
Answer: C
[Q376-DL-3]
[Q377-DL-3]
When Is The WHERE Clause Useful?
a) CREATE statement requires a perfect match.
b) SELECT statement requires an exact match.
c) SELECT query cannot find an exact match.
d) In a CREATE statement, it is impossible to find a perfect match.
Answer: C
[Q378-DL-3]
a) 789
b) 789abc
c) Exception
d) NaN
Answer: A
[Q379-DL-3]
Which method of the Window object may be used to open a new web browser window?
a) createtab()
b) Window.open()
c) open()
d) create()
Answer: B
[Q380-DL-3]