TW 06
TW 06
md 2025-03-22
Meeting Agenda
▶ Icebreaking
▶ Questions
▶ Interview Questions
▶ Retro meeting
1/9
tw-06.md 2025-03-22
Teamwork Schedule
Ice-breaking 90m
2/9
tw-06.md 2025-03-22
A. emptyObject = {};
B. emptyObject = new Empty();
C. emptyObject = Object.empty();
D. emptyObject = new Object();
9. How do you swap the values of two variables without using a temporary variable using array
destructuring?
A. const a = b; const b = a
B. const [a, b] = [a, b];
C. const [a, b] = [b, a];
D. const [b, a] = [a, b];
10. What happens if you try to destructure an array with more variables than there are elements in the
array?
3/9
tw-06.md 2025-03-22
Sample input :
const products = [
{ name: "Product 1", price: 20, category: "Electronics" },
{ name: "Product 2", price: 30, category: "Clothes" },
{ name: "Product 3", price: 40, category: "Electronics" },
{ name: "Product 4", price: 50, category: "Clothes" },
{ name: "Product 5", price: 60, category: "Clothes" },
{ name: "Product 6", price: 70, category: "Electronics" },
{ name: "Product 7", price: 80, category: "Clothes" },
{ name: "Product 8", price: 90, category: "Electronics" },
];
Expected outcome :
[
{ category: 'Clothes', average: 55 },
{ category: 'Electronics', average: 55 }
]
4/9
tw-06.md 2025-03-22
Solution :
const products = [
{ name: "Product 1", price: 20, category: "Electronics" },
{ name: "Product 2", price: 30, category: "Clothes" },
{ name: "Product 3", price: 40, category: "Electronics" },
{ name: "Product 4", price: 50, category: "Clothes" },
{ name: "Product 5", price: 60, category: "Clothes" },
{ name: "Product 6", price: 70, category: "Electronics" },
{ name: "Product 7", price: 80, category: "Clothes" },
{ name: "Product 8", price: 90, category: "Electronics" },
];
// Use filter to only select categories with an average above a certain threshold
const highPricedCategories = avgPriceByCategory.filter(category => category.average
> 50);
console.log(highPricedCategories)
1. Sass is a _____.
A. Scripting language
B. Markup language
C. CSS pre-processor
D. Programming Language
5/9
tw-06.md 2025-03-22
A. 2005
B. 2006
C. 2008
D. 2009
5. Which of the following directive displays the SassScript expression value as fatal error?
A. @error
B. @warn
C. @at-root
D. None of the above
A. Linus Torvalds
B. Brendan Eich
C. Hampton Catlin
D. Guido van Rossum
A. #primary-color: #888;
B. @primary-color: #888;
C. %primary-color: #888;
D. $primary-color: #888;
6/9
tw-06.md 2025-03-22
8. Which is the correct syntax to declare a variable "myfonts" assigning the two font names?
9. Which directive is used to create CSS code that is to be reused throughout the website?
A. @import
B. @define
C. @mixin
D. All of the above
10. Which directive is used to share a set of CSS properties from one selector to another?
A. @share
B. @import
C. @transfer
D. @extend
2. Explain the difference between dot notation and bracket notation when accessing object properties.
7/9
tw-06.md 2025-03-22
HR VS IT Department
Task : You are given an array of objects representing a collection of employees, each with a name, salary,
and department. Your task is to use map, filter, and reduce to calculate the average salary for each
department and then return an array of objects containing only the departments that have an average
salary above 65000.
Sample input :
const employees = [
{ name: "John", salary: 50000, department: "IT" },
{ name: "Jane", salary: 60000, department: "HR" },
{ name: "Bob", salary: 55000, department: "IT" },
{ name: "Sophie", salary: 75000, department: "HR" },
{ name: "Mike", salary: 65000, department: "IT" },
{ name: "Emily", salary: 80000, department: "HR" },
{ name: "David", salary: 70000, department: "IT" },
];
Expected outcome :
[
{ department: 'HR', average: 71666 }
]
8/9
tw-06.md 2025-03-22
Closing 5m
QA Session
9/9