Interview Questions

Interview Questions

This is a collection of interview questions that I pick and choose from (nobody has to answer all them) when I talk with both technical and non-technical people. I’ve been collecting these for several years and I try to keep them updated along the way. Some have historical interest. Some may need to be updated, or you may find value in their historical nature. Its true that the industry makes fun of people who use AIX, or emacs. Don’t do this in an interview. Its tacky.

Most of the hard questions have answers. Most of the soft questions don’t have a specific answer and the interviewer needs to gauge the answer individually. Some of the soft questions have tips, or suggestions on what to look for. For the questions that include a rating, total up. If you get more than 70, you did it wrong.

Soft Questions

  1. Who do you admire and why?

  2. In your last employee review, what areas for improvement were identified?

  3. Why are you here?

  4. If we hired you, what would you want to work on?

  5. Describe an environment where you would not thrive.

  6. If you could do anything, what would be your ideal job?

  7. Do you have a favorite sports team? If you were they’re owner, what would you do differently?

  8. Describe an interesting problem and how you solved it.

  9. What are your failures, and how have you learned from them?

  10. Describe yourself, what excites you (What is your passion)?

  11. Have you ever disagreed with a manager’s decision? How did you approach the disagreement? Give a specific example and explain how you rectified this disagreement, what the final outcome was, and how that individual would describe you today.

  12. What was your best day in the last 4 years? What was your worst?

  13. Have you been promoted at least once in a previous role? (Rate 1-10)

    Look at their LinkedIn profile and see if, at any of their previous companies, they’ve been promoted. Once is great, twice is amazing and three times is out of this world.

  14. Have you had to lead a big project in a previous role? How did they handle it? (Rate 1-10)

    Have they had a previous manager that was so confident in their abilities that they were given a large or important project to run on their own?

  15. Is this the same role you had at a previous job or is it somewhat/completely different? (Rate 1-10)

    They may not change companies so much as they change roles — because they like the challenge of constantly learning new things and being in new situations.

  16. Can you speak about our company and tell me what you like and what you might change? (Rate 1-10)

    Did they do research on a company before an interview. Did they try to understand your strategy, what’s going well and even what’s not. Can they clearly articulate what they like about your company but also provide some constructive feedback on something you might want to change? If they don’t know what your company does or they have no opinion (positive or negative) about it, that’s a red flag.

  17. Are you confident without being cocky? (Rate 1-10)

    This is a fine line. You want someone who talks a lot about being on great teams and having great managers and mentors, not someone constantly saying "I this, I that".

  18. Are you committed to continual learning? Can you prove it? (Rate 1-10)

    Ask them what they’re learning right now that’s specific to the role they’ve applied for.

    Ask them about a book they’re reading, recently read, or a mentor they’ve had that has changed their life.

    Ask them what they plan to learn in the next 6-12mo and how they’ll go about doing it. You want someone who a) values learning, b) enjoys it.

    Ask them what they learned in their previous role.

Technical Questions

  1. What kind of experience do you have managing IT or engineering projects that scale?

  2. How do you deal with the difference between getting people the resources they need to get the job done right vs decisions based on numbers?

  3. What kind of experience have you had working with Engineering? How do you see Engineering as being different from IT from a management perspective?

  4. What kind of experience have you had supporting services (not IT)?

  5. What do you see as the challenges in working with different geo locations?

  6. What do you think the challenges will be working with a group of people most of whom are not in the same locations? How would you propose to facilitate better communication between individuals and groups who are not in the same locations?

  7. Explain your understanding and expertise on both the software development side and the technical operations side of an organization you’ve worked for in the past.

    DevOps engineers almost always work in a 24/7 business critical online environment. I was adaptable to on-call duties and able to take up real-time, live-system responsibility. I successfully automated processes to support continuous software deployments. I have experience with public/private clouds, tools like Chef or Puppet, scripting and automation with tools like Python and PHP, and a background in Agile.

  8. Discuss your experience building bridges between IT Ops, QA and development.

    DevOps is all about effective communication and collaboration. I’ve been able to deal with production issues from the development and operations sides, effectively straddling the two worlds. I’m less interested in finding blame or playing the hero than I am with ensuring that all of the moving parts come together.

  9. What types of testing are needed?

    Software teams will often look for the “fair weather” path to system completion; that is, they start from an assumption that software will usually work and only occasionally fail. I believe to practice defensive programming in a pragmatic way, which often means assuming that the code will fail and planning for those failures. I try to incorporate unit test strategy, use of test harnesses, early load testing; network simulation, A/B and multi-variate testing etc.

  10. Give me an example of how you would handle projects?

    As a professional with managerial responsibilities, I would demonstrate a clear understanding of DevOps project management tactics and also work with teams to set objectives, streamline workflow, maintain scope, research and introduce new tools or frameworks, translate requirements into workflow and follow up. I would resort to CI, release management and other tools to keep interdisciplinary projects on track.

  11. How would you make software deployable?

    The ability to script the installation and reconfiguration of software systems is essential towards controlled and automated change. Although there is an increasing trend for new software to enable this, older systems and products suffer from the assumption that changes would be infrequent and minor, and so make automated changes difficult. As a professional who appreciates the need to expose configuration and settings in a manner accessible to automation, I will work with concepts like Inversion of Control (IoC) and Dependency Injection, scripted installation, test harnesses, separation of concerns, command-line tools, and infrastructure as code.

  12. What testing is necessary to ensure that a new service is ready for production?

    DevOps is all about continuous testing throughout the process, starting with development through to production. Everyone shares the testing responsibility. This ensures that developers are delivering code that doesn’t have any errors and is of high quality, and it also helps everyone leverage their time most effectively.

  13. Describe two-factor authentication?

    Two-factor authentication is a security process in which the user provides two means of identification from separate categories of credentials; one is typically a physical token, such as a card, and the other is typically something memorized, such as a security code.

  14. How would you prepare for a migration?

    Tips to answer: This question evaluates your experience of real projects with all the awkwardness and complexity they bring. Include terms like cut-over, dress rehearsals, roll-back and roll-forward, DNS solutions, feature toggles, branch by abstraction, and automation in your answer. Developing greenfield systems with little or no existing technology in place is always easier than having to deal with legacy components and configuration. As a candidate if you appreciate that any interesting software system will in effect be under constant migration, you will appear suitable for the role.

  15. What’s your systems background?

    Tips to answer: Some DevOps jobs require extensive systems knowledge, including server clustering and highly concurrent systems. As a DevOps engineer, you need to analyze system capabilities and implement upgrades for efficiency, scalability and stability, or resilience. It is recommended that you have a solid knowledge of OSes and supporting technologies, like network security, virtual private networks and proxy server configuration. DevOps relies on virtualization for rapid workload provisioning and allocating compute resources to new VMs to support the next rollout, so it is useful to have in-depth knowledge around popular hypervisors. This should ideally include backup, migration and lifecycle management tactics to protect, optimize and eventually recover computing resources. Some environments may emphasize microservices software development tailored for virtual containers. Operations expertise must include extensive knowledge of systems management tools like Microsoft System Center, Puppet, Nagios and Chef. DevOps jobs with an emphasis on operations require detailed problem-solving, troubleshooting and analytical skills.

  16. What other tools are you familiar with that might help you in this role?

    Tips to answer: DevOps is so diverse and inclusive that it rarely ends with coding, testing and systems. A DevOps project might rely on database platforms like SQL or NoSQL, data structure servers like Redis, or configuration and management issue tracking systems like Redmine. Web applications are popular for modern enterprises, making a background with Web servers, like Microsoft Internet Information Services, Apache Tomcat or other Web servers, beneficial. Make sure to bring across that you are familiar with Agile application lifecycle management techniques and tools.

  17. How can you reduce load time of a dynamic website?

*Tips to answer: Talk about Webpage optimization, cached web pages,
quality web hosting , compressed text files, Apache  fine tuning.*
  1. How would you ensure traceability?

    Tips to answer: This question probes your attitude to metrics, logging, transaction journeys, and reporting. You should be able to identify that metric, monitoring and logging needs to be a core part of the software system, and that without them, the software is essentially not going to be able to appear maintained and diagnosed. Include words like SysLog, Splunk, error tracking, Nagios, SCOM, Avicode in your answer.

  2. What was your greatest achievement on a recent project?

    Tips to answer: Make sure you demonstrate your perfect understanding of both development and operations. Do not let your answer lean towards one particular skillset ignoring the other. Even if you have worked in an environment wherein you had to work more with one skillset, assure the intervewer that you are agile according to the needs of your organization.

  3. What problems did you face and how did you solve them in a way that met the team’s goals?

    Tips to answer: This questions aims to find out how much you can handle stress and non-conformity at work. Talk about your leadership skills to handle and motivate the team to solve problems together.Talk about CI, release management and other tools to keep interdisciplinary projects on track.

  4. How does HTTP work?

    The HTTP protocol works in a client and server model like most other protocols. A web browser using which a request is initiated is called as a client and a web server software which responds to that request is called a server. World Wide Web Consortium and the Internet Engineering Task Force are two important spokes in the standardization of the HTTP protocol. HTTP allows improvement of its request and response with the help of intermediates, for example a gateway, a proxy, or a tunnel. The resources that can be requested using the HTTP protocol, are made available using a certain type of URI (Uniform Resource Identifier) called a URL (Uniform Resource Locator). TCP (Transmission Control Protocol) is used to establish a connection to the application layer port 80 used by HTTP.

Security

  1. How are symmetric and public key encryption different?

    Symmetric key encryption uses the same key for both encrypt and decrypt. Public key encryption uses different keys for encryption and decryption.

  2. Describe how public key encryption works at a high level.

    Public-key cryptography refers to a cryptographic system requiring two separate keys, one to lock or encrypt the plaintext, and one to unlock or decrypt the cyphertext. Neither key will do both functions. One of these keys is published or public and the other is kept private. If the lock/encryption key is the one published then the system enables private communication from the public to the unlocking key’s owner. If the unlock/decryption key is the one published then the system serves as a signature verifier of documents locked by the owner of the private key.

  3. Describe how symmetric key encryption works at a high level.

    Symmetric-key algorithms are a class of algorithms for cryptography that use trivially related, often identical, cryptographic keys for both encryption of plaintext and decryption of ciphertext. The encryption key is trivially related to the decryption key, in that they may be identical or there is a simple transformation to go between the two keys. The keys, in practice, represent a shared secret between two or more parties that can be used to maintain a private information link.

  4. Have you used PGP before? Can you explain at a high level how PGP works? Alternatively, can you explain how HTTPS works? What is a digital signature?

    A digital signature or digital signature scheme is a mathematical scheme for demonstrating the authenticity of a digital message or document. A valid digital signature gives a recipient reason to believe that the message was created by a known sender, and that it was not altered in transit. Digital signatures are commonly used for software distribution, financial transactions, and in other cases where it is important to detect forgery or tampering.

  5. Can you tell me the difference between Authentication and Authorization?

    Authentication (from Greek: αὐθεντικός; real or genuine, from αὐθέντης authentes; author) is the act of confirming the truth of an attribute of a datum or entity. This might involve confirming the identity of a person or software program, tracing the origins of an artifact, ensuring that a product is what its packaging and labeling claims to be.

    Authorization (also spelt Authorisation) is the function of specifying access rights to resources, which is related to information security and computer security in general and to access control in particular. More formally, “to authorize” is to define access policy.

Revision Control

  1. What revision control systems have you used?

    SCCS, RCS, CVS, SVN, Git, Perforce, Clear Case

  2. What do you like about revision control? What do you dislike about revision control?

  3. Are there other uses for revision control beyond managing source code?

  4. What is a checkout (or clone)?

  5. What is the difference between a configuration management tool and version control tool?

    Configuration management (CM) is a systems engineering process for establishing and maintaining consistency of a product’s performance, functional, and physical attributes with its requirements, design, and operational information throughout its life.

    A component of software configuration management, version control, also known as revision control or source control, is the management of changes to documents, computer programs, large web sites, and other collections of information.

SQL

  1. Select Statement: Given following table “quips”, show all the quips from userid=5

     ```
     +----------+--------------+------+-----+---------+----------------+
     | Field    | Type         | Null | Key | Default | Extra          |
     +----------+--------------+------+-----+---------+----------------+
     | quipid   | mediumint(9) |      | PRI | NULL    | auto_increment |
     | userid   | mediumint(9) |      |     | 0       |                |
     | quip     | text         |      |     |         |                |
     | approved | tinyint(1)   |      |     | 1       |                |
     +----------+--------------+------+-----+---------+----------------+
     ```
    

    SQL

     #!sql
     SELECT quip FROM quips WHERE userid=5;
    
  2. Simple Join: Given following two tables, show all the “quip"s with associated login_name.

     ```
     +----------+--------------+------+-----+---------+----------------+
     | Field    | Type         | Null | Key | Default | Extra          |
     +----------+--------------+------+-----+---------+----------------+
     | quipid   | mediumint(9) |      | PRI | NULL    | auto_increment |
     | userid   | mediumint(9) |      |     | 0       |                |
     | quip     | text         |      |     |         |                |
     +----------+--------------+------+-----+---------+----------------+
     ```
    
     ```
     +------------+--------------+------+-----+----------+----------------+
     | Field      | Type         | Null | Key | Default  | Extra          |
     +------------+--------------+------+-----+----------+----------------+
     | userid     | mediumint(9) |      | PRI | NULL     | auto_increment |
     | login_name | varchar(255) |      | UNI |          |                |
     +------------+--------------+------+-----+----------+----------------+
     ```
    

    Either answer would work:

     #!sql
     SELECT quips.quip, profiles.login_name FROM quips,profiles WHERE quips.userid = profiles.userid;
    

    or

     #!sql
     SELECT t1.quip, t2.login_name FROM quips as t1, profiles as t2 WHERE t1.userid = t2.userid;
    
  3. Describe the process you would go through for tuning a PostgreSQL database.

System Administration

  1. All UNIX/Linux machines have a superuser account, what is it?

    root

  2. If I’m logged in as a normal user and I want to become root, what command would I use?

    sudo or su

  3. What’s the difference between sudo and su?

    To a certain extent, sudo(8) allows fine grained access control to elevated privileges. Specific users, groups, commands. It also helps track the use of commands which require elevated privileges.

  4. Is there a security concern with using sudo vs. su?

  5. Tell me what you know about UNIX permissions

  6. For each owner, group, world, there are three contexts, what are they?

    r w x

  7. Have you ever compiled a kernel from scratch? Describe the experience.

  8. When you see a Linux kernel load, it says “loading initrd”. What is an initrd and what is it used for?

    initrd is a init ramdisk. Used for loading kernel modules before the disk can be examined (such as for software RAID).

  9. In the root level of the filesystem, there is a directory called ‘dev’. What is the importance of this directory?

    All physical devices are represented here.

  10. If I do ls -l for a file in /dev (on RHEL), what 3 bits of information are present that aren’t present for files outside of /dev?

    All devices list the type of device (block, character, etc..), and the major and minor numbers (major numbers refer to the controller of the device, the minor number tells the kernel special characteristics of the device to be accessed. For example, the second hard disk has a different minor number than the first. The COM1 port has a different minor number than the COM2 port, each partition on the primary IDE disk has a different minor device number, and so forth.

  11. What is important about /proc (on Linux)?

    procfs (or the proc filesystem) is a special filesystem in UNIX-like operating systems that presents information about processes and other system information in a hierarchical file-like structure, providing a more convenient and standardized method for dynamically accessing process data held in the kernel than traditional tracing methods or direct access to kernel memory. Typically, it is mapped to a mount point named /proc at boot time.

  12. How is it different from the /sys directory?

    Sysfs is a virtual file system provided by Linux 2.6. Sysfs exports information about devices and drivers from the kernel device model to user space, and is also used for configuration. It is similar to the sysctl mechanism found in BSD systems, but implemented as a file system instead of a separate mechanism.

  13. What is the file /etc/nsswitch.conf for?

    The Name Service Switch (NSS) is a facility in Unix-like operating systems that provides a variety of sources for common configuration databases and name resolution mechanisms. Such source databases include local operating system files, for example, /etc/passwd, /etc/group, and /etc/hosts, the Domain Name System (DNS), the Network Information Service (NIS), LDAP, and others.

  14. What is the utility to modify the firewall on Linux? FreeBSD? Are there any significant differences in how they work?

    iptables, ipfw, pf, ipf

  15. Which command will tell me a list of files (in an arbitrary directory structure) contains a given string?

    grep

  16. What file do you define remote volume mount points?

  17. Is it the same for NFS? CIFS?

  18. What is the difference between CIFS and SMB?

  19. What file do you define configuration parameters for a bond interface in RHEL?

    /etc/sysconfig/network-scripts/ifcfg-bondX

  20. What file do you define configuration parameters for a vlan interface in RHEL?

    /etc/sysconfig/network-scripts/ifcfg-vlanX

  21. When you type ‘ssh $host’, what happens?

    Need to use more detail than “connects to host”.

  22. What is the command to install a package in FreeBSD (eg, bind)? RHEL/CentOS? Debian? Solaris? HPUX? AIX?

    • pkg install bind9
    • RHEL/CentOS: yum install bind
    • Debian/Ubuntu: apt-get install bind9
    • Solaris: pkgadd/pkgrm to install/remove pkgs
    • HPUX: swinstall/swremove to install/remove depot pkgs
    • AIX >=5.2: rpm
  23. I have a text file where I misspelled desert with two ‘s’, making it dessert. What command should I use to replace all instances of dessert with desert?

    #!bash
    sed -i 's/dessert/desert/g' /path/to/file*
    
  24. How would I use awk to print the second and last field of a file with a tab between them?

    #!bash
    awk /path/to/file '{print $1"\t"$NF}'
    
  25. I want to recursively remove a file from a directory structure. How do I do it?

    #!bash
    find ./ -type f -exec rm -f {} \;*
    
  26. What is the difference between RAID0, RAID1, RAID5, RAID10, RAID01? What is the difference between RAID and ZFS? Do you have a preference?

    RAID 0 (block-level striping without parity or mirroring) has no (or zero) redundancy. It provides improved performance and additional storage but no fault tolerance.

    RAID 1 (mirroring without parity or striping), data is written identically to multiple drives, thereby producing a “mirrored set”; at least 2 drives are required to constitute such an array.

    RAID 5 (block-level striping with distributed parity) distributes parity along with the data and requires all drives but one to be present to operate; the array is not destroyed by a single drive failure.

    RAID 6 (block-level striping with double distributed parity) provides fault tolerance of two drive failures; the array continues to operate with up to two failed drives. This makes larger RAID groups more practical, especially for high-availability systems.

    RAID10 and RAID01 are combinations of RAID1 and RAID0. Different orders produce different features and limitation.

    RAID provides a way to logically group disks and provide redundancy. ZFS provides RAID-like capabilities, in addition to being a volume manager. A volume manager adds the abilities to carve up the volumes that RAID produces so you can provide different volumes to different aspects of the system. For example, you could have a volume for the OS, and a volume for data storage.

  27. What is your favorite shell? Why?

  28. What is your favorite shell to program in? If this is different than your favorite shell, why?

  29. Why would you put {} around a variable name (${foo})?

    Braces on a variable name allow you to define what part is the variable and what part is additional.

  30. You have a directory titled foo. What does chmod +t foo accomplish?

    Sticky, keeps users from changing other users files

  31. You have a directory titled bar. What does chmod +s bar accomplish?

    Set user/group id

  32. What is the first process? What’s wrong with the command: kill -9 1 ? What would if you do this?

    On a *BSD or (non-systemd) Linux system, process ID 1 is “init”. Init is the parent process of all other processes, meaning once they die, you can’t create more.

  33. Do you have a favorite UNIX/Linux distribution?

    AIX is not acceptable

  34. Assume current directory is /. I have created a directory named ‘–export’. How do I delete it?

    #!bash
    rm -- --export
    
  35. Looking at the firewall rules, please describe in detail what they do (protocols allowed, denied, ports allowed, denied, etc..)

  36. What is the difference between $$ and $! ?

    $$ shows the process id of the currently executing process

    $! shows the process id of the process that recently went into the background

  37. What is your favorite editor?

    emacs is not acceptable

  38. You have a LAMP stack machine that is currently running at 10% utilization with 10M requests per day. Its a monolithic design doing both web and database. Pick an automation tool you’ve used before and walk us through the process you would use to be able to recreate the components on 10 servers (all with the same monolithic design).

    What do you do? How do you do it? Is there any tuning you think should happen first or wait until you finish the migration? What kind of monitoring (alerting+trending) would you want to make sure exists to facilitate any troubleshooting, or scaling questions that are likely to come up?

  39. We decided that we don’t like monolithic design and we want to migrate all the databases to a single database machine (or cluster), leaving all the web servers intact, but still communicating with the database (cluster). Does the automation work you’ve done previously change? If so, How? How much of it can be reused to design our new architecture? Can all this work be automated? Should it? What are the implications to automating all of it?

ESX/ESXi

  1. Do you know what virtualization is? Have you ever used virtualization technologies? If so, which ones.

    In computing, virtualization is a broad term that refers to the abstraction of computer resources.

  2. Describe your experience with VMware ESX/ESXi.

  3. You have just installed ESXi on a new server. What is the process for adding an NFS mount?

     #!bash
     esxcfg-nas -a <datastore name>  -o <nfs_server-hostname/ip> -s <mount_dir>
     esxcli <conn_options> storage nfs add --host=<nfs_server-hostname/ip> --share=/<mount_dir> --volume-name=<volume_name>
    
  4. What is vMotion? What is storage vMotion?

    vMotion allows the migration of operational guest virtual machines between similar but separate hardware hosts sharing the same storage

    Same as vMotion, but allows migration to a separate data store

  5. What is the difference between a .vmx file and a .vmdk file?

    • .vmx - Virtual Machine Configuration File
    • .vmdk - Virtual Machine Disk file
    • .vswp - Virtual Machine Swap File
  6. What is a template?

  7. What is thin provisioning?

  8. What are linked clones? Are they different from full clones? How?

  9. Explain the physical topology of a vSphere4/5/6 Data Center?

  10. How do you configure Clusters, Hosts, Resource Pools in vSphere4/5/6?

  11. What are resource pools & whats the advantage of implementing them?

  12. Explain why VMware ESXi Server is preferred over Virtual Server or Workstation for enterprise implementation?

  13. You have a LAMP stack machine that is currently running at 90% utilization with 10M requests per day. You’ve been asked to provide a virtual solution for this system that will be horizontally scalable. The VM(s) will be going in to a pre-existing VMware cluster so you need to ensure that you properly allocate resources in VMware but also don’t allow the VMs to consume all resources. What do you do? How do you do it? Is there any tuning you think should happen first or wait until you finish the migration? What kind of monitoring (alerting+trending) would you want to make sure exists to facilitate any troubleshooting, or scaling questions that are likely to come up?

Mac OS X

  1. How do you add a user?

    Apple -> System Preferences -> Accounts

     #!bash
     dscl . -create /Users/user_name
     dscl . -create /Users/user_name UserShell /bin/bash
     dscl . -create /Users/user_name RealName "First Last"
     dscl . -create /Users/user_name UniqueID "1010"
     dscl . -create /Users/user_name PrimaryGroupID 80
     dscl . -create /Users/user_name NFSHomeDirectory /Users/user_name
     dscl . -passwd /Users/user_name password
     dscl . -append /Groups/admin GroupMembership user_name
    
  2. Can you explain to me what the KeyChain is?

    The keychain is a utility to manage accounts and passwords. Inclusive of Browser, and SSH.

  3. Can you describe 2 ways to change the IP address on a Mac OS X machine?

    Apple -> System Preferences -> Network -> $interface

     #!bash
     ifconfig $interface $ip/$netmask
    
  4. How do you configure NTP on OX X?

    Apple -> System Preferences -> Date & Time

     #!bash
     systemsetup -settimezone timezone
     systemsetup -setnetworktimeserver timeserver
    
  5. How do you check for updates and install them on OS X?

    Apple -> Software Update

  6. Can you describe how to use Disk Utility to fix permissions?

     #!bash
     $ diskutil list
     /dev/disk0 (internal, physical):
        #:                       TYPE NAME                    SIZE       IDENTIFIER
        0:      GUID_partition_scheme                        *251.0 GB   disk0
        1:                        EFI EFI                     209.7 MB   disk0s1
        2:          Apple_CoreStorage Macintosh HD            250.1 GB   disk0s2
        3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
     /dev/disk1 (internal, virtual):
        #:                       TYPE NAME                    SIZE       IDENTIFIER
        0:                  Apple_HFS Macintosh HD           +249.8 GB   disk1
                                      Logical Volume on disk0s2
                                      7B2F242A-4473-47AB-8AB9-45BECF4FD52B
                                      Unlocked Encrypted
     $ diskutil verifyVolume disk1
     $ diskutil repairVolume disk1
    
  7. How would you remove support for Bluetooth w/o removing any hardware?

     #!bash
     rm /System/Library/Extensions/IOBluetoothFamily.kext
     rm /System/Library/Extensions/IOBluetoothHIDDriver.kext
    
  8. What is the point of the terminal on OS X?

  9. What is Xcode?

    Xcode is a suite of tools developed by Apple for developing software for Mac OS X and iOS.

Networking

  1. Which of these addresses are not routable?

    10.10.17.5

    2001:0db8:0000:0042:0000:8a2e:0370:7334

    63.251.255.4

    198.18.1.25

    ::1

    fe80::8c8:f5f4:4ca0:ebce%em0

  2. What are the 7 layers of the OSI (Open System Interconnection) model?
    Please give an example of what sits on the Application layer. Where is TCP? Where is UDP? What’s the difference between TCP and UDP?

    Application, Presentation, Session, Transport, Network, Data Link, Physical

    Telnet

    TCP is Transport Layer, UDP is Transport Layer

    TCP is stateful/connection oriented. 3way handshake.

  3. If layers 2 and 3 both have addresses, what is the difference between them?

    Layer 2 addresses are limited to the broadcast domain, are traditionally not portable (burned into NIC firmware). Layer 3 addresses are routable, portable, any host could have any IP address, and in some cases, more than 1 host can share an IP address (HSRP/CARP/VRRP, Multicast).

  4. What is the difference between Cisco ISL and IEEE 802.1Q is? How might this effect interoperability between Cisco and non-Cisco devices?

    ISL is a Cisco propriatary protocol for VLAN tagging. 802.1Q is an IEEE standard for VLAN tagging. Interoperation of devices doing VLANs will likely require dot1q.

  5. What are broadcast domains and what do they have to do with VLANs?

    A broadcast domain is the set of all devices which will get a broadcast packet on a particular subnet. Routers do NOT forward broadcast packets. VLANs allow a broadcast domain to become a logical construction and become an arbitrary collection of ports spanning multiple switches (as opposed to all ports on all switches).

  6. What is 802.3ad? What is the difference between Etherchannel and LACP?

    Link aggregation or trunking or link bundling or Ethernet/network/NIC bonding[1] or NIC teaming are computer networking umbrella terms to describe various methods of combining (aggregating) multiple network connections in parallel to increase throughput beyond what a single connection could sustain, and to provide redundancy in case one of the links fails.

  7. What is a VPN? Where does it come in to play for the 7 layer model?

    A virtual private network (VPN) is a network that uses primarily public telecommunication infrastructure, such as the Internet, to provide remote offices or traveling users access to a central organizational network.

  8. What is IPSec? How is it different from a VPN? Does using IPSec make it OK to use Telnet?

    Internet Protocol Security (IPsec) is a protocol suite for securing Internet Protocol (IP) communications by authenticating and encrypting each IP packet of a communication session. IPsec also includes protocols for establishing mutual authentication between agents at the beginning of the session and negotiation of cryptographic keys to be used during the session.

  9. What is a VPLS? What is the difference between a VPN and a VPLS?

    Virtual Private LAN Service (VPLS) is a way to provide Ethernet based multipoint to multipoint communication over IP/MPLS networks. It allows geographically dispersed sites to share an Ethernet broadcast domain by connecting sites through pseudo-wires. The technologies that can be used as pseudo-wire can be Ethernet over MPLS, L2TPv3 or even GRE. There are two IETF standards track RFCs (RFC 4761 and RFC 4762) describing VPLS establishment.

  10. What is an Autonomous System?

    Within the Internet, an Autonomous System (AS) is a collection of connected Internet Protocol (IP) routing prefixes under the control of one or more network operators that presents a common, clearly defined routing policy to the Internet.

  11. What is the difference between RIP, OSPF, and BGP?

    The Routing Information Protocol (RIP) is a distance-vector routing protocol, which employs the hop count as a routing metric.

    Open Shortest Path First (OSPF) is an adaptive routing protocol for Internet Protocol (IP) networks. It uses a link state routing algorithm and falls into the group of interior routing protocols, operating within a single autonomous system (AS).

    The Border Gateway Protocol (BGP) is the protocol backing the core routing decisions on the Internet. It maintains a table of IP networks or ‘prefixes’ which designate network reach-ability among autonomous systems (AS). It is described as a path vector protocol.

  12. Can you tell me what’s taking place in the packet dump printouts?

  13. Can you name one advantage and one disadvantage between Telnet and SSH?

    Telnet can be used to check any (non-encrypted) service, Telnet is insecure. SSH is encrypted (secure), but this can also make it harder to debug if there are problems.

  14. Why are HSRP/VRRP useful protocols?

  15. What is the difference between a tap and a span port (or Port Mirror)?

    Port Mirroring is used on a network switch to send a copy of network packets seen on one switch port (or an entire VLAN) to a network monitoring connection on another switch port. This is commonly used for network appliances that require monitoring of network traffic, such as an intrusion-detection system. Port mirroring on a Cisco Systems switch is generally referred to as Switched Port Analyzer (SPAN); some other vendors have other names for it, such as Roving Analysis Port (RAP) on 3Com switches.

  16. Can traceroute work across a firewall? Why, or why not?

  17. What is the difference between a routed protocol and a routing protocol?

  18. What is the subnet mask 10.2.1.3/22?

    255.255.252.0

  19. What is the administrative distance of EIGRP, eBGP, iBGP?

  20. What is your favorite routing Protocol?

  21. In EIGRP, what is a Stuck in Active route?

  22. In OSPF, what is a totaly stubby area? What does Area Zero do?

  23. Which internal routing protocol would use if you needed to route between Cisco and non-Cisco equipment?

    OSPF, RIP, ISIS are all multi-vendor IGPs

  24. Explain what a 3-way handshake is in TCP?

  25. What is a VLAN trunking protocol?

    VTP (VLAN Trunking Protocol) is a Cisco technology that allows devices to propagate VLAN definitions from one device to another

  26. Explain what is an Ether-Channel?

  27. What do you need to do to setup a VTP domain?

  28. What is Spanning Tree used for?

  29. What is a root bridge and why do you need one?

  30. What is needed on a router interface to allow DHCP to function on a subnet?

  31. Describe what a stateful firewall is?

  32. What is HSRP? Is this an open standard?

  33. In a PIX/ASA, what are security levels used for? Alternatively, on a Juniper SRX, what are security zones used for?

  34. What two things are needed in a PIX/ASA firewall to allow traffic to pass from a higher security level to a lower security level?

  35. In IPSec VPNs, what is diffie hellman? What is it used for?

  36. In an IPSec tunnel, what is main mode?

  37. When a device is delivered ICMP echo/reply messages out of order, how does it know whether or not the message is the most recent request sent?

    In the ICMP header, there is a sequence number

Programming Questions

Shell

  1. What are some of the ways you can pass arguments to a shell script?

    scriptName “Arg1” “Arg2”

    scriptName “-F” “-o blarg”

  2. What is the significance of $#?

    $# shows the count of the arguments that have been passed to the script

  3. What is the difference between $* and $@?

    $@ treates each quoted argument as separate arguments. $ considers the entire set of positional parameters as a single string*

  4. Print the 10th line of a file using only tail and head

    tail -n 10 file | head -1

  5. Print the 10th line of a a file with out using tail or head

    sed -n ‘10p’ file

  6. Write a shell script that prints the first N digits of the fibonacci sequence

     1 #!/bin/sh
     2 # 1 1 2 3 5 8 13 21
     3 a=0
     4 b=1
     5 seq_length="$1"
     6 for (( num=0;num<=$seq_length;num++)) ; do
     7 	echo $a
     8 	c=$(($a+$b))
     9 	a=$b
    10 	b=$c
    11 done
    

Perl

  1. Do you use strict?  Why is it a good idea?  (hearing any one of the answers here is fine.)

    Forces you to declare variables before using them reducing errors from inadvertently mistying a variable name

    (refs) Generates runtime error if you use symbolic references

    (vars) Generates compile time error if you variable that wasn’t declared via my, full qualificiation or imported

    (subs) Generates compile time error if you try to use a bareword identifier

  2. What’s the difference between chop and chomp?

    chop always takes off the last character

    chop will return the last character

    chomp will take off all new line characters

    chomp will return number of \n (newline)

  3. What’s the difference between single quote ' and double quote " enclosed strings in perl?

    ' - doesn’t interpret variables or backslashes (\n, \t etc)

  4. Regular Expression Quickies - what do these match:

    \d - digit 0-9

    \D - non digit

    \s - whitespace - space \t \n \r \f

    \S - reverse of above

    ^ - beginning of string

    $ - end of string

  5. What’s the difference between my and local in Perl?

    local variable is dynamically scoped, my variable is lexically scoped. Lexically scoped variables are totally hidden from the outside world including a subroutine.  In general, prefer to use my over local as it’s faster and safer.

  6. What does bless do?

    Mostly for object oriented perl - it tells the item that it is now an object in the class package.  This can be a very long answer but this is all I’m looking for.

  7. I need to install module XML::YYLex.  How do I do that?

    Short answer, use CPAN

     #!bash
     % perl -MCPAN -e "shell"
     cpan> install XML::YYLex
    

    Long answer, tarball

     #!bash
     % tar xvfz module_name.tgz
     % cd module_name
     % perl Makefile.PL
     % make
     % make test
     % make install
    

Python

  1. What are Python decorators and how would you use them?

    They extend past python, and are functions that take a function as an argument and return functions. A simple example might be a decorator that takes a function, prints its args to stdout, prints the return value to stdout, then returns that return value. The syntax in Python is usually done with the @decorator_name above a function definition.

  2. How would you setup many projects where each one uses different versions of Python and third party libraries?

    virtualenv

  3. What is PEP8 and do you follow its guidelines when you’re coding?

    PEP8 is a coding standard. Depending on the project you’re working with, the coding standard may differ. Its always a good idea to adhere to a coding standard to make your code more readable. Additionally, pylint can be a great help.

  4. Are arguments passed by reference or by value?

  5. What is the difference between lists and tuples? Can you give me an example for their usage?

    Tuples are immutable. A tuple might be a good type for a coordinate inst var in some class. Lists are ordered collections, but with a tuple, each index generally has a certain meaning, so coord[0] is the x coordinate and coord[1] is y.

  6. What is the difference between range and xrange?

    Range returns a list of the full sequence while xrange generates each element iteratively like you would with the “yield” keyword. This changes in python3, and the default behavior is to yield like xrange. I think xrange is out.

  7. How to avoid cyclical imports without having to resort to imports in functions?

    Refactoring your code? Not sure. When I’ve ran into this I generally have restructured functions into different modules which ended up cleaning everything anyway.

  8. what’s wrong with import all?

    You can overwrite functions and this can be dangerous especially if you don’t maintain that module.

    • rewrite.py def open(foo): print(‘aint happening!’)

    • test.py from rewrite import * z = open(’test.txt’) prints aint happening!

  9. Why is the Global Interpreter Lock (GIL) important?

    It has to do with preventing true multithreaded bytecode, and has been an issue forever. The python bytecode execution is protected with the Global Interpreter Lock so every bc execution is atomic. Explained best here: http://wiki.python.org/moin/GlobalInterpreterLock

    You might want to consider writing a multithreaded module or program in C and wrapping it with Python if this is an issue for you.

  10. What are “special” methods (), how they work, etc

    These are methods like str and gt, which override behavior of other global functions like str() and operators like >. enter and exit will be used with the with keyword, and there are many more like getattr. Overriding getattr can result in some very unpredictable behavior with a dynamic language like Python, and you should be very careful when you use magic like that.

  11. Can you manipulate functions as first-class objects?

    Yes. eg. they can be passed as args to functions.

  12. Do you know what list and dict comprehensions are? Can you give an example?

    ways to construct a list or dict through an expression and an iterable.

    #!python
    >>> x = [(a, a+1) for a in range(5)]
    >>> y = dict((a,b) for a,b in x)
    >>> x
    [(0, 1), (1, 2), (2, 3), (3, 4), (4, 5)]
    >>> y
    {0: 1, 1: 2, 2: 3, 3: 4, 4: 5}
    
  13. What is the difference between “class Foo” and “class Foo(object)”

    class Foo(object) inherits from the new-style object. I don’t know the specifics, but here’s stack overflow: http://stackoverflow.com/questions/4015417/python-class-inherits-object

  14. How would you read a 8GB file in python?

    Operate on chunks, and not one byte at a time. Be wary about the RAM of the host machine. What is the nature of the data such that it is so large? How are you operating on it? What are you returning? Are you accessing it sequentially or randomly? There’s a lot more to ask than to answer here.

  15. What don’t you like about Python?

    It’s slow, and it can be too dynamic for certain tasks in my opinion. It is not compiled. It can be very unpredictable. People abuse the flexibility of it sometimes.

  16. Do you use tabs or spaces, which ones are better?

    Spaces. Stick to PEP8 when possible.

  17. What is multiple inheritance / does python have multiple inheritance?

  18. Is Python compiled, interpreted and/or emulated? What is the difference?

  19. What differentiates Python from Ruby

  20. How do you debug your Python? What’s pdb and how do you use it?

  21. How do you modify global variables in a function? Why should you avoid this?

Code Questions

  1. What’s a quick way to tell if a number is even or odd?

    Perl:

     #!perl
     if ($var % 2 == 0)
    

    Python:

     #!python
     if num % 2 == 0
    
  2. How do you check to see if the file “testfile.txt” exists?

    Perl:

     #!perl
     if (-e "testfile.txt") { ... }
    

    Python:

     #!python
     if os.path.isfile("testfile.txt"):
    
  3. Sort this list “10, 5, 1, 2, 6, 8”. Do not overthink this.

    Perl:

     #!perl
     my @a = [10,5,1,2,6,8];
     @a = sort @a;
    

    Python:

     #!python
     a = [10,5,1,2,6,8]
     a.sort()
    
  4. Split this string into an array where each element of the array is a word. “This    is a  sentence with no punctuation”

    Perl:

     #!perl
     my $string = "This    is a  sentence with no punctuation";
     my @array = split (/\s+/, $string);
    

    Python:

     #!python
     def string = "This    is a  sentence with no punctuation"
     words = text.split()
    
  5. For debugging purposes how would I print out the contents of a variable $blah that has a crazy complicated data structure attached to it?

    Perl:

     #!perl
     use Data::Dumper;
     print Dumper($blah);
    

    Python:

     #!python
     pprint.pprint(d)
    
  6. Execute a command and parse out the error lines on the fly.

    Perl:

     #!perl
     open (my $FILE, '<', "command_to_execute | ");
     while (<$FILE>) {
     	my $line = $[0];
     	// do your thing... this is sufficient to answer the question
     }
    

    Python:

     #!python
     import subprocess
     proc = subprocess.Popen(['python','fake_utility.py'],stdout=subprocess.PIPE)
     while True:
       line = proc.stdout.readline()
       if line != '':
         #the real code does filtering here
         print "test:", line.rstrip()
       else:
         break
    
  7. How do you open a file for writing?  Create a new file “file.txt”, print the text “something” into it and close it out.

    Perl:

     #!perl
     open (my $HANDLE, '>', "file.txt");
     print $HANDLE "something";
     close $HANDLE;
    

    Python:

     #!python
     target = open("file.txt", 'w')
     line1 = raw_input("line 1: ")
     target.write(line1)
     target.close()
    
  8. Regular Expression. Given a httpd access log - Produce a snippet of code that shows how many times 100.64.1.39 accessed the web site.

    Access Log looks like:

     ```
     100.64.1.39 - - [20/Mar/2005:19:25:42 -0800] "GET /atmSE_2.13/login.mpl HTTP/1.1" 200 4070
     100.64.1.39 - - [20/Mar/2005:19:25:45 -0800] "GET /atmSE_2.13/images/ATMNew2.jpg HTTP/1.1" 200 61 05
     100.64.1.39 - - [23/Mar/2005:13:42:23 -0800] "GET /ATMManual.pdf HTTP/1.1" 206 471308
     100.64.1.39 - - [23/Mar/2005:13:42:23 -0800] "GET /ATMManual.pdf HTTP/1.1" 206 2094
     ```
    

    I’ve gotten you started:

    Perl:

     #!perl
     my $count=0;
     open (my $FILE, '<', "access_log");
     while (<$FILE>) {
    
     }
     close ($FILE);
    
     print "Count = $count\n";
    

    Python:

     #!python
     with open('access_log') as f:
         for line in f:
    
     print(total)
    

    Here’s the bits I’m looking for:

    Perl:

     #!perl
     if ($_ =~ /^64\.100\.2\.227/) {
     	$count++;
     }
    

    Python:

     #!python
     found = line.find('100.64.1.39')
     if found != -1 and found != 0:
     	total += 1
    
  9. What is this data structure describing?

    Perl:

     #!perl
     $DataStruct = {
     	'key1' => [1,2,3,4,5]
     };
    

    Python:

     #!python
     d = {
     	key1: ['1','2','3','4','5']
     }
    

    This is a hash with a key of “key1” with a value that points to an array.

  10. A function find ( name, foo ), operating on a DataStruct containing String name, bool isDir, Object child that will return either the name of a file/dir, or null. Terminate the search on the first successful find.

    Perl:

    #!perl
    find ( x, y) {
    	if ( name == $name ) {
    		return name;
    	} else {
    		foreach child {
    			find ( child, foo );
    			if ( name == $name ) {
    				return name;
    			} else {
    				return null;
    			}
    		}
    	}
    }
    

    Python:

    #!python
    find (x, y)
    	if name == name
    		return name
    	else
    		foreach child
    			find (child, foo)
    				if name == name
    					return name
    				else
    					return null
    
  11. Show me how to print/fetch every third item in a list?

    Perl:

    #!perl
    for ($i = 0; $i < @list; $i += 3) {
        print $list[$i]; # print it
    }
    

    Python:

    #!python
    [x for i, x in enumerate(thelist) if i%3 == 0]
    
    for i, x in enumerate(thelist):
        if i % 3: continue
        yield x
    
    a = 0
    for x in thelist:
        if a%3: continue
        yield x
        a += 1
    
  12. Convert ascii characters to an integer without using built in methods like string.atoi or int()?

    Perl, then Python

    #!perl
    @ASCII = unpack("C*", $string);
    $STRING = pack("C*", @ascii);
    

    Python:

    #!python
    struct.unpack("<I", foo)[0]
    
    ord, chr
    

Things to watch for

  • Grit - Or, what we fondly refer to around here as “The Make it Happen Spirit.” When the going gets tough, when the obstacles mount, and when the resources are scarce, people with grit always find a way to make it happen. Rather than focusing on the possibility of failure—which is always a possibility—they hit the ground running. And they do it with so much creativity and motivation that they leave the mere idea of failure in the dust

    To assess the trait of grit in a candidate, I often ask, “Tell me about a time you were facing great adversity in your role or schooling.” Here’s the secret: I’m more interested in the tactics this person used to overcome the obstacle than the actual obstacle itself.

  • Collaborative Tendencies - The power of our company lies within the creative strength of the collective team. Oftentimes, we reach our goal faster by culling each individual’s strengths and working together to find the best solution. The notion of “consensus-driven” decision-making doesn’t fly around here, because we know the power of diverse thinking and coordinated effort always leads to success. So, there’s no room for destructive egos in our office. Instead, we relish the idea of reaching our destination together, because we know we’re always better for it.

    Here, I’ll ask the candidate to describe the best office environment he or she ever been a part of. In the answer, I look for a person who clearly understands (and respects!) that collaboration is the heart of a winning team.

  • Curiosity - One of our core values is learning—we seek to constantly be moving forward. The more curious a person is, the more likely he or she is to be open to learning, always looking for new information. Everyone I hire wants to understand the undercurrents of our business and the world around us.

    I typically assess curiosity and love for learning based on how the candidate describes his or her motivations for changing jobs, as well as based on the questions he or she asks me. Hint: Anyone can ask how we came up with the idea to start Eventbrite. I’m actually more impressed with educated and probing questions around our company’s philosophies and strategy.

  • Empathy - Emotional intelligence is high on my list for must-haves in a great team member. That’s not because we want to have a homogenous community of social beings. It’s because empathy is the root of mindfulness, connection, great leadership, and deep bonds. This drives the foundation of trust in an organization and equates to teams pushing each other to be better and achieve greater things together.

    To be completely honest, this is much more of an unspoken vibe I get from being in the room with the candidate. Empathy is palpable and has as much more to do with body language and eye contact than it does with conversation.

  • How would you rate teh quality and quantity of questions they ask during the interview?

    Generally A-players will come prepared with a collection of questions they want to ask during the interview.

    Look for questions about the team they’ll be joining, their manager (if that’s not you) and where you plan to take the company moving forward.

    You want them to ask questions that show you they have a good foundational understanding of your business and are excited about coming on board - but also want to make sure they’re joining a great company with good future prospects.


Footnotes

Copyright

Comments