johnsvakel
BAN USER
- 0of 0 votes
AnswerWe have an array if 0's and 1's like
- johnsvakel in India for NA
00010000010001001
Assume that all 1's are a person and if a new person comes and if we want to add to the array in such a way that the gap between individuals are maximum as possible.
if we add a new person, then the new array should be
000100100010001001| Report Duplicate | Flag | PURGE
Microsoft Staff Engineer Data Structures - 0of 0 votes
AnswersWe have a quote file with millions of entries. Design a system to read from the system and return a random quote always with O(1) time. We can read the file once and can keep in memory but should not re read the same. Also when you restart your system, it should preserve and work with O(1) complexity.
- johnsvakel in India| Report Duplicate | Flag | PURGE
Adobe Data Scientist Large Scale Computing Math & Computation Object Oriented Design - 0of 0 votes
AnswersAssume that garbage collector is not there in place or you are implementing a garbage collector for C++. Write the design and sample code for garbage collector implementation
- johnsvakel in India for Endpoint Computing
We have 3 classed and Class A, B, C. object of A uses object B and Object of B uses Object of C. How can we track the object existence and clear memory ?
Answer which I suggested : Write a tree (or Graph?)data structure (Garbage collector is a container class holds this data structure) where each node has multiple paths to reach. If any of the node is not having a path to reach then we can clean that memory. This way the garbage collection will work. Please suggest your design as well.| Report Duplicate | Flag | PURGE
VMWare Inc Member Technical Staff Algorithm - 0of 0 votes
AnswersWe have a file path as like this:
- johnsvakel in India for DS
wchar_t* pCompletePath = L"\\?\UNC\10.1.3.23\TOKEN$\0x464564564576\C\FileDrive\Testcase.doc";
Write a C++ function which will take input argument as above string and gives output as L”\\?\UNC\10.1.3.23\TOKEN$\C\FileDrive\Testcase.doc” (Removing one token after the TOKEN$)
Constraints: TOKEN$ will be there for all strings, so we can use that for search| Report Duplicate | Flag | PURGE
Symantec Senior Software Development Engineer Arrays - 0of 0 votes
AnswersThis question is windows based subsystem design to test the design skills. We are working in a complex system which involves multiple process, DLLs, windows services which will be gets installed on our system with the project. We have to design a logger system for this project where in all the multiple subsystem can use this logger system for their logging activities .
- johnsvakel in India for Azure
Design pattern used
Statically linked or Dynamically linked?
How the logger functions are designed (sample signatures)
How we can improve performance while logging (Think of ETL tracing)| Report Duplicate | Flag | PURGE
Microsoft Member Technical Staff design - 2of 2 votes
AnswersWe have an iterator class as below:
class CIterator { int Next(); //Returns the value of the next element in the iteration by advancing the iterator bool HasNext() const; //check whether any next element for the current iterator };
We need a CPeekIterator class which is having below functionalities
Class CPeekIterator { int Next (); //Same as CIterator does bool HasNext() const; //same as CIterator does int Peek(); // Returns the next element in the iteration without advancing the iterator };
Write the CPeekIterator class
- johnsvakel in United States for GFS| Report Duplicate | Flag | PURGE
Google SDE1 Algorithm - 0of 0 votes
AnswersWrite a bitmap class where we don’t have fixed size for the bitmap. Calculate the changed bits from previous instance to new instance in least iteration.
- johnsvakel in India for GFS
Real-time usage : In file systems we will scan only those parts changed from last save to new edit. At that time this bitmap should be used to scan the changed/added/removed parts.| Report Duplicate | Flag | PURGE
Google Software Engineer Algorithm
void * memcpy(void * dst, void * src, size_t count)
; {
; void * ret = dst;
;
; if (dst <= src || dst >= (src + count)) {
; /*
; * Non-Overlapping Buffers
; * copy from lower addresses to higher addresses
; */
; while (count--)
; *dst++ = *src++;
; }
; else {
; /*
; * Overlapping Buffers
; * copy from higher addresses to lower addresses
; */
; dst += count - 1;
; src += count - 1;
;
; while (count--)
; *dst-- = *src--;
; }
;
; return(ret);
; }
Repjoankelly306, Site Manager at EFI
Hi, I am Joan from Fairbanks, in USA. I have been a Food Product Manager in a Food Barn Company ...
- johnsvakel November 24, 2015