What is the output of below program. var a = [1,2,3,4] for (var i=0; i<a.length; i++){ setTimeout(function(){ console.log(i) },1000) } ( My Ans : it will print 4 5 times as it will store the latest reference) Next They asked me : How can i print 1,2,3,4 by changing some code in above example
Desarrollador Web Java Interview Questions
712,594 desarrollador web java interview questions shared by candidates
puzzle two wires of diff dimensions have been given. both of them gets completely combusted in 1 hour. you are in a pitch dark room with such two wires and a box of matches. you have to come out of the room in 45 minutes. [you cannot count seconds in your mind or else you cannot visually determine the halfway of the wires given neither do you have anything else other than a box of matches and those 2 wires]
write a program in c++ with this pointer
Given an array of N integers, find the missing integer.
Consider 4 components of a color where: unsigned char red = 0x10; unsigned char green = 0xFF; unsigned char blue = 0x0F; unsigned char alpha = 0x44; Generate a packed color ARGB which is a 32 bit integer such that A is in the MSB of ARGB followed by red, green, blue ----------------- | A | R | G | B | -----------------
simple questions like printing 1 if 0 is input and vice-versa without using switch and if.
solve following program void main(){ int x =10; { int y =20; } pfintf('x=%d,y = %d',x. y); }
1) One grandfather has three grandchildren, two of their age difference is 3, eldest child age is 3 times youngest child’s age and eldest child’s age is two times of sum of other two children. What is the age of eldest child? (Ans: 15 years) 2) we can tell you that the first and last digits of the year during which he was born add up to the second digit and that the third digit is one larger than the second digit and that 3 times fourth digit equals 2 times the third digit. Calculate year of his birth. (Ans: 1564) 3) Bella wants to go on a date and prefers her date to be tall, dark and handsome. Of the preferred traits - tall, dark and handsome - no two of Lautner, Jacob, Edward and Welch have the same number. Only Lautner or Welch is tall and fair. Only Jacob or Edward is short and handsome. Lautner and Edward are either both tall or both short. Jacob and Welch are either both dark or both fair. Who is Bella's date? (Ans: Edward)
Calculate the angle between a clock's hands---in any language.
Home code test. Write a point of sales API that applies a discount after certain # of products of a the same type have been purchased.
Viewing 2081 - 2090 interview questions