0% found this document useful (0 votes)
43 views23 pages

Viva Question Part 2

Uploaded by

DEVANSH MISHRA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
43 views23 pages

Viva Question Part 2

Uploaded by

DEVANSH MISHRA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 23
Viva Voce Questions -« python translated to its object code 7 ys PY ans Python language isan interpreted language. That is, the eo a ‘Saihon converts the source code line by line into an ins to machine language which is then executed. So, “frst one needs t0 correct it before resuming thy eT the code. Sowing lines of a executes line by é lermediate language and if error occurs in one line of the ' conversion and execution of iat. wet sprich built-i1t types does Python provide ? 0 ans. Python’s built in types are : Numbers (integers, Booleans, floating point numbers snd complex rumbers), Strings, Lists, Sets, Tuples, Dictionaries, sume mutable and immutable built-in data types of Python, * ns. Python's Mutable built-in types are : Lists, Sets, Dictionaries. Python's Immutable built-in types are : Strings, Tuples, Numbers. Wut is case sensitivity ? Is Python case-sensitive 2 Ans. A language is case-sensitive if it treats uppercase letters and lowercase letters differently. That means identifiers like name, Name and NAME are different in a case sensitive language. Python is a case sensitive language. 3. What is pass statement of Python ? Ans. Pass is a no-operation Python statement. It is written where the syntax demands a statement but logic demands no-action. & What is the difference between list and tuple ? Ans, Lists and tuples, both are sequence of elements but the difference between ‘hem is that lists are mutable types while tuples are not. 7 What is slicing in Python ? Ans. It is the selecting of a sub-sequence or a sequence of elements contained in “quences like list, tuple, strings etc. * Mis te purpose of comments and iidentation in a program ? *. Comments let one insert programmer related information. Indentation makes the program readable and presentable 0, What is docetring in Python ? Ans. A docstring is a Python documentation string. Docs rings are mB are Une Docstrings are yt triple-quoted strings. Docstrings written in program code are ignored by documenting Python functions, modules and clas ie the Pyrpen interpreter. n 10. What ds the purpose of docstrings in Pytion ? Ans. In Python, the docstring is a triple quoted string used for doc purpose, written in program code ~ in Python functions, modules, clas: given in docstrings are listed through help( ). MeNtatig S€5. Details 11. Inaprogram, both docstrings and comments are not processed by the Python in do docstrings and comments mean the same thing? If not, how are docstrings comments ? terpreter, they different a Ans. Both docstrings and comments are ignored by the interpreter, ie, these not considered for execution purpose. In that sense both comments and docstrings es the same. BUT docstrings are not just comments. The information given in docstrings i treated as documentation for the program/module, which we can access using the help() function. 12. What is the usage of help( ) and dir( ) function in Python? Ans. Both the functions help( ) and dir( ), are accessible from the Python interpreter and are used for viewing a consolidated dump of built-in functions. > The help() function is used to display the documentation text and also facilitates us to see the help related to modules, keywords, and attributes. > The dir( ) function is used to display the defined symbols. 13. What is negative index in Python ? Ans. Python sequences can have indexes of both types : positive and negative. While positive indexes begin from 0 for the first element and go till size-1 for the last element, the negative index is a backward indexing where -1 is for the last element and it moves backwards with -size index for the first element. t= ['0","e Forward indexing > 0 1 2 3 4° Uist{0) = "a" = listt-5] listt{1} =e" = tist4}-4} fist2) = °F = listt-3} list4(3} = "0° = list1[-2} | lstttay listt{-1) vorf fas Sita “5-4-3 -2 -1 << Backward indexing] List Elements’ two way indexing Lst = [47, True, “good”, 4.59] 14. What does [:: -1} do ? Ans. For example : 1] is used to reverse the order of an array or a sequence. >>> list =[1, 2, ,3, 4, 5] >>> Mst{::-1) (5, 4, 3, 2, 1]) ceprintsa reversed copy of ordered d : ety oF list Femains unchanged, ata structures such as an array or a list. af will be tne output of datal-2] from the list data = (2, 4, 6, 8, 9, 3, 0)? 15 Og In alist the “2 (negative 2 “! index) index, is 2" index from the right. The resent at this index fs 3 in given ist. So, the output ill be : jo ot emer ou CoV ans. Hf string contains only numerical characters, we can convert it into an integer the int() function, however, we cannot convert alphabetic and alphanumeric using UT integer in Python. strings !° /, Hol do you convert @ number to a string ? pns. TO convert a number into a string, we can use the inbuilt function str( ). For octal oF ‘nexadecimal representation, we can use the inbuilt function oct() or hex()- What i the use of 1 operator in Python ? I ee ‘ans. The // operator is a floor division operator. It gives the integer quotient resulting, fro™ the division of two numbers while discarding the remainder or fractional part. 1p, How do you check whether the two variables are pointing to the same object in Python ? ‘ans. In Python, we have an operator called ‘is’, which returns true if the two yariables are pointing to the same object. For example, pas “Computer” pocea praise : True We can confirm this Foris to return True, both objects must wert a string into an int in Python 2 6 can by checking the id’s ( memory address) of both these objects. be pointing to same memory address. 3>> id(a) j 47173368 >>> id(c) 47173368 20, What isthe difference between deep and shallow copy ? ‘Ans. Shallow copy just creates a new label for a sequen’ OF object. It does not create separate memory holding duplicate copy of elements. Changes made in original object/sequence are reflected in shallow copy- Deep copy creates a separate memory area and the! there, Thus deep copy is also called the true copy: Changes m: object/sequence are not reflected in deep COPY: n creates labels for each element ade in original 21, What is the purpose of “end” argument in print( ) in Python? ‘Ans, By default the print( ) function always prints a newline in the end, ie., the following output will appear on the ion f line (default behaviour). To suppress this default behaviour, the print( ) function “ccepts an optional parameter known 25 the ‘end, Its value is’\n’ by default. We can change the end character in a print statement witl th the value of our choice using this parameter. ~~ end’s value as space then space will be printed at the So if we change the end’s value as sf , p c n the sams end cane : fie a put and next output will continue in the same line, f a print( J's out For example, print ("My") print(“World") will give output as My World While the code print(“My”, end=*? ) print (“world”) will give output as My World 22. What is for-else and while-else in Python ? Ans, Python provides an interesting way of handling loops by providing a provision to write else block in case the loop is not satisfying the condition. So, else clause of a loop can be thought of as the false-part of the while loop ic., it gets executed when the while Joop’s condition is false. For the for loop, it executes when for loop ends normally. 23. How do you programmatically know the version of Python you are using ? Ans. The version property under sys module will give the version of Python that we are using. >>> import sys >>> sys.version 24. What is the role of len() function in Python ? Ans. The len( ) determines the length of an a sequence, e.g., for a string “My world”, the len() would yield the result as 8 >>> string "My world" >>> len(string) 8 25. What is the role of chr( ) function in Python? ‘An6.The chr( ) returns the string Storing a character whose Unicode value is passed to it in integer form. For example, the chr(97) will return the string ‘a’. >>> chr(98) ‘y? 26. What is the role of ord() function in Python ? Ans. The ord( ) returns the Unicode value in intey storing a character. For example, the ord(‘a’ >>> ord(“b”) 98 ‘ger form corresponding to a string ) will return the integer value 97. je a tuapte in Pytion What 2 ge. A tuple i8 2 sequence oF a collect ; 9 collection type data structure in Python which mamutabte. The efements of tpl ara encloged (np pervciany fe tye ; rae (3555 75.9) The tuples ate immutable, ic, their elements cannot be ek ; annat be changed in place junit eo icttonary in Python ? ‘ans. A dictionary is a data structure kno ae 11 as an associative array in ch stores a collection of objects in the form of key:value pairs. The collection is a set whic Wrxoys having a single associated value ‘A Dictionary is also known as a hash, a map, or a hashmap in other programming languages: Hows will you remove the last object from a list 2 ‘Ans. Using the index -1, we can access the last element of a list. Thus, in a list namely mylist, following code List.pop(obj = mylist[-2]) gill remove and return last element from the list. Differentiate between append( ) and extend( ) methods. ‘Ans. Both append( ) and extend( ) methods are the methods of lists. Both these methods add the elements at the end of the list. But append ) adds single element, pile extend( ) can add a list of elements, i, 2%. wl append(element) ~ adds the given element at the end of the List which has called this method. extend(another-list) _ adds the elements of another- list at the end of the List which is called the extend method. 31, What is Index Out of Range error ? ‘Ans. When the value passed to the index operator is greater than the actual size of the tuple or list, Index Out of Range error is thrown by Python. >>> a= [11,21,31,41]# a isa list >>> a[3] 41 >>> al 4] Traceback (most recent call last): IndexError: list index out of range >>>b=(1,3,5) #bisatuple >>> b[4] Traceback (most recent call last): Indexerror: tuple index out of range 38. 39. 41 Consider the given Python code fragment: / In the above assignment operation, what Is the data type of A’? Ans, The data type of A is tuple, because when we assign 4 grog oy separated values to a single name, Python creates a tuple out of it ty, | assignment is called “Tuple Packing” 8 4 Consider the below given Python code fragment. >>> Aw 101, 202, 203, 404 >>> a,b, c,d=A What is the value assigned to the variable d 7 Ans. 404 Why is following code giving error (TypeError)? What could be the reason 7 >>> a,b,c, d=R Ans. For the given statement to work, R must be 2 sequene/ variables in it, otherwise (e.g, if R is an integer or @ float value, will produce error. The previous question's assigning tuple elements to individual variables ~ what is this type assignment called ? a! Ans. This type of assignment is called ‘Tuple Unpacking’. What is the use of the dictionary in Python ? Ans. A dictionary is an associative array (also known 25 hashes dictionary is associated (or mapped) to a value. Thus, to store values th and are associated with one another, dictionaries are used. How do you add elements to a dictionary in Python ? Ans. We can add elements by modifying the dictionary with a fresh key and set the value to it. How do you get all keys from a Python dictionary ? Ans. To get all keys from a dictionary, we can use keys( ) method w dictionary name. How do you get all values from a Python dictionary 7 Ans. To get all values from a dictionary, we can use values( ) method with the dictionary name. How do you delete elements of a dictionary in Python? Ans. There are two ways of doing this : (i) by using the del( ) method. (ii) by use is the pop() function. How do you check the presence of a key in a dictionary ? 4 Ans. We can use Python's “in” operator to test the presence of a key inside 2 dictionary object. sate between a run-time fate n-time error and syntax error. Give one example of each run-time error is tha i ‘Ans: a i ao Utara during execution of a program. The compilation 108) ith it. For example, ‘File could not be opened” ‘Not enough ofthe P neon? : A Syntax ae i that a statements are wrongly written violating rules of the rogramming language. For example MAX + 2 = DMAX is a syntax error as an ipressioncan not appear on the left side of an assignment operator. ronilable’ are run time errors, a. Name some standard Python errors that may occur. Ans. typeérror Occurs when the expected type doesn’ i esn’t i Senate YP isn’t match with the given tyP' yalueérror When an expected value is not given- if you are expecting 4 elements in a list and you gave 2. Nameerror Occurs when trying to access a variable or a function that is not defined. indexError Accessing an invalid index of a sequence will throw an IndexError. keyerror When an invalid key is used to access a value in the dictonary- 14, Init mandatory for a Python function to return a value ? ‘Ans. It is not at all necessary for a function to return any value. 45, The void functions are non-returning functions, ie they do not return ¢ value to their caller. How does a void function intimate its caller that is returning no value? ‘Ans. The void functions return a legal empty/missing-value object, None, to their caller to signify it. 46. What are different ways of argument matching in Python functions? ‘Ans. In python functions, the arguments can be matched in these ways : > Positional matching, It is normal way of matching arguments wherein arguments are matched left to right, fe, arguments are matched by their position or order of placement. = Keyword/named argument matching. In this Way of argument matching, arguments are matched by the argument name, irrespective of their position in function call statement. > Default argument matching. This type of argument matching takes place only if the function call passes fewer values that the required parameters. In such a Taso, the missing arguments get the default values already defined in function definition. 47. Consider the following code lines. Find out, twitere these code lines appear in a code (i.e., when inside caller function or inside the function definition) and identify the type of argument and ‘matching style in these. func(value, 60) func(a = 25, name = value) def func(name, a =12) fune(a = 25, value) 48. 49, 50. 51 52. 53. Interpretation Ans. — Location east % sae caller formal argument : positional matching ie, 60) Calle Normal ars : eye Y arguments, coe = Lae een an ae gume: functa= 25, namesvalue) | Caller — | Keyword arguments : both arguments are ma é Func! argument : name will be matched an ~ el ame, ae 11 Function. | Normal argument a o_o , positional or named argument. y Parameter a, if given in function call, will be mateheg any by positional or named argument, but if skippeg default argument matching will be performed. Caller | It will cause error as positional arguments must not june(a= 25, valu fines ova) follow keyword arguments. What is the name of top level segment in a program, i., the segment which is not part of any function? Ans. Python names the top level segment as _main__ In a program, if there are five different functions defined, wherefrom Python will stark executing ? Ans. Python always starts the execution of a program from the top level segment named as __main__, irrespective of number of functions defined in the program. If a function is defined in a program, but not called through __main__ section, will it ever be invoked ? Ans. A function defined but not invoked (directly or indirectly) from __main_ will never be executed. In order for a function to be called, it must be called either directly or indirectly (when its caller is called through __main__and then its caller calls it) from __main_ segment. Can a function have multiple return statements in it ? Ans. Yes, a function can have multiple return statements in it. Can a Python function return multiple values? Ans. Yes, a Python function can return multiple values by giving comma separated values in the return statement, e.g., returna, b, c,d What are fruitful and non-fruitful questions ? Ans. The functions returning some legal values are called fruitful functions and void functions, the functions not returning any legal value are called non-fruitful functions. What is a variable’s scope ? Ans. The scope of a variable refers to the context in which that variable is visible/accessible to the Python interpreter. 7 - aeieeakeniainoe —— saat 6 local scope nd lob scone in Python, > 6 1 gnse A variable defined inside a function - pence it has focal scope. A variable defined manne gross all parts Of 9 Program and it hag ly available to the function and all functic ® plobal scope lobally available «tna onder docs Python résotoe a naine then acess 9 Ans. Python resolves a name being accessed a per LEGB ord B accessed as per LEGB order (i) It first looks for the name in toca (ii) If not found in local scope, then it look me in losin; , 0ks for the ein its enclosis ae or the name in its enclosing | environment, (ii) Tf not found in enclosing scope, then it looks for the name in its ee looks for the name in its global (i) If not found in global scope, then it looks for the name in its built-in environment. <7, What are modules in Python ? Ans. The Python Modules refer to a file containing Python statements and function definitions. A file containing Python code, for e.g., abe-py, is called a module module name would be abe. We use modules to break down large programs into small manageable organized files. Furthermore, modules provide reusability of code. 5, How do you import modules in Python? Ans. We can import the definitions inside a module to another module by using the import command. To import a module namely abc, we can type the following : >>> import abc 53. What's the difference between “import module” and “from module import ** statements? Ans. The import statement, ¢; import sys creates a new namespace by the name “sys” into your module and to access each of # function/definition defined in it, you need to use qualified name as sys., It does not give you direct access to any of the names inside sys module . To access those you need to prefix them with sys, ¢.8. sys.exit(). The from module import statement, 8+, from sys import * = does not creates a new namespace “sys” into your module, rather it brings all of the names/functions/definitions given inside sys Namespace. into your module's existing Now you can access those names without a prefix, Tike this exit() fo What are the possible consequences of using from import command ? Ans. As from module import command adds all the names/definitions ig gy 7 tt current namespace, any similar name will simply get overwritten What are Python packages ? Ans, Python packages are namespaces containing multiple modules, 6 Which fle must added to directory structure of your module files in order to make i oy importable package ? Ans. __init__.py What is the difference between “r” and “r+” file modes ? Ans. The “r” mode opens a file for reading only. The file pointer is placed at the beginning of the file, This is the default mode. The “r¥” mode opens a file for both reading and writing. The file pointer placed at 63. the beginning of the file. 64. What is the difference between “w” and “w+” file modes? Ans. The “w” mode opens a file for writing only. It overwrites the file if the fle exists. If the file does not exist, creates a new file for writing. The “w+” mode opens a file for both writing and reading. It overwrites the existing file if the file exists. If the file does not exist, creates a new file for writing and reading. . What is the difference between “a” and “at” file modes ? Ans, The “a” mode opens a file for appending. The file pointer is at the end of the file if the file exists. That is, the file is in the append mode. If the file does not exist, it creates a new file for writing. The “a+” mode opens a file for both appending and reading. The file pointers at the end of the file if the file exists. The file opens in the append mode. If the file does not exist, it creates a new file for reading and writing. & 66. What are common file processing modes supported by Python ? Ans, Python provides three modes to open files. The read-only, write-only, read-write and append mode. ‘r’ is used to open a file in read-only mode, ‘w’ is used to open a file in write-only mode, ‘rw’ is used to open in reading and write mode, ‘a’ is used to open a file in append mode. If the mode is not specified, by default file opens in read-only mode. Read-only mode (‘r') Opens a file for reading. It is the default mode. "Opens a file for writing. If the file contains data, data would be “Write-only mode( ‘w' ) L "ost. Otherwise a new file is created. Read-Write mode( ‘rw’ ) Opens a file for reading, write mode, It means updating mode. @ B gt file contains only one tine one program ypatest fl i only ne and the file is read ys Fat using realinest ) iN another program? Win okt thelr apie mf a 2 would be the difference in two progran (a) AE OPENC SAMPLE. txt") p06 prine(typaca)) adline() () Be openc"sample. txt") readtines( print (type(a)) : s. The readli 0 . Ans. The readline() will read the line of text from file and return the result in form ofa string while readlines() will read the line oem of a list read the line of text from the file and return the result data to be written in a file is avaitabte i ’ ie Galante file is available in the form of a list, which function would you use to Ans. writelines() If data to be written in a file is available in the for ing, whic i fae e ie form of a string, which function would you use Ans. write() eum will you use to read “n" number of characters from a file using the file object ? Ans. .read(n) Which command will you use to read the entire contents of a file as a string using the file object ? Ans. .read() Which command will you use to read the next line of a file using the file object ? Ans. .readline() Which command will you use to read the remaining lines ofa fle using the file object ? Ans. «myfile>.readlines() Which of the following are the file modes of both sorting and reading in Python files ? (a) wb+ ow (©) wb (a) we ‘Ans. wb+ and w+ modes “w+” opens a text file for both writing and reading. 1 overwrites the existing file if the file exists. If the file does not exist, it creates a new file for reading and writing. “wb+" opens a file for both writing and reading in binary format, overwrites the existing file if the file exists. If the file ‘does not exist, it creates a new file for reading and writing. FR SCHNCE (PY 3a2 saove FAST Wit COMPU ve betwen ream wot modes ? the file pointer is initially placed at the be 1 of the file, when opened oS What is the different Ans In mo the painter is at the ‘BiNNng of mode we me Wht are tie fornrs of text files ? Ans. The text files are of following types : (i) Regular Text files. These are the text files which store the te ae ped. Here the newline character ends a line and the xt iN the. text trang place. . (ii) Delimited Text files. In these text files, a specific character jg the values, ic, after each value, e.., a tab or a comma aft Stored er ey, 77. What is pickling ? Ans, Itis the process of converting Python object hierarchy into 3 , that it can be written into a binary file. 7 78. What is unpickling ? Ans. Unpickling is the inverse of Pickling where a byte stream storag (pickled) file, is converted into an object hierarchy. Unpickling produce replica of the original object. 79. Which pickle module function allows you to perform the pickling process ? Ans. pickle.dump( ) function. 80. Which pickle module function allows you to perform the unpickling process ? Ans. pickle load{ ) function. 81. What are cso files ? Ans. A CSV file (Comma Separated Values) is a type of plain text 5 tabular data. As the name suggests, CSVs generally use commas to separate &= value, but other than comma, it supports other separators too. 82. Are cso files the text files ? Ans. Yes, All CSV files are plain text files wherein different data items stored separator/delimiter character embedded in between. 83. What are delimiters in the context of eso files ? Ans. In csv files, the character or symbol used to separate the data items8* delimiter, which is mostly a comma. However, Commas aren't the only Separate data ; other delimiters could be a tab (\t), colon ( ;), or semi-colo( 84 What are iso files? Ave they type of cso files ? (Ans, When a tab character is used to separate the values stored, these 28°" TSV files (Tab Separated Values files), Yes, TSV files are a type of CSV files where the delimiter used isthe #5 85, 5 vihon provid Which bi Pylon prod tose and work with es fies? Ans, The esv module/ibrary, : carat ‘ jecursion 2 We gs I BOE am, if a function calle © itselE (out je susion. And the function calling eh Wher diteetly or indirectly), it is on teats WO EXAMPLES OF reCUrSio MM As called recursive users eit g ® ): def AC (i) do ) A) Hof a ; def C(): BC) ase case and recursive case? What is the; at are is their role in a recursive cM ans. Ina recursive solution, the B A reclitsive program? ase cases are est Ve of the problem : if the in eam tation is necessary to get the result oor Predetermined solutions for th - solutions for the given problem is a base case, no further he recursive case is the one that calls the secursive step is a set he bi function ay ain wi i again with a new set of va tof rules that eventually reduc o ofthe problem ase eeepc ee es all versions of the problem to ane of iuiy i base case so important in a recursive function ? Ans. The base case, in a recursive case, represents a pre-known case whose solution is ga prinown, This case is very important because upon reaching at base case, ve function occurs as base case does not invoke the function again, rather it tums a pre-known result. In the absence of base case, the recursive furetion executes endlesily. Therefore, the execution of base case is necessary for the termination of the recursive function, the termination of = Wht does infinite recursion occur ? Ans. Infinite recursion is when a recursive function executes itself again and again, endlessly. This happens when either the base case is missing or it is not reachable. % Compare iteration and recursion. Ans. In iteration, the code is executed repeatedly using the same memory space. That is, the memory space allocated once, is used for each pass of the loop. On the other hand in recursion, since it involves fuiction call at each step, fresh memory is allocated for each recursive call. For this reason i.v., because of function call overheads, the recursive function runs slower than its iterative counterpart. When toould a recursive solution make more sense than iterative solution? Ans. Recursion is a way of arriving at a solution by breaking down the input into smaller and smaller pieces until it can no longer be broken down. The final output is Glculated by putting together the output of these calls with the “smaller” inputs. Ifthe input of a question consists of sub-problems where each of the sub-problem ‘an be solved using the same logic with a different value, then, it’s a good indication that recursion is needed. Out of iteratice and recursive solutions, which one is slowerlfaster and why ? Ans. Out of the two, the iterative version is faster comparatively. The iterative Eien works with same memory every time while recursive version has to call a new ‘tion for every new value. This additional function call overheads make it slower — oe -XxI 334 MOVE FAST WITH COMPUTER SCIENCE (Python) ~ Xl 93. What is an algorithm ? ‘Ans. An algorithm is any welldefined computational procedure yh) Ana : find a solution of a given problem. An ea some values qn? ing fon oF ult as output, An algorithm is thus a sequence of cop, mut put into the output. Pugh produce: ] steps that transform the in] 94, What is a Stack ? Ans. Stack is a linear d FILO (First In Last Out) for accessing elem: fata structure which the order LIFO (Last ty 5; ents. rl Ou 95, Name some common applications of stacks ? Ans. Common Applications of Stacks : Infix to Postfix Conversion using Stack Evaluation of Postfix Expression Reverse a String using Stack > Implement two stacks in an array > Check for balanced parentheses in an expression vv 96. What is a Queue ? ‘Ans. Queue is a linear structure which follows the order is First In First Out (gq) to access elements. 97. Name some common applications of queues ? Ans. Common Applications of queues : > First come first served queues/lines > Resource sharing among multiple consumers = Using shared printer with multiple computers m= Call center phone system attending multiple calls waiting/on-hold > Airports sharing a runway for flights in waiting > CPU being shared among jobs having similar priority 98, Describe the similarities and differences between queues and stacks. Ans. Similarities : 1. Both queues and stacks are special cases of linear lists. 2. Both can be implemented as arrays or linked lists. Differences : 1. A stack is a LIFO list, a queue is a FIFO list. 2, There are no variations of stack, a queue, however, may be circu! deque. lar ot 99. What is @ network? Ans. A network is a set of devices that are connected by a physical li mote networks are connected by one or more nodes. Example of a net\ ternet. The Internet connects the millions of people across the world. ink or two work is a ay neat by netiork topology ? we it ] apology apocifios i i Netverk lope loa apocttion he layout ofa cenmputar nator nr Common ty pee of top AR it eabtes are connected to each ott frigies at yest Aol raph. aa aor types of metivorke and explain ? gerver-bawed! network “me Poort ertopour netwoh cereer bse networks provide centralized control of network reneurces and rely oF = cOMMpUleT to provide security and network adiminiatration we atrations peerstope’? network, Computers can act as both worvers sharing, resnrces and # rainy, HE FESOUTCES, client 4 «pane the fil Ans (Node. A computer that is attached to a network is known an node. owinng terms +) Nowe (1) Workstation (UD Server uy MILL (o) TAP giy Workstation. A node is also called workstation, fi Servers A computer that facilitates resource sharing, on a network fir) NIU, NIU means Network Interface Unit. t is an interpreter that helps catablish communication between the server and the work stations ‘erminal Acce: oy TAP. TAP means as Point. It is another name for NIC na i he erence Wetiocen: Hub, Site, and Rowler 7 Ans. ey Hub east expensive, east | Switches work similarly like bb be saat ini more efficient Switch complicated cnt of these three. ft router is smartest and Teast complicated | Hu cc three. It broadcasts all data | manner, It creates connections | comes in all shapes and sizes very port which, may eau dynamically and provides | Routers are sirnilar like |istle ability [information only to the | computers dedicated for cu sows security and rel requesting, port. network traffic Routers are located at gateway and forwards data packets. etwork sina seaNetwork, Hub is a common | Switch is a device in Etnction point for devices | which forwards pa “enected to the network, Hub | network. ccosins multiple ports and is aed to connect segments of UN. 14. What is meant by internetworking ? ‘Ans. Internetworking, is the connection of two er more networks. 15, What is a Gateway ? Ans. A gateway is a device that connects dissimilar networks. "% What do you mean by a backbone network ? Ans. A backbone network is a network that is used several LANs together to form a WAN. FDDI (Fiber Distributed Data Interface) is such a network. FDDE is a high Performance fiber optic token ring, LAN running at 100 Mbps over distances upto 200 with upto 1000 stations connected as a backbone to connect 336 107, 108. 109. 110. 11. 112. 113. MOVE FAST WITH COMPUTER SCIENCE (Pylon) = XH What is the difference between Internet and internet ? Ans. Internet refers to the WAN covering entire World and that ry 7 ot 5 Wy internet on the other hand, can refer to any two or more inter-connectoq Ww i Neto What is meant by Client/Server architecture ? Ans, Client/Server architecture refers to a network in which a yoy i ks formation from a computer that can share resources i.e, the se ati reques = In client/server networking, the user programs called clients, have g server for the required data/action instead of carrying it out themselves, The ty also called front-end and the server is also called back-end. cling Mee, What is Telnet ? What does it do ? Ans. The telnet is an Internet facility that facilitates remote login, Remote the process of accessing a network from a remote place without actually bey 2 actual place of working. Bate What is E-mail ? What are its advantages ? Ans. The E-mail (Electronic main) is sending and receiving messages jy computer. The major advantages of E-mail are : ya (i) Easy record maintenance (ii) Waste reduction (iil) Low Cost (iv) Fast delivery Give the full form of the following : (a) Modem (b) FM (c) AM (d) NFS (@) Erp. Ans. (@) Modulator/DEModulator (0) Frequency Modulation (c) Amplitude Modulation (d) Network File Server (e) File Transfer Protocol. What are the different types of networks ? Ans. Networks vary widely in their size, complexity and geographical spread. On the basis of geographical spread, networks can be classified into three categories (i) Local Area Networks (LANs). These are computer networks confined © localised area such as an office or a factory. (ii) Metropolitan Area Networks (MANs). These are the networks that list computer facilities within a city. (iii) Wide Area Networks (WANs). These are the networks spread over distances, say across countries or even continents. It can even intl group of LANs connected together. What is meant by bandtwidth ? What is its role ina netevork 2 te Ans. Bandwidth means the capacity of a medium to transmit a signal It") bandwidth that determines the amount of information that can be transmit isso distance. To carry digital signals, baseband modulation is used that allows ta" at a single frequency at a time. To carry RF (radio frequency) signals ne ‘modulation is used that allows multiple transmission taking place at different 0" a large aie 3 20? 1g 0 refers to added features and |e eppott easy online-information exchangy Ape Pies of Web 2.0 are blogs, wi RSS ete, applicati Pplications that make the web more erability. Some video-sharing website ing ‘ seh ? What is its role ? computer that facilitates the sharing of data, software twwork, is called server. Since resource sharing isthe : - ieee 5 e key purpose of a panel ‘ ays this key role, ever PI sat bet no types of servers : Fee | an be fe , | ted SEES It is a workstation on a small network that can double Ses a le up red Server. On bigger networks, a computer is reserved for the cause of i oi policit@ ch ig called a dedicated server. serving WE ro protocols z A protocol means the rules that are applicable for a network. Protocol defines } coniardized formats for data packets, techniques for detecting and correcting errors B00 qounderstand the concept of a communication protocol, let us assume that A and reed t0 talk to one another. They want to exchange their ideas. But it turns out that, fon A and B are egoists. They start talking again simultaneously, ‘then pause for sesh simultaneously, and then start talking again. Now imagine the confusion nj aos. To avoid it, they must follow a set of rules while talking. For instance, say then he/she must give B a chance to put forward his/her ideas, and fist A must talk, ‘san This command set of rules would be known as communication protocol for A ad B. Thus for effective use of a networ ‘Ther are various protocols that are use BM LAN software, DEC net (Digital's family o! (Iensmission Control Protocol/Internet Protocol) etc. iferet. ° rk it must follow a standardized protocol. .d in various types of networks, For example, ff communication protocols), TCP/IP TCP/IP is the native protocol of * Wikjare protocols needed ? Ans. In networks, communication occurs between the entities in different system Troentites cannot just send bit streams to each other and expect to be under eee ‘mmunication, the entities must agree on a protocol. A protocol isa set of rules that ‘fvem data communication. ‘or Matis 180 OS1 standard for networks ? Ans. The OSI model was developed to standardize rexcha sellin between communicating systems. The OSI is a communication reference (y ,hathas been defined by the International Standard Organisation (ISO) The ISO Model is a seven layer communication protocol intended to be a standard for ran ication systems world wide. the procedures for exchange of rave FAST WHT Coe to provide comniyy cAioy aan hniques employe sinning tO yo. What are the alipferent inns : oT paywiteningy te" niques employed 10 provide gy, . Ans, The differen vn counppetons are ca tla a vt 3 {tching, When & complet placer re phone bib. © Sa ot within the tolephor nyntom see a out ‘ ' ta Mg quia yy sender te sphone (0 the receiver ; jelephione, (oP bn ean i 7 perty of ita in to setup an end-to-end path before 2 important prop’ mt be sent ing. In this form) of switching, NO physical co, ~ saviteling ne © Snot in Maivance between sender and. receiver. rte established fata to be sent HIS atored in first switching gy” Se + Olfce .* sender has forwarded later, e awitching, there is no limit on biog, tight upper limit on block size,” Packet Switebings, With means past packet switeing Places & its advantages ? soo. Whats World Wide Web andl rwohat are “Ans, The World Wide Web (WWW) is.a set of protocols that allows you wy, any document on the NET through @ naming, system based on URLS (URL acy Uniform Resource Locator, which is @ pointer to information on the WivWy, j ny ver types of resources such as ftp servers and gopher sery ca B) WWW also specifies a way the HyperText Trang st and send a document over the internet. With Pa one can set up a server and construct types document on the server. © include pointers to ott addition to WWW serve Protocol (HTTP) to requ standard protocols of WWW is place, documents with links in them that point to the 121. What are cookies ? ‘Ans. Cookies are messages that web server can keep track of users aweb server transmits to a web browser so thatthe activity on a specific web site. 122. What is VoIP ? Ans. VoIP (Voice over IP) refers to network. It offers a set of facilities to manage the deliver a way to carry telephone calls over an IP daty ry of voice information ove I form. Internet in digi 123. What is Intellectual Property ? haere reine Property may be defined as a product of the intelle onmeteal i is ing copyrighted property such as literary or artis 124. What is Spam ? Ans. Spam rel ctronic ji pon a refers to electronic junk mail or junk newsgroups postings ine spam even more generally as any unsolicited e-mail. 125, What is attenuation ? Ans. The de; i . generation of a si ver di Ha signal over distance on a network cable is “ adalress for a devicw A 8 itis identitig, fin the Network architecture, MAC addneeg see Mevlia Access Control (MAC) vet AL adapter card andl is nique {s usually stored in ROM on the ‘wo . gt te aierener DEHN BE Tate Hd Band rate ‘ . pags. Bitrate is the number of bits transmitted during one second whereas baud esto the number of signal units per second they cond that sate ote are required to represent those its ‘ paul rate = bit rate/N is no-ot-bits represented by « ayhere N ach signal shift hackers ? Who are crackers Who are * ans. The Crackers are the malicious programme are more intereste bly using this knowledge Ns prog t8 Who break into secure systems lin gaining knowledge for playtul pranks, about computer systems which of the following will come under Cyber Crime ? (p Theft of @ brand ne «iy Access to a bank account for getting unauthorized sealed pack Laptop Money Transaction (i) Modification in a company data with unauthori od access {j) Photocopying a printed report Ans. (i) Access toa bank account for getting unauthorized Money Transaction Discuss how IPod is different from IP v6, Ans, Internet Protocol (IP) is a set of technical rules that define how computers communicate over a network. There are currently tivo versions : IP version 4 (IPva) and IP version 6 (IPv6). > IPvd was the first version of Internet Protocol to be widely used and still accounts for most of today’s Internet traffic. There are just over 4 billion [Pvt addresses. While that is a lot of IP address: > IPv6 provid is not enoug h to last forever, em to replace IPva. Lt was deployed in 1999 and 's, Which should meet the need well into the future a newer numbering, s far more IP addres The major difference between IPva and IPv6 is the number ot IW addresses, Although there are slightly more than 4 billion [Pv addresses, there are more than, I6billion-billion IPv6 addresses. Int t Protocol version 4 (IF) Protocol version & (IVS) Address -bit numbe 1BS-Hit NUMIber | Address format Dotted decimal notation: Hexadecimal notation: = IEEE ZSOASACIet 192,168.0 | Numer of addresses 131. 132. 133. 134. 135. a Ss What is online banking ? i ‘Ans. Online banking refers to the usage of banking services using online meth such as the Intemet ete, With online banking, the user can use and availa all fnangay services of a bank, otherwise available in offline mode. a What is the difference between online banking and net banking ? Ans. Difference between online banking and mobile banking is that Mobje banking is done via a mobile banking app while the online baking is done via secu website of the bank. d What is é-wallet ? Give examples. : ‘Ans. E-wallet refers to availability of own money electronically, which can be used, through various types of online media. Some popular e-wallets are PayTy, Freecharge, Airtel Money etc. What is meant by a primary key ? Ans. A primary key is a field in the table/file that uniquely identifies every record ina file. Define the following terms : (a) relation (tuple) attribute (4) domain (®) primary key _(f) candidate key (g) cartesian product (h) cardinality —_—~(i) degree Ans. 4 (2) Relation. A relation is a table having atomic values, unique rows and unordered rows and columns. () Tuple. A row in a relation is known as tuple. (0) Attribute. A column of a table is known as an attribute. (@) Domain. A domain is a pool of values from which the actual values appearing in a given column are drawn. (©) Primary key. A primary key is a set of one or more attributes that can uniquely identify tuples within the relation. (f) Candidate key. All attribute combinations inside a relation that can serve as primary key are candidate keys as they are candidates for the primary key position. w Cartesian product. The cartesian Product of two relations A and B written as) Ax B results into a new relation with all possible combinations of the tuples of the two relations operated upon. All tuples of first relation are concatenated with all the tuples of second relation to form the tuples of the new relation. (h) Cardinality. The Cardinality of a relation means the number of tuples (tows) in the relation. 7 (i) Degree. The degree of a relation means the number of attributes (columns) in the relation, 7 pais redundancy ? What are the problems associated witli it ? . Duplication of data is data redundancy, Ite Ans: ; re and data inconsistency, ‘ads to the problems like ¥ ols «aha a ‘Ans. Multiple-mismatched copies of same data in a database is called Data ja inconsistency ? pirntate Between DDL and DML. ns. The DDL provides statements for the creation and deletion of tables and indexes. The DML provides statements to enter, update, delete data and perform complex queries On these tables. vas What is composite primary key ? ‘Ans. The primary key which is created on multiple columns in a table is generally considered as the Composite primary key. What is the difference between primary key and unique constraints 2 ‘Ans, Primary key cannot have NULL value, the unique constraints can have NULL values, There is only one primary key in a table, but there can be multiple unique constrains. The primary key creates the cluster index automatically but the Unique key does not. rey i. What is a join in SQL? What are the types of joins ? Ans. An SQL Join statement is used to combine data or rows from two or more tables based on a common field between them. 12 Name some common DDL commands. Ans. Create Table, Create Index, Alter Table, Drop table. 45. Name some common DML commands. Ans, Select, Insert Into, Update, Delete Can you use = comparison operator fo compare Null values in a select query ? ‘Ans, No, the operator to compare Null values is ‘is’ operator. What is the significance of GROUP BY clause in a SQL query ? Ans, The GROUP BY clause combines all those records that have identical values 'na particular field or a group of fields. This grouping results into one summary record Per group if group-functions are used with it. What is the significance of the default constraint in SQL ? ig Ate ltis used when it comes to including a default value in a column in case there “No new value provided at the time a record is inserted. 7 " Whats he difference between Delete and Truncate commands ? Ans. The Delete command can delete one or more rows of a relation depending N the pi ‘i the given condition. Truncate command deletes all the records from a relation. . Ms 149. 154. 156. . What are intellectual property rights 2 unt & the arene feo DROP TABLE and Truncate commana, » Ans. The Truncate _an empty table s commane! deletes all the rows from a ty I ties in the database, Te structure stays, 1 The drop table command rene fable. no table with the given name the table object from the ¢, exists in the database. Mtabas, 4 What is @ constraint ? «i to specify the limit on the data type of, Ans. Constraint can be use i ww can be specified while creating or altering the lable statement 6. Con

You might also like