I was interviewed over phone for preliminary screening for an "Embedded Wireless Engineer" position at Qualcomm/Atheros. The position was a mid-level engineer position with [roughly] following requirements:
- BS + 6 yrs
- MS + 3 yrs
- MUST have Networking Knowledge [good understanding of TCP/IP stack]
- MUST have device drivers knowledge [I don't have any]
- Good knowledge of OS principles [one should expect that for device drivers job]
I have 4 yrs background developing software for a router company [Ericsson Inc., formerly Redback Networks].
I was interviewed by a very senior engineer, perhaps a Staff Engineer or an Architect. It lasted for about 45 mins and the interviewer was very cordial. I felt my performance was average to poor.
I am listing the questions asked and the answers I have given. I don't know if all of my responses were right.
Q: Write a macro to unset one bit in an integer.
A:
#define BIT_UNSET(x,y) (x & ~(1<<y))
Q: What does the keyword static do to a local variable? How is it different than automatic variables?
A: 'static' variables are assigned from heap instead of stack. So their life, unlike 'automatic' variables, lasts beyond the function call in which they are defined.
Q: Where is the memory assigned for static variables?
A: Heap [Kind of answered above]
Q: Who assigns a heap to the program?
A: I mumbled something like Operating System. All the CS concepts came flooding and I got confused. Is it the compiler [no way]? Is it the JVM, in case of Java [don't know]? I wasn't sure about my answer.
Q:
host A <----> interface A | router | interface B <------> host B
Host A and Host B are on 2 different subnets. Now assign network addresses, subnet masks, host ip addresses to various interfaces and hosts.
A:
I assigned 10.1.1.0/24 to A subnet, 10.1.2.0/24 to B subnet.
Host A: 10.1.1.2
Interface A: 10.1.1.1
Subnet Mask: 255.255.255.0
Host B: 10.1.2.2
Interface B: 10.1.2.1
Subnet Mask: 255.255.255.0
Q: Explain various headers when you ping from host A to host B? Explain what happens during ping.
A: ICMP inside IP inside Ethernet headers.
From Host A to Intf A.
----------------------
Source IP: 10.1.1.2, Dest IP: 10.1.2.2, Source Mac: Host A's MAC, Dest MAC: Intf A's MAC
From Intf A to Intf B
---------------------
Based on dest IP, router looks up its routing table and decides that packet has to go out on intf B.
Q: What is this table and how does this look like?
A: I said it is an ARP table [wrong] and has columns like "destination IP", "MAC addr" etc. Interviewer question me again about this table and I corrected myself that it is an IP routing table.
Q: Please continue with previous question.
A:
From Intf B to Host B
---------------------
Source IP: 10.1.1.2 Dest IP: 10.1.2.2, Source MAC: intf B MAC, Dest MAC: Host B's MAC
That is ICMP echo request message. Similarly trace back for echo response/reply message.
During my response, I explained that ICMP is embedded inside IP and
interviewer politely disagreed. I was confident but felt that I may be wrong. Later found that ICMP infact is embedded inside IP header. Protocol field in IP header is set to 1. Please see section "Message Format" in RFC 792.
After the phone interview, I wrote to the recruiter asking her to contact the engineer with my findings. The engineers' response was very quick and acknowledged that above answer is correct. I was super happy!
Q: Do you have any experience working on kernels and low level programming like device drivers?
A: Nope.
Q: Suppose a process is running and an interrupt is generated, what happens?
A:
I have an academic knowledge and am not very sure about it. [My answer was very vague and involved lot of hand waving.]
A process is running. Interrupt is generated. There is an interrupt handler registered with [someone/somewhere, not sure] to handle this interrupt. The handler then starts some activity by context switching out the running process.
Interviewer agreed, somewhat and said that given my background and experience, it is not right to expect deep OS knowledge from me.
Overall, I felt, my performance in the interview was mediocre. However, I was lucky to be called for next stage. I have an onsite interview at their office in San Jose.
Later, I'll update this blog about that interview. Labels: Atheros Phone Interview, C Coding, Computer Networking, Interview Questions, Qualcomm Phone Interview