0% found this document useful (0 votes)
15 views6 pages

QNA

The document covers various topics in computer science, including the differences between threads and processes, the importance of web technologies like NLP and machine learning, and the principles of Object-Oriented Programming (OOP). It also discusses algorithms for evaluating balanced parentheses, the software development lifecycle (SDLC), and secure coding practices. Additionally, it includes programming tasks, such as implementing a letter counter class and analyzing large CSV files, along with explanations of network concepts like firewalls and the OSI model.

Uploaded by

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

QNA

The document covers various topics in computer science, including the differences between threads and processes, the importance of web technologies like NLP and machine learning, and the principles of Object-Oriented Programming (OOP). It also discusses algorithms for evaluating balanced parentheses, the software development lifecycle (SDLC), and secure coding practices. Additionally, it includes programming tasks, such as implementing a letter counter class and analyzing large CSV files, along with explanations of network concepts like firewalls and the OSI model.

Uploaded by

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

1. Explain the differences between a Thread and a Process.

Ans: A thread is the smallest unit of execution within a process, sharing the same
memory space and resources with other threads in the same process, enabling
efficient communication but risking data conflicts. A process, on the other hand,
is an independent unit with its own memory and resources, providing isolation and
stability but requiring more overhead for inter-process communication.

Process is the program under execution whereas the thread is part of process.
Process heavy weight task . Thread light weight task.
System call involved in process. There is no system call.
Independent unit with its own memory. Sharing the same memory space and
resources with other thread in the same process.

2. What web technologies are you excited about, and why do you think they’ll
win/survive in the next decade?

Ans: I am excited about the integration of Natural Language Processing (NLP) and
machine learning into web technologies. They enhance user experiences with smarter
chatbots, personalized content, and better search results. As AI continues to
evolve, these technologies will remain essential for creating adaptive, efficient,
and user-focused applications. Their ability to learn and improve ensures their
long-term relevance in the tech landscape.

3. Are you familiar with OOP?

Ans: Yes, I’m familiar with Object-Oriented Programming (OOP). It organizes code
into reusable classes and objects, making it easier to manage, maintain, and scale.
Concepts like inheritance and encapsulation reduce duplication and enhance
security, making OOP essential for building efficient and reliable software.

4. Write an algorithm to evaluate whether the parentheses are balanced in an


expression.
Ans: // let str = "()";
// str = "(()())";
// str = "((()))";
// str = "()()()";
// str = "((())(()))";
// str = "(()";
// str = "())";
// str = "(()))";
// str = "(((())";
str = ")((())";

// str = str.replace(/[^()]/g, "")

let counter = 0;
for(let i = 0; i < str.length; i++){
if(counter < 0) {
console.log("Not Balanced");
break;
}
if (str[i] == "(") counter++;
else if (str[i] == ")") counter--;
}
if (!counter) console.log("Balanced");
else console.log("Not Balanced");

5. Describe the process you follow for a programming task, from requirements to
delivery.
Ans: I start with understanding the problem and requirements, then move to
planning and designing a solution. Next, I implement the code, test it for
correctness, and deliver the final product with proper documentation.

6.What are some ways to make websites faster? Name as many different techniques as
you can.
Ans:
Optimize images and other media files to reduce their size.
Minimize HTTP requests by combining CSS and JavaScript files.
Implement browser caching to store static files locally, reducing load times.

7. 3 Bulbs and 3 Switches Puzzle:


You are in a room with three light switches (1, 2, and 3), each wired to a light
bulb in the room next door. All switches are initially OFF. You can flip the
switches ON and OFF as much as you like but must eventually go into the other room
and determine which light bulb is connected to which switch.
How would you do that?

Ans:

8. Explain Regular Expression (RE).


Write a RE for the string "I love program hate the exam." to filter out all vowels
Ans: A regular expression is a sequence of characters that defines a search
pattern, used for matching strings against specific criteria.
"I love programming 3210".replace(/[aeiou023456789]/g, "");
9. What is the software development lifecycle (SDLC)?
Ans:
The Software Development Lifecycle (SDLC) is a structured approach to software
development that includes stages like planning, design, implementation, testing,
deployment, and maintenance. Each stage focuses on different aspects: planning
defines goals, design creates specifications, implementation writes code, testing
checks for defects, deployment releases the software, and maintenance ensures
ongoing support and updates.

10. What are firewalls? What is the use of a default gateway? What is a subnet
mask?
Ans: A firewall is a network security device that monitors and controls incoming
and outgoing traffic based on predefined security rules.
A default gateway is the network node used to forward data from one network to
another.
A subnet mask is a numerical value that divides an IP address into network and host
parts, helping in managing IP address allocation and network traffic.

BIG
11. What is software version controlling? Explain the concept of git merge.
Describes the differences between tags and branches.

Software version control is a system that helps track changes in software projects
over time, allowing multiple developers to collaborate without conflicts.
Git merge is a process where two branches of code are combined, integrating changes
from one branch into another.
Tags in Git are used to mark specific versions of the software, often for stable
releases, while branches are used to work on features or fixes separately from the
main codebase. Branches can be modified, merged, and deleted, while tags are
permanent and can't be changed.

12. Write a class LetterCounter and implement a static method CountLettersAsString.


Ans:
class LetterCounter {
static CountLettersAsString(str) {
let letterCount = {};

for(let i = 0; i < str.length; i++){


let currLetter = str[i];

if(letterCount[currLetter] == undefined){
letterCount[currLetter] = 1;
} else {
letterCount[currLetter] += 1;
}
}

for(let letter in letterCount){


let ast = '';
for(let i = 0; i < letterCount[letter] ; i++)
ast += '*';

console.log(letter + " : " + ast);


}

}
}

LetterCounter.CountLettersAsString("NahidZamanReed");

13. Suppose you have a CSV file larger than 5GB. You need to analyze the data and
show it on a web portal.

Ans:

Read the File in Chunks:

I will use Python’s Pandas read the large CSV in small parts. This avoids memory
overload.

Process and Clean Data:

After reading each chunk, I’ll clean and format it as needed.

Store Data in a Database:

I will save the processed data in a database like MySQL or mongoDB for better
querying and filtering.

Build a Web Portal:

I will use React, D3 and ExpressJS to create a web portal.


14. What is secure coding, and why is it important?

Ans: Secure coding is the practice of writing software in a way that protects it
from security vulnerabilities and attacks, ensuring data integrity,
confidentiality, and availability.

Password files can be protected by encrypting the file and using strong hashing .

Cross-Site Scripting (XSS) is a vulnerability that allows attackers to inject


malicious scripts into web pages viewed by other users.

Penetration Testing is the process of simulating attacks on a system to identify


vulnerabilities and assess security risks.

A Network Intrusion Detection System (NIDS) monitors network traffic for suspicious
activity and alerts administrators of potential security threats.

15. What is your greatest weakness, and what have you done to overcome it?
Ans: My greatest weakness is sometimes taking on too many tasks because I want
everything to be perfect. To improve, I’ve been working on managing my time better
and setting clear priorities to get things done on time without stressing.

16. Why do you want to work here?


Write something about yourself.

Ans:

Why do you want to work here?


"I am excited about the opportunity to work here because I admire the company’s
values, culture, and goals. I believe I can contribute effectively while learning
and growing in a dynamic and supportive environment."

Write something about yourself:


"I am a passionate and dedicated individual with a strong interest in software
engineering. I enjoy solving problems and learning new technologies. My goal is to
apply my skills and knowledge to make a positive impact while continuing to grow
professionally."

Pattern

#include <iostream>
using namespace std;

int main() {
int n = 6; // Number of rows

for (int i = 0; i < n; i++) {


for (int j = 0; j i; j++) {
if (j == 0 || j == i) {
cout << "*"; // Print '*' at the first and last position of the row
} else {
cout << " "; // Print spaces in between
}
}
cout << endl; // Move to the next line after each row
}

// Print the last full row


for (int i = 1; i <= n + 2; i++) {
cout << "*";
}
cout << endl;

return 0;
}

Here’s a one-line explanation of each OSI model layer:

1. *Physical Layer:* Handles raw bit transmission over physical mediums.


2. *Data Link Layer:* Ensures error-free data transfer between directly connected
devices.
3. *Network Layer:* Manages routing and delivery of data across different networks.
4. *Transport Layer:* Provides reliable data transfer with error correction and
flow control.
5. *Session Layer:* Manages and maintains communication sessions between
applications.
6. *Presentation Layer:* Formats and encrypts data for application layer use.
7. *Application Layer:* Interfaces directly with user applications and manages
network services.

Physical Layer: Transmits raw data bits over a physical medium like cables or radio
waves.

Data Link Layer: Provides error detection and correction, and controls data flow
between devices on the same network.

Network Layer: Handles routing and forwarding of data packets between different
networks.

Transport Layer: Ensures reliable data transfer between end-to-end devices,


managing flow control and error recovery.

Session Layer: Manages and controls the dialogues (sessions) between two devices,
ensuring data is properly synchronized.

Presentation Layer: Translates data formats, encryption, and compression, ensuring


data is readable by the application layer.

Application Layer: Provides network services directly to user applications, like


email, file transfer, and web browsing.

You might also like