Intrvw: Difference between revisions

5,567 bytes added ,  1 year ago
 
(24 intermediate revisions by the same user not shown)
Line 1:
= Google GCP Workspaces =
 
* Code:
 
<syntaxhighlight lang='python'>
with open('tab.txt','r') as tab, open('csv.txt','r') as csv, open('data.txt','w') as data:
for line in tab.readlines():
data.write(' '.join(line.strip().split('\t'))+'\n')
for line2 in csv.readlines():
data.write(' '.join(line2.strip().split(','))+'\n')
 
data.close()
 
 
with open('data.txt','r') as file:
for line in file.readlines():
print(line)
</syntaxhighlight>
 
* Code2:
 
<pre>
def analyze(numbers):
result = []
index = {}
min = None
max = None
for n in numbers:
index[n] = True
if not max or n > max:
max = n 9
if not min or n < min:
min = n 0
for n in range(min + 1, max):
if not n in index:
result.append(n)
return result
 
analyze()
 
 
4,5,6,7,8
3rd
0—-
 
 
analyze([5,9])
 
(6,9)
result = [6,7,8]
 
 
analyze([3,0,5,9])
4,3
 
 
Result = [1,2,4,6,7,8]
</pre>
 
* Equivalent Code:
<pre>
def analyze(numbers):
min = None
max = None
for n in numbers:
print(n)
if not max or n > max:
max = n
if not min or n < min:
min = n
print("max: ",max," min: ",min)
</pre>
 
* Results:
<pre>
>>> analyze([3,0,5,9])
3
max: 3 min: 3
0
max: 3 min: 0
5
max: 5 min: 5
9
max: 9 min: 5
</pre>
 
* Logic:
<pre>
>>> min = None
>>> not min
True
>>> min = 0
>>> not min
True
</pre>
 
* Working code for Min & Max:
<pre>
def analyze(numbers):
min = 0
max = 0
for n in numbers:
print(n)
if n > max:
max = n
if n < min:
min = n
print("max: ",max," min: ",min)
</pre>
 
= Amzn SysDE II =
 
* Recover from below issue:
chmod -x /bin/chmod
 
# Copy
# tar -file
# ld
 
* Coding
 
<syntaxhighlight lang='python'>
## Write a function that gives you the average latency in a log file with the following format
#
# timestamp requestid operation latency
# 2021-01-20T08:19:18+00:00 123e4567-e89b-12d3-a456-426614174000 getresults 175
# 2021-01-20T08:19:20+00:00 123e4567-e89b-12d3-a456-426614174100 submitquery 100
# 2021-01-20T08:19:21+00:00 123e4567-e89b-12d3-a456-426614174200 getquerystatus 60
# 2021-01-20T08:20:03+00:00 123e4567-e89b-12d3-a456-426614174300 getresults 150
# 2021-01-20T08:22:09+00:00 123e4567-e89b-12d3-a456-426614174400 cancelquery 20
 
}
 
path = input('')
#path = '/var/log/messages'
 
r = []
 
with open(path,'r') as file:
for line in file:
r.append(line.split()[-1])
 
avg_Latency = sum(r)/len(r)
 
print(avg_Latency)
 
--------------------------------------
 
#path = input('')
 
 
def avg_lat(path):
#a = 0
#rr = 0
latency = {}
occurrence = {}
with open(path,'r') as file:
for line in file:
try:
c = line.split()[-1]
if int(c):
#a += 1
#rr = rr + int(c)
latency['getresults']
oper.update({line.split()[-2]:line.split()[-1]})
except:
pass
latency = {
'getresults': 455,
'submitquery': 678
...
}
occurrences = {
'getresults': 4,
'submitquery': 9
}
latency.get('getresults')
#return (rr/a)
 
 
avg_lat('/var/log/syslog')
</syntaxhighlight>
 
;Debrief
<pre>
feedback - team liked, pleasure in interview
strong NW
stron linux
LP fine
L4 is not good for you
System design not good
DB using indexing, Queues, scalable, parallel approach, LB using, indexing DBs, instead of storage.
Coding was also OK, difficulty with dictionary
Should know Datastructures not algorithms
Try again in 6 months, ask HR & try to get exception.
</pre>
 
* Correct Code:
<pre>
latency ={}
occurrance = {}
 
with open('latency2.logs','r') as file:
for line in file:
lat = int(line.split()[-1])
oper = line.split()[-2]
if oper in latency.keys():
add_latency = latency.get(oper) + lat
occurrance.update({oper:occurrance.get(oper)+1})
else:
add_latency = lat
occurrance.update({oper:1})
latency.update({oper:add_latency})
 
print(latency)
print(occurrance)
 
for k,v in latency.items():
print(k,int(v/occurrance.get(k)))
</pre>
 
= MasterCard =
 
* SSL Handshake
* TCP 3-Way Handshake
* TLS 1.0 vs TLS 3.0
* curl -kv (meaning of k)
* HTTP
 
= Microsoft =
 
;HM Round:
* State a Work process you changed
* Mention a time when you worked with a Cross functional team
* Mention a time when you tried to understand the Customer needs in a better way.
 
; Scripting Round
* Write a code to:
- Check how many IP addresses from a range are online
- Login into one of them & perform traceroute to each & save output to <IP>_traceroute.txt file
- Login into each and save output of ipconfig/all & nbtstat to a file called <IP>_config.txt
* Program with AND/OR function operations
* What is a Pull Request? (Merge branch into Main branch)
* What is a Class? (Datatype eg: string - Cat, Sub, etc functions)
 
; Networking Round
* NTP Strutum
* Vlan turking - switchport mode trunk without impact
-> allowed VLAN command
* Difference between BGP default info orig & default orig
* OSPF AD? eBGP/iBGP AD?
* BGP port no, States, Attributes
* OSI Model
 
= AMZN Networking =
 
Line 358 ⟶ 620:
 
<pre>
# Read the file
f = open('/var/log/apache2/access.log','r')
lines = f.readlines()
f.close()
 
print(len(lines))
 
# Append Response code & Dest IP address to 'a'
a = []
for i in lines:
a.append((i.split()[0], i.split()[8]))
 
print(len(a))
 
# Create a set of IP addresses 'b'
b=[]
for i in a:
b.append(i[0])
Line 375 ⟶ 641:
b = set(b)
 
print(len(b))
 
# Create a new list having Unique IP addresses & list of Responses for each:
c=[]
for i in b:
x = []
for j in range(len(a)):
if i == a[j][0]:
x.append(a[j][1])
c.append((i,x))
 
print(len(c))
c =[]
 
# Print the results:
c = [(a[j][0],a[j][1]) for i in b for j in range(len(a)) if i == a[j][0]]
for k in range(len(c)):
print(c[k][0],len(c[k][1]))
</pre>
 
Line 1,407 ⟶ 1,683:
= TechM (Chd) =
 
* SRX fxp1 interface
For SRX240B:
ge-0/0/0 interface will be mapped to fxp0 (out-of-band management)
ge-0/0/1 interface will be mapped to fxp1 (control).
The interfaces that are mapped to fxp0 and fxp1 are device specific.
* IPS blocked webmail. Where to get the alerts?
Analysis & Reporting > IPS > Intrusion Events
* Upgrade process of Sourcefire Sensors:
Reimage:
Reboot Sensor
Select System Restore
Set IP config
Select SCP, Enter Server IP, Credentials & ISO File name
Download & Mount ISO
Install
Reboot
* Screenos flow
* What is Sanity Checking?
* VPN
* NSRP Preempt behavior
* Proxy Server Experience
 
= ZScalar (Chd) =
 
DNS? need for DNS
Traffic troubleshooting
HTTP is in which layer?
DNS uses protocol? UDP & TCP
Why not use UDP for all DNS traffic? (Ans:Huge Overhead)
Reverse of DNS possible?
ScreenOS CPU utilization check command
Port no of DNS, SSH, HTTP
SSH access is there but WebUI not opening?
 
;2nd Level
 
302,403,401 error HTTP
SSL Handshake steps - 4 phases
Hashing vs Encryption, examples of protocols
Port Numbers - 80, 443
Proxy Server functions
ALG - Active vs Passive FTP
Destination NAT - Proxy ARP, Server issues, Debugging
If the Server does not have a reverse route to reach firewall,it will drop reply packet. Workaround is to create a Source NAT rule in firewall
Aggressive vs Main Mode
Is Preshared Key, ID shared in clear text in Aggressive mode? (no, its Hashed)
Dynamic IP in Site, Which mode is used? (Aggressive)
What is a Digital Signature?
 
 
= Convergys (JTAC L2) =
 
* VPN traffic is not reaching other gateway device? How to prove?
Ans:Take snoop simultaneusly at both sites.
 
* What filters to use for VPN Traffic?
Ans: 4 filters- two for & to the gateways, two to & for the PCs
 
* 4 VPNs between 2 devices, how to identify which packet is for which VPN?
Ans:SPI will be unique & remains same for a single VPN
 
* ESP has Port no?
 
* IMP:What is NAT-T? Why packet will drop without NAT-T? at which packet exchange will it drop?
Ans:At which packet level does it start using UDP port 4500?
 
*Scenario 1:
Line 1,501 ⟶ 1,776:
= TechM (Chd) =
 
* Ph1 Configuration steps
* Ph1 Troubleshooting
* Traffic not reaching Destination roubleshooting
* NAT in ScreenOS
* VIP
* Nat DST
* DIP
* Troubleshooting VPN
* Commands in ScreenOS
* TCP in juniper srx flow
 
= Akamai =
 
* Detailed data transfer(http/ftp) steps
* EC Window, CWR
* 3-way handshake (Sequence number was wrong)
* Acknowledgment field value in a Syn Packet
* Window size=0; what conditions
Server is overloaded
Window scaling is not supported or configured
Some old OS in use by server
* Fields in a TCP & IP Header
 
= Iopex =
 
* IP Header Fields, Flags & length
* TCP Header Fields, Flags & length
* How ICMP will recognize reply message? Identification field
* Where Segmentation occurs
* What is MTU
* URG vs Push Flag
* Data Offset
* NAT-T
* DORA
* DHCP Relay
* Use of GARP
* Port no of Telnet, SMTP, FTP
* Why FTP uses 2 ports
* Phase 1 parameters
* Phase 1 errors
'''If Proxy ID mismatch occurs, will VPN come up or just data will not transfer?'''
IKE Phase 1 successful, Phase 2 fails due to proxy-id mismatch
The Proxy ID on the local and remote VPN device must match for phase 2 to complete the VPN negotiations
* Use of Inverse ARP(Frame Relay)
* Scenario: Ping from PC1 to PC2 - Explain ARP, IP, MAC table, etc
[PC1]------[SW]------[Router]------[PC2]
 
 
= Arcesium =
Line 1,554 ⟶ 1,828:
* Which cmd sets max size of core dumps? ulimit
* Which cmd used to inspect system call made by running proces?
strace
ptrace ?
lsof ?
* In bash which cmd used to execute a shel script in current shel context?
source
exec
'.'
all of the above ?
* Print top 5 lines
cat foo.txt | head -5
head -5 foo.txt
* Redirect error stream to file errors? foo2>errors?
* Command used to create a new process? fork()
Line 1,570 ⟶ 1,844:
* init was replace by which default service manager in RHEL? systemd
* Check env variables of a running process?
env
htop
/proc FS
all of the abpve?
* Web Server can do what?
caching
LB ?
Proxy
URL Rewrite
* HTTP/2 was inspired by what? SPDY
* Most commonly used compression in response from server to client in HTTP? gzip
Line 1,584 ⟶ 1,858:
= Interview Questionaire =
 
* ;General
 
* Benefit of using Transparent mode?
* Basic difference between IDS & IPS?
* SSL VPN
* Phase 1,2 no of packets? encryption starts at which packet in VPN?
* PFS
* VPN Troubleshooting
* Stateful Inspection
* Aggressive mode / Main mode more secure?
* Task/Flow CPU High
* Reasons for High Memory?
 
;ScreenOS
 
* Flow in Netsreen firewall
Benefit of using Transparent mode?
* MIP vs VIP
Basic difference between IDS & IPS?
* Multi-Cell policy
SSL VPN
* Traffic Shapping is config where?
Phase 1,2 no of packets? encryption starts at which packet in VPN?
* 100 VPNs terminating on the Juniper firewall? Filter
PFS
* Pseudo session ?
VPN Troubleshooting
* Snoop Detail?
Stateful Inspection
* Debug flow basic
Aggressive mode / Main mode more secure?
* Precautions while debugging
Task/Flow CPU High
* Sync NSRP devices manually
Reasons for High Memory?
* NSRP non-propagating parameters
* How to avoid Split-Brain scenario?
* How to avoid No Brain scenario?
* Secondary path in NSRP
 
= Achievements =
* ScreenOS
 
* Rockman Cyberoam ARP script
Flow in Netsreen firewall
* Rockman Nagios Monitoring
MIP vs VIP
* Wipro BP SRX & NSM Repro
Multi-Cell policy
* Citrix SDWAN VoIP repro
Traffic Shapping is config where?
* Citrix CodeRed - PHP/Laravel
100 VPNs terminating on the Juniper firewall? Filter
* AVI Case Alert script
Pseudo session ?
* AVI config Parser
Snoop Detail?
* AWS VPN Log Parser
Debug flow basic
* Endian Firewall Deployments
Precautions while debugging
* NIC Snort IDS
sync NSRP devices manually
* NIC Nessus Vulnerability
NSRP non-propagating parameters
* Citrix SDWAN SME/Dev Deployment
How to avoid Split-Brain scenario?
* Cloudwatch Alarm S3 Bucket Objects Lambda function
How to avoid No Brain scenario?
Secondary path in NSRP