
Real Interview Questions for the Cybersecurity Engineer at Aselsan
NewInterview Q&A
Q&A-1Why did you choose this solution for your project?
Reported in ASELSAN Software Engineer Salary: Factors Determining ...
The 90-second answer
For my capstone I built a telemetry gateway that forwards sensor data from field units to a control server over a public LTE link. I chose mutual TLS 1.3 with short-lived certificates, plus signed firmware updates, over a site-to-site VPN and over a bearer-token API.
The deciding constraints were not throughput. The gateway runs on an ARM board with 512 MB RAM, it must keep working when the LTE link drops for hours, and the server side has to prove to an auditor which device sent which record. A VPN gives me a tunnel, but it authenticates the network, not the individual device or the firmware it is running. A bearer token authenticates a client once, then anyone who copies it from logs or a compromised gateway can replay it until expiry.
Mutual TLS gave me per-device identity on every connection, and signing gave me integrity for the update path. That split mattered more than raw speed.
What I measured
Hypothetical bench figures from my test rig, gateway to server over LTE with 60 ms RTT:
| Option | Handshake cost | Offline behaviour | Identity granularity |
|---|---|---|---|
| Site-to-site VPN (IPsec) | Tunnel setup once, then ~0 ms per record | Tunnel drops, no per-record proof | Per site, not per device |
| Bearer token over TLS 1.3 | 1 RTT, ~60 ms, then token reuse | Token valid until expiry, replay possible | Per client account |
| Mutual TLS 1.3, ECDSA P-256 | 1 RTT, ~60 ms, session resumption ~20 ms | Queues records locally, authenticates on reconnect | Per device certificate |
The mutual TLS cost was acceptable because the gateway sends batched records every 5 seconds, not one request per sensor sample. Session resumption kept reconnects cheap after a drop. I set certificate lifetime to 24 hours and automated renewal at 12 hours, so a stolen certificate had a short window and renewal did not need a human in the loop.
How the pieces fit
gateway --(1) TLS handshake, client cert--> server
--(2) server checks cert chain + expiry--> allow
--(3) batched records, each with device_id + seq--> store
--(4) firmware image + signature over HTTPS--> verify before flashOn the server I checked the certificate against a private CA, rejected expired or revoked serials, and logged device_id, certificate serial, and sequence number with every batch. Sequence gaps flagged dropped or replayed batches. For firmware, the gateway downloaded the image, verified an Ed25519 signature against a key baked into secure boot storage, and only then wrote it to the inactive partition. A bad signature left the running partition untouched.
Failure modes I designed for
Clock skew on a field device can make a valid certificate look expired. I added a check that rejects certificates more than 5 minutes in the future, logs the offset, and syncs time via authenticated NTP before retrying, instead of widening the validity window.
Revocation is harder offline. I could not rely on OCSP from a disconnected gateway, so I pushed a signed revocation list with the firmware channel and cached it for 7 days. If the list expired, the gateway still connected but the server marked its records as unverified and raised an alert. That degraded trust visibly instead of failing silently.
Certificate expiry was the outage I hit in testing. Renewal failed when the CA endpoint was unreachable, the certificate lapsed, and reconnects started failing with certificate_expired. I added metrics for hours until expiry per device and an alert at 6 hours, which caught the next failure in staging before it reached the field.
If I rebuilt it today I would keep mutual TLS and signed updates, and I would add hardware-backed key storage on the gateway so the private key never leaves the secure element. The core trade-off stays the same: I paid a small handshake and operational cost to get per-device identity and update integrity, which a tunnel or a token alone did not provide.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-2Describe your graduation project: why did you solve the problem this way, what alternatives did you eliminate?
Reported in ASELSAN New Graduate Salary: What Determines the Starting ...
The 90-second answer
My graduation project was a secure firmware update system for an ARM Cortex-M4 sensor node, the kind of device that sits on a vehicle or a remote station and cannot be physically serviced. The problem was not just encrypting the image. We had to guarantee that only code signed by our build server would boot, that a replayed older image would be rejected, and that a power cut halfway through an update would not brick the node.
I split it into three parts. The build server signs a manifest containing the image hash, version and device ID with ECDSA P-256. The node downloads the image over TLS 1.2, verifies the signature and hash before writing to the inactive flash bank, then sets a pending-boot flag. On next reset the bootloader checks the flag, verifies the image again from flash, increments an anti-rollback counter stored in OTP, and only then jumps to the new image. If verification fails or power is lost, the old bank still boots.
The board had 1 MB of flash and 256 KB of RAM. The application image was about 380 KB, so two 512 KB banks fit with room for the bootloader and configuration sector.
Why this design, and what I ruled out
| Decision | Chosen | Alternative eliminated | Reason it lost |
|---|---|---|---|
| Image protection | AES-256-GCM, 12-byte nonce, tag checked before use | AES-CBC plus HMAC | Two primitives meant two places to get padding and tag order wrong. GCM gave authenticated encryption in one call, and our threat model did not need CBC for legacy compatibility. |
| Signature | ECDSA P-256, 64-byte signature, 33-byte compressed public key | RSA-2048, 256-byte signature and public key | RSA verification with e=65537 is actually fast, often faster than ECDSA verification on a small MCU. I did not choose ECDSA for verification speed. I chose it for size. On a 100 kbps link the extra 192 bytes per signature and the larger key in the bootloader mattered, and signing on the server is faster with ECDSA. |
| Update layout | A/B banks, 512 KB each on a 1 MB flash part | Single bank with overwrite in place | A single bank cannot recover from a torn write. With A/B, a failed update is a failed boot attempt, not a dead device. Cost was doubling flash, which we could afford at this image size. |
| Rollback protection | Monotonic counter in OTP, incremented only after successful boot | Version check in the manifest alone | A manifest check stops accidental downgrades. It does not stop an attacker who captures a valid older signed image and replays it. The OTP counter makes that replay fail even with a valid signature. |
| Key storage | Private key only on the build server in an HSM-backed signer, public key pinned in bootloader | Key stored in device flash | A key in flash can be read with a debug probe or a chip-off attack. The node never needs the private key, so it never stores it. |
A trace from testing
We tested the replay case explicitly because it is the one a reviewer asked about first.
Boot 1: manifest version 14, signature OK, hash OK, OTP counter 14 -> boot image 14
Boot 2: attacker replays signed image version 12, signature OK, hash OK,
manifest version 12 < OTP counter 14 -> reject, boot image 14, log event 0x2F
Boot 3: power cut during write to bank B -> pending flag not set -> boot image 14
Boot 4: valid image version 15, signature OK, hash OK, OTP counter 14 -> 15 -> boot image 15The bootloader code that made the difference was short, and the ordering mattered:
/* bootloader, checked against GCC 12.2 for Cortex-M4 */
if (!verify_signature(manifest, pubkey)) goto reject;
if (!verify_hash(image, manifest->sha256)) goto reject;
if (manifest->version <= otp_counter) goto reject;
write_pending_flag();
reset();
/* on next boot, after the new image runs its self-test: */
if (self_test_ok()) otp_increment();Note the counter increments after the new image boots and passes its self-test, not when the flag is written. If we incremented earlier, a corrupt image that passed signature checks but crashed on startup would lock us out of the last good version.
What I would change now
Two things. First, we used TLS with a pinned server certificate, which is fine for a prototype but brittle for a fleet. I would move to mutual TLS with per-device certificates issued at manufacturing, so a compromised server certificate does not let an attacker push to every node. Second, our delta update idea was cut for time. At 512 KB a full image over a slow link took about 40 seconds at 100 kbps, which is acceptable for a monthly update but not for a weekly patch. A binary delta would cut that to roughly 90 KB in our test images, at the cost of a more complex patcher that itself needs to be verified.
If I had to defend the core choice in one line: we optimised for a device that must never boot untrusted code and must never brick itself, and we accepted double flash and a slower full-image download to get both properties.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-3What concrete contributions did you make during your internship, what did you add to the team?
Reported in ASELSAN New Graduate Salary: What Determines the Starting ...
I interned for ten weeks with the SOC team, working on detection and triage for our internal network. I shipped two things the team kept after I left, and I can walk through both.
The first was a detection rule for credential dumping on Windows endpoints. We had a noisy Sysmon rule that fired on any process reading LSASS memory, including our own EDR and a backup agent. It generated about 180 alerts a day, and analysts were closing most of them without reading the details. I spent the first two weeks pulling a week of alerts, labelling them with the analysts, and checking which process trees were legitimate.
I rewrote it as a Sigma rule with exclusions for the signed EDR and backup binaries, and I added the parent process and the access mask. Only 0x1010 and 0x1410 style reads stayed in scope. 0x1010 is PROCESS_VM_READ (0x0010) plus PROCESS_QUERY_LIMITED_INFORMATION (0x1000). That is different from PROCESS_QUERY_INFORMATION (0x0400), which is a narrower query right and was not what the dumping tools in our test set used. The snippet I committed, checked against Sigma 1.0 syntax, looked like this:
title: LSASS Memory Access by Unsigned Process
logsource:
product: windows
category: process_access
service: sysmon
detection:
selection:
TargetImage|contains: '\\lsass.exe'
GrantedAccess:
- '0x1010'
- '0x1410'
filter:
SourceImage:
- 'C:\\Program Files\\Windows Defender\\MsMpEng.exe'
- 'C:\\Program Files\\Backup\\backup_agent.exe'
ParentImage|contains: '\\services.exe'
condition: selection and not filter
level: highAfter tuning, the same week of traffic produced 11 alerts instead of 180, and 4 of those were real test cases from our red team exercise. That is the number I quote, because it came from replaying the same logs through both versions.
I considered replacing the rule entirely with a behavioural rule that looked for known dumping tool patterns, such as a process opening LSASS and then writing a file. That would have caught more variants, but it needed file telemetry we did not reliably collect on every endpoint at the time, and it would have taken longer to validate. I chose tuning because the existing rule already had the right event source and the false positives came from a small set of known binaries. I would have switched to replacement if, after two tuning passes, the replay still produced more than about 30 alerts a day or if the red team had shown a common technique that the access mask missed.
The second contribution was a small triage script. Analysts were manually copying the source IP, user, and host from a Splunk alert into three other tools to check if the host had been seen before. I wrote a Python script that took the alert JSON, queried our asset inventory API, checked the last 30 days of authentication logs for that user, and printed a one page summary. It did not auto close anything. It just removed the copy and paste work.
A typical run looked like this in the terminal:
$ python triage.py alert_8841.json
Host: WS-4471 (last seen 12 min ago, VLAN 214)
User: a.yilmaz (3 failed logons, then 1 success, 02:14)
Prior alerts for this host: 0 in 30 days
Inventory owner: Engineering, not a serverWe measured it over the next three weeks. Median time from alert to first analyst note dropped from about 14 minutes to about 5 minutes for the alerts the script covered. I labelled that as our team measurement, not a vendor claim, and it only applied to Windows endpoint alerts where the inventory record existed.
The exclusion I added has a concrete failure mode. My first draft filtered on the file name ending in backup_agent.exe. An attacker could copy a malicious binary with that name into a user writable folder and the rule would skip it. I caught that in review and changed the filter to the full path under Program Files, which a standard user cannot write to. That still does not stop an attacker who gains admin rights and replaces the real binary, or who uses a process injection technique that runs inside an already trusted process. We would detect the first case through file integrity monitoring on that path and through a mismatch between the process hash in Sysmon and the known good hash. We would detect the second case only if the injected code still requested the same access mask from a parent process that did not normally do so, which is why I kept the parent process in the rule instead of filtering on the source alone.
What I learned that I still use is how much context a rule needs before it is useful. The original rule was technically correct. It detected the API call. It failed because it gave the analyst no way to decide quickly. Adding the parent process, the access mask, and the asset owner turned a noisy signal into something they could act on.
If I had stayed longer, I would have added the same triage output for Linux hosts, where our inventory data was less complete. I left the script with tests and a README, and the team added two more data sources to it in the month after my internship ended.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-4Why do you want to work at ASELSAN?
Reported in ASELSAN Interview Process and Stages Explained
The 90-second answer
"I looked at three kinds of role last year. A civilian SOC job in Istanbul, a product security job at a vendor, and this. I ruled the SOC job out first. I have done alert triage for three years, and I was spending most of my time tuning the same 30 rules. I wanted work where a design decision stays in the field for years. The vendor job was closer, but the roadmap was set by a foreign parent company and I would not have seen the hardware. ASELSAN is the only place I found where I can work on a system from the threat model to the lab test, and where the system is actually deployed. That is why I applied here, specifically to cybersecurity engineering, not to a general IT security post."
If they push on that, I give them the criteria I used, because "I admire your mission" is not a reason.
I wanted a long lifecycle product. My last project was a gateway for industrial control, 40 units in the field, firmware life expected to be 10 years. We shipped an 18 MB image. On a 64 kbps field link that is about 37 minutes if nothing drops, and in practice we saw retries push it past an hour. So we split the image into 256 KB chunks, each with a hash in a signed manifest, wrote to the inactive slot, and only flipped the boot flag after a second verification. We also kept a monotonic rollback counter in TPM NVRAM so a device could not be sent back to version 1.2 after we had fixed a remote code execution in it. Testing that took a week of power cuts at random points in the write. That week taught me more than any course.
That is the kind of problem I want more of, and it is why ASELSAN fits. A radio or a sensor system has the same constraints, plus a captured device in the threat model and no vendor patch coming. I would rather learn secure boot and update design where the test lab can actually simulate a downgrade attack than where I only write a policy about it.
There are conditions where I would not join, and I would say so. If the role turned out to be mostly audit paperwork, with no access to the build system or the test bench, I would decline. I have seen that job. It produces reports and the product does not change. I also would not join if I could not work on site in Ankara under the clearance and export rules that apply here. I understand those rules and I am willing to work inside them, but I am not willing to spend the next five years remote from a system I cannot touch.
What I do not have yet is production military cryptography. I have used TLS and signed updates, I have not implemented a key management system for a classified network. I would expect to start on analysis and test work, learn the applicable standards from the internal documentation, and take on design tasks as the senior engineers trust me with them. I am not applying because I think I already know this work. I am applying because the gateway project showed me I like this work, and ASELSAN is where I can do it at a scale I cannot get elsewhere."
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-5What are your strengths and areas for development?
Reported in ASELSAN Interview Process and Stages Explained
The 90-second answer
My main strength is secure design and incident work for systems that cannot simply be patched and rebooted. Most of my experience is with embedded Linux and networked controllers, where a vulnerability fix has to be validated against safety, timing and a release cycle measured in months. That fits the work here better than a purely enterprise SOC background.
I am strongest in three practical areas. First, threat modelling a system before code is written, including trust boundaries between a field device, its update channel and the maintenance laptop that connects to it. Second, triage under pressure: preserve volatile evidence, decide whether to isolate or keep a system running, and write a timeline someone else can act on. Third, turning a finding into a fix that survives review, with a regression test or a detection rule attached.
My area for development is cloud-native supply chain security. I have solid depth in on-premise and air-gapped environments, and less depth in Kubernetes admission control, image signing at scale and provenance for container builds. I started closing that gap this year rather than waiting for a job to require it.
| Strength | Evidence from my work | Why it matters at ASELSAN |
|---|---|---|
| Threat modelling for constrained systems | Modelled a firmware update path with signed images, rollback protection and a compromised maintenance station as an explicit attacker position | Update and maintenance paths are where a fielded system is most exposed |
| Incident triage with evidence preservation | In a lab exercise, isolated a compromised test controller in 22 minutes while capturing memory and network traffic for later analysis | Keeps operations running without destroying the evidence needed for root cause |
| Fixing findings permanently | Added a fuzzing harness for a parser after a crash was found, then tracked the crash rate across releases | A closed finding with a test is worth more than a ticket marked resolved |
Where I am still developing
I will be direct about the cloud gap. I can harden a single host and review a Dockerfile, but I have not yet owned image provenance across a large Kubernetes fleet. That is a real limitation if a programme moves workloads into a managed cluster.
What I have done about it, with dates I can show:
| Step | What I produced | Status |
|---|---|---|
| Built a small cluster lab with signed images and admission checks that reject unsigned deployments | A working policy and a log of rejected builds | Done, 6 weeks ago |
| Ran CIS Kubernetes Benchmark checks against the lab and documented the failures I could not fix without changing the application | A short report with pass and fail counts per section | Done, 3 weeks ago |
| Studying SBOM generation in a build pipeline and comparing two generators on the same project | A comparison on accuracy and build time | In progress |
I would not claim that makes me a cloud security specialist. It means I can learn a new platform by building, measuring and writing down what failed, which is how I learned the embedded side.
How I would handle the constraints here
Two habits from previous work carry over. I document assumptions and decisions in the design record, so a reviewer who does not have my context can follow the reasoning. And I treat access as need-to-know by default, including in my own notes and test data. In a defence environment, discipline about classified material is not paperwork on top of the engineering. It is part of the engineering.
If you hired me, I would expect to contribute fastest on vulnerability review, secure update design and incident exercises for fielded systems. I would expect to need mentoring on any large cloud programme, and I would ask for that early rather than after I had made a design mistake.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-6Why the defense industry and why this company?
Reported in ASELSAN New Graduate Salary: What Determines the Starting ...
Two reasons, and they pull in the same direction. I want to work on systems where the security constraints cannot be negotiated away, and I want to work for a company that builds the whole system itself rather than buying in a platform and adding controls around it.
In commercial software you can usually rotate a key, force an update, or accept a residual risk and move on. On a fielded military radio or sensor you may have none of those options. The device can be offline, captured, or expected to run for fifteen years with hardware you cannot change. That changes the design completely. A signature check is not enough. You need a monotonic rollback counter in storage the attacker cannot rewrite, otherwise an old signed image can be replayed. You need an A/B partition so a power loss during an update still leaves a bootable image. And the hardware model has to be inside the signed manifest, not in a filename, or an image for one variant will install on another. I enjoy that kind of problem because the failure is concrete and you can test it on a bench before it matters.
ASELSAN fits because of the scale and the vertical integration. Founded in Ankara in 1975, it now employs roughly twelve thousand people, most of them engineers, and sells into more than eighty countries. It designs its own military radios, radars, electro-optical systems such as the CATS family, and the cryptographic modules that go inside them. That means a security engineer here is not auditing someone else's product from the outside. You are close to the firmware, the key management, and the integration test range, and you see what happens when a trusted sensor feeds a network that assumes the sensor can never lie.
I weighed the alternatives honestly. A large technology company would give me better tooling and faster iteration. A consultancy would give me broader exposure across clients. I would take either if the work were shallow, but I would not take them over this if the role here is genuinely product security. What would make me decline is also clear. If the post turned out to be mostly compliance paperwork with no access to design reviews, if the clearance and export process meant I could not see the systems I was meant to secure for the first year, or if the team had no authority to change a design once the hardware was frozen, then the match would not be there. I am asking about that in this loop because it decides whether I can do the work I described.
I do not hold a clearance and I have not worked under Turkish export rules before, so I would need to learn that process and I would not expect access to restricted programs early. In the first months I would focus on one product line, read its threat model, and re-derive one flow end to end, probably a secure update or a key zeroisation path, and write down every assumption I could not verify. That is how I would earn trust on a team like this, and it is the work I am applying for.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-7Explain inheritance, polymorphism, and abstraction in object-oriented programming?
Reported in ASELSAN Software Engineer Salary: Factors Determining ...
The 90-second answer
Inheritance is reuse through a class hierarchy. Polymorphism is one interface with many implementations behind it. Abstraction is exposing only the contract a caller needs and hiding how it is implemented. In C++ the three combine in an abstract base: it declares the contract, derived classes inherit shared state and behaviour, and callers use a base reference so the concrete type is chosen at runtime.
Checked against C++20, compiled as a single translation unit:
#include <cstdint>
#include <string>
#include <vector>
class Device { // abstraction: contract only, cannot be instantiated
public:
virtual ~Device() = default;
virtual bool read(std::vector<std::uint8_t>& out) = 0;
virtual std::string name() const = 0;
protected:
std::uint32_t id_;
explicit Device(std::uint32_t id) : id_(id) {}
};
class Sensor : public Device { // inheritance: reuses id_, adds sensing
public:
using Device::Device;
bool read(std::vector<std::uint8_t>& out) override {
out.assign({0x01, 0x02});
return true;
}
std::string name() const override { return "sensor"; }
};
class SecureSensor : public Sensor { // polymorphism: same read(), authenticated path
public:
using Sensor::Sensor;
bool read(std::vector<std::uint8_t>& out) override {
out.assign({0x01, 0x02, 0x03}); // in real code: verify MAC first, return false on failure
return true;
}
};
void poll(Device& d, std::vector<std::uint8_t>& buf) {
if (d.read(buf)) { /* process buf */ }
}Trace: poll takes a Device&. Bound to a SecureSensor, the call d.read(buf) dispatches at runtime to SecureSensor::read, not Sensor::read. Swap in a plain Sensor and poll does not change. The abstraction (Device) is what the rest of the code depends on, inheritance carries the common identity, and polymorphism lets the authenticated variant substitute for the plain one.
What it costs, in bytes
On x86-64 Linux with the System V ABI, a pointer is 8 bytes. A class with virtual functions carries one hidden vptr, 8 bytes, at offset 0. Device has a vptr plus id_ (4 bytes) plus 4 bytes of tail padding, so sizeof(Device) is not usable because it is abstract, but a Sensor object is 16 bytes before any member it adds. Its vtable holds 3 entries for the destructor, read, and name, 24 bytes, shared by all instances. A virtual call is an indirect load through that vtable. That is the concrete trade: 8 bytes per object and one indirection per call, in exchange for runtime substitution without recompiling callers.
| Concept | Question it answers | C++ mechanism | Cost if misused |
|---|---|---|---|
| Abstraction | What must every device do? | Pure virtual functions, protected members | Leaky interface: callers depend on concrete types and cannot be tested or swapped |
| Inheritance | What do I reuse? | Public base class, constructor chaining | Fragile base class: a change in Sensor silently changes SecureSensor |
| Polymorphism | Which implementation runs? | virtual dispatch through base reference or pointer | Hidden override failures and unexpected dispatch |
Where it breaks
Object slicing is often cited here, and with this abstract base it cannot happen: Device has pure virtual functions, so it cannot be instantiated, passed by value, or returned by value. The compiler rejects Device d = sensor;. Slicing becomes a real risk only if the base is later made concrete. If Device gained a default read, passing a SecureSensor by value as a Device would copy only the Device subobject and lose the authenticated override. The defence is the same either way: pass and return by reference or pointer when polymorphism matters.
Two other failures are live in this code. A non-virtual destructor would make delete devicePtr on a derived object undefined behaviour, which is why ~Device is virtual. And a derived class that hides rather than overrides, for example declaring bool read(std::vector<std::uint8_t>&) without override and with a different signature, compiles but is never called through Device&. Marking every override with override turns that into a compile error.
Inheritance also has a limit. It models "is a" and couples the derived class to the base for life. When the relationship is "uses a", such as a sensor that uses a crypto provider, composition is safer: hold a provider behind an abstract interface and inject it. I use inheritance for genuine specialisation in a stable hierarchy, composition for interchangeable services, and I keep the abstract base small so the contract stays auditable.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-8How do you handle thread management, synchronization, race conditions, and deadlock scenarios?
Reported in ASELSAN Software Engineer Salary: Factors Determining ...
The 90-second answer
I treat threads as shared mutable state with a security boundary, not as free parallelism. In C++ I use std::thread or a fixed pool, never detached threads owning key material, and every shared object gets one owner, one lock discipline, and a documented lock order. The defaults I reach for are std::mutex with std::lock_guard or std::scoped_lock, std::atomic for counters and flags, and a condition variable for producer-consumer queues. I avoid sleep-based coordination, holding a lock across network or disk I/O, and lock-free structures unless profiling shows contention I cannot remove by shrinking the critical section.
Thread management
For a service handling sensor ingest and cryptographic operations, I size the pool from the workload. CPU-bound crypto workers go at core count, I/O workers higher, and I cap total threads because each default stack is 8 MB virtual on Linux. A pool of 64 threads is 512 MB of virtual stack before any work happens. Workers are created once, named with pthread_setname_np, joined on shutdown, and given a stop flag plus a condition variable so shutdown does not hang on a blocked queue. Priority and affinity only when the real-time budget demands it, because a high-priority thread spinning on a mutex starves the thread that releases it.
// C++17, checked against GCC 13
class KeyStore {
mutable std::mutex m_;
std::vector<uint8_t> key_; // guarded by m_
public:
void publish(std::vector<uint8_t> k) {
std::lock_guard<std::mutex> lk(m_);
key_ = std::move(k);
}
std::vector<uint8_t> snapshot() const {
std::lock_guard<std::mutex> lk(m_);
return key_;
}
};Copying under the lock keeps the critical section short and gives callers a private copy they can use without holding the lock. The trade-off is allocation per snapshot. If that shows up in profiling, I switch to double buffering with two slots and an atomic index, and I only do that after measuring.
Race conditions
A data race in C++ is undefined behaviour, and in security code it is also a TOCTOU risk: a length checked in one thread and used in another, a key buffer resized while a worker reads it, a flag set after the data it protects. The trace I look for is this pattern:
| Step | Thread 1 (ingest) | Thread 2 (crypto worker) |
|---|---|---|
| 1 | reads buf_len = 256 | |
| 2 | reads buf_len = 256 | |
| 3 | reallocates buf to 64 bytes | |
| 4 | copies 256 bytes from buf |
Step 4 reads past the allocation. The fix is not a volatile flag. It is making the length and the buffer one invariant under the same mutex, or publishing an immutable snapshot through std::shared_ptr<const Buffer> with atomic load and store. I verify with ThreadSanitizer in CI (-fsanitize=thread), which reports the two conflicting accesses and the lock that should have covered them. A race that only appears under load usually means the lock covers the write but not the read, or a copy is made outside the lock.
Deadlock
Deadlock needs four conditions at once: mutual exclusion, hold and wait, no preemption, and circular wait. I break circular wait by construction. Every lock gets a rank in a header comment, locks are always taken in rank order, and when two locks are needed I use std::scoped_lock, which takes them in a deadlock-free order internally. If I must take a lock that might be held, I use try_lock with a bounded retry and a metric, never an unbounded spin.
The failure I test for explicitly:
T1: lock(A) -> lock(B) blocked
T2: lock(B) -> lock(A) blockedTwo threads, two mutexes, opposite order. Detection in production is a watchdog: a thread that holds a lock longer than, say, 100 ms while others wait increments a counter and dumps stacks. In test I run Helgrind or ThreadSanitizer with a stress harness that forces interleavings, because a deadlock that needs a 1-in-10,000 scheduling order will not show up in a functional test. The other common cause I have seen is calling out to a callback or a blocking queue push while holding a lock. That turns a short critical section into an unbounded one, so the rule is copy out, unlock, then call out.
Choosing the primitive
| Need | Primitive | Why, and when it fails |
|---|---|---|
| Short mutual exclusion | std::mutex + RAII guard | Uncontended cost is tens of nanoseconds. Fails when held across I/O, because waiters queue behind a slow holder. |
| Multiple readers, rare writers | std::shared_mutex | Helps read-heavy tables. Fails if writers are frequent, since it degrades to writer starvation handling. |
| Counter, flag, stop signal | std::atomic | Lock-free and cheap. Fails for multi-field invariants, which need a lock or an immutable snapshot. |
| Producer-consumer queue | mutex + condition_variable | No polling, no missed wakeups if the predicate is checked under the lock. Fails if the predicate is checked outside it. |
| Bounded concurrency, no ownership | counting semaphore | Limits in-flight requests. Fails as a mutex substitute, since it has no owner and cannot detect misuse. |
The interview follow-up I expect is why not lock-free everywhere. My answer is that a lock-free queue or hash table moves the bug from a hang I can detect to memory corruption I cannot, and in code handling keys and authentication state that trade is backwards. I use atomics where the invariant is one word, locks where it is more, and I measure contention with lock wait histograms before reaching for anything fancier.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-9How do you manage pointers, dynamic memory, and resource management?
Reported in ASELSAN Software Engineer Salary: Factors Determining ...
The 90-second answer
I treat every pointer as an owner, a borrower, or a null. If I cannot name which one it is at the declaration, I do not write it. In C++ that means raw new and malloc almost never appear in application code. Allocation is wrapped once, in a type that releases on every exit path, and the rest of the code moves or borrows that handle.
For a long-lived defence system I also ask whether dynamic allocation belongs there at all. A fixed-size buffer or a preallocated pool with a hard cap is deterministic, testable, and cannot fragment over a 10-year deployment. Dynamic allocation is for variable-size input, such as a parsed message, and even then it is bounded and checked.
Ownership in practice
// C++17. Checked with GCC 13 -std=c++17 -Wall -Wextra
#include <cstddef>
#include <cstdlib>
#include <memory>
#include <stdexcept>
struct BufferDeleter {
void operator()(unsigned char* p) const noexcept { std::free(p); }
};
using Buffer = std::unique_ptr<unsigned char, BufferDeleter>;
Buffer make_buffer(std::size_t n) {
if (n == 0 || n > 64 * 1024) throw std::length_error("buffer size");
void* p = std::malloc(n);
if (!p) throw std::bad_alloc();
return Buffer(static_cast<unsigned char*>(p));
}
void handle(const unsigned char* borrowed, std::size_t len); // borrows, never frees
void process(std::size_t n) {
Buffer buf = make_buffer(n); // owner
handle(buf.get(), n); // borrower gets a view, not ownership
} // buf freed here on normal return, throw, or early returnThe rules I apply on top of that: unique_ptr for single ownership, shared_ptr only when two owners genuinely share lifetime and I can explain why neither can own it alone, raw pointers or string_view / span for borrows with a lifetime shorter than the owner. No delete this, no owning raw pointer stored in a struct without a destructor that frees it, and every allocation site has exactly one release site.
Why this matters for security
The classic failures are use-after-free, double-free, and leak. They are not just crashes. A double-free corrupts the heap allocator metadata and can be turned into controlled allocation. A use-after-free lets an attacker influence freed memory that gets reused. A slow leak is a denial of service: at 1 KB leaked per request and 100 requests per second, that is 8.6 GB per day, so a process with a 2 GB limit dies in under 6 hours.
| Approach | Release guarantee | Main risk | When I use it |
|---|---|---|---|
malloc / free | None, manual | Leak, double-free on early return | Only inside the RAII wrapper above |
new / delete | None, manual | Same, plus mismatched array form | Rarely, inside a wrapper |
unique_ptr / make_unique | On scope exit, including exceptions | Use-after-move if misused | Default for single ownership |
| Fixed pool / static array | No runtime free | Exhaustion if cap is wrong | Embedded, real-time, safety paths |
Resource management beyond memory
The same pattern covers files, sockets, locks, and handles. I wrap them in RAII types so an exception or an error return cannot skip the close. For a lock I use lock_guard or scoped_lock, never a manual lock() / unlock() pair around code that can throw. For a file descriptor I use a small wrapper or unique_ptr with a custom deleter that calls close(). That gives one invariant: acquisition and release live in the same type.
Failure modes and how I detect them
Allocation failure: I check for null or use the throwing form and handle bad_alloc at a boundary, rather than dereferencing null. In a fixed-memory target I treat pool exhaustion as a designed error, log a counter, and drop or truncate the message instead of allocating elsewhere.
Double-free and use-after-free: I run AddressSanitizer and UndefinedBehaviorSanitizer in CI. A typical trace I expect to see is heap-use-after-free on address ... in handle() at parser.cpp:42, freed by BufferDeleter at parser.cpp:9. That tells me the borrower outlived the owner, so I fix the lifetime instead of adding a null check that hides it.
Leaks and fragmentation: LeakSanitizer catches leaks at exit, and I track allocation counts and high-water marks in long-running tests. If a pool is used, I size it from measured peak usage plus headroom, for example peak 12,000 messages of 256 bytes in a soak test, so I provision 16,000 slots and alert at 80 percent occupancy rather than discovering exhaustion in the field.
In review I look for three things: a raw owning pointer, an allocation without a matching release on every path, and a borrowed pointer stored beyond the scope that created it. Any of those gets sent back, because in C that is where the exploitable bugs live.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-10How do you choose data structures and analyze algorithm complexity?
Reported in ASELSAN Software Engineer Salary: Factors Determining ...
The 90-second answer
I start from the access pattern and the constraints, not from a favourite structure. What is looked up, how often, what must stay bounded, and what happens on adversarial input. In security code that last point decides a lot: an attacker controls keys, packet fields and string lengths, so average case is not enough. I need worst case and memory ceiling stated before I write the loop.
For a session or flow table in a packet path, for example, the pattern is: insert on first packet of a flow, lookup on every packet, delete on timeout. That is a hash table keyed by the 5-tuple. An array indexed by a port would be O(1) too but wastes memory and fails when the key is a 128-bit address. A balanced tree gives O(log n) guaranteed and no hash attack surface, but with pointer chasing and worse cache behaviour at 1M packets per second. I would pick the hash table, bound it, and handle collisions explicitly.
Choosing by operation, with numbers
| Structure | Lookup | Insert | Memory per entry | When I pick it |
|---|---|---|---|---|
| Array / direct index | O(1) | O(1) | Fixed, dense | Key is small integer range, e.g. VLAN id 0-4095 |
| Hash table | O(1) avg, O(n) worst | O(1) avg | 2-3x key size with load factor | Flow table, session cache, allowlist lookup |
| Balanced tree (red-black) | O(log n) | O(log n) | Pointer overhead, ~48 bytes/entry | Ordered iteration needed, or hash flooding is a real threat |
| Trie | O(L), L = key length | O(L) | High, but shared prefixes | Signature or routing prefix matching |
| Ring buffer | O(1) | O(1) | Fixed at allocation | Packet capture, log queue, no allocation in the hot path |
| Bloom filter | O(k) | O(k) | ~10 bits/element for 1% false positive | Pre-filter before an expensive lookup, e.g. blocklist check |
Worked sizing, hypothetical but labelled as such: 200,000 concurrent flows, 5-tuple key of 16 bytes plus state. A hash table at load factor 0.7 needs about 286,000 slots. At 32 bytes per slot that is roughly 9 MB. A tree at the same count costs more in pointers and, at 1M lookups per second, the log factor is about 18 comparisons against mostly cache misses. That difference shows up as p99 latency, so I measure it on the target board rather than trusting the table alone.
Complexity analysis I actually do
I write the cost in terms of n, the input size I can bound, and I separate three cases: best, average and worst. For signature matching with Aho-Corasick, scanning is O(n + m) where n is packet bytes and m is matches, instead of O(n * s) for s signatures checked naively. That matters when s grows from 100 to 10,000 rules.
For hash tables I state the attack: if keys are attacker controlled and the hash is weak or seeded poorly, collisions degrade lookup to O(n) and a single flow can stall the path. Mitigations I would name in the interview: keyed hash (SipHash or a per-boot random seed), load factor cap with eviction policy, and a hard cap on table size so memory exhaustion is a dropped new flow, not a crashed process.
Amortised cost matters for structures that resize. A dynamic array push is O(1) amortised because doubling copies each element O(log n) times in total, but the worst single push is O(n). In a real-time or embedded loop at ASELSAN I avoid that spike: preallocate the ring buffer or table at init, never grow it in the packet path.
/* Fixed ring buffer for captured packets: O(1) push, no allocation */
#define RING_SIZE 4096
typedef struct { uint8_t buf[RING_SIZE][2048]; uint32_t head, tail; } ring_t;
int ring_push(ring_t *r, const uint8_t *pkt, uint32_t len) {
uint32_t next = (r->head + 1) % RING_SIZE;
if (next == r->tail) return -1; /* full: drop and count, do not block */
memcpy(r->buf[r->head], pkt, len);
r->head = next;
return 0;
}Trace: head at 4095, push writes slot 4095, head wraps to 0. Next push checks slot 0 against tail. If tail is 0 the buffer is full and the packet is dropped with a counter incremented. No malloc, no lock in the single-producer case, and the worst case is the memcpy of one packet.
Failure modes I check before signing off
Unbounded growth from a structure with no eviction, so a scan fills the flow table and legitimate traffic is refused. Hash collision degradation, detected by tracking max chain length and load factor as metrics, not just hit rate. Timing side channels when a lookup compares secrets, for example a token table where early exit on mismatch leaks position, which needs constant-time comparison regardless of the structure. And integer issues in the arithmetic itself: n * s overflowing a 32-bit counter when I estimate worst case work.
My closing line in an interview would be: I pick the structure from the access pattern, I quote worst case and memory bound alongside average case, and I test the adversarial case on the actual hardware, because that is where the choice either holds or fails.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-11What are your motivation and career expectations?
Reported in ASELSAN New Graduate Salary: What Determines the Starting ...
My motivation is pretty specific. I want to do security work where a finding changes a design, not just closes a ticket. During my internship I was watching logs from a small industrial network and we kept getting alerts from one service account. It turned out to be a misconfigured job that was polling a device every few seconds. Fixing the config stopped the alerts, but the useful part was adding the logging that would have shown us the pattern in an hour instead of a week. I liked that loop. Detect something, work out why it happened, fix the cause so it does not come back.
That is why I applied here rather than taking a general SOC role I was offered elsewhere. The SOC work was interesting and the team was good, but the feedback was mostly about triage speed and ticket quality. I would have learned incident handling well. What I would not have learned is how a secure boot chain or a signed update gets designed into a product that has to run for years in the field, with no easy patch path. I weighed the two against one thing: where do I get to see the consequence of a security decision I made? In product security I get that in the next design review. In the SOC role I would have seen it in the next shift. I chose the slower loop because I want to understand the systems, not only the alerts they generate.
My expectation for the first year is to be useful on defined tasks while I learn the environment. That means the build system, the test lab, and the standards the team actually follows, which are not always the same as the ones in the documents. I expect to spend time on unclassified work at first. Clearance can take months and I have no control over that timeline, so my plan cannot depend on getting access quickly. If I am stuck waiting, I want to be working on hardening guides, test cases, or threat models for parts of the system I am allowed to see. If I am not, that is a problem I would raise early rather than sit idle.
By year two or three I expect to own a piece of work end to end. For me that would be something like the security design for one subsystem, or the hardening baseline for a Linux image we ship. Owning it means I write the threat model, I sit in the design review, and I have to defend the trade-offs when someone asks why we did not use a stronger control. Sometimes the answer will be cost, sometimes it will be that the control breaks a real-time requirement. I want to learn to make that call and to write it down so the next engineer knows why we chose it.
There are ways this plan goes wrong and I would rather name them. One is if the team I join is mostly doing compliance checks and audits. That work matters, but it would not give me the design experience I am looking for, and after six months I would ask to move toward product work or I would know this is the wrong team. Another is if there is no one reviewing my work closely. I learn fastest when someone senior reads my threat model and tells me what I missed. If that is not happening, I would ask for a mentor explicitly and I would ask at my first review what skill gap I should close next. I do not want to find out at the end of year one that my writing was the problem.
I am not looking for a short stay. I know the work here is on site in Ankara, that some of it is controlled, and that travel and access come with conditions I have to accept. I am choosing a defence employer because the projects are long. A decision I make in year one on how we verify an update is still protecting a system in year five. I want to stay long enough to see that through and to become the person newer engineers ask to review a design. That is the expectation I am signing up for.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-12Describe the architectural decisions in your past projects and how you solved the problems you encountered?
Reported in ASELSAN Software Engineer Salary: Factors Determining ...
The project I would walk through is a secure firmware update and remote management gateway for an embedded Linux device deployed in a disconnected environment. The device had to accept updates only from an authorised server, keep running if an update was interrupted, and give us forensic evidence if a device was tampered with. That set of constraints drove every architectural choice.
The 90-second answer
I split the system into three trust zones. A small immutable bootloader and a TPM 2.0 chip hold the root of trust. The main Linux application runs in a read-only root filesystem and cannot write to the bootloader partition. A separate update service, running as its own user with no network access except to one update endpoint, verifies and stages images before the bootloader ever sees them.
[Update server] --TLS 1.3, mutual auth--> [Update service]
| verifies signature + manifest
v
[Staging partition B]
| atomic switch on reboot
[TPM 2.0] <-- PCR measurements --> [Bootloader] --> [Linux A or B]Decision 1: Signed images with anti-rollback, not TLS alone
TLS would have protected the download in transit, but it would not stop a compromised server, a replayed old image, or a device restored from a backup image. So each image carries a manifest signed with ECDSA P-256. The manifest lists image hash, version, and minimum allowed version. The bootloader checks the signature and the version counter stored in TPM NV before booting a new slot.
| Option | What it stops | What it misses | Cost in my project |
|---|---|---|---|
| TLS only | Network tampering | Malicious or replayed image | Low, but no offline trust |
| Signed image, no counter | Tampered image | Rollback to vulnerable version | Signature check about 12 ms on Cortex-A53 |
| Signed image + TPM counter | Tampered and replayed image | Requires key provisioning | Extra provisioning step, see below |
Decision 2: A/B slots with atomic switch
The device has two 64 MB application slots. The update service writes to the inactive slot, verifies the full hash, then flips a flag in the bootloader config. If power is lost mid-write, the old slot still boots. Trace from a test I ran: update starts at 02:14:03, power cut at 02:14:41 with 61% written, device reboots at 02:15:02, bootloader finds slot B incomplete, boots slot A, update service reports staging_incomplete and retries from the last verified 256 KB chunk. No partial image ever became bootable.
Decision 3: Least privilege inside Linux
The update service can write only to the staging partition and read the public key. It cannot read application data, which lives on an encrypted partition whose key is sealed to TPM PCRs 0, 2, and 7. If someone boots a modified kernel, the PCRs change and the data partition will not unseal. That gave us tamper evidence without a custom hypervisor.
Problems I hit and how I solved them
Key provisioning was the hardest part. Signing keys could not live on the build server. We moved signing to an HSM, kept the private key offline, and issued per-device certificates at the factory with a 10-year validity and a CRL checked at update time. When a test certificate expired early, devices rejected updates for 36 hours. I added a second, longer-lived trust anchor for the bootloader and a monitored alert at 90 days before expiry. That failure is why expiry is now a release gate, not an afterthought.
The second problem was clock skew. Devices without battery-backed RTC drifted by hours, which broke certificate validity checks. I stopped relying on wall-clock time for the update decision. The bootloader checks signature and version counter, which do not depend on time. Certificate expiry is checked by the update service only after it syncs time over authenticated NTP, and a skew beyond 5 minutes triggers a warning, not a silent failure.
The third problem was image size. A full 48 MB image over a constrained link took over 20 minutes and increased the chance of interruption. We moved to chunked, resumable transfer with per-chunk hashes. Average update time dropped to about 6 minutes on the same link, and interrupted updates resumed instead of restarting.
If I rebuilt it today, I would keep the same three zones and change only the provisioning flow. I would automate factory key injection and add a hardware-backed monotonic counter check in CI, so a rollback attempt fails a test before it reaches a device.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Curated: · Written: · Reviewed: