Honeywell interview prep
5 practice questions on the topics candidates reported from Honeywell interviews, with answers. The questions are ours; each one links to the interview report that names its topic.
Practise them as a timed round15 roles open at Honeywell Technologies
DSA 2
-
Two pointers start at the head of a singly linked list. Each step, one moves one node and the other moves two. When the fast one reaches the end, where is the slow one?
- At the head
- At the middle node
- At the last node
- At the second node
Show the answer
B. At the middle node
The fast pointer covers twice the distance, so the slow one has gone half way. This finds the middle in one traversal; for an even length it lands on the first or second middle depending on the exact loop condition.
This topic is named in a candidate’s interview report: Software engineer on-campus interview, 2022, on GeeksforGeeks.
-
What is the running time of Dijkstra's algorithm with a binary-heap priority queue, on a graph with V vertices and E edges?
- O(V + E)
- O(V^2 log E)
- O((V + E) log V)
- O(E log E log V)
Show the answer
C. O((V + E) log V)
Every vertex is taken out of the heap once and every edge can cause one decrease-key or push, each O(log V). A plain array gives O(V^2) instead, which is better only for dense graphs.
This topic is named in a candidate’s interview report: Intern on-campus interview, 2024, on GeeksforGeeks.
C and C++ 3
-
In a C program, a function declares static int calls = 0; inside it. Where is calls stored?
- On the stack, created fresh on every call
- On the heap, freed when the function returns
- With the globals, in the data area (BSS here, since it starts at zero); it keeps its value between calls
- Only in a CPU register
Show the answer
C. With the globals, in the data area (BSS here, since it starts at zero); it keeps its value between calls
Static and global variables live for the whole run, in the data segment, or BSS when they start at zero. Ordinary local variables sit on the stack and vanish when the function returns. Memory from malloc or new is on the heap until it is freed.
This topic is named in a candidate’s interview report: Software engineer on-campus interview, 2022, on GeeksforGeeks.
-
In C, what does static do to a global variable declared at file scope?
- Makes it a constant
- Limits its visibility to that source file (internal linkage); it still lives for the whole program
- Moves it onto the stack
- Makes it visible to every file without extern
Show the answer
B. Limits its visibility to that source file (internal linkage); it still lives for the whole program
Every global already has static storage duration. Adding static changes only linkage, so another file cannot refer to it with extern. Inside a function, static instead keeps a local's value between calls.
This topic is named in a candidate’s interview report: Software engineer on-campus interview, 2022, on GeeksforGeeks.
-
With a 4-byte, two's complement int, what is the range of int?
- -2147483648 to 2147483647
- -2147483647 to 2147483647
- 0 to 4294967295
- -32768 to 32767
Show the answer
A. -2147483648 to 2147483647
32 bits give 2^32 values. Two's complement splits them as -2^31 to 2^31 - 1, so there is one more negative value than positive. 0 to 4294967295 is unsigned int, and -32768 to 32767 is a 2-byte short.
This topic is named in a candidate’s interview report: Software engineer on-campus interview, 2022, on GeeksforGeeks.