Assembly Interview Questions
- -6of 6 votes
Answers
- budfox April 25, 2019 in United States;*************************************************************************** ; Imagine you have received a binary to reverse and you stumbled upon this ; function. What can you tell me about this function? Does anything stand ; out that makes you want to take a closer look? ; ; At a high level, explain what is going on. Then we will go into this code ; in more detail ;***************************************************************************
| Report Duplicate | Flag | PURGE
Facebook Virus Researcher Assembly - 0of 0 votes
AnswersNone actually understands how garbage collection works, albeit people ask this in the interviews. Nonetheless, we are going to ask you something very similar. Here is the problem.
Take an array of bytes, perhaps 1MB in size.
Implement these two operations:ptr_structure = alloc ( amount_of_storage ) freeed = free ( ptr_structure )
Now, here is your problem. alloc must allocate contiguous storage. If it is not possible, you need to compact ( defragment ) memory. So, you need to implicitly write a :
defragment() // defragments memory
Worse is coming. Even imagining you have written a stop the world defragmenter, after you reallocate, how the ptr_structures would actually work?
- NoOne October 14, 2016 in India
Solve this whole problem.
Time allocated was 1 hour. Face to face, panel with 2 interviewers.| Report Duplicate | Flag | PURGE
SDET Algorithm Assembly Computer Architecture & Low Level Computer Science Data Structures - 0of 0 votes
AnswersImagine you are given the instructions :
GOTO <LABEL> WHEN <CONDITION> NOP ; no operation
Implement the following using it:
- NoOne October 14, 2016 in India
1. If condition.
2. If else condition.
3. If else if else condition.
4. While loop
5. for loop.| Report Duplicate | Flag | PURGE
SDET Assembly - 0of 0 votes
AnswersYou given and instruction called DBNZ ( Decrement and Branch if Not Zero)
- srcnaks February 02, 2015 in -
which can be used as "DBNZ X L10".
This instruction decrement X by one and checks X, if X is not zero than branches line 10,
if it is zero than continue to next instructions.
By using DBNZ instruction implement CLEAR instruction.
CLEAR can be used as "CLEAR X" which means set X to zero.
By using DBNZ and CLEAR instructions implement NEGATE instruction
NEGATE can be used as "NEGATE X Y" which means set Y to negative of X ( Y = -X)| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm Assembly - 0of 2 votes
AnswersDifference between a crash and exception.
- avinash September 20, 2014 in India for GTSC
Difference between macros and inline functions.
Mfc: message maps and virtual functions.
Different calling convention.
Late n early binding...
Garbage collector algorithm. When gc will fail to clean the memory.
How to know heap size, crash dump analysis, What is a stack n how to know stack memory size.
Commands in windbg.
Questions on Critical section, mutex, semaphores. Can we use mutex in single process and how?
Working of MSIL and JIT COMPILER.
Can a C# code, use c++ code and call kernel functions like createfile.
Areas: dot net, oops, operating systems, thread synchronization.
Difference in execution steps of c++ and c# code| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Assembly C++ Data Structures Debugging Object Oriented Design Operating System Threads - 0of 0 votes
AnswersWhat is the output of following program:
- godzilla January 04, 2014 in United States for unknown1 #include <stdio.h> 2 3 int r = 1; 4 int numbers[5] = {1, 2, 3, 1, 5 }; 5 6 int main(int argc, char** argv) 7 { 8 #if !defined(_MSC_VER) 9 asm("leal numbers, %esi"); 10 asm("movl $0, %ecx"); 11 asm("movl r, %eax"); 12 asm("label1:"); 13 asm("movl (%esi,%ecx,0x4), %ebx"); 14 asm("imul %ebx, %eax"); 15 asm("addl $1, %ecx"); 16 asm("cmpl $5, %ecx"); 17 asm("jl label1"); 18 asm("mov %eax, r"); 19 #else 20 __asm 21 { 22 LEA ESI, numbers 23 MOV ECX, 0 24 MOV EAX, r 25 label1: 26 MOV EBX, [ESI + ECX * 4] 27 IMUL EAX, EBX 28 ADD ECX, 1 29 CMP ECX, 5 30 JL label1 31 MOV r, EAX 32 } 33 #endif 34 printf("Result= %d\n", r); 35 return 0; 36 }
| Report Duplicate | Flag | PURGE
CareerCup Software Engineer / Developer Assembly - 0of 0 votes
AnswersHow would you create a stack backtrace once an exception has occurred on an x86 platform?
- ootah November 14, 2013 in United States for Kernel
EDIT: Sorry, I should have mentioned that you don't have GDB or any debugging tools. You're supposed to implement everything from scratch in assembly.| Report Duplicate | Flag | PURGE
Apple Software Engineer / Developer Assembly - 0of 0 votes
AnswerImplement a synchronized queue for multiple threads, avoiding race conditions and deadlocks
- ootah November 14, 2013 in United States for Kernel
EDIT: There was a tougher follow up btw: If you use any synchronization mechanisms, how might they be implemented at the assembly level?| Report Duplicate | Flag | PURGE
Apple Software Engineer / Developer Assembly C# - 0of 0 votes
AnswersA car is to be parked in 5x5 matrix parking lane.First of all we have to search the free space in the given matrix and then we have to allocate the memory to the car .Afterwards we have to remove the car from the parking lane.(In C)
- coder June 28, 2013 in India| Report Duplicate | Flag | PURGE
Cisco Systems Software Engineer / Developer Assembly - 0of 0 votes
AnswersDesign a Tic Tac Toe Game. Classes Segregation and Code Flow.
- hprem991 March 18, 2013 in India| Report Duplicate | Flag | PURGE
StartUp Amazon Software Architect Software Engineer / Developer Algorithm Android Application / UI Design Arrays Assembly Automata Behavioral Bit Manipulation Brain Teasers C C++ Object Oriented Design - 0of 2 votes
AnswersA log file which has user details(user ID,timestamp) and pages visited in a particular day by that user.The next day -the same kind of log file gets generated.How do you find the probability of users who logged in consecutive days out of the second day - logged in users? The question is simple,but they look for the efficient data structure and time complexity.
- sriramMS December 20, 2012 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm Application / UI Design Arrays Assembly Automata Behavioral Bit Manipulation Brain Teasers C C# C++ Cache Coding Data Mining Data Structures - 0of 0 votes
AnswersHow do you get the current code pointer (eip) into the eax register?
- gdrocell June 01, 2012 in United States for SIGOV| Report Duplicate | Flag | PURGE
Raytheon Reverse Engineering and System Developer Assembly