Skip to main content

Apple Phone Interview PIE SRE

1st phone interview

internal aws
search using solr
kafka
zookeeper
sort system?

data centers
scale
every phone is a client

- a deverloper said his binary is running slow. and need more hardware.
how do you know if we really need more hardware?

top

- if cpu usage is low, still seeing high load. how possible?
some processes in waiting state, such as i/o.

- if i see load 16 is it high?
not necessarily. if on 32 core machine it's fine.

main dev
devops sre
    services automation
    min support

mesos is used on compute side.
he is in stateful ervice.

lots of python code automate

on call once a quarter

produce a lot of code
    accelerated

------
def is_palindrome(candidate):
    candidate = candidate.lower().replace(' ', '')
    candidate = [c for c in candidate if c.isalnum()]
    return candidate == candidate[::-1]

for candidate in candidates:
    print "{}:   {}".format(candidate, is_palindrome(candidate)

>>> string = "Special $#! characters   spaces 888323"
>>> ''.join(e for e in string if e.isalnum())
'Specialcharactersspaces888323'

=========================
2nd phone interview

# Given two non overlapping, sorted range pairs.
# A = [2,5], [8, 9], [11, 13]
# B = [1,7], [9, 11], [13,17]

# find the overlap between the two.
# [2,5],[9], [11]
# or
# 2,3,4,5,9

solution 1:
convert A, B into two sets with all integers.
do a intersection of A and B.
this will give 2nd answer.

solution 2:
def overlap([x,y], [a,b]:
    if x > b or y < a:
        return None
    else:
        return [max(x,a), min(y,b)]

def print_overlap(A, B):
    res = []
    for [x, y] in A:
        for [a, b] in B:
            if not overlap([x,y], [a,b]):
                break
            res.append(overlap([x,y], [a,b]))

------------------------
challenge projects
automation

dever doing devops currently
automation is way to go

solr cloud

what is the architecture of es?

how did you tune es?

lucene
open source api
filter out
proxy cloud
rate limiting

mesos 10k hosts

solr cloud is about 10k hosts, not all used for searching though.

- how did you implment access control?
TLS
distributed shared secrets
security is difficult to manage.

Comments

Popular posts from this blog

CKA Simulator Kubernetes 1.22

  https://killer.sh Pre Setup Once you've gained access to your terminal it might be wise to spend ~1 minute to setup your environment. You could set these: alias k = kubectl                         # will already be pre-configured export do = "--dry-run=client -o yaml"     # k get pod x $do export now = "--force --grace-period 0"   # k delete pod x $now Vim To make vim use 2 spaces for a tab edit ~/.vimrc to contain: set tabstop=2 set expandtab set shiftwidth=2 More setup suggestions are in the tips section .     Question 1 | Contexts Task weight: 1%   You have access to multiple clusters from your main terminal through kubectl contexts. Write all those context names into /opt/course/1/contexts . Next write a command to display the current context into /opt/course/1/context_default_kubectl.sh , the command should use kubectl . Finally write a second command doing the same thing into ...

OWASP Top 10 Threats and Mitigations Exam - Single Select

Last updated 4 Aug 11 Course Title: OWASP Top 10 Threats and Mitigation Exam Questions - Single Select 1) Which of the following consequences is most likely to occur due to an injection attack? Spoofing Cross-site request forgery Denial of service   Correct Insecure direct object references 2) Your application is created using a language that does not support a clear distinction between code and data. Which vulnerability is most likely to occur in your application? Injection   Correct Insecure direct object references Failure to restrict URL access Insufficient transport layer protection 3) Which of the following scenarios is most likely to cause an injection attack? Unvalidated input is embedded in an instruction stream.   Correct Unvalidated input can be distinguished from valid instructions. A Web application does not validate a client’s access to a resource. A Web action performs an operation on behalf of the user without checkin...