Honeywell Coding Round Questions with Solutions
Last updated 2026-11-19
Coding questions for control and embedded roles read like small pieces of an actual product: a thermostat with hysteresis, a PID update, a majority voter, a checksum, a stuck-sensor check. This page gives twelve practice problems in that style with complete runnable solutions, complexity and the common mistake.
They are practice problems in the style of topics such rounds are commonly reported to include, not real papers. For the concept side see Honeywell interview questions, and for more embedded drill see Texas Instruments coding round questions.
How to approach them
Pick the number type before writing anything, and decide what happens at the limits. Control code that overflows silently can drive an actuator the wrong way, so saturate instead of wrapping and say so.
Show a small test run in your answer. A trace of three or four samples through a filter or a state machine proves that you understood the behaviour.
Hiring status
No sourced hiring facts for Honeywell are held on this site, so no dates, openings or packages are quoted. Use the company's own careers site.
Honeywell Coding Round Questions with Solutions: questions with worked answers
1 Implement a thermostat with hysteresis: heater on below 20, off above 22.
easyKeep the previous output; turn the heater on when the temperature drops below the lower threshold, off when it rises above the upper one, and otherwise hold the state. This stops rapid on-off switching around a single threshold. For readings 21, 19, 21, 23, 21 starting off, the states are off, on, on, off, off. Time O(1) per reading. Common mistake: using one threshold, so noise toggles the heater continuously.
c#include <stdio.h> int main(void) { double t[] = {21, 19, 21, 23, 21}; int on = 0; for (int i = 0; i < 5; i++) { if (t[i] < 20.0) on = 1; else if (t[i] > 22.0) on = 0; printf("%d ", on); } puts(""); /* 0 1 1 0 0 */ return 0; }2 Vote bitwise among three redundant channels.
easyThe majority of three bits is (a & b) | (b & c) | (a & c), which works on every bit of a word in parallel. For a = 0b1100, b = 0b1010 and c = 0b1001 the result is 0b1000. If one channel is wrong, the voter returns the other two's agreement. Time O(1). Common mistake: using a comparison of whole values, which fails when each channel has a different faulty bit.
c#include <stdio.h> #include <stdint.h> uint8_t vote(uint8_t a, uint8_t b, uint8_t c) { return (a & b) | (b & c) | (a & c); } int main(void) { printf("0x%X 0x%X\n", vote(0xC, 0xA, 0x9), vote(0x55, 0x55, 0xFF)); /* 0x8 0x55 */ return 0; }3 Write one step of a discrete PID controller with output clamping and anti-windup.
mediumCompute the error, add error x dt to the integral, take the derivative as (error - previous error) / dt, form the output, clamp it, and if clamped, undo the integration that step. With Kp = 2, Ki = 1, Kd = 0, dt = 1 and a constant error of 1, the unclamped outputs are 3, 4, 5, and with a limit of 4 the outputs are 3, 4, 4. Time O(1). Common mistake: letting the integral grow while the output is saturated.
c#include <stdio.h> typedef struct { double kp, ki, kd, integ, prev, lo, hi; } Pid; double pid_step(Pid *p, double err, double dt) { p->integ += err * dt; double d = (err - p->prev) / dt; p->prev = err; double u = p->kp * err + p->ki * p->integ + p->kd * d; if (u > p->hi) { u = p->hi; p->integ -= err * dt; } else if (u < p->lo) { u = p->lo; p->integ -= err * dt; } return u; } int main(void) { Pid p = {2, 1, 0, 0, 0, -4, 4}; for (int i = 0; i < 3; i++) printf("%.0f ", pid_step(&p, 1.0, 1.0)); puts(""); /* 3 4 4 */ return 0; }4 Add two unsigned 8-bit values with saturation at 255.
easyAdd in a wider type and clamp, or use the check a > 255 - b. 200 + 100 saturates to 255, and 100 + 50 stays 150. Time O(1). The wrap-around alternative gives 44 for 200 + 100, which in a gain or brightness calculation would turn a loud value into a quiet one. Common mistake: testing the result after the addition in the same 8-bit type, where overflow has already wrapped.
c#include <stdio.h> #include <stdint.h> uint8_t sat_add(uint8_t a, uint8_t b) { return (a > 255 - b) ? 255 : (uint8_t)(a + b); } int main(void) { printf("%d %d\n", sat_add(200, 100), sat_add(100, 50)); /* 255 150 */ return 0; }5 Scale a 12-bit ADC reading to 0..100 percent of a sensor range with integer maths, rounded.
mediumCompute (code x 100 + 2047) / 4095 in 32-bit arithmetic. Code 0 gives 0, 2048 gives 50 and 4095 gives 100. If the sensor spans 0.5 V to 4.5 V on a 5 V reference, subtract the offset code first and clamp. Time O(1). Common mistake: dividing first, so every code below 4095 becomes 0 percent.
c#include <stdio.h> #include <stdint.h> uint32_t percent(uint16_t code) { return ((uint32_t)code * 100u + 2047u) / 4095u; } int main(void) { printf("%u %u %u\n", percent(0), percent(2048), percent(4095)); /* 0 50 100 */ return 0; }6 Compute the Fletcher-16 checksum of a byte string.
hardKeep two sums modulo 255: sum1 adds each byte, sum2 adds sum1 each time. The checksum is (sum2 << 8) | sum1. For "abcde" it is 0xC8F0. Fletcher detects reordered bytes that a plain sum cannot. Time O(n), space O(1). Common mistake: using modulo 256 instead of 255, which gives different values.
c#include <stdio.h> #include <stdint.h> #include <string.h> uint16_t fletcher16(const uint8_t *p, size_t n) { uint16_t s1 = 0, s2 = 0; while (n--) { s1 = (s1 + *p++) % 255; s2 = (s2 + s1) % 255; } return (uint16_t)((s2 << 8) | s1); } int main(void) { const char *s = "abcde"; printf("0x%04X\n", fletcher16((const uint8_t *)s, strlen(s))); /* 0xC8F0 */ return 0; }7 Detect a stuck sensor: report when the last N readings are identical.
mediumKeep a counter of consecutive equal readings and reset it when a reading changes. When the counter reaches N, flag the sensor. For N = 4 and readings 5, 5, 5, 6, 6, 6, 6, 7 the fault is raised at the seventh reading. Time O(n), space O(1). Common mistake: comparing each reading only with a constant limit, which misses a stuck-at value that is in range.
pythondef stuck_at(readings, n): run = 1 for i in range(1, len(readings)): run = run + 1 if readings[i] == readings[i - 1] else 1 if run >= n: return i + 1 # 1-based sample index of detection return None print(stuck_at([5, 5, 5, 6, 6, 6, 6, 7], 4)) # 78 Find the index of the peak value in a sampled signal.
easyScan once, tracking the maximum value and its index; on ties keep the first. For [2, 7, 3, 9, 4, 9] the peak is 9 at index 3. Time O(n), space O(1). Common mistake: initialising the maximum to 0, which fails for signals that are all negative; start from the first element.
pythondef peak(a): idx = 0 for i in range(1, len(a)): if a[i] > a[idx]: idx = i return idx, a[idx] print(peak([2, 7, 3, 9, 4, 9]), peak([-5, -2, -8])) # (3, 9) (1, -2)9 Predict the output: the size of an enum and a union's byte view.
easyAn enum in C has the size of an int on most compilers, so sizeof is 4. In the union, the 32-bit value 0x01020304 is stored with the least significant byte first on a little-endian machine, so b[0] is 4. Reading a different union member than the one last written is allowed in C, but gives implementation-dependent results. Output on a little-endian system: 4 4. Common mistake: assuming b[0] is the most significant byte.
c#include <stdio.h> #include <stdint.h> enum Mode { OFF, ON, FAULT }; union Word { uint32_t u; uint8_t b[4]; }; int main(void) { union Word w; w.u = 0x01020304u; printf("%zu %d\n", sizeof(enum Mode), w.b[0]); return 0; }10 Convert a decimal string to an integer without atoi, rejecting overflow.
mediumSkip an optional sign, then for each digit check that value x 10 + digit would not exceed the limit before applying it. Return an error for non-digit characters and for empty input. "12345" gives 12345, "-7" gives -7 and "99999999999" is rejected for 32-bit. Time O(n), space O(1). Common mistake: checking for overflow after it has happened, which is undefined for signed types.
c#include <stdio.h> #include <limits.h> int parse(const char *s, int *out) { int neg = 0; long long v = 0; if (*s == '-') { neg = 1; s++; } if (!*s) return 0; for (; *s; s++) { if (*s < '0' || *s > '9') return 0; v = v * 10 + (*s - '0'); if (v > (long long)INT_MAX + neg) return 0; } *out = (int)(neg ? -v : v); return 1; } int main(void) { int a = 0, b = 0; int r1 = parse("12345", &a); int r2 = parse("-7", &b); int r3 = parse("99999999999", &a); printf("%d %d %d %d %d\n", r1, a, r2, b, r3); /* 1 12345 1 -7 0 */ return 0; }11 Rotate an array to the right by k positions in place.
mediumReverse the whole array, then reverse the first k elements and the remaining n - k elements. Take k modulo n first. [1, 2, 3, 4, 5, 6, 7] rotated by 3 becomes [5, 6, 7, 1, 2, 3, 4]. Time O(n), space O(1). Common mistake: not reducing k modulo n, and copying into a second array when in place was asked.
pythondef rotate(a, k): n = len(a) k %= n def rev(i, j): while i < j: a[i], a[j] = a[j], a[i]; i += 1; j -= 1 rev(0, n - 1); rev(0, k - 1); rev(k, n - 1) return a print(rotate([1, 2, 3, 4, 5, 6, 7], 3)) # [5, 6, 7, 1, 2, 3, 4]12 Maintain a running minimum and maximum over a fixed window of the latest N samples, simply.
mediumFor small N, keep a deque of the last N values and take min and max each time, costing O(N) per sample. For larger N use monotonic deques to get O(1) amortised. With N = 3 and samples 4, 2, 7, 1 the windows give min/max pairs (2, 7) and (1, 7). Common mistake: forgetting to drop the oldest value, so the window grows without bound.
pythonfrom collections import deque def window_minmax(samples, n): w, out = deque(maxlen=n), [] for s in samples: w.append(s) if len(w) == n: out.append((min(w), max(w))) return out print(window_minmax([4, 2, 7, 1], 3)) # [(2, 7), (1, 7)]
Frequently asked questions
What coding questions suit a controls and embedded role?
Commonly reported are C output prediction, bit manipulation, filters and checksums, simple control code such as hysteresis or PID, and standard array and string problems.
Do I need to write a PID controller from memory?
Know the three terms, the discrete form and anti-windup, and be able to write the update step as above. Tuning rules are rarely coded.
Are these real Honeywell problems?
No. They are practice problems in the style of topics such rounds are commonly reported to cover. The company does not publish its papers.
How can I test my solutions?
Run each program on your PC with a few inputs, including boundary and error cases, and compare with the commented results.
Related guides
- Honeywell Interview Questions and Answers for India Engineering Roles
- Bosch Coding Round Questions with Solutions
- NXP Coding Round Questions with Solutions
- Texas Instruments Coding Round Questions with Solutions
- Bit manipulation interview questions with worked solutions
- C Language Interview Questions and Answers
More in Company Interview Questions
- Honeywell Interview Questions and Answers for India Engineering Roles
- HSBC coding round questions with solutions
- HSBC interview questions with answers (technology graduates)
- IBM coding round questions
- IBM interview questions and answers
- Info Edge (Naukri) Interview Questions with Answers
- Info Edge Coding Round Questions
- Infosys Coding Round Questions with Solutions
- Infosys Interview Questions for Freshers
- Intel Coding Round Questions with Solutions
- Intel Interview Questions and Answers for India Software Roles
- Intuit Coding Round Questions with Solutions in Python and Java