Amazon Interview Question
Software Development ManagersCountry: India
Interview Type: In-Person
Thanks, i guess these pretty much cover all peripheral aspects to be considered. But what could be the core approach to perform this ? . As in, if user wants to change an 'IP', how do we design the system such that , it then changes the IP config of all underlying 'TYPES' of routers (using their native approaches of xml, api etc) ?
Thanks once again
I guess we should abstract by creating the interface for the n routers, with the common interface routertype.taskExecuter(operation, data) where operation will be one of the J jobs.
And let all the routers implement there own methods for the operation(DLINK Global API and netgear data in XML).
taskExecuter( "IPCHNAGE", "1.2.3.4")
Create a parent class Router. This will have all the basic attributes that defines the router details like router type, ip address, MAC Address, Model etc. Create an interface RouterOperation, with all the possible operations that the user can perform on a router like, refresh, resetPassword, resetIPAddress, updateSoftware, createUser etc. The Router class will implement the RouterOperation interface and will provide default implementation. Now each specific type Router will extend the Router class an provides the router specific implementation of the job.
yea, this is really a white board task, be creative,
- Chris November 16, 2016I would approach it like this:
- think about usecases, what does the user, who is the user, what is the result expected, what does the system do, what should happen if something fails, try to understand the expectations to the system.
- entities: router, job, job-result, user, protocol, job-status, job-queue...
- deployable components / existing infrastructure: job scheduler / executer, front-end (e.g. web server, console programm to talk to executer), router directory (like LDAP), user directory with rights,
- protocols: front-end - executer (some sort of RPC, how to do it, if there are multiple executers for scaling, fail over, redundancy, ...) executer among each other, e.g. to identify what's the next task for each executer, data-storage, maybe MySQL and some db midleware, user directory may be LDAP, router directory may be LDAP, etc...
- interesting topics:
- how many different type of jobs? If there are a lot, and if they are changing often, it might be a good idea to create some abstract way to create the API-calls or XML data based on a simple meta language or a set of helper functions etc... discuss a few approaches here, it's advantages and disadvantes
- if a job needs to be executed on all routhers what are the time constraints and what should be done if it fails on a few routhers, should then everything be rolled back, retried, protocollled, a ticket raised, a person paged, etc?
- I fmultiple executions happen simulatenously, maybe the execution should be done from multiple machines to be faster, can we loose some how locality information, so the machine and router are close to each other, would it matter, maybe not, but thinking of it loud may be good...
- need for authentication and autorization of the user scheduling a job, but how about the execution to the routers? How is this done?
etc....