Interview Non Sde
Interview Non Sde
hr questions
1. Difference between udp and tcp 2. Difference between hub and switch 3.What is an
Inode LP questions
1) Introduce yourself 2) About project 3) why did u choose that project? 4) discussed in
depth about project for 30 mins.. 5) asked me to share the screen and gave two coding
question to solve. 6) situation based questions 7) trouble shooting questions 8) Linux
commands
I am grateful for the support you have shown, but it is difficult for me to attend the interview at
this time. I kindly request to reschedule it on October 01, 2023, or later.
they first ask me about myself and about my projects and then start asking me questions based on
my resume and then they ask me to share my screen and give me questions to code the first code
that they told me to write was the perfect number and in second coding question, they told me to
write a program to sort the array based on the frequency of elements, after that, they ask me some
behavioral questions
what is tcp/udp? what is recursion? what is undirected graph and implement it?
1. linux file operation commands. 2. python scripting, bash 3, basic linux commands
1. Given a linked list and two keys in it, swap nodes for two given keys.
Nodes should be swapped by changing links. Swap Linked List on GfG. I
went on with the brute force approach and solved the question, by
explaining at each step. The interviewer then asked me to optimise it using
a single loop and i was able to do that. I solved this question and
interacted with the interviewer explaining him in each step which
approach I am using.
2. The second question asked was : To check if a string is rearranged can it
form a palindrome or not . As the interviewer was running a bit late, he
just asked me to describe the approach I’d use to solve this question.
Behavioral and OS+Networking Round (LAST ROUND): So the interviewer was
the best!! She was very polite. The interview started with her introducing herself,
and then she asked me to introduce myself. The interview started with behavioral
questions and this totally depends on your answers. Make sure you go through the
Amazon company policies before the round.
After the behavioral round she said let’s start with the technical part. The round
lasted one hour, and the questions asked were mostly from Networking and OS.
Few questions asked were:
1. What are the HTTP and the HTTPS protocol?
2. What is the DNS?
3. What is the TCP protocol?
4. What is thread in OS?
5. What is a process? What are the different states of a process?
6. What is the difference between paging and segmentation?
1
12
123
1234
12345
The STP also stands for Spanning Tree Protocol constructs a loop-free logical topography for
Ethernet networks. It is a network protocol. Preventing bridge loops along with the broadcast
radiation that results from them are the primary functions. If an active link fails, spanning tree
consequently allows a network design to include backup links so that it could provide fault
tolerance.
As denoted, STP creates a kind of spanning tree within a network of connected layer-2
bridges, along with disabling those links that which doesn’t form part of the spanning tree,
leaving a single active path between any two network nodes. Radia Perlman invented the
algorithm on which STP is based. At that time she was working for Digital Equipment
Corporation.
Powered By
A prime number is a whole number greater than 1, which is only divisible by 1 and itself.
return true;
}
/^(?:\(\d{3}\)|\d{3}-)\d{3}-\d{4}$/
The du command shows the disk space used by the directory or file.
The computer file hosts can be defined as an operating system file that directs hostnames to
IP addresses. The host file is a plain text file. The host file has several system facilities, being
one of them to assist in addressing network nodes in a computer network. An operating
system’s Internet Protocol (IP) implementation has a host file as its common part. It also
serves the function of converting human-friendly hostnames into some numeric protocol
addresses, called IP addresses, which identifies and locates a host in an IP network.
7) What is DNS, how it works?
DNS stands for Domain Name System, which is primarily used as the medium to convert
domain names to their respective IP addresses whenever a client initiates a request query.
DNS also stores the database of all the available domain names and their IP addresses, which
happens to be registered on the network.
Likewise, in the working of DNS when we type out the website name in the browser, it
would send a request to the DNS server. Moreover, if the website domain name has got
registered in the database with the DNS, then it would respond with the IP address of the
website which is being tried to get accessed and would be something like 53.294.214.67
The letter O is significantly used because the order of the function is also referred to as the
growth rate of a function. An explanation of a function regarding big O notation would
usually just provide an upper bound on the growth rate of that function.
Virtual hosting is one of the methods by which they host multiple domain names along with
the separate handling of each name ultimately on a single server or pool of servers. The
respective process would then allow one server to share its resources like memory, processor
cycles, etc., without actually having to require all services which are provided so that to use
that same hostname. The term virtual hosting is widely used to mainly refer to web servers.
Moreover, shared web hosting would be an extensively used application.
It is a commonly followed practice for a single entity to desire to use multiple names on the
very same machine. Doing so, the names would reflect services offered and ultimately not
where those services are to be hosted.
Stack Queue
It follows the principle of LIFO (last in first It follows the principle of FIFO (first in first
out). out).
It performs the operation of push and pop. It performs the operation of Enqueue and
dequeue.
The implementation is simpler here. The implementation is comparatively complex.
Stack does not consist of variants. Queue contains variants like priority queue etc.
12) How to find the least common ancestor for given 2 nodes in a tree?
The simple O(n) algorithm to find the Least Common Ancestor of n1 and n2 is as follows.
Calculate the path from the root to n1 and store it in a vector or array.
Calculate the path from the root to n2 and store it in another vector or array.
Traverse both paths till the values in arrays are the same. Return the common element
just before the mismatch which one is the least common ancestor of given two nodes
in a tree.
13) Write a program to find all substrings of a string.
import java.util.Scanner;
class SubstringsOfAString
{
public static void main(String args[])
{
String string, sub;
int i, c, length;
Scanner in = new Scanner(System.in);
System.out.println("Enter a string to print it's all substrings");
string = in.nextLine();
length = string.length();
System.out.println("Substrings of \""+string+"\" are :-");
for( c = 0 ; c < length ; c++ )
{
for( i = 1 ; i <= length - c ; i++ )
{
sub = string.substring(c, c+i);
System.out.println(sub);
}
}
}
}
TCP UDP
It connects the computers before It does the work of sending data directly to the destination
even transmitting the data. computer without checking the status of the system.
Its speed is comparatively slower. Its speed is comparatively faster.
It is technically connection It does not need a connection, being connectionless.
oriented.
Power on being the first step of the process is the power-on step. The user would typically
initiate this step. The second step after execution of the ROM routines, the system executes a
Power-On Self Test (POST) routine. This process ensures the operational status of all
hardware.
In the next step the system checks for an active device in the boot device list, which would be
starting at the top. In this step after ensuring the hardware is functional and loading the BIOS,
the computer proceeds would then load the operating system into its memory.
Now, the boot process takes control over to it once the OS is loaded.
16) Command to find all files that are modified 2 days before.
We would use the find command along with an argument for files, which is owned by a given
username and certainly modified over a certain time.
import java.io.File;
public class Demo {
public static void main(String[] args) {
try {
File file1 = new File("demo1.txt");
File file2 = new File("demo2.txt");
file1.createNewFile();
file2.createNewFile();
boolean flag = file1.renameTo(file2);
System.out.print("File renamed? " + flag);
} catch(Exception e) {
e.printStackTrace();
}
}
}
The DHCP stands for Dynamic Host Configuration Protocol (DHCP). It is primarily a
network management protocol, which is used on UDP or IP networks. At this moment a
DHCP server then assigns an IP address and other respective network configuration
parameters to each of the available device on a network so that they can easily communicate
with the other present IP networks.
19) What is the relative path? write a program to convert relative path to
absolute path?
The relative path is also referred to as a partial path or the non-absolute path. A relative path
is a kind of URL, which mainly constitutes a part of the full path based on its respective
relation to the directory in which it is linking. These provided shorter addresses are of greater
convenience for the people who create web pages mainly to require less typing and to take up
fewer characters.
20) Write a program to reverse the order of the given single linked list.
Link List is a sequence of links that contain items in which each item contains a connection
to another item.
A reverse link list is a linked list created to form a linked list by reversing the items of the
list. The head node of the linked list will become the last node of the linked list and the last
one will be the head node.
#include
struct Node {
int data;
struct Node* next;
};
Node* insertNode(int key) {
Node* temp = new Node;
temp->data = key;
temp->next = NULL;
return temp;
}
void tailRecRevese(Node* current, Node* previous, Node** head){
if (!current->next) {
*head = current;
current->next = previous;
return;
}
Node* next = current->next;
current->next = previous;
tailRecRevese(next, current, head);
}
void tailRecReveseLL(Node** head){
if (!head)
return;
tailRecRevese(*head, NULL, head);
}
void printLinkedList(Node* head){
while (head != NULL) {
printf("%d ", head->data);
head = head->next;
}
printf("n");
}
int main(){
Node* head1 = insertNode(9);
head1->next = insertNode(32);
head1->next->next = insertNode(65);
head1->next->next->next = insertNode(10);
head1->next->next->next->next = insertNode(85);
printf("Link list: t");
printLinkedList(head1);
tailRecReveseLL(&head1);
printf("The output is as follows: t");
printLinkedList(head1);
return 0;
}