Skip to content
Tech Interview Prep

Real Interview Questions for the Embedded Systems Engineer at Aselsan

New

Interview Q&A

11 questions · Flow follows Relevance until this set has a learning order.

Q&A-1Describe your graduation project: why did you solve the problem this way, and what alternatives did you eliminate?

Reported in ASELSAN New Graduate Salary: What Determines the Starting Salary? | Envanter Medya

The 90-second answer

My graduation project was a closed-loop DC motor controller on an STM32F407. A 24 V brushed motor was driven through a MOSFET H-bridge, with encoder feedback for speed and a shunt resistor for current. The control loop ran at 1 kHz from a hardware timer, CAN ran at a lower priority, and protection was partly in hardware: a comparator trip on current and a watchdog that cut PWM if the loop missed its deadline.

The requirements drove that split. Speed had to stay within plus or minus 2% from 200 to 1,500 rpm under load steps, stop within 300 ms on a fault, and not reset the MCU when the motor stalled on a shared 24 V supply.

Why this architecture

I used a PI controller on speed, with feedforward from the setpoint. Current was not in the fast loop. It was used for stall detection and the hardware trip. That kept the 1 kHz loop simple enough to verify on a scope.

The encoder gave 48 counts per motor revolution and the gearbox was 6:1, so 288 counts per output revolution. Counting over 1 ms, one count equals 1,000 counts per second, which is 208 rpm. That is too coarse, so I accumulated counts over 10 ms. Resolution then becomes 20.8 rpm per count, with 10 ms of added lag.

C
/* STM32F407, 168 MHz. Control ISR at 1 kHz, speed updated every 10 ticks. */
static int32_t prev_count = 0;
static float integral = 0.0f;

void control_tick(void) {
    static int tick = 0;
    if (++tick < 10) return;
    tick = 0;

    int32_t now = encoder_count;
    float rpm = (float)(now - prev_count) * 6000.0f / 288.0f; /* 10 ms window */
    prev_count = now;

    float err = setpoint_rpm - rpm;
    integral = clamp(integral + err * 0.01f, -40.0f, 40.0f);
    float duty = 0.35f * err + 2.1f * integral + feedforward(setpoint_rpm);
    set_pwm(clamp(duty, -0.95f, 0.95f));
}

In a bench test with a load step at 800 rpm, speed fell to about 742 rpm at 10 ms, recovered to 791 rpm by 120 ms, and settled near 798 rpm at 300 ms. Those are measured values from our test rig, not simulation.

Alternatives I eliminated

AlternativeWhat I triedWhy I dropped it
---------
Arduino Uno, polling loopQuick prototypeLoop jitter reached 3 ms under CAN load and speed error reached 9%. No DMA or hardware trip.
PID on currentTighter torque on paperNeeded a current loop near 10 kHz. At 1 kHz it oscillated, and it would have required a faster MCU for no gain in speed accuracy.
LIN instead of CANCheaper transceiverLIN is polled by a master at up to 20 kbit/s. We needed fault frames sent without waiting for a poll, at 500 kbit/s.
Software watchdog onlyLess hardwareA hung loop could leave PWM asserted. I kept the independent watchdog at 100 ms plus a comparator wired to the H-bridge enable.

I also considered CANopen. For one node it added roughly 30 KB of flash and a week of integration for features we did not use, so I used raw CAN frames with a documented layout.

Failure modes I hit

On stall, current rose to 6.8 A and the shared rail dipped to 19 V, resetting the MCU. I added a separate 5 V buck for logic and 470 uF bulk capacitance at the H-bridge. After that, 50 stall cycles ran without a reset. Stall detection required current above 6 A and speed below 50 rpm for 20 ms, to avoid tripping on normal acceleration.

At low speed the encoder counts arrived in bursts, so I removed the derivative term. The PI response slowed by about 15 ms but became stable. CAN error frames also appeared when the CAN pair ran under the switching node. Routing the pair to the board edge and terminating both ends cleared the errors in a 10 minute soak test.

If I rebuilt it, I would keep the same partition and add a replayable test harness for setpoint profiles and a proper fault recovery state machine. The decision I would not change is speed for control and current for protection. That split made the loop testable, which mattered more than squeezing out the last percent of performance.

Curated: · Written: · Reviewed:

Difficulty: Easy
Q&A-2What concrete contributions did you make during your internship, and what did you add to the team?

Reported in ASELSAN New Graduate Salary: What Determines the Starting Salary? | Envanter Medya

The 90-second answer

I would not list the ticket titles. I would pick two pieces of work that reached the board or the test bench, and give the before and after numbers for each.

In my internship I worked on a STM32F4 sensor node that reported over CAN. My first contribution was fixing a timing fault in the ADC DMA driver. The second was adding a host-side test harness for the CAN frame parser, which the team kept after I left. Both are small, but both changed a measurement the team could check.

What I actually shipped

WorkProblem on arrivalWhat I changedEvidence it worked
ADC DMA driverIntermittent stale samples at 1 kHz, roughly 1 in 400 framesReworked the DMA circular buffer handling and added a sequence counter checkStale frames dropped to 0 in a 2 hour soak at 1 kHz, verified on a logic analyser
CAN parser testsParser only tested on the bench by hand, regressions found lateWrote a host test harness in C with recorded frames as inputs47 cases, runs in under 1 second, caught a byte-order bug in review before merge

The DMA fault is the one I would lead with, because it shows how I debug on hardware.

The node sampled a pressure sensor with DMA into a circular buffer and sent the result on CAN every 10 ms. Under load the host occasionally read a buffer slot that had not been refreshed yet. The symptom looked like a sensor problem, because the value repeated for one cycle.

I added a monotonically increasing sequence number per DMA transfer and logged it alongside the CAN frame timestamp. On the bench, with a 1 MHz timer capture, the pattern was clear: the stale reads clustered right after a CAN transmit interrupt. The transmit ISR was taking about 180 microseconds and, on the older code, could preempt the DMA half-transfer handling long enough for the buffer index to be read twice.

The fix was narrow. I moved the index update into the DMA interrupt, made the shared index volatile, and added a guard that rejected a sample whose sequence number had not advanced. The core of the change:

C
/* STM32F4, DMA1 Stream0, circular mode */
static volatile uint32_t dma_seq;
static volatile uint16_t buf_idx;

void DMA1_Stream0_IRQHandler(void)
{
    if (DMA_GetITStatus(DMA1, DMA_IT_HTIF0)) {
        buf_idx = 0;
        dma_seq++;
        DMA_ClearITPendingBit(DMA1, DMA_IT_HTIF0);
    }
    if (DMA_GetITStatus(DMA1, DMA_IT_TCIF0)) {
        buf_idx = 64;
        dma_seq++;
        DMA_ClearITPendingBit(DMA1, DMA_IT_TCIF0);
    }
}

Before the change, a 10 minute run at full rate produced about 150 stale frames out of 60,000. After, a 2 hour run produced none, and CAN bus load stayed at 31 percent, well under the 60 percent ceiling the team used for this bus. I also left a short note in the driver header stating the assumption: the CAN transmit ISR must stay under 200 microseconds, or the guard will drop samples rather than send stale ones. That trade-off was deliberate. Dropping one sample at 1 kHz is recoverable downstream. Sending a repeated value that looks valid is not.

The second contribution mattered for the team rather than the board. The CAN parser handled 12 frame types and had no automated tests. I recorded real frames from the bench, including malformed ones with bad checksums and truncated payloads, and built a harness that compiled the parser for the host with the HAL calls stubbed out. A typical case feeds a recorded byte array and checks the decoded fields:

C
/* host test, compiled with gcc, parser linked unchanged */
uint8_t frame[] = {0x18, 0xFE, 0xF2, 0x10, 0x3C, 0x00, 0x7F, 0xFF};
can_frame_t out;
assert(can_parse(frame, sizeof(frame), &out) == CAN_OK);
assert(out.pressure_kpa == 1240);

That harness caught a real bug during my internship: the parser treated a 16-bit field as little-endian when the sensor sent it big-endian. The bench test had missed it because the test values were symmetric. After I left, the team added two more frame types using the same harness, which is the outcome I would point to if asked what I added. The code was useful, but the reusable test setup was the lasting part.

What I would not claim

I did not redesign the firmware architecture, and I did not own the board bring-up. Saying so would invite questions I could not answer well. If the interviewer pushes on scope, I would state the boundary plainly: I owned the DMA fix end to end, from reproduction to soak test, and I owned the test harness. I contributed to the CAN parser bug fix, but the parser itself was someone else's design.

If asked what I learned about working in a larger engineering organisation, I would give one concrete habit rather than a general statement. I started writing the reproduction steps and the measured result into the commit message, not just the change. That made review faster, because the reviewer could see the before and after numbers without asking me to rerun the bench. It is a small practice, and it is the one I would carry into a full-time role here.

Curated: · Written: · Reviewed:

Difficulty: Easy
Q&A-3Explain inheritance, polymorphism, and abstraction in object-oriented programming?

Reported in ASELSAN Software Engineer Salary: Factors Determining the Fee | Envanter Medya

The 90-second answer

Inheritance lets a derived class reuse and specialise a base class. Polymorphism lets code call a base-class interface and get the derived behaviour at runtime. Abstraction hides the implementation behind that interface so callers depend on the contract, not on the concrete driver.

In embedded C++ I would ground all three in a sensor driver, because that is where the trade-offs show up immediately: a vtable costs RAM and a pointer per object, and a missing virtual destructor or a sliced object corrupts state silently.

C++
// C++17, checked with g++ -std=c++17 -Wall -Wextra
#include <cstdint>

class Sensor {  // abstraction: pure virtual interface
public:
    virtual ~Sensor() = default;              // virtual: delete via base is safe
    virtual uint32_t readRaw() = 0;           // polymorphism: overridden below
    virtual uint32_t readMilliUnits() = 0;
};

class TemperatureSensor : public Sensor {     // inheritance
public:
    uint32_t readRaw() override { return adcRead(0); }
    uint32_t readMilliUnits() override { return readRaw() * 25; } // 25 mV per count, illustrative
private:
    uint32_t adcRead(int channel);
};

class PressureSensor : public Sensor {
public:
    uint32_t readRaw() override { return adcRead(1); }
    uint32_t readMilliUnits() override { return readRaw() * 10; }
private:
    uint32_t adcRead(int channel);
};

uint32_t poll(Sensor& s) { return s.readMilliUnits(); } // caller sees only Sensor

poll() never names TemperatureSensor. Passing a TemperatureSensor& or a PressureSensor& both bind to Sensor&, and the call dispatches to the override. That is the practical payoff of abstraction in firmware: the control loop, logger and fault monitor are written once against Sensor, and a new driver is added by writing a new derived class without touching them.

What the compiler actually emits

On a 32-bit ARM target, each class with virtual functions gets one vtable in flash. Each object carries one vptr, 4 bytes, pointing at its class vtable. For TemperatureSensor with two virtual functions, the vtable holds two 4-byte entries plus the offset-to-top and type-info slots the ABI reserves.

Trace for Sensor* s = new TemperatureSensor; s->readMilliUnits();:

  1. s holds the address of the TemperatureSensor object, whose first word is the vptr.
  2. The compiler loads the vptr, indexes slot 1, and jumps to TemperatureSensor::readMilliUnits.
  3. No branch on type in poll(). The cost is one indirect load and call, typically a few cycles, and it stays bounded. That boundedness matters for worst-case timing analysis in a way a heap allocation after initialisation does not.

Static versus dynamic polymorphism

MechanismWhen it resolvesCostEmbedded use
Templates, overloadsCompile timeZero runtime cost, code bloat per instantiationHot paths, fixed sensor sets, MISRA-friendly builds
Virtual functionsRuntime via vtable4 bytes per object on 32-bit, indirect callPlugin drivers, runtime configuration, test doubles

I reach for templates when the set of types is known at build time and the call sits in an ISR or a tight loop. I reach for virtual functions when drivers are selected at runtime, for example after probing a bus, or when a unit test needs to substitute a fake sensor.

Failure modes I check for

Slicing is the classic one. void log(Sensor s) takes the base by value, copies only the Sensor subobject, and every override is lost. The fix is to pass by reference or pointer, as poll(Sensor&) does.

A non-virtual destructor is the second. delete sensorPtr where sensorPtr is a Sensor* pointing at a derived object with members needing destruction is undefined behaviour if ~Sensor is not virtual. The = default virtual destructor above closes that.

Multiple inheritance and diamond hierarchies are the third. Two bases each carrying state create ambiguous subobjects and layout surprises. In driver code I avoid it and use composition instead: a TemperatureSensor holds a AdcChannel member rather than inheriting from two driver bases. Inheritance then models a genuine is-a relationship, which is the only case where it earns its keep.

Two build flags change the picture and I would name them in an interview. -fno-rtti removes dynamic_cast and typeid, which some safety coding standards require anyway. -fno-exceptions removes throw-based error handling, so driver failures return status codes through the interface instead. Neither removes virtual dispatch, so the design above survives both.

If asked when not to use inheritance at all: when the relationship is has-a, when the hierarchy would force public data members to satisfy a base, or when the vtable cost per object is unacceptable across thousands of instances. Composition with a small interface gives the same abstraction without the coupling.

Curated: · Written: · Reviewed:

Difficulty: Easy
Q&A-4How do you handle thread management, synchronization, race conditions, and deadlock scenarios?

Reported in ASELSAN Software Engineer Salary: Factors Determining the Fee | Envanter Medya

The 90-second answer

On a bare-metal or RTOS target I treat threads as scheduled tasks with a priority, a stack budget, and a defined set of shared resources. I do not start from "add a mutex everywhere". I start from what data is shared, who owns it, and what happens if a task blocks.

For an Aselsan-style controller, say a sensor task producing samples and a comms task sending frames over CAN or UART, the default is ownership plus queues. The sensor task owns the sample buffer and pushes completed frames into a queue. The comms task owns the transmit buffer and pops from it. No shared mutable state means no race on the data itself. I add a mutex only where ownership cannot be split, for example a shared SPI bus or a hardware register block touched by two tasks.

Thread management

In FreeRTOS that is task creation with explicit priority and stack size, not defaults. I size stacks from measured worst case, not guesswork: run with stack watermark checking (uxTaskGetStackHighWaterMark) under load and add 25 to 50 percent headroom. Priorities follow rate and deadline. A 1 kHz control loop gets a higher priority than a 10 Hz telemetry task, and anything that can block on a bus never runs at the highest priority. On Linux with pthreads I pin real-time threads with SCHED_FIFO, set pthread_attr_setinheritsched, and keep the number of real-time threads small enough that a runaway thread cannot starve the kernel watchdog thread.

C
/* FreeRTOS, checked against FreeRTOS 11.x */
static SemaphoreHandle_t spi_mutex;

void comms_task(void *arg) {
    frame_t f;
    for (;;) {
        if (xQueueReceive(frame_q, &f, portMAX_DELAY) != pdPASS) continue;
        if (xSemaphoreTake(spi_mutex, pdMS_TO_TICKS(5)) != pdPASS) {
            /* Bus holder is stuck or dead. Count it, drop this frame,
               do not block the queue behind one bad transfer. */
            dropped_frames++;
            continue;
        }
        spi_transfer(f.buf, f.len);
        xSemaphoreGive(spi_mutex);
    }
}

Two details matter there. The take has a timeout, so a holder that crashes does not wedge every other user of the bus. And the ISR path never takes that mutex. An ISR sets a flag or writes to a queue with FromISR variants and returns. Blocking calls from interrupt context are a classic source of corruption on Cortex-M targets.

Race conditions

A race needs shared mutable state accessed without ordering. The fix hierarchy I use is: remove sharing, use a queue or double buffer, use a lock, and only then use atomics for a single word or flag. Double buffering is common for sensor data. The producer writes the inactive buffer, then flips an index. The consumer reads the active buffer. The flip is one atomic store, so the consumer never sees half a sample.

Where a lock is unavoidable, I keep the critical section short, never sleep or do I/O inside it, and never call a function that might take another lock while holding the first unless the ordering is documented.

Deadlock and priority inversion

Deadlock needs four things at once: mutual exclusion, hold and wait, no preemption, and a circular wait. I break circular wait by a global lock order. If task A takes the bus mutex then the log mutex, no task ever takes them in the reverse order. I also prefer try-lock with backoff over indefinite waits on secondary resources, and I add a watchdog that detects a task that has not made progress in its expected window.

Priority inversion is the embedded version of the same problem. A low priority task holds the SPI mutex, a high priority task blocks on it, and a medium priority task that does not need the bus preempts the low one. The high priority task waits for the medium task to finish, which can be unbounded. FreeRTOS mutexes implement priority inheritance, so the low priority holder temporarily inherits the high priority task's priority until it releases the mutex. That only works if I use a mutex for this, not a binary semaphore, because semaphores do not carry inheritance.

PrimitiveUse it forAvoid it for
QueuePassing ownership of data between tasksSharing one buffer in place
MutexMutual exclusion with priority inheritanceSignalling, or use from an ISR
Binary semaphoreSignalling between tasksMutual exclusion where inversion matters
Counting semaphorePool of identical resourcesOrdering two different resources
Atomic flag or double bufferSingle word status, latest sampleMulti-field structures

How I detect it before the customer does

I run the firmware with mutex and queue sets sized to timeout, enable configASSERT and stack overflow detection in FreeRTOS, and log lock wait times. A wait that exceeds, say, 5 ms on a bus that should transfer in under 1 ms at 8 MHz SPI is a bug, not noise. In a test harness I inject faults: kill a task while it holds a lock, delay a bus transfer, and check that the watchdog fires and the system recovers to a known state instead of hanging silently. On the bench I also check with a logic analyser that the ISR latency budget still holds when all locks are contended, because a correct design that misses its deadline is still a failed design.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-5How do you manage pointers, dynamic memory, and resource management?

Reported in ASELSAN Software Engineer Salary: Factors Determining the Fee | Envanter Medya

The 90-second answer

In embedded C I treat a pointer as an ownership claim, not just an address. Every pointer has one owner, a lifetime, and a cleanup path, and I design those three before I write the allocation. On a constrained target, usually a Cortex-M or similar MCU with 64 to 512 KB of RAM and no MMU, I avoid general malloc/free on any path that must be deterministic. I prefer compile-time static allocation, then fixed-size pools for variable counts, and only use the heap where fragmentation and failure are acceptable and testable.

That rule comes from three failure modes I have to defend in review: fragmentation, unbounded latency, and leaks that only appear after hours of uptime.

Ownership and cleanup in C

C has no destructor, so cleanup is manual and must be boring. I use a single exit path per function, null a pointer after freeing it, and never return a pointer to a stack frame or to a buffer owned by a caller that has already moved on.

C
/* Checked against C11, bare-metal target, no RTOS heap in ISR context */
typedef struct {
    uint8_t *data;
    size_t   len;
    size_t   cap;
} Buffer;

static bool buffer_init(Buffer *b, size_t cap)
{
    b->data = (uint8_t *)malloc(cap);
    if (b->data == NULL) {
        b->len = 0;
        b->cap = 0;
        return false;
    }
    b->len = 0;
    b->cap = cap;
    return true;
}

static void buffer_destroy(Buffer *b)
{
    free(b->data);   /* free(NULL) is a no-op, so this is safe twice */
    b->data = NULL;  /* a later use is now a visible NULL dereference, not use-after-free */
    b->len = 0;
    b->cap = 0;
}

In a function that acquires two resources, I do not return early between them. I use goto cleanup so a failure on the second acquisition releases the first. That pattern is ugly in application code and essential here, because a missed free on an error path is exactly the leak that survives code review.

Why pools beat the heap on this hardware

StrategyAllocation timeFragmentationFailure mode
Static arrayZero, resolved at link timeNoneBuild fails if you exceed RAM
Fixed poolO(1), bounded, no searchNone, slots are fixed sizePool exhausted, returns NULL immediately
malloc/freeVariable, depends on heap stateExternal fragmentation over timeReturns NULL late, after partial work

A pool for, say, 32 CAN frames of 64 bytes costs 2,048 bytes plus a bitmap, and every allocation takes the same number of cycles. With the heap, a device that allocates and frees variable sizes for a week can end up with plenty of free bytes in total and no contiguous block large enough for a 256-byte DMA buffer. The allocation then fails even though the heap reports, for example, 8 KB free. I have seen that exact split on a 256 KB part: total free looked healthy, largest contiguous block was under 100 bytes.

Worked trace for a pool of 4 slots:

alloc slot 0 -> ok, free list: 1,2,3
alloc slot 1 -> ok, free list: 2,3
free slot 0  -> ok, free list: 0,2,3
alloc slot 2 -> ok, free list: 0,3
alloc slot 3 -> ok, free list: 0
alloc slot 4 -> NULL, caller must drop or queue the frame, no partial state

The caller gets a clean, immediate failure it can count and log, instead of a half-initialised structure.

Resources beyond memory

The same discipline applies to DMA channels, timers, mutexes, and file or socket handles. I acquire in one order everywhere, release in reverse order, and never hold a lock while blocking on another resource. In interrupt context I do not allocate at all. An ISR sets a flag or pushes a fixed-size item into a ring buffer; the task does the work. Allocating in an ISR risks calling a non-reentrant heap function, taking a lock the interrupted task already holds, and blowing the worst-case interrupt latency budget.

For long-lived systems I also add cheap detection: a pool high-water mark, a counter of failed allocations, and, in debug builds, a magic value and length stored beside each allocation so a buffer overrun or double free corrupts a check I can trap on rather than silently corrupting the heap. In production I keep the counters, because "allocation failed 12 times in the last hour, all on the telemetry path" is actionable, while a field return with no data is not.

If an interviewer pushes on when I would use malloc at all: at startup, before the scheduler runs, for buffers whose size is only known after configuration, and in non-critical logging paths where a NULL return is handled. Never in a control loop, never in an ISR, and never without a checked NULL path that leaves the system in a safe state.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-6How do you choose data structures and algorithms, and how do you analyze their complexity?

Reported in ASELSAN Software Engineer Salary: Factors Determining the Fee | Envanter Medya

I start from the constraints, not from the textbook. On the targets I work on, usually an ARM Cortex-M under FreeRTOS with 64 to 512 KB of RAM, the choice is decided by four things: worst-case time in the calling context, static memory footprint, determinism, and whether the code can run in an ISR or a task without blocking.

If a lookup runs in a 1 kHz control loop or an ISR, average-case O(1) is not enough. I need a bounded worst case I can measure on the board. If it runs in a background logging task, amortized cost and code size matter more.

How I compare candidates

Take a concrete case I have used: mapping a 16-bit sensor or CAN identifier to a calibration record, with up to 4,096 entries, looked up on every frame.

StructureLookupInsertMemory per entryEmbedded concern
Sorted array + binary searchO(log n), about 12 comparisons at n=4096O(n) shift8 bytes, contiguousDeterministic, cache friendly, no pointers
Hash table, open addressingO(1) average, O(n) worstO(1) average16 bytes with load factor 0.5Collision worst case must be bounded and tested
Linked listO(n), 2,048 averageO(1) at head12+ bytes plus fragmentationPointer chasing, no locality, hard to bound
Binary search treeO(log n) average, O(n) degenerateO(log n) average20+ bytes with pointersUnbalanced input gives linear worst case

For that table I would pick the sorted array unless inserts are frequent. 12 comparisons of integers is a few hundred cycles on a Cortex-M4 at 168 MHz, well under a microsecond, and the worst case equals the average case. A hash table wins only if I need frequent inserts and I can prove the probe length stays bounded, for example by capping load factor at 0.7 and measuring maximum probes with a test harness.

For streaming data the default is different. A UART or ADC ISR producing samples consumed by a task gets a fixed ring buffer, not a queue built on malloc:

C
// C11, checked on STM32F4 with -O2. Capacity must be a power of two.
#define RB_CAP 256u
typedef struct { uint16_t buf[RB_CAP]; volatile uint16_t head, tail; } ring_t;

static inline int rb_push(ring_t *r, uint16_t v) {
    uint16_t next = (uint16_t)((r->head + 1u) & (RB_CAP - 1u));
    if (next == r->tail) return -1; /* full: drop or count an overrun, never block in ISR */
    r->buf[r->head] = v;
    r->head = next;
    return 0;
}

Push and pop are O(1) worst case, memory is exactly 512 bytes, and there is no allocation failure path to handle in the ISR. The failure mode is explicit: push returns -1, I increment an overrun counter, and the consumer can detect a gap instead of silently reading stale data.

How I analyze complexity

I define n in terms of the real input, here number of table entries or buffer size, then count the operations that dominate on the target. I state three numbers separately: worst case, average case under a stated distribution, and amortized cost if the structure resizes. For binary search that is 12 steps worst and average at n=4096. For a dynamic array that grows by doubling, amortized insert is O(1) but a single resize copies n elements, which can stall a task for milliseconds at large n, so in firmware I preallocate to the known maximum instead.

Big O alone hides constants that matter at small n. Sorting 32 samples with insertion sort can beat quicksort in cycles and has a simple worst case, while quicksort on already sorted input degrades to O(n^2) unless the pivot strategy is fixed. I therefore verify with measurement: toggle a GPIO around the operation, or read the DWT cycle counter, and record maximum cycles over a soak test with worst-case input, not just typical input.

Failure modes I check before signing off: recursion depth overflowing a 1 KB task stack, which I detect with a stack watermark and a canary; hash collisions turning a lookup into a long probe chain under adversarial or clustered IDs; heap fragmentation from malloc in a long-running unit, which is why safety critical paths use static allocation; and priority inversion when a low priority task holds a lock the ISR path needs. If any of those appear, I change the structure or the allocation strategy, not the timing budget.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-7Explain the fundamentals of circuit analysis?

Reported in ASELSAN New Graduate Salary: What Determines the Starting Salary? | Envanter Medya

The 90-second answer

Everything in DC and low-frequency analysis comes from three relations: Ohm's law, Kirchhoff's current law, and Kirchhoff's voltage law. V = I * R for a resistor, KCL says currents entering a node sum to zero, KVL says voltages around a closed loop sum to zero. From those I get series and parallel reduction, the voltage divider, nodal and mesh analysis, and Thevenin and Norton equivalents. In embedded work I use those to check levels into an ADC or GPIO, current through a driver, and power in a resistor before I trust a simulation.

The core tools

Series resistors add: R_eq = R1 + R2. Parallel resistors add in reciprocal: 1/R_eq = 1/R1 + 1/R2. A divider follows directly from KVL and Ohm:

Vout = Vin * R2 / (R1 + R2)

Nodal analysis picks node voltages as unknowns and writes KCL at each one. Mesh analysis picks loop currents and writes KVL around each loop. Nodal usually wins when there are many parallel branches, which is the normal case on a power rail or a sensor front end. Mesh wins for a small number of loops with shared branches.

TechniqueUse it whenWhat it gives you
DividerTwo resistors in series, one output nodeOutput voltage and divider current
NodalSeveral nodes tied to rails and sourcesAll node voltages in one system
TheveninA network feeds a load you will changeVth in series with Rth
NortonSame network, current form preferredIn in parallel with Rth
SuperpositionMultiple independent sourcesSum of one-source-at-a-time results

Worked example: a 12 V rail into an ADC

Suppose a 12 V sensor rail feeds a 3.3 V ADC through R1 = 10 kΩ and R2 = 2.2 kΩ.

Unloaded output:

Vout = 12 * 2.2 / (10 + 2.2) = 2.16 V

Divider current: I = 12 / 12.2 kΩ = 0.98 mA. Power in R1: I²R = 9.6 mW, so a 0603 part is comfortable, but the current is wasted continuously. That is the first trade-off I check on a battery rail.

Now load it. If the ADC input and any protection network present 100 kΩ to ground in parallel with R2, the lower leg becomes 2.2 kΩ || 100 kΩ = 2.15 kΩ, and Vout falls to 2.13 V. Small here. If a later revision hangs a 10 kΩ load there, the lower leg becomes 1.80 kΩ and Vout drops to 1.83 V. The divider formula alone would have missed that by 330 mV.

Thevenin makes the loading and settling question explicit:

Vth = 2.16 V Rth = R1 || R2 = 10 kΩ || 2.2 kΩ = 1.80 kΩ

So the ADC sees a 2.16 V source behind 1.80 kΩ. With a sampling capacitor of, say, 20 pF on the input, the settling time constant is τ = Rth * C = 36 ns, and settling to half an LSB at 12 bits needs about 9τ, roughly 320 ns. That fits a 1 MSPS converter. If I had used 100 kΩ resistors for lower current, Rth would be about 18 kΩ and the same calculation gives roughly 3.2 µs, which would not fit. Same divider ratio, very different embedded result.

Where candidates get caught

Tolerance stack-up. With 1% resistors the ratio error stays near 1%. With 5% parts, worst case R1 low and R2 high pushes Vout up by about 5%, and the opposite pairing pushes it down by about 5%. On a 2.16 V nominal that is roughly ±110 mV, enough to matter for a threshold or a ratiometric sensor.

Power and voltage ratings. A resistor dissipating 100 mW in a 0603 rated at 100 mW has no margin for temperature rise inside an enclosure. I derate to at most half the rated power for continuous duty.

Ideal sources. Real rails have source resistance, and real grounds have resistance. A 50 mΩ trace and connector path carrying 2 A drops 100 mV, which KVL will show if I include it and hide if I assume a perfect ground node.

Frequency limits. The laws above assume lumped elements. Once trace length, stray capacitance, and inductance matter, usually above tens of MHz on a fast edge, the schematic values stop describing the board. That is where I move to measurement with a scope and a proper probe ground, rather than more hand calculation.

In an interview I would state the assumptions first, run the divider and Thevenin numbers, then name the loading, tolerance, and power checks. That sequence shows I can do the theory and that I know where the theory stops on real hardware.

Curated: · Written: · Reviewed:

Difficulty: Easy
Q&A-8Explain the fundamentals of signal processing?

Reported in ASELSAN Interview Process and Stages Explained

The 90-second answer

A signal is a function of time, or sometimes space, that carries information. In embedded work I start from the physical source, a microphone, an accelerometer, a receiver I/Q stream, and ask three questions. Can I sample it without losing information, can I separate the part I want from noise and interference, and can I do that inside the CPU, memory and latency budget of the target MCU or DSP.

Sampling comes first because everything after it assumes it was done correctly. If I sample at fs, I can only represent frequencies below fs/2, the Nyquist limit. Anything above that folds back as an alias and no filter afterwards can undo it. Quantisation then sets the floor: an ideal N-bit ADC gives roughly 6.02*N + 1.76 dB SNR, so 12 bits is about 74 dB before analogue noise, which in practice dominates. After sampling, the usual chain is conditioning, filtering or spectral analysis, detection or estimation, and decimation if I only need a lower rate for control or logging.

Sampling, aliasing and a worked trace

Suppose a vibration sensor has a real tone at 5 kHz and I sample at 8 kHz. Nyquist is 4 kHz, so the tone is above it. It appears at |5 kHz - 8 kHz| = 3 kHz in the sampled data. A 3 kHz peak in the FFT would look like a genuine mechanical resonance, and I would chase the wrong fault. The fix is analogue, before the ADC: an anti-alias low-pass filter with cutoff below 4 kHz, plus margin, because real filters roll off gradually.

For spectral analysis the numbers are just as concrete. With fs = 8192 Hz and N = 1024 samples, FFT bin spacing is fs/N = 8 Hz. A 440 Hz tone lands exactly on bin 55. If the tone were 444 Hz, halfway between bins 55 and 56, energy leaks across neighbouring bins unless I apply a window such as Hann. That leakage is not a bug in the FFT, it is the consequence of analysing a finite slice of a signal that does not repeat exactly in that slice.

ChoiceWhat it buysWhat it costs on an MCU
FIR filterLinear phase, predictable group delay, always stableMore taps and multiply-accumulates for the same roll-off
IIR filterSharp cutoff with few coefficientsNonlinear phase, stability and fixed-point limit-cycle risk
Rectangular windowNo attenuation, narrowest main lobeWorst leakage, sidelobes at about -13 dB
Hann windowSidelobes about -31 dB, good for general spectraMain lobe twice as wide, worse resolution of close tones

Doing it in real time on the target

On a Cortex-M4 or similar part I would not poll the ADC in a loop. I configure DMA in double-buffer mode, fill one buffer while the CPU processes the other, and raise an interrupt only on a completed block. That bounds jitter. If the block is 256 samples at 8 kHz, I have 32 ms to finish, which is generous. If it is 256 samples at 100 kHz, I have 2.56 ms, and a 64-tap FIR at 100 kHz is 6.4 million multiply-accumulates per second, which needs to be checked against the core clock and the other tasks in the scheduler.

Fixed point is where embedded signal processing differs from a laptop prototype. A Q15 multiply in C can overflow silently if I accumulate in 16 bits. I accumulate in 32 bits and saturate or scale on output. A short FIR looks like this, checked against CMSIS-DSP conventions on a Cortex-M4:

C
/* Q15 samples and coefficients, 32-bit accumulator */
int16_t fir_q15(const int16_t *x, const int16_t *h, int16_t *y, int n, int taps)
{
    for (int i = 0; i < n; i++) {
        int32_t acc = 0;
        for (int k = 0; k < taps; k++) {
            int idx = i - k;
            if (idx < 0) continue;
            acc += (int32_t)x[idx] * h[k]; /* Q30 product */
        }
        acc >>= 15; /* back to Q15 */
        if (acc > 32767) acc = 32767;
        if (acc < -32768) acc = -32768;
        y[i] = (int16_t)acc;
    }
    return 0;
}

The failure modes I watch for are specific. Aliasing from a missing anti-alias filter. Overflow and clipping when a large transient hits a fixed-point accumulator. Spectral leakage mistaken for a second tone. Group delay from a long FIR shifting a control loop phase margin, which matters if the filtered signal feeds a motor or antenna controller. And a prototype that works in Python float32 but loses 10 dB of SNR in Q15 because I never modelled quantisation noise.

If an interviewer pushes further, I would go to the DFT definition behind the FFT, X[k] = sum x[n] * exp(-j*2*pi*k*n/N), explain why the FFT reduces O(N^2) to O(N log N), and discuss decimation and filtering in stages so the expensive filter runs at the lowest rate that still meets the specification.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-9Describe your measurement and testing approach?

Reported in ASELSAN Salaries 2026: Engineer, Technician, and Specialist ...

The 90-second answer

I clarify the measurand first: nominal value, tolerance, load, temperature and supply range, and how much uncertainty I can afford. I aim for instrument uncertainty at least four times smaller than the tolerance half band. Then I test in layers. Bare board with a current limited supply, board with firmware and real loads, and the assembled unit across temperature and supply extremes. Each run records raw values, instrument settings, board revision and firmware version. A reading without those is not reproducible.

Worked example: 3.3 V rail and 1 kHz PWM

Assume the rail must stay between 3.135 V and 3.465 V from -20 C to +70 C, and the PWM must be 1 kHz within 1 percent at 50 percent duty. I would measure them differently because the questions differ. The DMM answers the DC level. The scope answers ripple and edge behaviour.

MeasurandSetupWhat I recordPass check
Rail DC levelBench DMM, 4-wire sense at the loadVoltage at 0, 250 and 500 mA, cold, room and hotInside 3.135 to 3.465 V after uncertainty
RippleOscilloscope, ground spring, 20 MHz limitPeak to peak at the load capacitorBelow 50 mV peak to peak, hypothetical budget from the schematic
PWMScope or logic analyzer at the MCU pin100 periods, mean and worst case990 to 1010 Hz, duty 49 to 51 percent
I2C trafficLogic analyzer on SDA and SCLDecoded transactions against the design traceACK where expected, no framing errors

For the uncertainty arithmetic, take a hypothetical DMM specification of plus or minus 0.05 percent of reading plus 3 counts. On a 3.3 V reading that is about plus or minus 2 mV. I label that as an assumed specification for the calculation, and in a real lab I would substitute the calibration certificate for the exact model in use. Against a 165 mV half tolerance, 2 mV is negligible. An 8-bit scope is weaker for absolute DC: vertical accuracy of a few percent makes it suitable for ripple shape and relative change, and I quote the DMM for the level. Quoting the scope number for DC is a common way to pass a board on the bench and fail it in the enclosure.

Automation, and when I skip it

I automate the repeatable sweep because manual readings drift between operators. The script below uses one writer, which matters because creating two writers can duplicate or misalign the header.

Python
import csv, time
from instruments import psu, dmm, scope  # lab drivers, checked against Python 3.11

rows = []
for load_mA in (0, 250, 500):
    psu.set_current_limit(load_mA / 1000)
    time.sleep(0.5)
    v = dmm.read_volts_4wire()
    ripple = scope.measure_vpp(channel=1, bw_limit_mhz=20)
    rows.append({"load_mA": load_mA, "v_rail": v, "ripple_vpp": ripple,
                 "pass": 3.135 <= v <= 3.465 and ripple < 0.050})

fieldnames = list(rows[0].keys())
with open("rail_test.csv", "w", newline="") as f:
    writer = csv.DictWriter(f, fieldnames=fieldnames)
    writer.writeheader()
    writer.writerows(rows)

I do not automate everything. During first bring-up I use manual scope probing, because I need to see waveform shape, ringing and the order in which rails come up, and a script that only returns peak to peak hides that. I also stay manual for intermittent faults, where the operator has to react to a rare event, and for a one-off check where writing and validating a driver would take longer than the measurement. Automation pays off when the same sweep runs across revisions, temperatures or many boards.

Failure modes I check explicitly

Aliasing and probe loading can invent a problem. A slow timebase can make a jittery 1 kHz PWM look stable, so I confirm frequency with a logic analyzer count over a fixed gate time. A long ground lead adds ringing on a fast edge, so I use a ground spring and keep the loop short, then repeat a suspicious edge from a second probe point. Ground loops between a grounded scope and a grounded supply can inject current through the board, so I use a single bench star point and isolated supplies where the design requires them.

At system level I repeat the rail and PWM checks at temperature extremes and at low and high supply. If the rail fails hot, I hold the MCU in reset and measure again. That separates the power stage from the load. If the rail recovers in reset, the load transient is the suspect. If it still fails, the regulator and its compensation are. That split locates the fault instead of reporting a vague out of tolerance result.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-10Why do you want to work in the defense industry and why this company?

Reported in ASELSAN New Graduate Salary: What Determines the Starting Salary? | Envanter Medya

The 90-second answer

I want to work on embedded systems that have to keep working for years, on hardware where I can measure the timing myself. My final project was a motor controller on an STM32H7 with a 1 kHz current loop. That gives 1,000 microseconds per cycle. My first version printed over a blocking UART inside the interrupt and missed the deadline about once every 40 cycles. I moved logging to a DMA ring buffer, gave the current loop the highest priority, and measured worst case execution time with a GPIO toggle on a logic analyser. It then held 1 kHz at 180 microseconds worst case, with jitter under 12 microseconds. That kind of work, a hard budget and a trace to prove it, is what I want to do for a living.

Defense is where those budgets do not get negotiated away. A consumer product can retry in the cloud or ship a fix next month. A radio, a radar processor, or a turret controller has to meet latency, power, temperature, vibration, and electromagnetic limits on the first qualified build, and then stay supportable for a decade or more. I also want the discipline that comes with that. Requirements traced to tests, configuration control, and code review that assumes someone else has to maintain this after I leave. I have not worked under a formal qualification process yet, and I expect that to be a real change from university projects.

I am applying to ASELSAN because the embedded work here spans the areas I want to learn together. Software defined radios that switch modes in milliseconds, radar signal processing on DSPs and FPGAs, and unmanned systems where the flight controller and payload computer have separate timing and safety cases. I want to work on a team that owns the hardware and the firmware, not only integration of bought modules, and I want to build my career in Turkey.

The trade-offs I have weighed

Defense work is slower. A change that takes a week in a commercial product can take months through review, test, and approval here. Secrecy also limits what I can publish or put in a portfolio, and a clearance process can restrict assignments early on. I accept that because speed is not my main priority at this stage. Learning to design for determinism, long service life, and testability will teach me more than shipping quickly and rewriting later. If I wanted rapid iteration and public code, I would apply elsewhere.

What would make this the wrong choice

I would be wrong for this role if the team has no bench access for junior engineers, if the work is mostly paperwork with no ownership of a module, or if embedded means only writing application code on top of a vendor stack with no timing analysis. I would also be wrong if I cannot adapt to the documentation and review culture. I am used to moving fast on a prototype. Here I would need to write for the engineer who maintains the system in ten years, and to accept that a correct change can still be rejected if it is not traceable.

In the first six months I would aim to be useful on the bench. I can write bare metal C, set up interrupts and DMA, and measure execution time. I need to learn your coding standard, your RTOS setup, and your hardware in the loop test flow. If after a couple of years I had still not owned a subsystem through test, that would tell me I had chosen the wrong team, and I would look again. For now, the constraints of this work match the problems I enjoy solving, and ASELSAN is where I want to solve them.

Curated: · Written: · Reviewed:

Difficulty: Easy
Q&A-11Explain embedded software and control systems concepts for real-time hardware-close applications?

Reported in ASELSAN Interview Process and Stages Explained

The 90-second answer

Hardware-close means physics sets the deadline. A current loop or gimbal controller does not wait because the processor was logging. If the output arrives late, the plant has already moved. So I design backwards from the timing budget: sample period, worst-case execution time, jitter, and behaviour on a missed deadline.

Take a 1 kHz current loop on a 168 MHz Cortex-M4. The period is 1 ms, which is 168,000 cycles. I measure the path on the target with the DWT cycle counter and a GPIO toggle on a scope:

StageBudget (us)Measured (us)
ADC trigger to data ready, timer plus DMA1210
ISR entry, read buffer, scale to amps86
PID, anti-windup, PWM update2518
Total, sensor to PWM4534

Jitter over 10,000 runs was 3.1 us peak to peak. That leaves margin for a fault check and a lower priority telemetry task. The control path never blocks on a queue, heap allocation, or shared bus.

Structure

A timer triggers the ADC. DMA fills a small ring buffer without waking the CPU per sample. The highest priority ISR or RTOS task consumes one sample, runs the controller, and writes the PWM compare register. Everything else can be preempted.

C
/* C, Cortex-M4, CMSIS 5.x */
static volatile uint16_t adc_buf[16];
static volatile uint8_t head, tail;

void control_step(void) { /* every 1 ms, highest priority */
    uint16_t raw = adc_buf[tail];
    tail = (tail + 1) & 15;
    float i_meas = (float)raw * ADC_TO_AMP;
    float err = i_ref - i_meas;
    integral += err * DT;
    integral = clamp(integral, -I_MAX, I_MAX); /* anti-windup */
    float duty = KP * err + KI * integral;
    pwm_set(clamp(duty, -0.95f, 0.95f));
}

No variable length loops, no dynamic allocation, no blocking calls in that path. On an M4 with an FPU the float code is fine if the cycle count confirms it. On a smaller part I would use fixed point.

Control checks that bite on hardware

As a starting rule of thumb, I sample at 10 to 20 times the intended closed-loop bandwidth, then verify phase margin with the actual computation delay included. A 200 Hz loop at 1 kHz sampling is in that range. Aliasing is the other trap. With 1 kHz sampling and no anti-alias filter, a 700 Hz vibration folds to 300 Hz and the controller chases a false signal. The fix is an analogue low-pass before the ADC, or faster sampling with decimation.

Saturation also matters. When PWM hits its limit, an unclamped integral keeps growing and the loop overshoots on recovery. The clamp above prevents that windup.

Bare metal, RTOS, or Linux

Bare metal suits a single tight loop on a small MCU. An RTOS such as FreeRTOS or Zephyr suits several loops plus comms and logging, provided mutex use does not cause priority inversion. Linux, even with PREEMPT_RT, is rarely my choice for a 1 kHz inner loop because jitter is harder to bound, though it can work for outer loops, HMI, and networking.

I also ship a deadline-miss counter, a fault GPIO, and a watchdog that forces a safe output after repeated misses. In testing I inject a delay into the ISR and confirm the counter and safe state on the scope. That, plus cycle counts on the target rather than in simulation, is how I prove determinism.

Curated: · Written: · Reviewed:

Difficulty: Hard

Curated: · Written: · Reviewed: