└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # embedded-interview-questions 2 | 3 | 1) __Which endianness is: A) x86 families. B) ARM families. C) internet protocols. D) other processors? One of these is kind of a trick question.__ 4 | 5 | A) x86 CPUs, especially Intel, are little endian. 6 | 7 | B) Most ARM processors are little endian, or bi-endian. 8 | 9 | C) Networking protocols mainly are big endians. 10 | 11 | 12 | 2) __Explain how interrupts work. What are some things that you should never do in an interrupt function?__ 13 | 14 | Interrupts are signals, or events that temporary suspend the main software code, and rather execute an external task. Interrupts are usually hardware-driven, though there are software interrupts, implemented in the instruction set. 15 | 16 | Interrupts' big no nos: 17 | - Blocking function calls 18 | - Non-reeentrant function calls 19 | - Long function calls 20 | - Dynamic memory allocation (even more so in embedded) 21 | 22 | 23 | 3) __Explain when you should use "volatile" in C.__ 24 | `volatile` indicates the variable may be subject to change at any time. By using `volatile`, you tell the compiler to not optimize it. 25 | 26 | Therefore it is best to use `volatile` for memory-mapped, or hardware interfacing variables, or variable set in one thread of an OS to signal another. 27 | 28 | 4) __Explain UART, SPI, I2C buses. Describe some of the signals in each. At a high-level describe each. Have you ever used any? Where? How? What type of test equipment would you want to use to debug these types of buses? Have you ever used test equipment to do it? Which?__ 29 | 30 | 31 | 32 | 5) __Explain how DMA works. What are some of the issues that you need to worry about when using DMA?__ 33 | 34 | 6) __Where does the interrupt table reside in the memory map for various processor families?__ 35 | 36 | 7) __In which direction does the stack grow in various processor families?__ 37 | 38 | 8) __Implement a Count Leading Zero (CLZ) bit algorithm, but don't use the assembler instruction. What optimizations to make it faster? What are some uses of CLZ?__ 39 | 40 | 9) __What is RISC-V? What is it's claimed pros or cons?__ 41 | 42 | 10) __List some ARM cores. For embedded use, which cores were most commonly used in the past? now?__ 43 | 44 | 11) __Explain processor pipelines, and the pro/cons of shorter or longer pipelines.__ 45 | 46 | 12) __Explain fixed-point math. How do you convert a number into a fixed-point, and back again? Have you ever written any C functions or algorithms that used fixed-point math? Why did you?__ 47 | 48 | 13) __What is a pull-up or pull-down resistor? When might you need to use them?__ 49 | 50 | 14) __What is "zero copy" or "zero buffer" concept?__ 51 | 52 | 15) __How do you determine if a memory address is aligned on a 4 byte boundary in C?__ 53 | 54 | 16) __What hardware debugging protocols are used to communicate with ARM microcontrollers?__ 55 | 56 | JTAG and SWD. 57 | 58 | 17) __What processor architecture was the original Arduino based on?__ 59 | 60 | The ATmega168 on the Arduino Duemilanove (?) 61 | 62 | 18) __What are the basic concepts of what happens before main() is called in C?__ 63 | 64 | 19) __What are the basic concepts of how printf() works? List and describe some of the special format characters? Show some simple C coding examples.__ 65 | 66 | 20) __Describe each of the following? SRAM, Pseudo-SRAM, DRAM, ROM, PROM, EPROM, EEPROM, MRAM, FRAM, ...__ 67 | 68 | 21) __Show how to declare a pointer to constant data in C. Show how to declare a function pointer in C.__ 69 | 70 | ```c 71 | const uint8_t foo = 20; 72 | uint8_t * bar; 73 | bar = &foo; 74 | ``` 75 | 76 | ```c 77 | void (*foo) (int); 78 | ``` 79 | 80 | 22) __How do you multiply without using multiply or divide instructions for a multiplier constant of 15, 30, 60, 260?__ 81 | 82 | 23) __When do you use memmove() instead of memcpy() in C? Describe why.__ 83 | 84 | 24) __Why is strlen() sometimes not considered "safe" in C? How to make it safer? What is the newer safer function name?__ 85 | 86 | 25) __When is the best time to malloc() large blocks of memory in embedded processors? Describe alternate approach if malloc() isn't available or desired to not use it, and describe some things you will need to do to ensure it safely works.__ 87 | 88 | 26) __Describe symbols on a schematic? What is a printed circuit board?__ 89 | 90 | 27) __Do you know how to use a logic probe? multimeter? oscilloscope? logic analyzer? function generator? spectrum analyzer? other test equipment? Describe when you might want to use each of these. Have you hooked up and used any of these?__ 91 | 92 | 28) __What processors or microcontrollers are considered 4-bit? 8-bit? 16-bit? 24-bit? 32-bit? Which have you used in each size group? Which is your favorite or hate?__ 93 | 94 | 29) __What is ohm's law?__ 95 | 96 | `V = I * R` 97 | 98 | 30) __What is Nyquist frequency (rate)? When is this important?__ 99 | - Nyquist frequency is the highest possible frequency that can be accurately sampled based on the sampling rate. Any data sampled past the Nyquist frequency will come with aliasing, a type of digital distortion. 100 | 101 | 31) __What is "wait state"?__ 102 | 103 | 32) __What are some common logic voltages?__ 104 | 105 | 3.3v is most commonly used nowadays, followed by 5v and 1.8v. 106 | 107 | 33) __What are some common logic famlies?__ 108 | 109 | 34) __What is a CPLD? an FPGA? Describe why they might be used in an embedded system?__ 110 | 111 | 35) __List some types of connectors found on test equipment.__ 112 | 113 | 36) __What is AC? What is DC? Describe the voltage in the wall outlet? Describe the voltage in USB 1.x and 2.x cables?__ 114 | 115 | - Alternative Current and Direct Current. Alternative Current alternates between VCC and GND at a fixed frequency, usually 60Hz. Direct current does not. 116 | 117 | - In a wall outlet, the AC voltage is 220v (in European and Asian countries), and 110V (in US and Canada). 118 | 119 | - In USB 1.x and 2.x cables, DC voltage is 5v. 120 | 121 | 37) __What is RS232? RS432? RS485? MIDI? What do these have in common?__ 122 | 123 | - They are all serial communication protocols. 124 | - RS232 is full-duplex, RS432 is half-duplex. RS485 is differential transmission mode, while RS232 is single-ended transmission mode. MIDI is very similar to RS232, however MIDI has a baud rate of 31250 baud, while RS232 has many standard baud rates. 125 | 126 | 38) __What is ESD? Describe the purpose of "pink" ESD bags? black or silvery ESD bag? How do you properly use a ground strap? When should you use a ground strap? How critical is it to use ESD protections? How do you safely move ESD-sensitive boards between different parts of a building?__ 127 | 128 | 39) __What is "Lockout-Tagout"?__ 129 | 130 | - Lockout-Tagout is a safety protocol used to prevent tampering with machinery when not in use. The machinery in question has to be locked and tagged (with the name of the person who holds the key) when not in use. 131 | 132 | 40) __What is ISO9001? What is a simple summary of it's concepts?__ 133 | 134 | 41) __What is A/D? D/A? OpAmp? Comparator Other Components Here? Describe each. What/when might each be used?__ 135 | 136 | 42) __What host O/S have you used? List experience from most to least used.__ 137 | 138 | - Linux (Fedora, Ubuntu, Debian, Arch) 139 | 140 | - Windows 141 | 142 | - MacOS 143 | 144 | 43) __What embedded RTOS have you used? Have you ever written your own from scratch?__ 145 | 146 | 147 | 44) __Have you ever implemented from scratch any functions from the C Standard Library (that ships with most compilers)? Created your own because functions in C library didn't support something you needed?__ 148 | Most functions, `atoi`, `itoa`, and other misc. functions in K&R's book. 149 | 150 | 45) __Have you ever used any encryption algorithms? Did you write your own from scratch or use a library (which one)? Describe which type of algorithms you used and in what situations you used them?__ 151 | 152 | 45) __What is a CRC algorithm? Why would you use it? What are some CRC algorithms? What issues do you need to worry about when using CRC algorithms that might cause problems? Have you ever written a CRC algorithm from scratch?__ 153 | 154 | 46) __Do you know how to solder? Have you ever soldered surface mount devices?__ 155 | 156 | 47) __How do you permanently archive source code? project? what should be archived? what should be documented? have you ever written any procedures of how to archive or build a project? How about describing how to install software tools and configuring them from scratch on a brand new computer that was pulled out of a box?__ 157 | 158 | 48) __What issues are a concern for algorithms that read/write data to DRAM instead of SRAM?__ 159 | 160 | 49) __What is the "escape sequence" for "Hayes Command Set"? Where was this used in the past? Where is it used today?__ 161 | 162 | 50) __What is the "escape character" for "Epson ESC/P"? Where is this used?__ 163 | 164 | 51) __After powerup, have you ever initialized a character display using C code? From scratch or library calls?__ 165 | 166 | 52) __Have you ever written a RAM test from scratch? What are some issues you need to test?__ 167 | 168 | 53) __Have you ever written code to initialize (configure) low-power self-refreshing DRAM memory after power up (independent of BIOS or other code that did it for the system)? It's likely that most people have never done this.__ 169 | 170 | 54) __Write code in C to "round up" any number to the next "power of 2", unless the number is already a power of 2. For example, 5 rounds up to 8, 42 rounds up to 64, 128 rounds to 128. When is this algorithm useful?__ 171 | 172 | 55) __What are two of the hardware protocols used to communicate with SD cards? Which will most likely work with more microcontrollers?__ 173 | 174 | 56) __What issues concerns software when you WRITE a value to EEPROM memory? FLASH memory?__ 175 | 176 | 57) __What is NOR-Flash and NAND-Flash memory? Are there any unique software concerns for either?__ 177 | 178 | 58) __Conceptually, what do you need to do after reconfiguring a digital PLL? What if the digital PLL sources the clock for your microcontroller (and other concerns)?__ 179 | 180 | 59) __What topics or categories of jokes shouldn't you discuss, tell, forward at work?__ 181 | - Jokes considered inappropriate or of discriminative nature. 182 | 183 | 60) __Have you ever used any power tools for woodworking or metalworking?__ 184 | 185 | 61) __What is a common expression said when cutting anything to a specific length? (old expression for woodworking)__ 186 | 187 | Measure twice cut once. 188 | 189 | 62) __Have you ever 3D printed anything? Have you ever created a 3D model for anything? List one or more 3D file extensions.__ 190 | 191 | - `.stl`, `.obj` 192 | 193 | 63) __Do you know how to wire an AC wall outlet or ceiling light? Have you ever done either?__ 194 | 195 | 64) __Have you ever installed a new hard drive / RAM / CPU in a desktop computer?__ 196 | 197 | 198 | 65) __Have you ever installed Windows or Linux from scratch on a computer that has a brand-new hard drive?__ 199 | 200 | 201 | 66) __Have you ever "burned" a CD-R or DVD-R disc? Have you ever created an ISO image of a CD or DVD or USB drive or hard drive?__ 202 | 203 | 67) __Have you ever read the contents of a serial-EEPROM chip from a dead system (though EEPROM chip is ok)?__ 204 | 205 | 206 | 68) __Have you ever written data to a serial-EEPROM chip before it is soldered down to a PCB?__ 207 | 208 | 209 | 69) __How do you erase an "old school" EPROM chip? (has a glass window on top of the chip)__ 210 | 211 | - Erasing an EPROM is done by shining ultraviolet ray on the window - an alternative is to leave it out under direct sunlight for a bit. 212 | 213 | 70) __Describe any infrared protocols, either for data or remote controlling a TV.__ 214 | 215 | 71) __What is the most common protocol is used to communicate with a "smart card"? Have you ever written any software to communicate with a "smart card" in an embedded product?__ 216 | 217 | 72) __What is I2S? Where is it used? Why might you want to use I2S in an embedded system? Have you ever used it?__ 218 | 219 | 73) __What is CAN, LIN, FlexRay? Where are they used? Have you ever used any?__ 220 | 221 | 74) __What is ARINC 429? Where is it commonly used? Have you ever used it?__ 222 | 223 | 75) __What in-circuit debuggers or programmers have you used? Which one do you like or hate?__ 224 | 225 | 226 | 76) __Do you know any assembler code? For which processor? What assembler code is your favorite or hate? Have you ever written an assembler from scratch?__ 227 | 228 | 77) __What is "duff's device"? Have you ever used it?__ 229 | 230 | 78) __What is dual-port RAM? Why would it be useful in some embedded systems? What concerns do you need to worry about when using it? Have you ever used it? How?__ 231 | 232 | 79) __Have you ever soldered any electronic kits? Have you ever designed your own PCB(s)? Describe. What is a Gerber file?__ 233 | 234 | - A Gerber file is usually a collection of files with information on how a Printed Circuit Board should be manufactured, including routes, drill holes, silkscreen.. 235 | 236 | 80) __If you create a circular buffer, what size of buffer might optimized code be slightly faster to execute? why?__ 237 | 238 | 81) __Describe how to multiply two 256-bit numbers using any 32-bit processor without FPU or special instructions. Two or more methods?__ 239 | --------------------------------------------------------------------------------