EzDevInfo.com

networking interview questions

Top networking frequently asked interview questions

Simulating Slow Internet Connection

I know this is kind of an odd question. Since I usually develop applications based on the "assumption" that all users have a slow internet connection. But, does anybody think that there is a way to programmatically simulate a slow internet connection, so I can "see" how an application performs under various "connection speeds"?

I'm not worried about which language is used. And I'm not looking for code samples or anything, just interested in the logic behind it.


Source: (StackOverflow)

What is SaaS, PaaS and IaaS? With examples [closed]

There are various cloud services available today such as Amazon's EC2 and AWS, Apache Hadoop, Microsoft Azure and many others... So, to which of the above category do they belong and why?
And which type of service is more popular today and why?


Source: (StackOverflow)

Advertisements

close vs shutdown socket?

In C, I understood that if we close a socket, it means the socket will be destroyed and can be re-used later.

How about shutdown? The description said it closes half of a duplex connection to that socket. But will that socket be destroyed like close system call?


Source: (StackOverflow)

Network usage top/htop on Linux [closed]

Is there a htop/top on Linux where I get to sort processes by network usage?


Source: (StackOverflow)

Detect network connection type on Android

How do you detect the network connection type on Android?

Is it through ConnectivityManager.getActiveNetworkInfo().getType(), and is the answer limited to Wifi and mobile?


Source: (StackOverflow)

Can I use the /etc/hosts file to configure an alias [closed]

The /etc/hosts file can be used to override dns definitions, i.e. to point an hostname to a different ip.

I want to use /etc/hosts to make an alias record, i.e. to make my computer think that www.mysite.com does not point to a "hard coded" ip but instead is synonym of mychangingip.myip.com.

Can it be done?


Source: (StackOverflow)

What do pty and tty mean?

I noticed there are many mentions of pty and tty in some opensource projects, could someone can tell me what do they mean and what is the difference between them? Thanks!


Source: (StackOverflow)

How to validate IP address in Python? [duplicate]

This question already has an answer here:

What's the best way to validate that an IP entered by the user is valid? It comes in as a string.


Source: (StackOverflow)

How Do I Access The Host Machine From The Guest Machine? [closed]

I've just created a new Windows XP VM on my Mac using VMware Fusion. The VM is using NAT to share the host's Internet connection.

How do I access a Rails application, which is accessible on the Mac itself using http://localhost:3000?


Source: (StackOverflow)

When is it appropriate to use UDP instead of TCP?

Since TCP guarantees packet delivery and thus can be considered "reliable", whereas UDP doesn't guarantee anything and packets can be lost. What would be the advantage of transmitting data using UDP in an application rather than over a TCP stream? In what kind of situations would UDP be the better choice, and why?

I'm assuming that UDP is faster since it doesn't have the overhead of creating and maintaining a stream, but wouldn't that be irrelevant if some data never reaches its destination?


Source: (StackOverflow)

Network tools that simulate slow network connection [closed]

I would like to visually evaluate web pages response time for several Internet connections types (DSL, Cable, T1, dial-up etc.) while my browser and web server are on the same LAN or even on the same machine. Are there any simple network tools or browser plug-ins that slow down network bandwidth to simulate different real-world connection scenarios.

I appreciate any input on that.


Source: (StackOverflow)

What is the quickest way to HTTP GET in Python?

What is the quickest way to HTTP GET in Python if I know the Content will be a string? I am searching the docs for a quick one-liner like:

contents = url.get("http://example.com/foo/bar")

But all I can find using Google are httplib and urllib - and I am unable to find a shortcut in those libraries.

Does standard Python 2.5 have a shortcut in some form as above, or should I write a function url_get?

  1. I would prefer not to capture the output of shelling out to wget or curl.

Source: (StackOverflow)

A clean, lightweight alternative to Python's twisted? [closed]

A (long) while ago I wrote a web-spider that I multithreaded to enable concurrent requests to occur at the same time. That was in my Python youth, in the days before I knew about the GIL and the associated woes it creates for multithreaded code (IE, most of the time stuff just ends up serialized!)...

I'd like to rework this code to make it more robust and perform better. There are basically two ways I could do this: I could use the new multiprocessing module in 2.6+ or I could go for a reactor / event-based model of some sort. I would rather do the later since it's far simpler and less error-prone.

So the question relates to what framework would be best suited to my needs. The following is a list of the options I know about so far:

  • Twisted: The granddaddy of Python reactor frameworks: seems complex and a bit bloated however. Steep learning curve for a small task.
  • Eventlet: From the guys at lindenlab. Greenlet based framework that's geared towards these kinds of tasks. I had a look at the code though and it's not too pretty: non-pep8 compliant, scattered with prints (why do people do this in a framework!?), API seems a little inconsistent.
  • PyEv: Immature, doesn't seem to be anyone using it right now though it is based on libevent so it's got a solid backend.
  • asyncore: From the stdlib: über low-level, seems like a lot of legwork involved just to get something off the ground.
  • tornado: Though this is a server oriented product designed to server dynamic websites it does feature an async HTTP client and a simple ioloop. Looks like it could get the job done but not what it was intended for. [edit: doesn't run on Windows unfortunately, which counts it out for me - its a requirement for me to support this lame platform]

Is there anything I have missed at all? Surely there must be a library out there that fits the sweet-spot of a simplified async networking library!

[edit: big thanks to intgr for his pointer to this page. If you scroll to the bottom you will see there is a really nice list of projects that aim to tackle this task in one way or another. It seems actually that things have indeed moved on since the inception of Twisted: people now seem to favour a co-routine based solution rather than a traditional reactor / callback oriented one. The benefits of this approach are clearer more direct code: I've certainly found in the past, especially when working with boost.asio in C++ that callback based code can lead to designs that can be hard-to-follow and are relatively obscure to the untrained eye. Using co-routines allows you to write code that looks a little more synchronous at least. I guess now my task is to work out which one of these many libraries I like the look of and give it a go! Glad I asked now...]

[edit: perhaps of interest to anyone who followed or stumbled on this this question or cares about this topic in any sense: I found a really great writeup of the current state of the available tools for this job]


Source: (StackOverflow)

Finding local IP addresses using Python's stdlib

How can I find local IP addresses (i.e. 192.168.x.x or 10.0.x.x) in Python platform independently and using only the standard library?


Source: (StackOverflow)

Comparison of Android Networking Libraries: OkHTTP, Retrofit, Volley

Two part question from an iOS developer learning Android, working on an Android project that will make a variety of requests from JSON to image to streaming download of audio and video:

  1. In iOS I have used the AFNetworking project extensively. Is there an equivalent library for Android?

  2. I've read up on OkHTTP and Retrofit by Square, as well as Volley but dont yet have experience developing with them. I'm hoping someone can provide some concrete examples of best use cases for each. From what I've read, seems like OkHTTP is the most robust of the 3, and could handle the requirements of this project (mentioned above).


Source: (StackOverflow)