Codeaza Solutions

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Name : Muhammad Ahsan

Part 1 :

1. What do you think is needed to be a good developer ?

To be a good developer, you need to have problem solving and critical thinking skills. As
computer science is changing everyday, you should be able to learn and adapt to new
technologies quickly. One should focus on being a good engineer and be flexible. Moreover, a
good developer should be able to work and collaborate in teams. Understand others and
communicate his message to others as well.

2. What Made you choose the frontend side of Web development ?

Being a visual person, I have always been fascinated by the frontend and visual end of things.
Whenever I develop something, seeing the changes visually always motivates me to code more.
Also, the very first thing that I ever developed was in HTML and CSS. That’s why I chose this
skill, and have been learning React JS for some months now.

3. What do you expect to gain from this internship program ?

I expect to learn and grow. Implement all my learning to build real world applications and polish
my skills. Learn and collaborate with the professionals already working at Codeaza.

4. What are your future goals ?

My goal is to be really good at what I do. To be financially stable, happy, and provide a great
lifestyle for me and my family.

5. If you are selected as a developer, what can you bring to the


team ?

I am really passionate about programming and developing applications. Whatever a task is


assigned to me I will be able to complete it with full potential, using my experience and learning
in frontend development.
6. If you get caught up in a very challenging task, how do you
usually approach it?
I will take my time understanding the task, and then break it into smaller, more manageable
tasks. I then try to solve those tasks. If I still face an issue I will look it up on the internet. Things
like stackoverflow and now chatgpt have always helped me solve complex problems.

Part 2 :

1. Take x integers from a user and store it in an array. The array


should be in wave form.
JS Code :
const prompt = require("prompt-sync")();

function inputData() {
let x = prompt("Total Intergers : ")
// prompt by default inputs a string
// so converting if to integer using parseInt()
// console.log(typeof(x))

let X = parseInt(x)
let n = prompt("Enter " + X + " numbers seperated by space : ")

// splitting the string into an array of X, using map to apply parseInt() to each element

const numbers = n.split(" ").map(num => parseInt(num));

console.log(convertToWaveForm(numbers))

function convertToWaveForm(numbers) {
// sorting the number in asceding order
numbers.sort(function(a, b) {
return a - b;
});

// this will swap the numbers to create the wave form array, where a[0] >= a[1] <= a[2]
for (let i = 0; i < numbers.length - 1; i += 2) {
[numbers[i], numbers[i + 1]] = [numbers[i + 1], numbers[i]];
}
return numbers;
}

inputData()

2. Program to make 3 arrays and fill each array with 5 integers


each, input by user. Display list of integers of all 3 arrays.\

const prompt = require("prompt-sync")();

let arr1 = [], arr2 = [], arr3 = []


for (let i = 0; i < 5; i++) {
arr1[i] = prompt("Array 1, Element " + (i + 1) + " : ")
arr2[i] = prompt("Array 2, Element " + (i + 1) + " : ")
arr3[i] = prompt("Array 3, Element " + (i + 1) + " : ")
}
console.log("Array 1 : ",arr1, "Array 2 : ", arr2, "Array 3 : ", arr3)

3. Print all pairs of integers whose sum is equal to a certain number


k. Value of k should be input by the user. Also add maximum and
minimum difference to the adjacent elements of the array.

const prompt = require("prompt-sync")();

// Brute force solution

// Assigning random big values to MAX and MIN

let MAX = -999999


let MIN = 999999

function findPairs(numbers, K){

let pairs = []
for(let i = 0; i < numbers.length; i++) {
for (let j = i + 1; j < numbers.length ; j++) {

// If the pair is found, add it to the pairs array


if(numbers[i] + numbers[j] === parseInt(K))
{

pairs.push([numbers[i], numbers[j]])

// Max and Min difference


const diff = Math.abs(numbers[i] - numbers[j]);
MAX = Math.max(MAX, diff);
MIN = Math.min(MIN, diff);

}
}
return pairs

const numbers = [1, 2, 3, 4, 6, 7, 8, 9, 10]


const K = prompt("Enter a number : ")

console.log("Pairs : ", findPairs(numbers, K))


console.log("Max Difference: ", MAX)
console.log("Min Difference: ", MIN)

4. This is a simple loading page: Improve its design and make it


attractive. Try to make it follow the latest designing standards.
You can use conventional CSS, Tailwind CSS or Bootstrap

Using Bootstrap :
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

<!-- Bootstrap CSS -->


<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet" integrity="sha384-
KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We"
crossorigin="anonymous" />

<title>Bootstrap Login Form</title>


</head>
<body>
<section>
<div class="container mt-5 pt-5">
<div class="row">
<div class="col-12 col-sm-7 col-md-6 m-auto">
<div class="card border-0 shadow">
<div class="card-body">
<svg class="mx-auto my-3" xmlns="http://www.w3.org/2000/svg" width="50" height="50"
fill="currentColor" class="bi bi-person-circle" viewBox="0 0 16 16">
<path d="M11 6a3 3 0 1 1-6 0 3 3 0 0 1 6 0z" />
<path fill-rule="evenodd" d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8zm8-7a7 7 0 0 0-5.468
11.37C3.242 11.226 4.805 10 8 10s4.757 1.225 5.468 2.37A7 7 0 0 0 8 1z" />
</svg>
<form action="">
<input type="text" name="" id="" class="form-control my-4 py-2" placeholder="Username"
/>
<input type="text" name="" id="" class="form-control my-4 py-2" placeholder="Password"
/>
<div class="text-center mt-3">
<button class="btn btn-primary">Login</button>
<a href="#" class="nav-link">Already have an account ?</a>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Option 1: Bootstrap Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-U1DAWAznBHeqEIlVSCgzq+c9gqGAJn5c/t99JyeKa9xxaYpSvHU5awsuZVVFIhvj
" crossorigin="anonymous"></script>
</body>
</html>

You might also like