Quiz: Embedded / IoT
Embedded / IoT questions from real interviews as a quiz, with an explanation for every option.
Try it: 5 questions
Loading…
Sample questions
In a Unix-like filesystem, what is the fundamental difference between a hard link and a symbolic link?
- A hard link is another name for the same inode; a symbolic link stores a path to the target.
- A hard link stores the target path, while a symbolic link points to its inode.
- Both links point to an inode, but only a symbolic link can refer to a directory.
- A hard link copies the file contents, while a symbolic link shares them with the original.
How does Go generally decide whether to allocate an object on the heap?
- All local variables are automatically allocated on the heap.
- Any variable whose address is taken is allocated on the heap.
- The compiler analyzes whether the object escapes the current stack frame.
- An object is allocated on the heap only when it exceeds a certain size.
What is TCMalloc?
- A virtual-memory mechanism for mapping files into an address space
- A garbage collector that automatically frees unreachable objects
- A memory allocator optimized for multithreaded applications
- An operating-system scheduler that allocates CPU time
In Java, how does Jackson's
ObjectMappertypically create an instance during deserialization when the type is known at runtime?- It uses reflection to find a suitable constructor and create the instance
- It uses Java serialization to create the instance without calling a constructor
- It compiles and runs a
newexpression for the class at startup - It creates a proxy that replaces an instance of the original class
What is the time complexity of binary search in a sorted array of
nelements?O(n)O(n log n)O(1)O(log n)
An abstract class in C++ can have a constructor that is called when an object of a derived class is created.
- True
- False
What is a JAR file in Java?
- An executable containing machine code for a specific operating system.
- A Java source file that runs without being compiled.
- A Java Virtual Machine configuration file containing launch settings.
- A ZIP-based archive for packaging Java classes, resources, and metadata.
Why might a Java interface have a default method?
- To hide the method’s implementation from classes that implement the interface.
- To add a standard implementation without requiring existing classes to override it.
- To declare a method that can be called only through the interface name.
- To require every implementing class to provide its own implementation.
What is the time complexity of inserting an element into the middle of an
ArrayList?- Amortized O(1)
- O(log n)
- O(1)
- O(n)
What is true of a regular Go
mapwhen multiple goroutines access it concurrently?- Only concurrent writes are unsafe; reading while writing is safe.
- Concurrent reads and writes are unsafe; use synchronization or
sync.Map. - It is safe to read and write without synchronization;
mapis thread-safe. - It is enough to use
sync.RWMutexonly in write functions.