upwork test answer blogspot elance test answer 2015 .upwork test answer blogspot elance test answer 2015 blogspot.how to pass upwork test answer blogspot elance test answer 2015 free.upwork test answer blogspot elance test answer 2015.elance test answer for blogspot blogger.upwork test answer blogspot elance test answer 2015.upwork test answer blogspot elance test answer 2015 upwork test answer blogspot elance test answer 2015 upwork test answer blogspot elance test answer 2015

Tuesday, August 1, 2017

odesk upwork readiness test answer


See interesting fb & twitter  tips @http://shahin.murkho.com

                                                       

Here odesk test answer for readiness

Upwork Readines skill test answer
Upwork skill test answer 

Upwork skill test answer is E


Upwork Redinness skill test answer is E
Upwork skill test answer 

Upwork skill test answer is E

Upwork skill test answer
Upwork skill test answer 


Upwork skill test answer is D

Upwork skill test answer
Upwork skill test answer 
Upwork skill test answer is C

Upwork skill test answer
Upwork skill test answer 

Upwork skill test answer is C
Upwork skill test answer
Upwork skill test answer 
Upwork skill test answer is A

See interesting fb & twitter  tips @http://shahin.murkho.com

                                                       
interesting fb & twitter  tips

interesting fb & twitter  tips

Upwork skill test answer
Upwork skill test answer 
Upwork skill test answer is E

Upwork skill test answer
Upwork skill test answer 
Upwork skill test answer is D

Upwork skill test answer
Upwork skill test answer 

Upwork skill test answer is A
Upwork skill test answer
Upwork skill test answer 

Upwork skill test answer is E

See interesting fb & twitter  tips @http://shahin.murkho.com

                                                       
interesting fb & twitter  tips

interesting fb & twitter  tips




finished the odesk test answer for readiness

You may also like 1.elance google search skill test answer 2015 2.elance english spelling skill test answer 2015
3.elance math/mathematical skill test answer 2015
4.elance adobe photoshop cs5 skill test answer 2015
5.elance internet security skill test answer 2015
6.upwork rediness skill test answer 2015

7.elance xhtml skill test answer 2015
8.elance wordpress skill test answer 2015

See interesting fb & twitter  tips @http://shahin.murkho.com

                                                       
interesting fb & twitter  tips

interesting fb & twitter  tips

Tuesday, September 27, 2016

Saturday, August 13, 2016

Upwork C# Test Answer 2016

Upwork C# Test Answer 2016




 
Upwork C# test answers 2015 is one of the best way to get started on your upwork profile completeness.
Q.1. Which of the following define the rules for .NET Languages?
• GAC
• CLS
• CLI
• CTS
• CLR
• JIT
__________________________________________________________________
Q. 2. Which of the following will correctly remove duplicates from a List<T>?
• Int32 index = 0; while (index < list.Count + 1) { if (list[index] == list[index + 1]) list.RemoveAt(index); else index–; }
• List<T> withDupes = LoadSomeData(); List<T> noDupes = new List<T>(new HashSet<T>(withDupes)); withDupes.AddRange(noDupes);
• List<T> withDupes = LoadSomeData(); List<T> noDupes = withDupes.Distinct().ToList();
• List<T> withDupes = LoadSomeData(); var hs = new HashSet<T>(withDupes); withDupes.All( x => hs.Add(x) );
______________________________________________________________
Q.3. Which type of class members are associated with the class itself rather than the objects of the class?

• Public
• Protected
• Private
• Static
_________________________________________________________________
Q.4. Which of the following will block the current thread for a specified number of milliseconds?

• System.Threading.Thread.Sleep(50);
• System.Threading.Thread.SpinWait(50);
• System.Threading.Thread.Yield();
• None of these.
__________________________________________________________________
Q.5. Which of the following statements is true regarding predicate delegates in C#?

• Predicate delegates are used for filtering arrays.
• Predicate delegates are references to functions that return true or false.
• Predicate delegates are only used in System.Array and System.Collections.Generic.List classes.
• Predicate delegates are only used in ConvertAll and ForEach methods.
___________________________________________________________________
Q.6. What are the benefits of using the ExpandoObject class over a using dictionary?

• It offers easier data binding from XAML.
• It’s interoperable with dynamic languages, which will be expecting DLR properties rather than dictionary entries.
• WPF data binding will understand dynamic properties, so WPF controls can bind to an ExpandoObject more readily than a dictionary.
• ExpandoObject can help in creating complex hierarchical objects. ExpandoObject implements the INotifyPropertyChanged interface, which gives more control over properties than a dictionary.
_____________________________________________________________________
Q.7. What are Satellite assemblies in C# .NET?

• Additional assemblies that are used only by the main C# application
• User control assemblies used by the C# application
• Assemblies that contain only resource information and no code
• Assemblies that contain only code and no resource information
_______________________________________________________________________
Q.8. Where does a C# assembly store the information regarding the other external dependencies, such as satellite assemblies, global assemblies etc, and their versions so that they can be loaded correctly when the assembly is executed?

• In the embedded resources of the assembly
• In the manifest of the assembly
• In the MSIL of the assembly
• In the Windows registry database
• None of these
_______________________________________________________________________
Q.9. Which of the following will output the string below?
"\t\t\t\t\t"

• private string Tabs(uint numTabs) { IEnumerable<string> tabs = Enumerable.Repeat(“\t”, numTabs); return (numTabs > 0) ? tabs.Aggregate((sum, next) => sum + next) : “”; }
• private string Tabs(uint numTabs) { StringBuilder sb = new StringBuilder(); for (uint i = 0; i <= numTabs; i++) { sb.Append(“\t”); } return sb.ToString(); }
• private string Tabs(uint numTabs) { string output = “”; for (uint i = 0; i <= numTabs; i++) { output += ‘\t'; } return output; }
• private string Tabs(uint numTabs) { String output = new String(‘\t’, numTabs); return output; }
__________________________________________________________________
Q.10. The global assembly cache:

• Can store two DLL files with the same name
• Can store two DLL files with the same name, but different versions
• Can store two DLL files with the same name and same version
• Cannot store DLL files with the same name
__________________________________________________________________
Q.11. Which statements will give the path where the executing assembly is currently located?

• System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
• System.Reflection.Assembly.GetExecutingAssembly().Location;
• AppDomain.CurrentDomain.BaseDirectory;
• None of these
__________________________________________________________________
Q.12. There is a class that has a public int counter field that is accessed by multiple threads. This int is only incremented or decremented. To increment this field, three thread-safe approaches are mentioned below:

A) lock(this.locker) this.counter++;
B) Interlocked.Increment(ref this.counter);
C) Change the access modifier of counter to public volatile

Which statement is incorrect with regards to these approaches?
• All 3 are equivalent and can be used interchangeably.
• Though A is safe to do, it prevents any other threads from executing any other code which is guarded by locker.
• B is the best approach as it effectively does the read, increment, and write in ‘one hit’ which can’t be interrupted.
• C on it’s own isn’t actually safe at all. The point of volatile is that multiple threads running on multiple CPU’s can, and will, cache data and re-order instructions.
__________________________________________________________________
Q.13. What will happen if the following code is compiled in .NET 4 or above (Assume required namespaces are included)?

public class var { }
public class main
{
    public static void main(string[] args)
    {
        var testVar = new var();
    }
}

• This code will not compile, as var is a reserved keyword, so it can not be used as a class name.
• This code will compile, as var is merely a contextual keyword and it is used to provide a specific meaning in the code, so it will cause no problems.
• This code will not compile, as a new object cannot be created like var testVar = new var();
• None of these.
__________________________________________________________________
Q.14. Which object oriented term is related to protecting data from access by unauthorized functions?
• Inheritance
• Data hiding
• Polymorphism
• Operator overloading
• Abstraction
__________________________________________________________________
Q.15. The .NET Framework consists of:

• The Common Language Runtime
• A set of class libraries
• The Common Language Runtime and a set of class libraries
__________________________________________________________________
Q.16. What will be the value of the result variable after these two statements?


int num1 = 10, num2 = 9;

int result = num1 & num2;

• 1
• 8
• 9
• 10
• 11
• 109
__________________________________________________________________
Q.17. Which of the following code snippets converts an IEnumerable<string> into a string containing comma separated values?

• public static string ConvertToString(IEnumerable<T> source) { return new List<T>(source).ToArray(); }
• public static string ConvertToString(IEnumerable<T> source) { return string.Join(“,”,source.ToArray()); }
• public static string ConvertToString(IEnumerable<T> source) { return source.ToString(); }
• public static string ConvertToString(IEnumerable<T> source) { return string.Join(source.ToArray()); }
__________________________________________________________________
Q.18. Which of the following code samples will create a comma separated list from IList<string> or IEnumerable<string>?

• public static T[] ToArray(IEnumerable<T> source) { return new List<T>(source).ToArray(); } IEnumerable<string> strings = …; string[] array = Helpers.ToArray(strings); string joined = string.Join(“,”, strings.ToArray()); string joined = string.Join(“,”, new List<string>(strings).ToArray());
• List<string> ls = new List<string>(); ls.Add(“one”); ls.Add(“two”); string type = string.Join(“,”, ls.ToArray());
• string commaSeparatedList = input.Aggregate((a, x) => a + “, ” + x)
• public static string Join(this IEnumerable<string> source, string separator) { return string.Join(separator, source); }
__________________________________________________________________
Q.19. What is the advantage of using IList<T> over List<T>?

• IList<T> uses reflection, which is the most efficient way to process an object inside memory.
• IList<T> implements hashing to store objects in the collection; which produces optimum performance.
• Using IList<T> rather than List<T> allows the code to be more flexible. It can replace the implementation with any collection that implements IList<T> without breaking any calling code.
• IList<T> only allows immutable types to be stored inside the collection.
__________________________________________________________________
Q.20. Which of the following code samples will execute a command-line program in C# and return its STD OUT results?

• System.Diagnostics.Process pProcess = new System.Diagnostics.Process(); pProcess.StartInfo.FileName = strCommand; pProcess.StartInfo.Arguments = strCommandParameters; pProcess.StartInfo.UseShellExecute = false; pProcess.StartInfo.RedirectStandardOutput = true; pProcess.Start(); string strOutput = pProcess.StandardOutput.ReadToEnd(); pProcess.WaitForExit();
• Process p = new Process(); p.StartInfo.UseShellExecute = true p.StartInfo.RedirectStandardOutput = false p.StartInfo.FileName = “YOURBATCHFILE.bat”; p.Start(); string output = p.StandardOutput.ReadToEnd(); p.WaitForExit();
• System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo(“program_to_call.exe”); psi.RedirectStandardOutput = true; psi.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; psi.UseShellExecute = false; System.Diagnostics.Process proc System.Diagnostics.Process.Start(psi);; System.IO.StreamReader myOutput = proc.StandardOutput; proc.WaitForExit(2000); if (proc.HasExited) { string output = myOutput.ReadToEnd(); }
• System.Diagnostics.Process pProcess = new System.Diagnostics.Process(); pProcess.StartInfo.FileName = strCommand; pProcess.StartInfo.Arguments = strCommandParameters; pProcess.StartInfo.UseShellExecute = false; pProcess.StartInfo.RedirectStandardOutput = true; pProcess.StartInfo.WorkingDirectory = strWorkingDirectory; pProcess.Start(); string strOutput = pProcess.StandardOutput.ReadToEnd(); pProcess.WaitForExit();
__________________________________________________________________
Q.21. What is an Action delegate?

• An Action is a delegate to a method, that takes zero, one or more input parameters, but does not return anything.
• An Action is a delegate to a method, that takes zero, one or more input parameters, but always returns a boolean value.
• An Action is a delegate to a method that takes one or more input parameters, but does not return anything.
• An Action is a delegate to a method that takes one or more input parameters, but always returns a boolean value.
__________________________________________________________________
Q.22. Which of the following code samples will check if a file is in use?

• protected virtual bool IsFileLocked(FileInfo file) { FileStream stream = null; try { stream = file.Open(FileMode.Open, FileAccess.ReadWrite, FileShare.None); } catch (IOException) { return true; } finally { if (stream != null) stream.Close(); } return false; }
• try { using (Stream stream = new FileStream(“MyFilename.txt”, FileMode.Open)) { } } catch { }
• internal static bool FileOrDirectoryExists(string name) { return (Directory.Exists(name) || File.Exists(name)) }
• FileInfo file = new FileInfo(“file.txt”); if (file.Exists) { // TO DO }
__________________________________________________________________
Q.23. Which of the following statements is true regarding the code samples below?

A: 
try {
  // code goes here
} catch (Exception e) {
  throw e; 
}

B:
try {
  // code goes here
} catch (Exception e) {
  throw; 
}

• A will lose the call stack trace information. B will preserve the call stack trace information.
• A will preserve the call stack trace information. B will lose the call stack trace information.
• Both A and B will preserve the call stack trace information.
• Both A and B will lose the call stack trace information.
__________________________________________________________________
Q.24. Suppose there is a List of type Person with a property of LastName(string) and PopulateList is a function which returns a Generic List of type Person:
List<Person> people = PopulateList();

What does the statement below do?
people.Sort((x, y) => string.Compare(x.LastName, y.LastName));

• It will return a newly created sorted List.
• It will throw a compiler error.
• It will sort the string in place.
• It will throw InvalidOperationException at runtime.
__________________________________________________________________
Q.25. Is it possible to define custom Exception classes in C#?

• Yes
• Yes, but they have to be derived from System.Exception class
• Yes, but they have to be derived from System.Object class
• No
__________________________________________________________________
Q.26. What is the syntax required to load and use a normal unmanaged windows DLL (e.g. kernel32.DLL) in a managed .NET C# code?

• Assembly.Load(”Kernel32.DLL”)
• LoadLibrary(”Kernel32.DLL”)
• [DllImport(”kernel32”, SetLastError=true)]
• Unmanaged DLLs cannot be used in a managed .NET application.
__________________________________________________________________
Q.27. What is the output of the following code?

class Test
{
   static void Main() {
   string myString = “1 2       3  4    5”
   myString = Regex.Replace(myString, @"\s+", " ");
   System.Console.WriteLine(myString);
}
• 12345
• 1 2 3 4 5
• 54321
• 5 4 3 2 1
__________________________________________________________________
Q.28. What is the problem with the following function, which is supposed to convert a Stream into byte array?
public static byte[] ReadFully(Stream input)
{
    using (MemoryStream ms = new MemoryStream())
    {
        input.CopyTo(ms);
        return ms.ToArray();
    }
}

• It will work only in .NET Framework 4 or above, as the CopyTo function of the memory stream is available only in .NET Framework 4 or later versions.
• It will work only in .NET Framework 3.5 or below, as the CopyTo function of the memory stream is available only in .NET Framework 3.5 or earlier versions.
• It will work in all versions of the .NET framework.
• None of these.
__________________________________________________________________
Q.29. Which of the following functions are used to wait for a thread to terminate?

• Wait()
• Terminate()
• Join()
• Abort()
__________________________________________________________________
Q.30. _____________ helped overcome the DLL conflict faced by the C# language versions prior to .NET.

• CLR
• JIT
• CTS
• GAC
• Satellite Assemblies
• All of these
__________________________________________________________________
Q.31. What is the benefit of using a finally{} block with a try-catch statement in C#?

• The finally block is always executed before the thread is aborted.
• The finally block is never executed before the thread is aborted.
• The finally block is never executed after the thread is aborted.
• The finally block is always executed before the thread is started.
__________________________________________________________________
Q.32. In which of the following namespaces is the Assembly class defined?
• System.Assembly
• System.Reflection
• System.Collections
• System.Object
__________________________________________________________________
Q.33. Working with a list of Employees:
List<Employee> lstEmployees = new List<Employee>
            {
                new Employee{Name="Harry",Age=15},
                new Employee{Name="Peter",Age=22},
                new Employee{Name="John",Age=45},
                new Employee{Name="Harry",Age=15},
                new Employee{Name="Peter",Age=22},
                new Employee{Name="John",Age=45},

            };

It is required to filter out employees having distinct names.
Which one of the following options cannot be used?

• public class Employee { public int Age { get; set; } public string Name { get; set; } public override bool Equals(object obj) { return this.Name.Equals(((Employee)obj).Name); } public override int GetHashCode() { return this.Name.GetHashCode(); } } List<Employee> distinctEmployeesByName = lstEmployees.Distinct().ToList();
• public class Employee { public int Age { get; set; } public string Name { get; set; } } public class EmployeeEquityComparable : IEqualityComparer<Employee> { #region IEqualityComparer<Employee> Members public bool Equals(Employee x, Employee y) { return x.Name.Equals(y.Name); } public int GetHashCode(Employee obj) { return obj.Name.GetHashCode(); } #endregion } List<Employee> distinctEmployeesByName = lstEmployees.Distinct(new EmployeeEquityComparable()).ToList();
• public class Employee:IEqualityComparer<Employee> { public int Age { get; set; } public string Name { get; set; } #region IEqualityComparer<Employee> Members public bool Equals(Employee x, Employee y) { return x.Name.Equals(y.Name); } public int GetHashCode(Employee obj) { return obj.Name.GetHashCode(); } #endregion } List<Employee> distinctEmployeesByName = lstEmployees.Distinct().ToList();
• public class Employee { public int Age { get; set; } public string Name { get; set; } } List<Employee> distinctEmployeesByName = (from emp in lstEmployees group emp by emp.Name into gemp select gemp.First()).ToList();
__________________________________________________________________
Q.34. What will be the output of the following Main program in a C# console application (Assume required namespaces are included):

static void Main(string[] args)
        {
            int @int = 15;
            Console.WriteLine(@int);
            Console.ReadLine();
        }

• 15
• It will throw a compilation error.
• It will throw an error at runtime.
• @15
__________________________________________________________________
Q.35. What is the purpose of the catch block in the following code?

try { 
    // Code that might throw exceptions of different types 
}

catch { 
    // Code goes here 
}

• Only errors of type std::unexpected are caught here.
• Other code exceptions are caught.
• This catch block must be the first one in a series of catch blocks that may or may not be followed.
• This catch block can be the last one in a series of catch blocks to handle any exception which is not handled by the preceding catch blocks, each of which handles an exception of a particular type.
• No errors are caught in this try block (they are all passed to the next closest catch).
• None of these.
__________________________________________________________________
Q.36. Which of the following is true about friend functions in C#?

• Friend functions violate the concept of OOPS.
• Friend functions should not be used.
• Friend functions enhance the concept of OOPS if used properly.
• Friend functions are not available in C#.
__________________________________________________________________
Q.37. Which of the following statements is true about the code below?

string[] lines = theText.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);

• It splits the string variable on a system line break.
• It splits the string variable on a ‘\r\n’ line break.
• It splits the string variable on a system line break, while preserving the empty lines.
• It splits the string variable on a system line break, while removing the empty lines.
__________________________________________________________________
Q.38. Consider the following code:

        string s1 = "Old Value";
        string s2 = s1;
        s1 = "New Value";
        Console.WriteLine(s2);

What will be the output printed, and why?

• “New Value”, because string is a reference type.
• “Old Value”, because string is a value type.
• “New Value”, because string is a value type.
• “Old Value”, because string is a reference type.
• “Old Value”, because string is a reference type which is treated as a special case by the assignment operator.
__________________________________________________________________
Q.39. What will be the output if in a WinForms application, the following code is executed in the Load event of a form? Assume this form has lblMessage as a Label Control.

private void Form1_Load(object sender, EventArgs e)
{
    try
    {
        ThreadPool.QueueUserWorkItem(ShowMessage,null);
    }
    catch (Exception ex)
    {
    }
}

private void ShowMessage(object obj)
{
    try
    {
        lblMessage.Text = "Hello from Thread Pool";
    }
    catch (Exception ex)
    {
    }
}

• lblMessage.Text will be set to “Hello from Thread Pool”.
• An InvalidOperationException will be thrown for the function ShowMessage as the UI can be updated only from the UI thread.
• Behavior will vary depending on the form loaded.
• None of these.
__________________________________________________________________
Q.40. Complete the following sentence:
In C#, exception handling should be used...

• to handle the occurrence of unusual or unanticipated program events
• to redirect the programs normal flow of control
• in cases of potential logic or user input errors
• in case of overflow of an array boundary
__________________________________________________________________
Q.41. In C#, can global functions that are not associated with a particular class be defined?

• Yes
• Yes, but they have to be marked with the keyword static.
• Yes, but they have to be marked with the keyword internal.
• No
__________________________________________________________________
Q.42. Which of the following code snippets will call a generic method when the type parameter is not known at compile time?

• var name = InvokeMemberName.Create; Impromptu.InvokeMemberAction(this, name(“GenericMethod”, new[]{myType}));
• MethodInfo method = typeof(Sample).GetMethod(“GenericMethod”); MethodInfo generic = method.MakeGenericMethod(myType); generic.Invoke(this, null);
• Action<> GenMethod = GenericMethod< myType >; MethodInfo method = this.GetType().GetMethod(GenMethod.Method.Name); MethodInfo generic = method.MakeGenericMethod(myType); generic.Invoke(this, null);
• Action<> GenMethod = GenericMethod< myType >; MethodInfo method = this.GetType().GetMethod(“GenericMethod”); MethodInfo generic = method.MakeGenericMethod(myType); generic.Invoke(this, null);
__________________________________________________________________
Q.43. Which of the following is true for CLR?

• It is an interoperation between managed code, COM objects, and pre-existing DLL’s (unmanaged code and data).
• It is a software Output Unit of Deployment and a unit of versioning that contains MSIL code.
• It is the primary building block of a .NET Framework application and a collection of functionality that is built, versioned, and deployed as a single implementation unit.
• All of these.
__________________________________________________________________
Q.44. In the sample code given below, which of the data members are accessible from class Y?

class X {
    private int i;
    protected float f;
    public char c;
}

class Y : X { }

• c
• f
• i
• All of these
__________________________________________________________________
Q.45. If i == 0, why is (i += i++) == 0 in C#?

• //source code i += i++; //abstract syntax tree += / \ i i (post) \ ++
• // source code i += i++; //abstract syntax tree += / \ i ++ (post) \ i First, i++ returns 0. Then i is incremented by 1. Lastly i is set to the initial value of i which is 0 plus the value i++ returned, which is zero too. 0 + 0 = 0.
• int i = 0; i = i + i; i + 1;
• int ++(ref int i) { int c = i; i = i + i; return c;}
__________________________________________________________________
Q.46. Performance-wise, which of the following is the most efficient way to calculate the sum of integers stored in an object array?

• int FindSum(object[] values) { int sum = 0; foreach (object o in values) { if (o is int) { int x = (int) o; sum += x; } } return sum; }
• int FindSum (object[] values) { int sum = 0; foreach (object o in values) { int? x = o as int?; if (x.HasValue) { sum += x.Value; } } return sum; }
• int FindSum (object[] values) { int sum = values.OfType<int>().Sum(); return sum; }
• int FindSum (object[] values) { int sum = 0; foreach (object o in values) { if (o is int) { int x = Convert.ToInt32(o); sum += x; } } return sum; }
__________________________________________________________________
Q.47. Consider the following code block:
 
public class Person
{
    public string GetAge()
    {
        lock (this)
        {
            // Code to get Age of this person object.
        }
    }
}

Which of the following statements is true?

• lock(this) actually modifies the object passed as a parameter, and in some way makes it read-only or inaccessible.
• lock(this) can be problematic if the instance can be accessed publicly, because code beyond one’s control may lock on the object as well. This could create deadlock situations where two or more threads wait for the release of the same object.
• lock(this) marks current object as a critical section by obtaining the mutual-exclusion lock for a given object, all private fields of the object become read-only.
• Implement locking using current application instance or some private variable is absolutely the same and does not produce any synchronization issue, either technique can be used interchangeably.
__________________________________________________________________
Q.48. The ___________ namespace is not defined in the .NET class library.

• System
• System.CodeDom
• System.IO
• System.Thread
• System.Text
__________________________________________________________________
Q.49. Which of the following is true about constructors and member functions?

• A constructor can return values, but a member function cannot.
• A member function can declare and define values, but a constructor cannot.
• A member function can return values, but a constructor cannot.
• All of these.
__________________________________________________________________
Q.50. Which of the following language code is not 'managed' by default in .NET framework?

• Visual Basic
• C#
• C++
• Jscript
__________________________________________________________________
Q.51. One of the ternary operators provided in C# is:

• *
• ::
• &
• ?:
• &lt&lt
__________________________________________________________________
Q.52. What type of code is written to avail the services provided by Common Language Runtime?

• MSIL
• Unmanaged code
• Managed Code
• C#/VB/JS
__________________________________________________________________
Q.53. Asynchronous execution is supported in ADO.NET 2.0 for?

• ExecuteReader
• ExecuteScalar
• ExecuteNonQuery
• All of these
__________________________________________________________________
Q.54. An enum is defined in a program as follows:
         [Flags]
        public enum Permissions
        {
            None = 0,
            Read = 1,
            Write = 2,
            Delete = 4
        }

What will be the output of the following Main program (which has access to the enum defined above) in this C# console application (Assume required namespaces are included) :

static void Main(string[] args)
{
    var permissions = Permissions.Read | Permissions.Write;
    if ((permissions & Permissions.Write) == Permissions.Write)
    {
        Console.WriteLine("Write");
    }
    if ((permissions & Permissions.Delete) == Permissions.Delete)
    {
        Console.WriteLine("Delete");
    }
    if ((permissions & Permissions.Read) == Permissions.Read)
    {
        Console.WriteLine("Read");
    }
    Console.ReadLine();
}

• Write Delete Read
• Write Delete
• Delete
• Write Read
__________________________________________________________________
Q.55. Which of the following keywords prevents a class from being overridden further?
• abstract
• sealed
• final
• oot
• internal
__________________________________________________________________
Q.56. Suppose a class is declared as a protected internal:
protected internal class A
{
}

Which statement is correct with regards to its accessibility?

• This class can be accessed by code in the same assembly, or by any derived class in another assembly.
• This class can only be accessed by code which is in the same assembly.
• This class can only be accessed by code which is in the derived class (i.e. classes derived from Class A) and which are in the same assembly.
• This class can be accessed by any code whether in the same assembly or not.
__________________________________________________________________
Q.57. Which of the following is the correct way to randomize a generic list of 75 numbers using C#?

• Random random = new Random(); List<object> products= GetProducts(); products.OrderBy(product => random.Next(products.Count));
• Random random = new Random(); List<object> products= GetProducts(); products.Randomize(product => random.Next(products.Count));
• Random random = new Random(); List<object> products= GetProducts(); products.Randomize(products.Count);
• Random random = new Random(); List<object> products= GetProducts(); products.Reverse(product => random.Next(products.Count));
__________________________________________________________________
Q.58. What is the output of the following code:

class CCheck {

    public static void Main() {
        string str = @"E:\\RIL\\test.cs";
        Console.WriteLine(str);
    }
}

• “E:\\RIL\\test.cs”
• E:\\RIL\\test.cs
• “E:\RIL\test.cs”
• The compiler will generate an error saying undefined symbol ‘@’.
__________________________________________________________________
Q.59. What is the issue with the following function?

public string GetName(int iValue)
{
    string sValue = "0";
    switch (iValue)
    {
        case 1:
            sValue = iValue.ToString();
        case 2:
            sValue = iValue.ToString();
            break;
        default:
            sValue = "-1";
            break;
    }
    return sValue;
}
• The code will not compile as there shouldn’t be a break statement in the default case label.
• The code will compile but if case 1 is passed as the input parameter to the function, the code for case 2 will also execute (after the code for case 1), and so the wrong value may be returned.
• The code will compile and run without any issues.
• The code will not compile as there is no break statement in case 1.
__________________________________________________________________
Q.60. What will be the output of the following Main program in a C# console application (Assume required namespaces are included):

static void Main(string[] args)
{
    for (int i = 0; i < 1; i++)
    {
        Console.WriteLine("No Error");
    }
    int A = i;
    Console.ReadLine();
}

• No Error
• This program will throw a compilation error, “The name ‘i’ does not exist in the current context”.
• The program will compile, but throw an error at runtime.
• None of these.
__________________________________________________________________
Q.61. What is the difference between int and System.Int32 CLR types?
• int represents a 16-bit integer while System.Int32 represents a 32-bit integer.
• int is just an alias for System.Int32, there is no difference between them.
• int represents a 64-bit integer while Int32 represents a 32-bit integer.
• None of these.
__________________________________________________________________
Q.62. What will be the return value if the function fn is called with a value of 50 for the parameter var?

public int fn(int var)
{
    int retvar = var - (var / 10 * 5);
    return retvar;
}

• 50
• 25
• 49
• Error message
• None of these
__________________________________________________________________
Q.63. Which of the following is true regarding a null and an empty collection in C#?

• An empty collection and a null are both objects.
• An empty collection and a null both have the same meaning.
• Both an empty collection and a null do not refer to any object.
• An empty collection is an object while the null keyword is a literal.
__________________________________________________________________
Q.64. Which of the following exceptions cannot be thrown by the Delete() function of the FileInfo class (ie. FileInfo.Delete())?

• IOException
• SecurityException
• UnauthorizedAccessException
• InvalidOperationException
__________________________________________________________________
Q.65. Which of the following statements are true regarding the ref and out parameters in C#?

• A variable that is passed as an out parameter needs to be initialized, but the method using the out parameter does not need to set it to something.
• The out parameter can be used to return the values in the same variable passed as a parameter of the method. Any changes made to the parameter will be reflected in the variable.
• The ref keyword can only be used on one method parameter.
• The ref parameter is considered initially assigned by the callee. As such, the callee is not required to assign to the ref parameter before use. Ref parameters are passed both into and out of a method.
__________________________________________________________________
Q.66. What is the difference between the String and StringBuilder class objects with respect to mutability?

• String objects are mutable, while StringBuilder objects are immutable.
• String objects are immutable, while StringBuilder objects are mutable.
• There is no difference between them in this context, as both are immutable.
• There is no difference between them in this context, as both are mutable.
__________________________________________________________________
Q.67. How can a single instance application be created in C#?

• System.Threading.SingleInstance can be used to ensure that only one instance of a program can run at a time.
• System.Threading.Mutex can be used to ensure that only one instance of a program can run at a time.
• Locks can be used to force a C# application to launch a single instance at a time.
• C# applications cannot be restricted to a single instance.
__________________________________________________________________
Q.68. What is the difference between Expression<Func<T>> and Func<T>?

• There is no difference between the two.
• Func<T> denotes a delegate, while Expression<Func<T>> denotes a tree data structure for a lambda expression.
• Func<T> denotes a function with parameter of dynamic type, while Expression<Func<T>> denotes a lambda expression.
• None of these.
__________________________________________________________________
Q.69. Which of the following statements is true about IEnumerable<T>?

• IEnumerable<T> supports a Size property.
• IEnumerable<T> supports a Count() extension.
• IEnumerable<T> cannot be casted onto an ICollection<T>.
• IEnumerable<T> cannot be casted onto an IList<T>.
__________________________________________________________________
Q.70. Which of the following statements is true about the System.Environment.NewLine property?

• It’s a string containing “\n” for non-Unix platforms.
• It’s a string containing “\n” for Unix platforms.
• It’s a string containing “\r\n” for non-Unix platforms.
• It’s a string containing “\r\n” for Unix platforms.
__________________________________________________________________
Q.71. An Interface represents which kind of relationship?

• IS A
• HAS A
• CAN DO
• None of these
__________________________________________________________________
Q.72. Why is it a bad practice to use iteration variables in lambda expressions?

• Iteration variables can cause problems with accessing a modified closure.
• Iteration variables are passed by value, which produces unexpected results.
• Iteration variables are passed by reference, which produces unexpected results.
• It is perfectly valid to use iteration variables in lambda expressions.
__________________________________________________________________
Q.73. Which of the following is the correct way to implement deep copying of an object in C#?

• By using the System.Runtime.Serialization.Formatters.Binary.BinaryFormatter class.
• By using the System.Reflection.DeepCopy class.
• By using the DeepCopy() method of Object class.
• By using the MemberwiseClone() method of Object class.
__________________________________________________________________
Q.74. What will be the output of the following Main program in a C# console application (Assume required namespaces are included)?

static void Main(string[] args)
{
    string Invalid = "$am$it$";
    string sResult = Invalid.Trim(new char[]{'$'});
    Console.WriteLine(sResult);
    Console.ReadLine();
}
• amit
• am@am$
• $am$it$
• am$it
__________________________________________________________________
Q.75. Which of the following is the correct way to perform a LINQ query on a DataTable object?
• var results = from myRow in myDataTable where results.Field(“RowNo”) == 1 select results;
• var results = from myRow in myDataTable.AsEnumerable() where myRow.Field(“RowNo”) == 1 select myRow;
• var results = from myRow in myDataTable.Rows where myRow.Field<int>(“RowNo”) == 1 select myRow;
• var results = from myRow in myDataTable.AsEnumerable() where myRow.Field<int>(“RowNo”) == 1 select new { IID= myRow.Field<int>(“IID”), Date = myRow.Field<DateTime>(“Date”), };
__________________________________________________________________
Q.76. What is the purpose of the vshost.exe file in Visual Studio?

• It is used to improve the performance of the Visual Studio debugger.
• It is used to improve the performance of Visual Studio plugins.
• It is used to improve the performance of the C# compiler.
• It is used to load Visual Studio configuration data.
__________________________________________________________________
Q.77. Which of the following code snippets for catch shows a better way of handling an exception?

1.
catch (Exception exc)
{
    throw exc;
}


2.
catch (Exception exc)
{
    throw;
}
• 1 is better as it maintains the call stack.
• 2 is better as it maintains the call stack.
• Both are same.
• None of these.

skrill referee appointments,skrill referral code,skrill bonus,skrill sign up bonus 2016,skrill referral program,skrill invite friend ,skrill free money

skrill referee appointments,skrill referral code,skrill bonus,skrill sign up bonus 2016,skrill referral program,skrill invite friend,

skrill referee appointments,skrill referral code,skrill bonus,skrill sign up bonus 2016,skrill referral program,skrill invite friend

Just click this link and get your free online earning right now 


 skrill referee appointments,skrill referral code,skrill bonus,skrill sign up bonus 2016,skrill referral program,skrill invite friend ,skrill free money 




 skrill referee appointments,skrill referral code,skrill bonus,skrill sign up bonus 2016,skrill referral program,skrill invite friend ,skrill free money 




Just click this link and get your free online earning right now 


 
Just click this link and get your free online earning right now 


Just click this link and get your free online earning right now 

Wednesday, July 1, 2015

upwork skill test answers Javascript 2015

upwork skill test answers Javascript 2015
Find the upwork skill test answers Javascript 2015 key.Get passed upwork skill test answers Javascript 2015 from here easily.Exact and best upwork skill test answers Javascript 2015 with images.Free of cost upwork skill test answers Javascript 2015 to pass.Rel and best upwork skill test answers Javascript 2015.Every test you will pass upwork skill test answers Javascript 2015.
Upwork skilltest answers of Javascript 2015
Upwork skilltest answers of Javascript 2015


1. Which of the following is true about setTimeOut()?

  1. The statement(s) it executes run(s) only once.
  2.  It pauses the script in which it is called.
  3.  clearTimeOut() won't stop its execution.
  4.  The delay is measured in hundredths of a second.
  5.  It is required in every JavaScript function.
                                                         Upwork skilltest answers of Javascript 2015 is >1


2. How can the operating system of the client machine be detected?

• It is not possible using JavaScript.
• Using the navigator object
• Using the window object
• Using the document object
• None of these.
                                       Upwork skilltest answers of Javascript 2015 is >2
3. Which of the following prints "AbBc"?

  1.  var b = 'a'; var result = b.toUpperCase() + 'b' + 'b'.toUpperCase() +'C'['toLowerCase'](); alert(result);
  2.  var b = 'a'; var result = b.toUpperCase() + 'b' + 'b'.toUpperCase() +'c'['toUpperCase'](); alert(result);
  3.  var b = 'a'; var result = b.toUpperCase() + b + 'b'.toUpperCase() +'C'['toLowerCase'](); alert(result);
  4.  var b = 'a'; var result = b.toUpperCase() + 'b' + 'b'.toUpperCase() +C; alert(result);


     Upwork skilltest answers of Javascript 2015 is >1


4. Which of the following descriptions is true for the code below? var object0 = {}; Object.defineProperty(object0, "prop0", { value : 1, enumerable:false, configurable : true }); Object.defineProperty(object0, "prop1", { value : 2, enumerable:true, configurable : false }); Object.defineProperty(object0, "prop2", { value : 3 }); object0.prop3 = 4;

• Object 'object0' contains 4 properties. Property 'prop2' and property 'prop3' are available in the for...in loop. Property 'prop0' and property 'prop1' are available to delete.
• Object 'object0' contains 4 properties. Property 'prop1' and property 'prop2' are available in the for...in loop. Property 'prop2' and property 'prop3' are available to delete.
• Object 'object0' contains 4 properties. Property 'prop0' and property 'prop2' are available in the for...in loop. Property 'prop0' and property 'prop2' are available to delete.
• Object 'object0' contains 4 properties. Property 'prop1' and property 'prop3' are available in the for...in loop. Property 'prop0' and property 'prop3' are available to delete.

    Upwork skilltest answers of Javascript 2015 is >4
5. Performance-wise, which is the fastest way of repeating a string in JavaScript?
  1.  String.prototype.repeat = function( num ) { return new Array( num + 1 ).join( this ); }
  2.  function repeat(pattern, count) { if (count < 1) return ''; var result = ''; while (count > 0) { if (count & 1) result += pattern; count >>= 1, pattern += pattern; } return result; }
  3.  String.prototype.repeat = function(count) { if (count < 1) return ''; var result = '', pattern = this.valueOf(); while (count > 0) { if (count & 1) result += pattern; count >>= 1, pattern += pattern; } return result; };
  4.  String.prototype.repeat = function (n, d) { return --n ? this + (d || '') + this.repeat(n, d) : '' + this };
                                                                              Upwork skill  test answers of Javascript 2015 is >2

6. Consider the following variable declarations:

var a="adam"
var b="eve"

Which of the following would return the sentence "adam and eve"?
Answers:
• a.concatinate("and", b)
• a.concat("and", b)
• a.concatinate(" and ", b)
• a.concat(" and ", b)

  Upwork skill  test answers of Javascript 2015 is >4
7. Which of the following code snippets will correctly split "str"?
  1.  <script> var str = 'something -- something_else'; var substrn = str.split(' -- '); </script>
  2.  <script> var str = 'something -- something_else'; var substrn = split.str(' --- '); </script>
  3.  <script> var str = 'something -- something_else'; var substrn = str.split(' - ',' - '); </script>
  4.  <script> var str = 'something -- something_else'; var substrn = split.str(' - ',' - '); </script>
  Upwork skill  test answers of Javascript 2015 is >1

8. Which object can be used to ascertain the protocol of the current URL?

• document
• window
• history
• browser
• form
• location

  Upwork skill  test answers of Javascript 2015 is >5
9. Which of the following best describes a "for" loop?
Answers:
• "for" loop consists of six optional expressions, enclosed in parentheses and separated by semicolons, followed by a statement executed in the loop.
• "for" loop consists of five optional expressions, enclosed in parentheses and separated by semicolons, followed by a statement executed in the loop.
• "for" loop consists of four optional expressions, enclosed in parentheses and separated by semicolons, followed by a statement executed in the loop.
• "for" loop consists of three optional expressions, enclosed in parentheses and separated by semicolons, followed by a statement executed in the loop.

  Upwork skill  test answers of Javascript 2015 is >4
10. Which of the following descriptions best describes the code below?

<script>
var variable1 = { fastFood: "spaghetti", length: 10 };
Object.freeze(variable1);
variable1.price = 50;
delete variable1.length;
</script>
Answers:
• Object is frozen, a property named "price" is added in the variable1 object, a property named "length" is deleted from this object. At the end of the code, the object "variable1" contains 2 properties.
• Object is frozen, a property named "price" is not added in the variable1 object, a property named "length" is deleted from this object. At the end of the code, object "variable1" contains 1 properties.
• Object is frozen, a property named "price" is added in the variable1 object, a property named "length" is not deleted from this object. At the end of the code, object "variable1" contains 1 properties.
• Object is frozen, a property named "price" is not added in the variable1 object, a property named "length" is not deleted from this object. At the end of the code, object "variable1" contains 2 properties.
11. Which of the following is not a valid HTML event?
Answers:
• ondblclick
• onmousemove
• onclick
• onblink
12. Analyze the following code snippet which uses a Javascript Regular Expression character set. What will be the output of this code?

<html>
<body>

<script type="text/javascript">
var str = "Is this enough?";
var patt1 = new RegExp("[^A-J]");
var result = str.match(patt1);
document.write(result);
</script>

</body>
</html
Answers:
• I
• Is
• s
• I,s,
13. Consider the following image definition:
<img id="logo" src="companylogo1.gif" height="12" width="12" >
Which of the following will change the image to companylogo2.gif when the page loads?
Answers:
• logo.source="companylogo2.gif"
• logo.source="companylogo1.gif"
• document.getElementById('logo').src="companylogo1.gif"
• document.getElementById('logo').src="companylogo2.gif"
14. What is the final value of the variable bar in the following code?

var foo = 9;
bar = 5;
(function() {
var foo = 2;
bar= 1;
}())
bar = bar + foo;
Answers:
• 10
• 14
• 3
• 7
15. Which of the following are JavaScript unit testing tools?
Answers:
• Buster.js, jQuery, YUI Yeti
• QUnit, Modernizr, JsTestDriver
• Node.js, Modernizr, Jasmine
• Buster.js, YUI Yeti, Jasmine
16. Which of the following can be used for disabling the right click event in Internet Explorer?
Answers:
• event.button == 2
• event.button == 4
• event.click == 2
• event.click == 4
17. An image tag is defined as follows:
<img id="ERImage" width="100" height="100" onmouseover="ImageChange()" src="Image1.jpg">
The purpose of the ImageChange() function is to change the image source to Image2.jpg. Which of the following should the ImageChange() function look like?
Answers:
• document.getElementById('ERImage').src="Image1.jpg"
• document.getElementById('ERImage').src="Image2.jpg"
• document.getElementById('ERImage').style.src="Image1.jpg"
• document.getElementById('ERImage').style.src="Image2.jpg"
18. Consider the following JavaScript alert:
<script type="text/JavaScript">
function message() {
alert("Welcome to ExpertRating!!!")
}
</script>
Which of the following will run the function when a user opens the page?
Answers:
• body onload="message()"
• body onunload="message()"
• body onsubmit="message()"
• body onreset="message()"
19. Which of the following code snippets will correctly get the length of an object?
Answers:
• <script> var newObj = new Object(); newObj["firstname"] = "FirstName"; newObj["lastname"] = "LastName"; newObj["age"] = 21; Object.size = function(obj) { var size = 0, key; for (key in obj) { if (obj.hasOwnProperty(index)) size++; } return size; }; var size = Object.size(newObj); </script>
• <script> var newObj = new Object(); newObj["firstname"] = "FirstName"; newObj["lastname"] = "LastName"; newObj["age"] = 21; Object.size = function(obj) { var size = 0, key; for (key in obj) { if (obj.hasOwnProperty(value)) size++; } return size; }; var size = Object.size(newObj); </script>
• <script> var newObj = new Object(); newObj["firstname"] = "FirstName"; newObj["lastname"] = "LastName"; newObj["age"] = 21; Object.size = function(obj) { var size = 0, key; for (key in obj) { if (obj.hasOwnProperty(length)) size++; } return size; }; var size = Object.size(newObj); </script>
• <script> var newObj = new Object(); newObj["firstname"] = "FirstName"; newObj["lastname"] = "LastName"; newObj["age"] = 21; Object.size = function(obj) { var size = 0, key; for (key in obj) { if (obj.hasOwnProperty(key)) size++; } return size; }; var size = Object.size(newObj); </script>
20. Which of the following Array methods in JavaScript runs a function on every item in the Array and collects the result from previous calls, but in reverse?
Answers:
• reduce()
• reduceRight()
• reverse()
• pop()
21. In an HTML page, the form tag is defined as follows:
<form onsubmit="return Validate()" action="http://www.mysite.com/">
The validate() function is intended to prevent the form from being submitted if the name field in the form is empty. What should the validate() function look like?
Answers:
• <script type="text/javascript"> function Validate() { if(document.forms[0].name.value == "") return true; else return false; } </script>
• <script type="text/javascript"> function Validate() { if(document.forms[0].name.value == "") return false; else return true; } </script>
• script type="text/javascript"> function Validate() { if(document.forms[0].name== "") return false; else return true; } </script>
• <script type="text/javascript"> function Validate() { if(document.forms[0].name == "") return true; else return false; } </script>
22. Which of the following code snippets changes an image on the page?
Answers:
• var img = document.getElementById("imageId"); img.src = "newImage.gif";
• var img = document.getElementById("imageId"); img.style.src = "newImage.gif";
• var img = document.getElementById("imageId"); img.src.value = "newImage.gif";
• var img = document.getElementById("imageId"); img = "newImage.gif";
23. Which of the following results is returned by the JavaScript operator "typeof" for the keyword "null"?
Answers:
• function
• object
• string
• number
24. What will be the final value of the variable "apt"?

var apt=2;
apt=apt<<2;
Answers:
• 2
• 4
• 6
• 8
• 16
25. How can a JavaScript object be printed?
Answers:
• console.log(obj)
• console.print(obj)
• console.echo(obj);
• None of these
26. Which of the following is the correct syntax for using the JavaScript exec() object method?
Answers:
• RegExpObject.exec()
• RegExpObject.exec(string)
• RegExpObject.exec(parameter1,parameter2)
• None of these
27. Having an array object var arr = new Array(), what is the best way to add a new item to the end of an array?
Answers:
• arr.push("New Item")
• arr[arr.length] = "New Item"
• arr.unshift("New Item")
• arr.append("New Item")
28. Consider the following JavaScript validation function:
function ValidateField()
{
if(document.forms[0].txtId.value =="")
{return false;}

return true;
}
Which of the following options will call the function as soon as the user leaves the field?
Answers:
• input name=txtId type="text" onreset="return ValidateField()"
• input name=txtId type="text" onfocus="return ValidateField()"
• input name=txtId type="text" onsubmit="return ValidateField()"
• input name=txtId type="text" onblur="return ValidateField()"
29. Which of following uses the "with" statement in JavaScript correctly?
Answers:
• with (document.getElementById("blah").style) { background = "black"; color = "blue"; border = "1px solid green"; }
• with document.getElementById("blah").style background = "black"; color = "blue"; border = "1px solid green"; End With
• With document.getElementByName("blah").style background = "black"; color = "blue"; border = "1px solid green"; End With
• with (document.getElementById("blah").style) { .background = "black"; .color = "blue"; .border = "1px solid green"; }
30. Consider the following JavaScript validation function:

<script type="text/JavaScript">
function ValidateField()
{
if(document.forms[0].txtId.value =="")
{return false;}

return true;
}
</script>

Which of the following options will call the function as soon as the user leaves the field?
Answers:
• input name=txtId type="text" onreset="return ValidateField()"
• input name=txtId type="text" onfocus="return ValidateField()"
• input name=txtId type="text" onsubmit="return ValidateField()"
• input name=txtId type="text" onblur="return ValidateField()"
31. Which of the following modifiers must be set if the JavaScript lastIndex object property was used during pattern matching?
Answers:
• i
• m
• g
• s
32. Consider the following image definition:

<img id="logo" src="companylogo1.gif" height="12" width="12" >

Which of the following will change the image to "companylogo2.gif" when the page loads?
Answers:
• logo.source="companylogo2.gif"
• logo.source="companylogo1.gif"
• document.getElementById('logo').src="companylogo1.gif"
• document.getElementById('logo').src="companylogo2.gif"
33. Which of the following will check whether the variable vRast exists or not?
Answers:
• if (typeof vRast="undefined") {}
• if (typeof vRast =="undefined") {}
• if (vRast.defined =true) {}
• if (vRast.defined ==true) {}
34. What would be the use of the following code?

function validate(field) {
var valid=''ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'';
var ok=''yes'';
var temp;

for(var i=0;i<field.value.length;i++) {
temp='''' + field.value.substring(i,i+1)

if(valid.indexOf(temp)==''-1'') {
ok=''no'';
}
}

if(ok==''no'') {
alert(''error'');
field.focus();
}
}
Answers:
• It will force a user to enter only numeric values.
• It will force a user to enter only alphanumeric values.
• It will force a user to enter only English alphabet character values.
• None of these.
35. An image tag is defined as follows:

<img id="ERImage" width="100" height="100" onmouseover="ImageChange()" src="Image1.jpg">

The purpose of the ImageChange() function is to change the image source to "Image2.jpg". Which of the following should the ImageChange() function look like?
Answers:
• document.getElementById('ERImage').src="Image1.jpg"
• document.getElementById('ERImage').src="Image2.jpg"
• document.getElementById('ERImage').style.src="Image1.jpg"
• document.getElementById('ERImage').style.src="Image2.jpg"
36. Which of the following choices will detect if "variableName" declares a function?

<script>
var variableName= function(){};
</script>
Answers:
• return variableName;
• nameof variableName;
• isFunction variableName;
• typeof variableName;
37. Which of the following choices will change the source of the image to "image2.gif" when a user clicks on the image?
Answers:
• img id="imageID" src="image1.gif" width="50" height="60" onmousedown="changeimg(image1.gif)" onmouseup="changeimg(image2.gif)"
• img id="imageID" src="image1.gif" width="50" height="60" onmouseclick="changeimg(image2.gif)" onmouseup="changeimg(image1.gif)"
• img id="imageID" src="image2.gif" width="50" height="60" onmousedown="changeimg(image1.gif)" onmouseup="changeimg(image2.gif)"
• img id="imageID" src="image2.gif" width="50" height="60" onmousedown="changeimg(image2.gif)" onmouseup="changeimg(image1.gif)"
• img id="imageID" src="image1.gif" width="50" height="60" onmousedown="changeimg('image2.gif')" onmouseup="changeimg('image1.gif')"
38. How can created cookies be deleted using JavaScript?
Answers:
• They can't be deleted. They are valid until they expire.
• Overwrite with an expiry date in the past
• Use escape() on the value of the path attribute
• Use unescape() on the value of the path attribute
• The cookie file will have to be removed from the client machine.
• Wait till the expiry date is reached
39. What would be the value of 'ind' after execution of the following code?

var msg="Welcome to ExpertRating"
var ind= msg.substr(3, 3)
Answers:
• lco
• com
• ome
• Welcome
40. Are the two statements below interchangeable?

object.property
object[''property'']
Answers:
• Yes
• No
41. Which of the following is not a valid method in generator-iterator objects in JavaScript?
Answers:
• send()
• throw()
• next()
• stop()
42. Which of the following code snippets will return all HTTP headers?
Answers:
• var req = new XMLHttpRequest(); req.open('GET', document.location, false); req.send(null); var headers = req.getAllResponseHeaders().toLowerCase(); alert(headers);
• var req = new XMLHttpAccess(); req.open('GET', document.location, false); req.send(null); var headers = req.getAllResponseHeaders().toLowerCase(); alert(headers);
• var req = new XMLHttpRequest(); req.open('GET', document.location, false); req.send(null); var headers = req.getResponseHeader().toLowerCase(); alert(headers);
• var req = new XMLHttpRequestHeader(); req.open('GET', document.location, false); req.send(null); var headers = req.retrieveAllResponseHeaders().toLowerCase(); alert(headers);
43. Consider the following JavaScript alert:

<script type="text/JavaScript">
function message() {
alert("Welcome to ExpertRating!!!")
}
</script>

Which of the following will run the function when a user opens the page?
Answers:
• body onload="message()"
• body onunload="message()"
• body onsubmit="message()"
• body onreset="message()"
44. Which of the following is the most secure and efficient way of declaring an array?
Answers:
• var a = []
• var a = new Array()
• var a = new Array(n)
• var a
45. Which of the following Regular Expression pattern flags is not valid?
Answers:
• gi
• p
• i
• g
46. Which of the following built-in functions is used to access form elements using their IDs?
Answers:
• getItem(id)
• getFormElement(id)
• getElementById(id)
• All of these
47. Which of the following statements is correct?
Answers:
• There is no undefined property in JavaScript.
• Undefined object properties can be checked using the following code: if (typeof something == null) alert("something is undefined");
• It is not possible to check for undefined object properties in JavaScript.
• Undefined object properties can be checked using the following code: if (typeof something === "undefined") alert("something is undefined");
48. Which of the following correctly uses a timer with a function named rearrange()?
Answers:
• tmr=setTimeout("rearrange ()",1)
• tmr=Timer(1,"rearrange ()")
• tmr=Timer("rearrange ()",1)
• tmr=setTimeout(1,"rearrange ()")
49. Which of the following can be used to escape the ' character?
Answers:
• *
• \
• -
• @
• #
• %
• |
• ~
50. Which event can be used to validate the value in a field as soon as the user moves out of the field by pressing the tab key?
Answers:
• onblur
• onfocus
• lostfocus
• gotfocus
• None of these
51. When setting cookies with JavaScript, what will happen to the cookies.txt data if the file exceeds the maximum size?
Answers:
• The script automatically generates a run-time error.
• The script automatically generates a load-time error.
• All processes using document.cookie are ignored.
• The file is truncated to the maximum length.
52. Which of the following are not global methods and properties in E4X?
Answers:
• ignoreComments
• ignoreWhiteSpace
• setName()
• setNamespace()
• ignoreComments and ignoreWhiteSpace
• setName() and setNamespace()
53. Which of the following will change the color of a paragraph's text to blue when a user hovers over it, and reset it back to black when the user hovers out?
Answers:
• <p onmouseover="style.color='black'" onmouseout="style.color='blue'"> The text of the paragraph..</p>
• <p onmouseover="style.color='blue'" onmouseout="style.color='black'"> The text of the paragraph..</p>
• <p onmouseout="style.color='blue'"> The text of the paragraph..</p>
• <p onmouseover="style.color='blue'"> The text of the paragraph..</p>
• <p onmousein="style.color='blue'" onmouseout="style.color='black'"> The text of the paragraph..</p>
54. What is the purpose of while(1) in the following JSON response?

while(1);[['u',[['smsSentFlag','false'],['hideInvitations','false'],['remindOnRespondedEventsOnly','true'],['hideInvitations_remindOnRespondedEventsOnly','false_true'],['Calendar ID stripped for privacy','false'],['smsVerifiedFlag','true']]]]
Answers:
• It's invalid JSON code.
• It makes it difficult for a third-party to insert the JSON response into an HTML document with a <script> tag.
• It iterates the JSON response.
• It prevents the JSON response from getting executed.
55. Consider the three variables: 

someText = 'JavaScript1.2';
pattern = /(\w+)(\d)\.(\d)/i;
outCome = pattern.exec(someText);

What does outCome[0] contain?
Answers:
• true
• false
• JavaScript1.2
• null
• 0
56. Which of the following choices will turn a string into a JavaScript function call (case with objects) of the following code snippet?

<script>
window.foo = {
bar: {
baz: function() {
alert('Hello!');
}
}
};
</script>
Answers:
• bar['baz']();
• object['foo']['bar']['baz']();
• document['foo']['bar']['baz']();
• window['foo']['bar']['baz']();
57. Which of the following determines whether cookies are enabled in a browser or not?
Answers:
• (navigator.Cookie)? true : false
• (application.cookieEnabled)? true : false
• (navigator.cookieEnabled)? true : false
• (application.cookie)? true : false
58. Which of the following options can be used for adding direct support for XML to JavaScript?
Answers:
• E4X
• egex
• Generators and Iterators
• let
59. Which of the following will detect which DOM element has the focus?
Answers:
• document.activeElement
• document.ready
• document.referrer
• document.getelementbyid
60. Which of the following will randomly choose an element from an array named myStuff, given that the number of elements changes dynamically?
Answers:
• randomElement = myStuff[Math.floor(Math.random() * myStuff.length)];
• randomElement = myStuff[Math.ceil(Math.random() * myStuff.length)];
• randomElement = myStuff[Math.random(myStuff.length)];
• randomElement = Math.random(myStuff.length);
61. How can global variables be declared in JavaScript?
Answers:
• All variables are local in JavaScript.
• Declare the variable between the 'script' tags, and outside a function to make the variable global
• Precede the variable name with the constant global
• Declare the variable in an external file
62. Which of the following objects in JavaScript contains the collection called "plugins"?
Answers:
• Location
• Window
• Screen
• Navigator
63. What will be output of the following code?

function testGenerator() {
yield "first";
document.write("step1");

yield "second";
document.write("step2");

yield "third";
document.write("step3");
}

var g = testGenerator();
document.write(g.next());
document.write(g.next());
Answers:
• firststep1second
• step1step2
• step1
• step1step2step3
64. Which of the following methods will copy data to the Clipboard?
Answers:
• execClipboard('Copy')
• copyCommand('Clipboard')
• execCommand('Copy')
• execClipboard('Copy')
65. Which of the following code snippets trims whitespace from the beginning and end of the given string str?
Answers:
• str.replace(/^\s+|\s+$/g, '');
• str.replace(/^\s+/,'');
• str.replace(/\s+$/,'');
• str.replace(/\s+/g,' ');
66. What is the difference between call() and apply()?
Answers:
• The call() function accepts an argument list of a function, while the apply() function accepts a single array of arguments.
• The apply() function accepts an argument list of a function, while the call() function accepts a single array of arguments.
• The call() function accepts an object list of a function, while the apply() function accepts a single array of an object.
• The call() function accepts an object list of a function, while the apply() function accepts a single array of an object.
67. Which of the following code snippets is more efficient, and why?

<script language="JavaScript">
for(i=0;i<document.images.length;i++)
document.images[i].src="blank.gif";
</script>

<script language="JavaScript">
var theimages = document.images;
for(i=0;i<theimages.length;i++)
theimages[i].src="blank.gif"
</script>
Answers:
• Both are equally efficient.
• The first code is more efficient as it contains less code.
• The first code is more efficient as it employs object caching.
• The second code is more efficient as it employs object caching.
68. What is the meaning of obfuscation in JavaScript?
Answers:
• Obfuscation is a keyword in JavaScript.
• Making code unreadable using advanced algorithms.
• Decrypting encrypted source code using advanced algorithms.
• None of these.
69. Which of the following JavaScript Regular Expression modifiers finds one or more occurrences of a specific character in a string?
Answers:
• ?
• *
• +
• #
70. Which of the following is not a valid JavaScript operator?
Answers:
• |
• ===
• %=
• ^
71. Which of the following code snippets returns "[object object]"?
Answers:
• <script> var o = new Object(); o.toSource(); </script>
• <script> var o = new Object(); o.valueOf(); </script>
• <script> var o = new Object(); o.toString(); </script>
• <script> var o = new Object(); o.getName(); </script>
72. Which of the following can be used to invoke an iframe from a parent page?
Answers:
• window.frames
• document.getElementById
• document.getelementsbyname
• document.getelementsbyclassname
73. Select the following function that shuffles an array?
Answers:
• function shuffle(array) { var tmp, current, top = array.length; if(top) while(--top) { current = Math.floor(Math.random() * (top + 1)); tmp = array[current]; array[current] = array[top]; array[top] = tmp; } return array; }
• function shuffle(array) { return array.sort(function(a,b) { return (a-b); }); }
• function shuffle(array) { var results = new Array(); var sorted_arr = array.sort(); for (var i = 0; i < array.length - 1; i++) { if (sorted_arr[i + 1] == sorted_arr[i]) { results.push(sorted_arr[i]); } } return results; }
• function shuffle(array) { for (var tmp, cur, top=array.length; top--;){ cur = (Math.random() * (top + 1)) << 0; tmp = array[cur]; array[cur] = array[top]; array[top] = tmp; } return array.sort(); }
74. Which of the following code snippets removes objects from an associative array?
Answers:
• delete array["propertyName"];
• array.propertyName.remove();
• array.splice(index, 1);
• array["propertyName"].remove();
75. What is the error in the statement: var charConvert = toCharCode('x');?
Answers:
• toCharCode() is a non-existent method.
• Nothing. The code will work fine.
• toCharCode only accepts numbers.
• toCharCode takes no arguments.
76. What value would JavaScript assign to an uninitialized variable?
Answers:
• NaN
• null
• undefined
• false
77. What does the following JavaScript code do?

contains(a, obj) {
for (var i = 0; i < a.length; i++) {
if (a[i] === obj) {
return true;
}
}
return false;
}
Answers:
• It calculates an array's length.
• It compares 'a' and 'obj' in an array.
• The code will cause an error.
• It checks if an array contains 'obj'.
78. If an image is placed styled with z-index=-1 and a text paragraph is overlapped with it, which one will be displayed on top?
Answers:
• The paragraph.
• The image.
• It depends on other rules.
79. Which of the following code snippets gets an image's dimensions (height & width) correctly?
Answers:
• var img = document.getElementById('imageid'); var width = img.clientWidth; var height = img.clientHeight;
• var img = document.getElementById('imageid'); var width = img.width; var height = img.height;
• var img = document.getElementById('imageid'); var width = img.getAttribute('width'); var height = img.getAttribute('height');
• var img=document.getElementById("imageid"); var width=img.offsetWidth; var height=img.offsetHeight;
80. Which of the following are correct values of variableC, and why?

<script>
variableA = [6,8];
variableB =[7,9];
variableC = variableA + variableB;
</script>
Answers:
• 6, 7, 8 and 9. The + operator is defined for arrays, and it concatenates strings, so it converts the arrays to strings.
• 6, 15 and 9. The + operator is defined for arrays, and it concatenates numbers, so it converts the arrays to numbers.
• 6, 8, 7 and 9. The + operator is defined for arrays, and it concatenates strings, so it converts the arrays to strings.
• 6, 87 and 9. The + operator is not defined for arrays, and it concatenates strings, so it converts the arrays to strings.

fuft7uuuuuuuuuuuuuuuuuuuuuuuuu

Popular Posts

Categories

upwork test answer blogspot elance test answer 2015 .upwork test answer blogspot elance test answer 2015 blogspot.how to pass upwork test answer blogspot elance test answer 2015 free.upwork test answer blogspot elance test answer 2015.elance test answer for blogspot blogger.upwork test answer blogspot elance test answer 2015.upwork test answer blogspot elance test answer 2015 upwork test answer blogspot elance test answer 2015 upwork test answer blogspot elance test answer 2015

Powered by Blogger.

Labels

Followers

About Me

moshiur rahman
View my complete profile

Labels

stat counter

http://blogspotforbloggerhelp.blogspot.com/

fb plugin

Popular Posts

Email Newsletter

Subscribe to our newsletter to get the latest updates to your inbox. ;-)


Your email address is safe with us!

Pages