Microsoft Interview Question for SDE-3s


Country: United States
Interview Type: In-Person




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

def get_unique_ip(l):
  d = {}
  for i in range(len(l)):
    n_l = map(str.strip, l[i].split('='))
    for j in range(len(n_l)):
      key = n_l[j]
      if d.has_key(key):
        d[key] +=1
      else:
         d[key] = 1
  l_unique = []
  for k, v in d.items(): 
    if v==1:
      l_unique.append(k)
  return l_unique

- Thanh Liem Tran January 18, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

again, using hashtable can handle the task.

- zr.roman January 18, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Form a hash table by adding only right side value of ipaddresses i.e IP1,IP3,IP3,IP5,IP7 would solve

- SV January 20, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

This problem can be solved by union-find data structure.
Other way is to construct a network of ip address and then for each of the connected component in the graph use just one ip address to represent them.

- MDJJ February 20, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Represent this using un-directed graph. Each IP is a node in the graph and = means there is a edge between two ips. Now take one ip from each of the connected components.

- Anonymous October 20, 2016 | 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