Amazon Interview Question for SDE-2s


Country: India
Interview Type: In-Person




Comment hidden because of low score. Click to expand.
2
of 2 vote

I believe, we can implement observer pattern between all application servers serving as event creator and a listener working as a observer which is subscribed to this app servers. The moment desired condition is encountered in any app server, it calls its update function to pass on this information to the listener (could be a messaging queue), and then listener pass on the this message to a parser module which will parse the message and accordingly will send the message to the concrete implementation of logging interface (Error, Warning, DiskFull... etc)

This way the system remains open to be scaled in future.
1. New app servers can be added in future. All it has to do is to implement the subject Interface and implement the functionality to register the observer.
2. Observer (listener will have to subcribe to the new subject)
3. In case new pattern comes (Out of Memory, Application Error...) in future, they will have their own concrete implementation of logging interface.
In total allowing all major actors to be independent to each other.

- Chandresh September 19, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Hi,

Is this hadoop related interview question because we can do this with Flume or Kafka, spooling data into HDFS and write a custom mapreduce on top of it. whats the best way to answer such questions? Thanks

- Karthik September 17, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I believe, we can implement observer pattern between all application servers serving as event creator and a listener working as a observer which is subscribed to this app servers. The moment desired condition is encountered in any app server, it calls its update function to pass on this information to the listener (could be a messaging queue), and then listener pass on the this message to a parser module which will parse the message and accordingly will send the message to the concrete implementation of logging interface (Error, Warning, DiskFull... etc)

This way the system remains open to be scaled in future.
1. New app servers can be added in future. All it has to do is to implement the subject Interface and implement the functionality to register the observer.
2. Observer (listener will have to subcribe to the new subject)
3. In case new pattern comes (Out of Memory, Application Error...) in future, they will have their own concrete implementation of logging interface.
In total allowing all major actors to be independent to each other.

- mail2chandreshv September 19, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

1) What kind of alarms will be raised? (emails, pageouts) -
We can have an alarming interface on the server side and each type of alarm (email, pageout) will implement it and using a factory class we can get appropriate instance of alarm system.

2) Does data need to be logged for future reference and how long?

3) How often patterns change ?
If they change frequently, we can implement observer pattern where the logging process running on each app server will register itself as observer. Every new pattern added on the logging system will be distributed to all app servers.
4) For notifying logging system about the events, we can either use simple messaging service.


Logging System
1) Pattern database and Pattern publisher.
2) Event Collector (messaging service)
3) Alarm Interface and implementing classes.
4) Event database
5) GUI to add new patterns and view event history.

App Server
1) Daemon process monitoring the patterns distributed by logging system.

- turukmakto1990 December 14, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Hi,

How do you set alarms to the system?

- ravi January 16, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

We can use queues corresponding to each of the application servers. One process on the other end would remove messages from queues in round robin manner and check the presence of specific keywords necessary to raise an exception.

- ravi February 20, 2017 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More