AnonymousN
BAN USER- 2of 2 votes
AnswersI have a photo storage service. The actual photos are present in some storage and the index of these photos is present at some other place. The index is huge, say trillions of photos. Design the class for index node of each photo (with attributes like name*, date*, size*, accesscontrol, camera details, shot details, etc) such that 1. It is serializable. 2. For faster processing, I am interested in first 3 attributes. When deserializing the bytes of object, parse these 3 attributes i.e. instead of deserializing whole class, deserialize only part of the class (members marked by*), other members of class should be deserialized on demand with another call.
- AnonymousN in United States
How will you test the performance of your serialization/ deserialization?| Report Duplicate | Flag | PURGE
Amazon SDE-2 Java - 0of 0 votes
AnswersThis was a design question, discuss data structures/ complexities, etc.
- AnonymousN in United States
There is a huge HashMap (Key-Value store). This is present in storage, dont worry about the Storage.
1. Build its index. Distributed system for indexing. Different cases: Key is a String/ Double/ complex structure, etc. How will you replicate this index structure - whole index is replicated/ parts of index are replicated.
2. How will you synchronize access (read/ write) if there are multiple replicas of the index partition. What if the actual Storage partition also has replicas.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Distributed Computing - 1of 1 vote
AnswersGiven a log file:
- AnonymousN in United States
some garbage...from:123.54,78.21...more garbage..to:56,82,124.54...more
some more garbage...from:11.54,45.84...garbage..to:115.87,98.65
...
Write a program or shell script to return pairs of (from, to) coordinates.
Assumption: these coordinates will always appear in sequence: from ... to... from ... to...
But these from - to pair may or may not be on same line.| Report Duplicate | Flag | PURGE
Amazon SDE-2 shell scripting - 1of 1 vote
AnswersGiven a 2d array (say n*m), visit all elements faster than linear time (i.e. faster than m*n). (Assume not too big array. i.e. fits in memory etc.etc)
- AnonymousN in United States
I gave a solution: 4 pointers that start from 4 ends ((0,0), (0,n), (m,0), (m,n)) and walk the edges. Once done next inner rows and columns (i.e. (1,1), (1,n-1), (m-1,1), (m-1,n-1)). Easier to implement with just the indices and we can say 4 times faster. Another solution I gave was to use multithreading. He said no multithreading. But the interviewer was not convinced and he gave me a hint to use recursion (?). Couldn't get the solution that he wanted.| Report Duplicate | Flag | PURGE
Microsoft Site Reliability Engineer
Focus was to write a shell command/ script. I gave simple one:
$ IFS=$'\n'; for i in `cat log`; do from=`echo "$i" | grep -o 'from:[^ ]*'`; to=`echo "$i" | grep -o 'to:[^ ]*' $i`; echo "$from $to"; done
He said it might work but it doesn't any corrections here?
Reptracyremly, Anesthesiologist at Ness
I am Tracy, working as an Anesthesiologist handles surgical patients and their pain relief during procedures.Rather than my job ...
Repgeraldgloria02, Android test engineer at Achieve Internet
I am a personal trainer. I design programs and provide nutritional advice and coaching. I wanted to share my knowledge ...
Repruchikadolph, HR Executive at Accenture
I choose the talking books to match the book library clerk blind library patrons . I compare a list of borrowers ...
RepDedicated administrative assistant with years of experience managing large and small offices. I have worked with numerous branches,including payroll ...
Repellaiyer15, Content Writer at Precious Moments
Committed to producing exceptional and creative types of content, including articles, internet content, advertisements, commercials, brochures, and publications. Experienced in ...
Repethelsizer, SDET at ADP
I am Ethel , creative news writer with 5+ years of experience. Have great storytelling skills , wrote and delivered high quality ...
Repkiaspenill, HTML Experienced at Computer Associates
I am Kia, a skilled cook with 2+ years of experience. Extensive knowledge of the food industry and its relation ...
Repriyanahobett, Sales Development Representative at Capgemini
I am Riyana , driven market researcher with over years of experience at Awthentikz , analyzing information in order to construct profiles ...
My mistake... the second $i should not be there in grep for 'to:' part. It works.
- AnonymousN December 16, 2015Correct one:
$ IFS=$'\n'; for i in `cat log`; do from=`echo "$i" | grep -o 'from:[^ ]*'`; to=`echo "$i" | grep -o 'to:[^ ]*'`; echo "$from $to"; done