Skip to content

Cookies on Jobverse

We use cookies that are needed to sign you in and keep the site working. With your permission we’d also use an analytics cookie to count job views, and Google advertising cookies to show ads. The site works the same whatever you choose. Read the Cookie Policy.

Jobverse
Sign in

Cybersecurity Engineer Top 100 Interview Questions

100 cybersecurity engineer interview questions with structured answers, comparison tables, flow diagrams, worked calculations and runnable code. Covers security fundamentals, cryptography, network and application security, identity, detection, incident response and vulnerability management, from the basics to design and scenario questions.

100 questions

Questions 1-20 of 100

  1. Q1.What are confidentiality, integrity and availability, and how is each one attacked?

    Confidentiality, integrity and availability are the three properties security protects: data is seen only by the right people, changed only in authorized ways, and reachable when it is needed. Almost every attack harms at least one of them, so the triad is a quick way to reason about impact.

    ConfidentialityIntegrityAvailability
    Only authorized parties can read dataData changes only in authorized waysSystems answer when needed
    Attacked by a stolen database exportAttacked by a tampered payment amountAttacked by a denial-of-service flood
    Protected by encryption and access controlProtected by hashes, signatures and input validationProtected by redundancy, rate limits and backups

    How to use it in practice:

    • Rate an incident's impact on each property separately. Ransomware hits availability, and often confidentiality too when data is copied out before encryption.
    • Watch for controls that trade one property for another. Strong encryption with no key backup protects confidentiality but can destroy availability.
    • Many teams add authenticity (who sent it) and non-repudiation (the sender cannot deny it) as companion properties.

    Interview tip: when you describe any control, say which of the three properties it protects; it shows you think in terms of impact rather than tools.

  2. Q2.What is the difference between a vulnerability, a threat and a risk?

    A vulnerability is a weakness, a threat is something that could exploit it, and risk is the likelihood and impact of that happening. A risk exists only where a threat can reach a vulnerability in an asset that matters.

    VulnerabilityThreatExploitRisk
    A weakness in a system, process or personAn actor or event that could cause harmThe method or code that uses the weaknessLikelihood times impact of the threat succeeding
    An unpatched web serverA criminal group scanning for that flawA public attack script for the flawCustomer data stolen, fines and lost trust

    Ways to lower a risk:

    • Remove the vulnerability: patch the server or fix the code.
    • Cut the threat's access: take the service off the internet or put it behind authentication.
    • Reduce the impact: encrypt the data, segment the network and keep tested backups.

    A simple working model is risk = likelihood × impact. It explains why a severe flaw on an isolated test machine can matter less than a moderate flaw on an internet-facing payment system.

  3. Q3.What is defense in depth, and what does it look like for a web application?

    Defense in depth means layering independent controls so that a single failure does not become a breach. Each layer assumes the one in front of it can be bypassed.

    EdgeNetworkIdentity
    Web application firewall, rate limitsPrivate subnets, tight firewall rulesMulti-factor authentication, short sessions
    Stops known attack payloads and floodsStops direct access to servers and databasesStops account takeover
    ApplicationDataMonitoring
    Input validation, output encoding, authorization checksEncryption, least-privilege database accountsCentral logs, alerts, audit trails
    Stops injection, cross-site scripting and data access by the wrong userStops bulk data theftCatches attacks that would go unnoticed

    What makes the layers effective:

    • They fail in different ways. Two filters that use the same pattern list are one layer, not two.
    • Each layer is owned and tested, not assumed. A firewall rule nobody reviews decays over time.
    • Detection sits behind prevention, because prevention eventually fails.
    • Layers cost money and add friction, so the deepest stack belongs in front of the most valuable data.

    Example

    One injection attempt walked through the layers of a shop's checkout service:

    1. An attacker encodes a database injection payload so that the firewall's pattern rules miss it.
    2. The application uses parameterized queries, so the payload is treated as data and the query is unchanged.
    3. Even if a query had been vulnerable, the service's database account can read only the orders table, so customer passwords stay out of reach.
    4. The burst of malformed requests from one address raises an alert, and the analyst blocks the source within minutes.

    One layer failed, and the breach was still stopped by the next three.

  4. Q4.What do least privilege and separation of duties mean in practice?

    Least privilege gives every person and system only the access needed for its task, for only as long as it is needed. Separation of duties splits sensitive actions so that no single person can complete them alone.

    Least privilege

    • Grant access through roles or groups, not to individuals one by one.
    • Use just-in-time elevation for administrative work: access is requested, approved, time-limited and logged.
    • Give each service its own account, scoped to the exact resources it uses.
    • Review access regularly and remove what has not been used.

    Separation of duties

    • The developer who writes a change should not be the only approver who releases it to production.
    • The person who adds a new supplier should not also be able to approve payments to that supplier.
    • Emergency "break-glass" accounts exist, but their use triggers an alert and a review.

    Both principles limit the blast radius of a stolen account, an insider or a simple mistake. The trade-off is friction, so automate requests and approvals to keep work moving.

  5. Q5.How do preventive, detective and corrective controls differ?

    Controls are grouped by when they act: preventive controls stop an incident, detective controls notice one, and corrective controls limit the damage and restore normal service. A sound program uses all three, because prevention alone eventually fails.

    PreventiveDetectiveCorrective
    Stops the incident from happeningNotices an incident during or after itLimits damage and recovers
    Multi-factor authentication, firewall rules, input validationAlerting on logs, file integrity monitoring, intrusion detectionRestoring backups, patching, revoking credentials
    DeterrentCompensating
    Discourages the attemptStands in when the main control is not possible
    Warning banners, visible monitoringExtra monitoring on a system that cannot be patched

    Controls are also classed by form:

    • Administrative: policies, training and background checks.
    • Technical: encryption, access control and logging.
    • Physical: locks, badges and cameras.

    When you assess a risk, check that it has at least one control of each timing type. A risk covered only by preventive controls has no plan for the day they fail.

  6. Q6.How do you calculate the annualized loss expectancy of a risk?

    Annualized loss expectancy estimates how much a risk costs per year on average: the loss from one occurrence multiplied by how often it is expected to occur.

    • SLE = asset value × exposure factor
    • ALE = SLE × ARO

    What each term means:

    • Asset value: what the asset is worth, including recovery work, fines and lost revenue, not only its purchase price.
    • Exposure factor: the share of that value lost in one incident, from 0 to 1.
    • SLE (single loss expectancy): the cost of one occurrence.
    • ARO (annualized rate of occurrence): expected occurrences per year; once every four years is 0.25.

    When to use it: to compare a risk with the cost of controlling it. A control is worth buying when its yearly cost is lower than the reduction in ALE it brings.

    The inputs are estimates, so present the result as a range and record the assumptions. Its main value is making a cost-versus-benefit discussion concrete.

    Example

    A worked decision about protecting a customer database:

    1. Asset value is 500,000 and one breach would lose 40% of it, so SLE = 500,000 × 0.4 = 200,000.
    2. A breach is expected about once every four years, so ARO = 0.25 and ALE = 200,000 × 0.25 = 50,000 per year.
    3. A monitoring and encryption upgrade costs 15,000 per year and is expected to cut the rate to once in twenty years, so the new ALE = 200,000 × 0.05 = 10,000.
    4. The control reduces expected loss by 50,000 − 10,000 = 40,000 a year, for a net benefit of 40,000 − 15,000 = 25,000.

    The control pays for itself even if the estimates are off by a wide margin.

  7. Q7.What are the four ways to treat a risk?

    Once a risk is assessed, an organization can avoid, mitigate, transfer or accept it. The choice depends on the risk's size, the cost of each option and the business value of the activity.

    AvoidMitigateTransferAccept
    Stop the activity that creates the riskAdd controls to lower likelihood or impactShare the financial impact with another partyKnowingly live with the remaining risk
    Stop storing card numbers and use a payment provider's tokenPatch, encrypt, add multi-factor authenticationCyber insurance, contractual liability with a supplierA low-impact flaw in an internal tool scheduled for retirement

    Points interviewers look for:

    • Acceptance must be formal: a named business owner signs it, with a reason and an expiry date, and it is reviewed again.
    • Transfer moves money, not accountability. Insurance can pay for recovery, but customers still blame the company that lost their data.
    • After mitigation some residual risk always remains, and that residual risk is what gets accepted.
    • Security teams advise; the business owner of the asset makes the final risk decision.
  8. Q8.What is zero trust, and how does it differ from perimeter-based security?

    Zero trust is a security model in which no request is trusted because of where it comes from: every access is verified using identity, device health and context, and is granted only to the specific resource needed. Perimeter security, by contrast, trusts anything inside the corporate network.

    Perimeter modelZero trust
    Trust based on network locationTrust based on identity, device and context
    Access to the whole internal networkAccess to one application or resource at a time
    Checked once, at login or connectionChecked on every request or session
    Lateral movement is easy once insideLateral movement limited by per-service policy
    Remote access through a network-level tunnel back to the officeRemote access direct to each app through an access proxy

    Core principles:

    • Verify explicitly: strong authentication plus device posture and risk signals.
    • Least privilege: short-lived, narrowly scoped access.
    • Assume breach: segment everything and monitor as if an attacker is already inside.

    Zero trust is a strategy that is adopted step by step, usually starting with strong identity and the most sensitive applications. No single product delivers it on its own.

  9. Q9.What is an attack surface, and how do you reduce it?

    The attack surface is the sum of all the points where an attacker could try to get in or pull data out: exposed services, applications, APIs, accounts, devices and people. Every one of those points needs defending, so a smaller surface is easier to protect.

    Parts of the surface:

    • Digital: open ports, web applications, APIs, cloud storage, remote access services and third-party integrations.
    • Human: staff who can be phished or tricked over the phone.
    • Physical: offices, laptops and removable media.

    How to reduce it:

    1. Inventory first: discover every internet-facing asset, including forgotten test systems and old domains.
    2. Remove what is not needed: unused services, ports, features, accounts and dependencies.
    3. Hide what must exist: put admin interfaces and databases on private networks behind authentication.
    4. Harden defaults: disable sample content, default credentials and verbose error messages.
    5. Watch for change: scan the external surface continuously, because new exposure appears with every deployment.

    Attack surface reduction is often the cheapest security win available. A service that is switched off cannot be exploited.

  10. Q10.What is threat modeling, and how would you run a session for a new feature?

    Threat modeling is a structured way to find what could go wrong in a design before it is built, and to decide what to do about it. It answers four questions: what are we building, what can go wrong, what will we do about it, and did we do a good job?

    flowchart LR
      A["Draw the data flow"] --> B["Mark trust boundaries"]
      B --> C["List threats per element"]
      C --> D["Rate and prioritize"]
      D --> E["Choose mitigations"]
      E --> F["Track and verify"]

    A common checklist for the "what can go wrong" step is STRIDE:

    SpoofingTamperingRepudiation
    Violates authenticityViolates integrityViolates non-repudiation
    Logging in as another userChanging a price in a requestDenying an action because nothing was logged
    Information disclosureDenial of serviceElevation of privilege
    Violates confidentialityViolates availabilityViolates authorization
    An error page leaking stack tracesFlooding an expensive endpointA normal user reaching admin functions

    Running the session: bring a developer, a product owner and a security engineer; keep it to about an hour; and turn each accepted threat into a tracked work item with an owner.

    Example

    A threat model for a "forgot password" feature, one threat per category that applies:

    1. Spoofing: an attacker guesses a reset token. Mitigation: 32 random bytes from a secure generator, single use, valid for 15 minutes.
    2. Information disclosure: different messages reveal which emails have accounts. Mitigation: the same response for every address.
    3. Denial of service: a script requests thousands of reset emails for one victim. Mitigation: rate limits per account and per source address.
    4. Tampering: the reset link carries the user ID, which an attacker edits. Mitigation: the server looks the user up from the token alone.
    5. Repudiation: a user claims they never changed their password. Mitigation: log every reset with time and source, and notify the account owner.

    Five concrete work items came out of a one-hour session, before any code was written.

  11. Q11.How do security policies, standards, procedures and guidelines differ?

    They form a hierarchy from intent to instruction: a policy states what must be achieved, a standard sets specific mandatory requirements, a procedure gives the exact steps, and a guideline offers optional advice.

    PolicyStandardProcedureGuideline
    High-level intent approved by leadershipSpecific, measurable requirementsStep-by-step instructionsRecommended practice
    MandatoryMandatoryMandatory for that taskOptional
    Customer data must be encrypted in transit and at restUse TLS 1.2 or later and disable older versionsHow to rotate the database encryption keyPrefer managed key services for new projects

    Why keep them separate:

    • Policies change rarely and need executive approval, while standards change as technology changes. Mixing them makes every technical update a leadership decision.
    • Auditors test against policies and standards, so they must be specific enough to check.
    • Procedures let anyone on call perform a sensitive task the same, safe way.

    Every standard should trace back to a policy, and every exception should be documented, approved and given an expiry date.

  12. Q12.How do you classify data, and why does classification drive security controls?

    Data classification sorts information into a few levels by the harm its disclosure, alteration or loss would cause. Each level then comes with required controls, so people do not have to make security decisions file by file.

    PublicInternalConfidentialRestricted
    Marketing pages, published pricesOrg charts, internal wikisCustomer records, contractsPayment data, health records, secret keys
    Integrity checks onlyStaff-only accessEncryption, need-to-know access, audit logsStrong encryption, strict access, monitoring, short retention

    How to make it work:

    1. Assign owners: each dataset has a business owner who decides its level.
    2. Label it: tags on files, storage buckets and database tables so tools can apply rules automatically.
    3. Tie controls to labels: encryption, access approvals, data loss prevention rules and retention follow the label.
    4. Review it: data changes over time, and a combined dataset can be more sensitive than its parts.

    Keep the scheme to three to five levels. More than that and people pick at random, which defeats the purpose.

  13. Q13.What is the difference between encoding, encryption and hashing?

    Encoding changes data into another format so systems can handle it, encryption hides data so only key holders can read it, and hashing produces a fixed-size fingerprint that cannot be reversed. Only encryption and hashing are security tools, and they do different jobs.

    EncodingEncryptionHashing
    For a safe transport or storage formatFor confidentialityFor integrity, fingerprints and password storage
    Reversible by anyoneReversible with the keyNot reversible
    Uses no keyUses a keyUses no key, unless it is a keyed hash
    Output grows with the inputOutput grows with the inputOutput has a fixed size
    Example: Base64, URL encodingExample: AES in an authenticated modeExample: SHA-256

    Common mistakes:

    • Treating Base64 as protection. Anyone can decode it in one step.
    • Saying a hash can be "decrypted". It cannot be reversed; attackers guess inputs and compare hashes instead.
    • Using a fast hash for passwords. Speed helps attackers guess billions of candidates per second, so passwords need a slow, salted algorithm.
  14. Q14.How do symmetric and asymmetric encryption differ, and why are they usually combined?

    Symmetric encryption uses one shared secret key to encrypt and decrypt, and it is fast. Asymmetric encryption uses a key pair, a public key that anyone can have and a private key that stays secret, and it solves key distribution but is much slower.

    SymmetricAsymmetric
    One shared secret keyA public and private key pair
    Fast, suits bulk dataSlow, suits small values
    Hard key distribution: the secret must be shared safelyEasy key distribution: the public key can be published
    Encrypts files, disks and trafficUsed for key exchange and digital signatures
    Example algorithms: AES, ChaCha20Example algorithms: elliptic-curve and integer-factoring schemes

    Why systems combine them (hybrid encryption):

    1. The two sides use asymmetric cryptography to agree on, or securely send, a fresh symmetric key.
    2. All the actual data is then encrypted with that symmetric key.
    3. The asymmetric keys also sign the exchange, so each side knows who it is talking to.

    This gives the convenience of public keys with the speed of symmetric ciphers. Secure web connections, encrypted messaging and envelope encryption of stored data all work this way.

  15. Q15.What properties make a cryptographic hash function secure?

    A secure hash function maps any input to a fixed-size output in a way that cannot be reversed, cannot be forced to collide, and changes completely when the input changes slightly.

    • Preimage resistance: given a hash, it is infeasible to find any input that produces it.
    • Second-preimage resistance: given one input, it is infeasible to find a different input with the same hash.
    • Collision resistance: it is infeasible to find any two inputs with the same hash.
    • Avalanche effect: changing one bit of input changes about half the output bits.
    • Deterministic and fixed-size: the same input always gives the same output of the same length.

    Which algorithms are safe: MD5 and SHA-1 have practical collision attacks, so they must not be used for signatures or certificates. SHA-256, SHA-512 and SHA-3 are current choices.

    Being fast is a feature for file integrity checks but a weakness for passwords. Password storage needs a deliberately slow function with a salt, not a general-purpose hash.

  16. Q16.How should an application store user passwords?

    Store passwords with a slow, salted, adaptive password-hashing function, never in plaintext and never with reversible encryption. The goal is that a stolen database gives attackers nothing they can use quickly.

    1. Pick a password-hashing algorithm: Argon2id, scrypt, bcrypt or PBKDF2 with a high iteration count. General hashes such as SHA-256 alone are too fast.
    2. Use a unique random salt per password, so identical passwords produce different hashes and precomputed tables are useless.
    3. Tune the work factor so one hash takes a noticeable fraction of a second on your servers, and raise it as hardware improves.
    4. Store the algorithm, parameters, salt and hash together, so old hashes can be upgraded when a user next logs in.
    5. Compare in constant time to avoid leaking information through response timing.
    6. Optionally add a pepper: a secret kept outside the database, such as in a key management service, so a database dump alone is not enough.

    Pair storage with login protections: rate limiting, checks against known breached passwords and multi-factor authentication.

    Example

    Hashing and verifying passwords with salted PBKDF2 from the standard library:

    import hashlib
    import hmac
    import secrets
    
    ITERATIONS = 600_000
    
    
    def hash_password(password: str) -> str:
        salt = secrets.token_bytes(16)
        digest = hashlib.pbkdf2_hmac("sha256", password.encode(), salt, ITERATIONS)
        return f"pbkdf2_sha256${ITERATIONS}${salt.hex()}${digest.hex()}"
    
    
    def verify_password(password: str, stored: str) -> bool:
        _, iterations, salt_hex, digest_hex = stored.split("$")
        digest = hashlib.pbkdf2_hmac("sha256", password.encode(), bytes.fromhex(salt_hex), int(iterations))
        return hmac.compare_digest(digest.hex(), digest_hex)
    
    
    stored = hash_password("river-lantern-42-quiet")
    print(stored.split("$")[:2])  # ['pbkdf2_sha256', '600000']
    print(verify_password("river-lantern-42-quiet", stored))  # True
    print(verify_password("River-lantern-42-quiet", stored))  # False
    print(hash_password("same") == hash_password("same"))  # False

    The last line shows the salt at work: the same password never produces the same stored value twice.

  17. Q17.What is a message authentication code, and how does it differ from a digital signature?

    A message authentication code (MAC) is a short tag computed from a message and a shared secret key; anyone with the key can create or check it. A digital signature uses a private key to sign and a public key to verify, so anyone can check it but only the key owner can create it.

    MAC, such as HMACDigital signature
    One shared secretThe private key signs, the public key verifies
    Only holders of the secret can verifyAnyone with the public key can verify
    Anyone who can verify can also create oneOnly the private key owner can create one
    No non-repudiationProvides non-repudiation
    Very fastSlower
    Used for webhooks, API request signing, session cookiesUsed for software releases, certificates, signed documents

    When to use which:

    • Use a MAC between two parties that already share a secret, such as your server and a payment provider's webhook.
    • Use a signature when many parties must verify without being able to forge, such as users checking a software update.
    • Both prove integrity and origin. Neither hides the content; add encryption for that.

    Example

    Verifying a webhook with HMAC-SHA256, the way a server checks that a callback really came from its partner:

    import hashlib
    import hmac
    
    SECRET = b"shared-webhook-secret"
    
    
    def sign(body: bytes) -> str:
        return hmac.new(SECRET, body, hashlib.sha256).hexdigest()
    
    
    def verify(body: bytes, signature: str) -> bool:
        return hmac.compare_digest(sign(body), signature)
    
    
    body = b'{"order": 1042, "status": "paid"}'
    signature = sign(body)  # sent by the partner in a request header
    
    print(len(signature))  # 64
    print(verify(body, signature))  # True
    print(verify(b'{"order": 1042, "status": "refunded"}', signature))  # False

    compare_digest takes the same time whether the first or the last character differs, so an attacker cannot learn the correct tag byte by byte from response times.

  18. Q18.How do digital signatures provide integrity and non-repudiation?

    A digital signature binds a message to the holder of a private key: the signer hashes the message and signs the hash with the private key, and anyone can check the result with the matching public key.

    1. Sign: the signer computes a hash of the message and creates a signature from that hash with the private key.
    2. Send: the message travels with its signature, and usually with a certificate that holds the public key.
    3. Verify: the receiver hashes the message it received and uses the public key to check the signature against that hash.
    4. Decide: a valid signature means the message is unchanged and was signed with that private key.
    sequenceDiagram
      participant S as Signer
      participant R as Receiver
      S->>S: Hash message and sign with private key
      S->>R: Message plus signature
      R->>R: Hash received message
      R->>R: Verify signature with public key
      R-->>S: Accept only if the check passes

    What it does and does not give:

    • Integrity: any change to the message makes verification fail.
    • Non-repudiation: only the private key holder could have signed, provided the key was protected.
    • No confidentiality: the message itself is readable unless it is also encrypted.
    • Trust in the public key still has to come from somewhere, which is the job of certificates.
  19. Q19.How does a certificate chain of trust work?

    A certificate chain links a server's certificate to a root authority that the client already trusts. Each certificate is signed by the one above it, so verifying every signature up the chain proves the server's public key is genuine.

    flowchart LR
      A["Root authority in the trust store"] -->|signs| B["Intermediate authority"]
      B -->|signs| C["Server certificate"]
      C -->|presented to| D["Client"]
      D -->|checks each signature up to| A
    1. Root: a self-signed certificate shipped in the operating system or browser trust store, and kept offline by its owner.
    2. Intermediate: signed by the root and used for day-to-day issuing, so the root key is rarely exposed.
    3. Leaf: the server's own certificate, signed by the intermediate and naming the domain.
    4. Validation: the client checks signatures, validity dates, the hostname, permitted key usage and revocation status.

    Common failures in practice:

    • The server sends only its leaf certificate and omits the intermediate, so some clients cannot build the chain.
    • The certificate expired because renewal was manual.
    • The hostname does not match, such as a certificate for the bare domain served on a subdomain.

    Interview tip: mention that the server must send the intermediate certificates; a missing intermediate is one of the most common real-world certificate errors.

  20. Q20.Walk through a TLS 1.3 handshake.

    A TLS 1.3 handshake agrees on keys and authenticates the server in one round trip. Both sides contribute an ephemeral key share, derive the same session keys, and the server proves it owns its certificate.

    sequenceDiagram
      participant C as Client
      participant S as Server
      C->>S: ClientHello with cipher suites and key share
      S->>C: ServerHello with its key share
      S->>C: Certificate and CertificateVerify, encrypted
      S->>C: Finished
      C->>C: Validate certificate chain and hostname
      C->>S: Finished
      C->>S: Encrypted application data
    1. ClientHello: the client lists supported cipher suites and sends an ephemeral key share.
    2. ServerHello: the server picks a suite and sends its own key share. Both sides now derive the handshake keys, so everything after this is encrypted.
    3. Authentication: the server sends its certificate and signs the handshake transcript with its private key.
    4. Finished messages: each side confirms the whole handshake was not altered.

    What changed from older versions:

    • Only ephemeral key exchange is allowed, so every session has forward secrecy.
    • Weak ciphers and modes were removed; only authenticated encryption remains.
    • An optional zero round-trip resumption sends data immediately, but that early data can be replayed, so it must be limited to safe, repeatable requests.