Saturday, March 14, 2020

Amdocs

How will you return the number of records in "Orders" table?
How will you delete records where "Customer_Name" is "David" in Orders Table?
Considering the following table:
Customers -
Columns: customer_id (number, primary key), name (varchar), country_code (varchar), discount (number)

Which statement will increase the discount in 10 for customers who are situated in Germany ('DE' - ISO code for Germany)?
HOC
What will be the output of the following code?

function ProductItem(props) {
return <div>{props.value}</div>;
}

function NumberList(props) {
const ids = props.ids;
const listItems = ids.map((id) =>
<ProductItem key={id.toString()}
value={id} />
);
return (
<ul>
{listItems}
</ul>
);
}

const ids = [100, 101, 102, 103];
ReactDOM.render(
<NumberList ids={ids} ></NumberList>,
document.getElementById('root')
);
    Ans:
  • 100
  • 101
  • 102
  • 103
What will be the output of the following code?

function Monitor(props) {
return <h1>Monitor is connected well!</h1>;
}

function NoMonitor(props) {
return <h1>Please connect a monitor.</h1>;
}

function HWManager(props) {
const isMonitorOn = props.isMonitorOn;
if (isMonitorOn) {
return <Monitor ></Monitor>;
}
return <NoMonitor ></NoMonitor>;
}

ReactDOM.render(
<HWManager ></HWManager>,
document.getElementById("root")
);
When working with JSX which of the following will allow you to embed a JavaScript expression in an attribute?

Ans:Please connect a monitor.

Consider the following HTML5 & CSS3 code, how will the two boxes be placed?

<!--doctype html-->
<html lang="en-us">
<head>
<style>
DIV.redBox {
box-sizing:border-box;
-moz-box-sizing:border-box; /* Firefox */
-webkit-box-sizing:border-box; /* Safari */
border:1px solid red;
float: left;
}
DIV.greenBox {
box-sizing:border-box;
-moz-box-sizing:border-box; /* Firefox */
-webkit-box-sizing:border-box; /* Safari */
border:1px solid green;
float: left;
}
</style>

</head>
<body>

<div class="redBox">
Red Box
</div>
<div class="greenBox">
Green Box
</div>

</body>
</html>

Ans:RedBox and Green Box

Consider the below style and HTML code, what will happen when the browser width will be 600px?

<html>

<style>

@media screen and (max-width:680px) {
ul.topnav li:not(:nth-child(1)):not(:nth-child(2)) {display: none;}
}


</style>


<body>
<ul class="topnav">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
<li>Water</li>
</ul>
</body>

</html>
ANS:
  • Coffee
  • Tea
    • What will be the output of the following code?

      public class Test {

      public void foo() {
      try{
      throw new RuntimeException();
      }finally{
      System.out.println("In Finally Block");
      }
      }

      public static void main(String[] args) {
      try{
      Test t = new Test();
      t.foo();
      System.out.println("Finished running");
      }catch(Exception e){}
      }
      }
      ANS:In Finally Block
      What do you think of the following Java code?

      //CustomTest.java

      package pack2;

      public abstract class CustomTest {

      abstract String getCustomTestName();

      }

      //Test.java

      package pack1;

      import pack2.CustomTest;

      public class Test extends CustomTest{

      private String testName;

      public String getCustomTestName(){
      return testName;
      }

      }

      What will be the result of the following code?

      public class A {

      public void printStuff() {
      System.out.println("printStuff in A");
      }

      public static void main(String[] args) {
      A a = new B();
      a.printStuff();
      }
      }


      class B extends A {

      public void printStuff() {
      super.printStuff();
      System.out.println("printStuff in B");
      }
      }
      Ans: printStuff in A printStuff in B
      Consider the following HTML5 & CSS3 code, how will you make the box stretched until the end of the line?

      <!--doctype html-->
      <html lang="en-us">
      <head>
      <style>
      .container {
      height:50px;
      border:1px solid red;
      width:50px;
      }
      </style>

      </head>
      <body>


      <div class="container">
      Hello
      </div>

      </body>
      </html>
      ANS: width:100%;
      What will be the result of the following code?

      public class Test {

      public static void foo(){
      try{
      throw new Exception();
      }catch(MyException me){
      System.out.println("In My Exception");
      }catch(Exception e){
      System.out.println("In Exception");
      }
      }

      public static void main(String[] args) {
      foo();
      }
      }

      class MyException extends Exception{

      }
      Ans:In Exception
      What will the following jQuery CSS Selector selects ?

      $("[href$='.jpg']")
      JQuery Effects
      Consider the following code

      $("Id").on('click', printValue);

      function printValue(){
      ...
      }

      The method printValue was changed and should be delivered with an argument.

      function printValue(value){
      ...
      }

      How will you pass an argument through jQuery event handler?
      Ans: $("button").on("click",{arg1: 'hello'},printValue );
      The name interrobang was a melding of what kinds of terms?

      - - -

      Answer the above question based on the following short passage (that will repeat itself in the next questions):

      Interrobang

      What?! You mean you've never heard of the interrobang?!

      Well, the Roman Empire gave us the modern European, or Latin, alphabet, and medieval scribes gave us the punctuation we use, today. The comma, period, exclamation point and question mark represent how people speak, whether they're reciting texts or talking amongst friends. As we all know, a comma is a pause, and a period is the end of a statement or a complete thought. A question mark asks a question, and an exclamation point is something that someone shouts. Punctuation has mostly remained the same throughout the centuries.

      But, in 1962, Martin K. Speckter, the editor of TYPEtalks magazine, decided he'd seen enough combinations of question marks and exclamation points to last a lifetime. He put his foot down and invented a punctuation mark that conveyed incredulity more efficiently. He printed the symbol in TYPEtalks and, being a magnanimous fellow, asked the magazine's readers what they thought it should be called.

      The readers of TYPEtalks responded, and Speckter was graced with the perfect name that combined linguistics with jargon, "interrobang." "Interro-" came from the interrogatory nature of a question, and "-bang" came from the printer's term for an exclamation point.

      Throughout the 1960s, the interrobang did manage to achieve a bit of fame. The mark found its way into print in newspapers and various magazines. And stodgy dictionary editors even saw fit to add "interrobang" as a word amongst their listings. The symbol's fame was short-lived, though. During the 1970s, the interrobang was mostly forgotten.

      Nowadays, Martin K. Speckter's legacy mostly lives on in the names of several businesses, Web sites and even a rock band. It still has some old fans out there. What's promising is that some young folks have discovered it in recent years, and that's good news for the interrobang. Now, all it has to do is win over the stodgy keyboard manufacturers.

      How long did the interrobang's fame last?

      - - -

      Answer the above question based on the following short passage (that will repeat itself in the next questions):

      Interrobang

      What?! You mean you've never heard of the interrobang?!

      Well, the Roman Empire gave us the modern European, or Latin, alphabet, and medieval scribes gave us the punctuation we use, today. The comma, period, exclamation point and question mark represent how people speak, whether they're reciting texts or talking amongst friends. As we all know, a comma is a pause, and a period is the end of a statement or a complete thought. A question mark asks a question, and an exclamation point is something that someone shouts. Punctuation has mostly remained the same throughout the centuries.

      But, in 1962, Martin K. Speckter, the editor of TYPEtalks magazine, decided he'd seen enough combinations of question marks and exclamation points to last a lifetime. He put his foot down and invented a punctuation mark that conveyed incredulity more efficiently. He printed the symbol in TYPEtalks and, being a magnanimous fellow, asked the magazine's readers what they thought it should be called.

      The readers of TYPEtalks responded, and Speckter was graced with the perfect name that combined linguistics with jargon, "interrobang." "Interro-" came from the interrogatory nature of a question, and "-bang" came from the printer's term for an exclamation point.

      Throughout the 1960s, the interrobang did manage to achieve a bit of fame. The mark found its way into print in newspapers and various magazines. And stodgy dictionary editors even saw fit to add "interrobang" as a word amongst their listings. The symbol's fame was short-lived, though. During the 1970s, the interrobang was mostly forgotten.

      Nowadays, Martin K. Speckter's legacy mostly lives on in the names of several businesses, Web sites and even a rock band. It still has some old fans out there. What's promising is that some young folks have discovered it in recent years, and that's good news for the interrobang. Now, all it has to do is win over the stodgy keyboard manufacturers.
      Which invention influenced the growth of punctuation the most?

      - - -

      Answer the above question based on the following short passage (that will repeat itself in the next questions):

      Punctuation's Evolution

      In most Western languages, punctuation classically aids in reading texts aloud. The ancient Greeks first came up with the idea to help actors performing onstage know when to pause for dramatic effect. And they expanded on that idea, using punctuation to indicate rhetorical sections of their writing.

      The Romans, who introduced the Latin alphabet, picked up on what the Greeks were doing and occasionally used punctuation to indicate pauses in their written texts. But, while the Romans were hugely influential in other areas, the Greek system of using punctuation for rhetorical purposes prevailed.

      The use of punctuation grew in the Middle Ages as scribes created multiple copies of the Bible. The scribes also began using other methods, such as indentation and capitalization, to separate long passages of text into more readable tidbits. The Bibles were copied to be read aloud, so the scribes' rhetorical devices were created specifically to aid in reciting its passages during mass.

      Then, when Johannes Gutenberg invented the printing press with his system of movable type in the 15th century, the use of punctuation exploded and became more standardized. The earliest printers used the ideas developed by the scribes of the time. As printed books became more common, the most influential printers led the way and gave us the most common punctuation that we use, today, including the comma and the period.

      Once those old printers standardized the use of punctuation, new punctuation marks were rarely brought into the fold. Even with the advent of digital fonts, desktop publishing and Web publishing, new punctuation marks are difficult to add, because, in order for them to be truly useful, everyone who reads the text must understand what they mean. But the invention of the interrobang, a combination of a question mark and an exclamation mark, shows that it's not impossible.
      What device, aside from punctuation, did the Medieval scribes use to separate their texts into readable tidbits?

      - - -

      Answer the above question based on the following short passage (that will repeat itself in the next questions):

      Punctuation's Evolution

      In most Western languages, punctuation classically aids in reading texts aloud. The ancient Greeks first came up with the idea to help actors performing onstage know when to pause for dramatic effect. And they expanded on that idea, using punctuation to indicate rhetorical sections of their writing.

      The Romans, who introduced the Latin alphabet, picked up on what the Greeks were doing and occasionally used punctuation to indicate pauses in their written texts. But, while the Romans were hugely influential in other areas, the Greek system of using punctuation for rhetorical purposes prevailed.

      The use of punctuation grew in the Middle Ages as scribes created multiple copies of the Bible. The scribes also began using other methods, such as indentation and capitalization, to separate long passages of text into more readable tidbits. The Bibles were copied to be read aloud, so the scribes' rhetorical devices were created specifically to aid in reciting its passages during mass.

      Then, when Johannes Gutenberg invented the printing press with his system of movable type in the 15th century, the use of punctuation exploded and became more standardized. The earliest printers used the ideas developed by the scribes of the time. As printed books became more common, the most influential printers led the way and gave us the most common punctuation that we use, today, including the comma and the period.

      Once those old printers standardized the use of punctuation, new punctuation marks were rarely brought into the fold. Even with the advent of digital fonts, desktop publishing and Web publishing, new punctuation marks are difficult to add, because, in order for them to be truly useful, everyone who reads the text must understand what they mean. But the invention of the interrobang, a combination of a question mark and an exclamation mark, shows that it's not impossible.

      Who invented the term interrobang?

      - - -

      Answer the above question based on the following short passage (that will repeat itself in the next questions):

      Interrobang

      What?! You mean you've never heard of the interrobang?!

      Well, the Roman Empire gave us the modern European, or Latin, alphabet, and medieval scribes gave us the punctuation we use, today. The comma, period, exclamation point and question mark represent how people speak, whether they're reciting texts or talking amongst friends. As we all know, a comma is a pause, and a period is the end of a statement or a complete thought. A question mark asks a question, and an exclamation point is something that someone shouts. Punctuation has mostly remained the same throughout the centuries.

      But, in 1962, Martin K. Speckter, the editor of TYPEtalks magazine, decided he'd seen enough combinations of question marks and exclamation points to last a lifetime. He put his foot down and invented a punctuation mark that conveyed incredulity more efficiently. He printed the symbol in TYPEtalks and, being a magnanimous fellow, asked the magazine's readers what they thought it should be called.

      The readers of TYPEtalks responded, and Speckter was graced with the perfect name that combined linguistics with jargon, "interrobang." "Interro-" came from the interrogatory nature of a question, and "-bang" came from the printer's term for an exclamation point.

      Throughout the 1960s, the interrobang did manage to achieve a bit of fame. The mark found its way into print in newspapers and various magazines. And stodgy dictionary editors even saw fit to add "interrobang" as a word amongst their listings. The symbol's fame was short-lived, though. During the 1970s, the interrobang was mostly forgotten.

      Nowadays, Martin K. Speckter's legacy mostly lives on in the names of several businesses, Web sites and even a rock band. It still has some old fans out there. What's promising is that some young folks have discovered it in recent years, and that's good news for the interrobang. Now, all it has to do is win over the stodgy keyboard manufacturers.

      Why was punctuation first invented?

      - - -

      Answer the above question based on the following short passage (that will repeat itself in the next questions):

      Punctuation's Evolution

      In most Western languages, punctuation classically aids in reading texts aloud. The ancient Greeks first came up with the idea to help actors performing onstage know when to pause for dramatic effect. And they expanded on that idea, using punctuation to indicate rhetorical sections of their writing.

      The Romans, who introduced the Latin alphabet, picked up on what the Greeks were doing and occasionally used punctuation to indicate pauses in their written texts. But, while the Romans were hugely influential in other areas, the Greek system of using punctuation for rhetorical purposes prevailed.

      The use of punctuation grew in the Middle Ages as scribes created multiple copies of the Bible. The scribes also began using other methods, such as indentation and capitalization, to separate long passages of text into more readable tidbits. The Bibles were copied to be read aloud, so the scribes' rhetorical devices were created specifically to aid in reciting its passages during mass.

      Then, when Johannes Gutenberg invented the printing press with his system of movable type in the 15th century, the use of punctuation exploded and became more standardized. The earliest printers used the ideas developed by the scribes of the time. As printed books became more common, the most influential printers led the way and gave us the most common punctuation that we use, today, including the comma and the period.

      Once those old printers standardized the use of punctuation, new punctuation marks were rarely brought into the fold. Even with the advent of digital fonts, desktop publishing and Web publishing, new punctuation marks are difficult to add, because, in order for them to be truly useful, everyone who reads the text must understand what they mean. But the invention of the interrobang, a combination of a question mark and an exclamation mark, shows that it's not impossible.


      A person runs 600 meters in 5 minutes. What is his speed in km per hour?
      From a pack of 52 cards, two cards are drawn together at random. What is the probability of both the cards being queens? (assume there are 4 queens cards)
      A car averages 12 kilometer per liter. If gas costs $2.22 per liter, which of the following is closest to how much the gas would cost for this car to travel 1,335 kilometers? The area of a circle 64 pi. What is the diameter of the circle? From a pack of 52 cards, two cards are drawn together at random. What is the probability of both the cards being queens? (assume there are 4 queens cards) A person runs 600 meters in 5 minutes. What is his speed in km per hour? Sales for a business were 6 million dollars more the second year than the first, and sales for the third year were double the sales for the second year. If sales for the third year were 76 million dollars, what were sales, in millions of dollars, for the first year?
      What should be the score of test6 to make an average score of 75

      Test1 score -> 52
      Test2 score -> 70
      Test3 score -> 92
      Test4 score -> 90
      Test5 score -> 60
      Test6 score -> ?
      What will be the output of the following code?

      const FOO = {
      num: 1,
      toString: function () {
      return FOO.num++;
      }
      }

      if(FOO == 1 && FOO == 2 && FOO == 3) {
      console.log('PASS');
      }
      What will be the output of the following code?

      function foo (a=10, b=7, c) {
      return a + b + c
      }

      console.log(foo(10));
      What will be the result of the following code?

      const NAMES = ["BMW","FIAT","KIA"];
      NAMES[0] = "JEEP";
      console.log(NAMES);
      What will be the result of the following code?

      var nums = new Array();
      var otherNums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
      const constArray = [1, 2, 3, 4, 5];
      try{
      constArray = otherNums;
      }catch(err){}
      otherNums.forEach(v => {
      if (v % 5 === 0)
      nums.push(v)
      })

      console.log(nums);
      What will be the output of the following code?

      function foo(someNum, ...params){
      return " "+(someNum) * params.length;
      }

      console.log(foo(100, "hello","world","ES6 Rocks!", true, 7));
      What will be the result of the following code?

      var n = 6;
      var foo = {
      n: 5,
      bar: function() {
      console.log(this.n);
      }
      };

      foo.bar();
      var f = foo.bar;
      f();
      What will be the output of the below code?

      console.log("here");
      setImmediate(function(){
      console.log("we");
      });
      console.log("are");
      Which of the following approaches will successfully load index.js module?

      Approach A
      var app = require("./index");

      Approach B
      var app = require("./");

      Approach C
      var app = require("./index.js");
      Please implement the method removeNode to remove the nth element of the node from the linked list and return the new updated linked list.

      Method arguments:
      head (of type Node) - start of the linked list
      index - the position of the node to be removed

      Assume that the last node of the linked list points to null.

      Node class definition:

      class Node {

      constructor (next, value) {
      this._next = next
      this._value = value
      }

      set next (next) { this._next = next }
      get next () { return this._next }

      set value (value) { this._value = value }
      get value () { return this._value }
      }


      Example:

      Given the following linked list:
      Node(1)->Node(2)->Node(3)->Node(4)->null

      Removing the node at position 1 will result with the following linked list

      Node(2)->Node(3)->Node(4)->null

      Note: Make sure the function returns the updated linked list
      Header and Footer
      Consider the following HTML5 code:

      <form oninput="z.value=parseInt(x.value)+parseInt(y.value)">
      <input id="firstNumber" type="number" name="x" value="2" min="0">
      <input id="secondNumber" type="number" name="y" value="200">
      <output name="z" for="x y"></output>
      </form>

      What will be the output when pressing the down button of the numeric stepper "firstNumber" three times?
      Which tag/s will you choose to group the input elements of the form below; so they will be more meaningful?

      <form>
      Name: <input type="text" size="20"><br>
      Email: <input type="text" size="20"><br>
      Date of birth: <input type="text" size="20">
      </form>
      What will be the output of the following code:

      <!--DOCTYPE html-->
      <html>
      <body>

      <script>
      var jsonObj = JSON.parse('{"name": "David", "age": 40}');
      console.log(jsonObj.name + ", " + jsonObj.age);
      </script>

      </body>
      </html>
      What will be the output of the following code:

      var myObj = { name: "David", age: 40};
      var myJSON = JSON.stringify(myObj);
      console.log(myJSON);
      What is true regarding the following code?


      ...
      xmlhttp.open("POST","newAccount.php?name=Luk&mobile=339957643",true);
      xmlhttp.send();
      Ajax offers two methods to read the response:
      1. responseText
      2. responseXML

      What will happen if the server returns an image in response to your AJAX request?
      What will be the result of the following code?

      var n = 6;
      var foo = {
      n: 5,
      bar: function() {
      console.log(this.n);
      }
      };

      foo.bar();
      var f = foo.bar;
      f();
      What will be the output of the below code?

      console.log("here");
      setImmediate(function(){
      console.log("we");
      });
      console.log("are");
      What will be the output of the below code?

      console.log("here");
      setImmediate(function(){
      console.log("we");
      });
      console.log("are");
      What will these two coding approaches do?

      //Approach A
      var fs = require('fs');

      try {
      fs.accessSync(path, fs.F_OK);
      } catch (e) {
      ...
      }

      //Approach B
      var fs = require('fs');

      fs.access(path, fs.F_OK, function(err) {
      if (!err) {
      ...
      } else {
      ...
      }
      });
      Please implement the function findLongestWord in the following way:

      1. You should get three strings from the following exported functions, getFirstString, getSecondString, getThirdString (the functions are stored in Main.js - same directory as this file)

      2. With-in these three strings the longest word is the longest sequence of letter-characters (a-zA-Z).
      A word will end by any non-letter character and start by any letter character, for example:

      ABC A2D2456 AGRE ATRGF6 ZZZ_SDFG

      The longest word is: ATRGF

      3. The function should return the longest word

      Note: you will need to use the exported functions as ES6 defines
      Which of the following tags will help you highlight a text line?
      Consider the following HTML5 code:

      <form oninput="z.value=parseInt(x.value)+parseInt(y.value)">
      <input id="firstNumber" type="number" name="x" value="2" min="0">
      <input id="secondNumber" type="number" name="y" value="200">
      <output name="z" for="x y"></output>
      </form>

      What will be the output when pressing the down button of the numeric stepper "firstNumber" three times?
      What is the difference between HTML5 Application Cache and regular HTML Browser Cache? Choose the figure which will continue the series

No comments:

Post a Comment