0% found this document useful (0 votes)
275 views5 pages

Technical Support Engineer - Home Assignment

The document provides CSS selector solutions for various technical questions. It also includes code to dynamically add IDs to elements and code to log clicked links to the console with a single event listener. Sample customer support cases are presented at the end involving an angry customer, a live site experiencing slowdowns, and an unhappy director expecting fixes by tomorrow.

Uploaded by

Rahul Kohli
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
275 views5 pages

Technical Support Engineer - Home Assignment

The document provides CSS selector solutions for various technical questions. It also includes code to dynamically add IDs to elements and code to log clicked links to the console with a single event listener. Sample customer support cases are presented at the end involving an angry customer, a live site experiencing slowdowns, and an unhappy director expecting fixes by tomorrow.

Uploaded by

Rahul Kohli
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Technical Questions

1. Please write CSS selectors for the following requests:


a. All input elements:
Solution : input {
//CSS property we can add here like margin:10px;
}

b. All input elements and all button elements:


Solution : input,
button {
//CSS property we can add here like margin:10px;
}
OR
input,
input [type=”button”] {
//CSS property we can add here like margin:10px;
}

c. All input elements with class “cta”:


Solution : input[class=”cta”] {
//CSS property we can add here like margin:10px;
}

d. Input element with id “ctcta”:


Solution : input[id=”cta”] {
//CSS property we can add here like margin:10px;
}

e. All input elements that have a div element with class “ctaWrapper” as a parent:

Solution : . ctaWrapper input {


//CSS property we can add here like margin:10px;
}

f. All input elements with type attribute that equals “text”:


Solution : input [type='text'] {
//CSS property we can add here like margin:10px;
}

g. All h1 elements with an attribute of data-type that equals “title” with header element
as the parent:
Solution : h1[data-type=”title”] {
//CSS property we can add here like margin:10px;
}

Société Contentsquare – SAS au capital de 25 680,81€, n°503.916.033.00056 RCS PARIS


Adresse : 5 boulevard de la Madeleine, 5e étage 75001 Paris
www.contentsquare.com - [email protected]
2. What does the following code do?
var CTallaels = $(".menu_top_item");
var CTacount = 0;
for (i = 0; i < CTallaels.length; i++) {
CTallaels[i].id = "RowExpand" + CTacount;
CTacount++;
}

Solution
<!DOCTYPE html>
<html>
<body >
    <div class="menu_top_item">
        <div id="1" style="height:100px; width:100px;"><a href="#">1</a></div>
        <div id="3" style="height:100px; width:100px;"><a href="#">3</a></div>
        <div id="4" style="height:100px; width:100px;"><a href="#">4</a></div>
        <div id="2" style="height:100px; width:100px;"><a href="#">2</a></div>
    </div>
        <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
        <script>
            var CTallaels = $(".menu_top_item");
            var CTacount = 0;
            for (i = 0; i < CTallaels.length; i++) {
                CTallaels[i].id = "RowExpand" + CTacount;
                CTacount++;
            }
        </script>
</body>
</html>

OUTPUT:

Société Contentsquare – SAS au capital de 25 680,81€, n°503.916.033.00056 RCS PARIS


Adresse : 5 boulevard de la Madeleine, 5e étage 75001 Paris
www.contentsquare.com - [email protected]
3. Please briefly explain what is:
● DOM:
● AJAX:
● XML:
● HTTPS vs. HTTP:

4. Given var hatul = [1, 2, 3];


Explain the difference between the results of:
for (let i in hatul) {
console.log(i);
}
And
for (let i of hatul) {
console.log(i);
}

Société Contentsquare – SAS au capital de 25 680,81€, n°503.916.033.00056 RCS PARIS


Adresse : 5 boulevard de la Madeleine, 5e étage 75001 Paris
www.contentsquare.com - [email protected]
5. Given the following HTML:

<!DOCTYPE html>
<html>
<body>
<div id="1" style="height:100px; width:100px;"><a href="#">1</a></div>
<div id="3" style="height:100px; width:100px;"><a href="#">3</a></div>
<div id="4" style="height:100px; width:100px;"><a href="#">4</a></div>
<div id="2" style="height:100px; width:100px;"><a href="#">2</a></div>
</body>
</html>

Write code that would catch the click of the mouse on the links and use console.log to write
the contents of the link that was clicked to the console.
Add no more than 1 listener. The listener should be on the body element.

Solution:

<!DOCTYPE html>
<html>
<body>
            <div id="1" style="height:100px; width:100px;"><a href="#">1</a></div>
            <div id="3" style="height:100px; width:100px;"><a href="#">3</a></div>
            <div id="4" style="height:100px; width:100px;"><a href="#">4</a></div>
            <div id="2" style="height:100px; width:100px;"><a href="#">2</a></div>
            
            <script>
                document.body.addEventListener("click", event => {
                    let target = event.target;
                    if (target.nodeName == "A") {
                        console.log(target.textContent);
                    }
                });
            </script>
</body>
</html>

Société Contentsquare – SAS au capital de 25 680,81€, n°503.916.033.00056 RCS PARIS


Adresse : 5 boulevard de la Madeleine, 5e étage 75001 Paris
www.contentsquare.com - [email protected]
Sample customer management cases
Please answer the following cases as if you (as a Support Engineer) were answering a customer.
Include your observations and findings as notes and elaborate on what steps you've taken to
answer them, and deal with it internally.

6. Case 1
An angry customer contacts you. They are complaining about a technical issue that was opened a
few weeks ago. They mentioned that they tried contacting Support several times, they are
very frustrated and want everything to be resolved within the hour.

7. Case 2
Hi,
I've been using Contentsquare successfully in my offline test environment but now that I
placed the code in my live site, it is slowing it down! Please advise as we are planning to
remove the tag from the site. We are also seeing some errors in the console that seem to be
coming from you.
o Please elaborate on the technical troubleshooting you would do to the best of your
knowledge; how would you go about troubleshooting such a case

8. Case 3
please write an email to the Director of E-commerce of a customer of ours: She is unhappy with the
Contentsquare Product due to many bugs and expects it to be fixed by tomorrow. You know
that R&D are planning to release the next version only in 2 weeks.

Société Contentsquare – SAS au capital de 25 680,81€, n°503.916.033.00056 RCS PARIS


Adresse : 5 boulevard de la Madeleine, 5e étage 75001 Paris
www.contentsquare.com - [email protected]

You might also like