DronaBlog

Tuesday, December 4, 2018

Important Python Interview Questions and Answers - Part I


In this article, we will focus on the most important questions which are asked during Python interviews. If you preparing for Python interview then this article will be the good start. If any detailed explanation is required then respective links are provided for your knowledge. Good luck with your interview.



Q1. What are the differences between Python version 3 and Python Version 2?

Answer: Both the Python versions are important for Python programming and they come with their own significance. We will discuss here the differences between these two Python versions.

S. No
Python Version 3
Python Version 2
1.
Python version 3 supports -Unicode UTF-8 and it has two-byte classes –a) Byte b)ByteArray
Python version 2 supports - ASCII str() types and separate Unicode() but there is no byte type code
2.
To print, any string parentheses are required in Python version 3. It will raise error without parentheses.
In Python version 2, to print any string no parentheses are required
3.
If we try to compare un-orderable types then it raises ‘TypeError’ as the warning
Python version 2 silently ignore the error/warning we try to compare un-orderable types
4.
The SyntaxError will be reported when we don’t enclose the exception argument in parentheses.
In this version, it accepts both new and old notations of syntax.



You can refer the video tutorial on Python to better understand Python concepts -


Q 2: What is the memory management process in Python?

Answer: The memory management in Python is similar to other programming languages such as Java.
  • The allocation of heap space is done by the memory manager. It includes memory allocation for Python objects and data structures.
  • The private heap space is used in Python for memory management. The data structures and Python objects are located in this private heap memory. 
  • The Python interpreter interacts with memory and takes care of memory-related tasks.
  • The garbage collector is used to release memory of unused object and make memory available to the heap space. The garbage collector is the inbuilt feature, no special configuration is not required.

Q 3: How Python is interpreted?

Answer: 
  • Python language is an interpreted language. 
  • The program written by the developer is interpreted by Python interpreter. 
  • Once the source is interpreted, it is executed step by step. 
  • The Python program runs directly from the source code, unlike Java compiler where the complete file is compiled first and then it is executed.
In the figure below, HelloWorld.py a Python file is interpreted by Python interpreter and executed at runtime. The output is shown on the console.

Q 4: What is namespace in Python language?

Answer: 
  • The namespace in Python defines the scope for objects such as package, module, class, function.
  • Each module, package, class, and function owns a namespace. In this namespace, variable names are resolved.
  • The namespace is evaluated during execution and dropped after execution is completed.
  • The global namespace is used if the local namespace is not defined.
  • The variable name is checked in the local namespace i.e. in the body of the function or the module, etc. If the variable name is not found in a local namespace then it is checked in the global namespace.
  • The variables are generally created in a local namespace. 



Q 5: What are the module and the package in Python language?

Answer: 
a) Module: The module is the way to structure program. The module can contain one more many Python program file or files. The module can import other modules like the attributes and the objects.

b) Package:  The package is the folder in Python language. A package can have modules or subfolders.








Thursday, November 29, 2018

Very Important Unix Commands


Are you looking for an article for Unix commands which are used for daily activities? Are you looking for the Unix commands which are used for manipulating data? Are also willing to know what commands used for networking and compressing the files? If yes, then you can refer this article as it highlights on commands which are used for data manipulation, networking, messaging and compressing the files.

A) Commands used for manipulating data:


Command
Details
awk
Pattern scanning and processing language
cmp
Compares the contents of two files
comm
Compares sorted data
cut
Cuts out selected fields of each line of a file
diff
Differential file comparator
expand
Expands tabs to spaces
join
Joins files on some common field
perl
Data manipulation language
sed
Stream text editor
sort
Sorts file data
split
Splits the file into smaller files
tr
Translates characters
uniq
Reports repeated lines in a file
wc
Counts words, lines, and characters
vi
Opens vi text editor
vim
Opens vim text editor
fmt
Simple text formatting
spell
Checks text for spelling error
ispell
Checks text for spelling error
emacs
GNU project Emacs
ex, edit
Line editor


B)  Commands used for Compressing files:


Command
Details
compress
Compresses files
gunzip
Helps uncompress gzipped files
gzip
GNU alternative compression method
uncompress
Helps uncompress files
unzip
List, test, and extract compressed files in a ZIP archive
zcat
Cat a compressed file
zcmp
Compares compressed files
zdiff
Compares compressed files
zmore
File perusal filter for crt viewing of compressed text




C)  Commands used for Getting information:


Command
Details
apropos
Locates commands by keyword lookup
info
Displays command information pages online
man
Displays manual pages online
whatis
Searches the whatis database for complete words
yelp
GNOME help viewer


D)  Commands used for Network Communication:


Command
Details
ftp
File transfer program
rcp
Remote file copy
rlogin
Remote login to a Unix host
rsh
Remote shell
tftp
Trivial file transfer program
telnet
Makes terminal connection to another host
ssh
Secures shell terminal or command connection
scp
Secures shell remote file copy
sftp
Secures shell file transfer program




E)  Commands used for sending messages between users:


Command
Details
evolution
GUI mail handling tool on Linux
mail
Simple send or read mail program
mesg
Permits or denies messages
parcel
Sends files to another user
pine
Vdu-based mail utility
talk
Talks to another user
write
Writes message to another user




Refer the video below more interesting concepts about Unix technology -


Wednesday, November 28, 2018

About Us




TechnoGuru is the platform to share knowledge through the articles, the quiz and Youtube videos based on Informatica Mater Data Management, Informatica Data Director, Active VOS, Informatica Services Integration Framework, Informatica User Exits, Provisioning Tool, Unix, Oracle, Microservices, Weblogic and Java. TechnoGuru team has extensive working experience and knowledge about these technologies.

The main focus of the website www.dronatechnoworld.com is to share knowledge with everyone and provide the latest updates in Technology.

You can reach us by email: guru4technoworld@gmail.com or by phone at +1 (914) 340 4011. You can donate us here



Monday, November 19, 2018

What are Zombie, Orphan and Daemon processes in Unix system?

Are you looking for the information about process management in Unix System? If already know about foreground and background process and would like to know more about Zombie, Orphan and Daemon processes in Unix system? If yes, then refer this article to understand more interesting things about process management in Unix. If you have not gone through the previous article about Process Management in Unix System then I would recommend going through it first.

What are Zombie processes?

Zombie processes are those processes which are killed or completed execution but still shows an entry in the process table.

Important points-
  • The zombie process shows the process with a Z state.
  • The zombie process is also known as the defunct process.
  • Such kind of processes are dead and not being used for any business or system processing.
  • The orphan processes and the zombie processes are different.
  • A child process always first becomes a zombie before being removed 
  • To remove zombies we can use 'kill' command as the SIGCHLD signal can be sent to the parent manually.
Reasons for the zombie processes-
  1. The issue in the parent program: If the Zombies that exist for more time then it indicates an issue in the parent program
  2. The issue with child program: The Unix system uncommon decision to not reap children.
  3. The operating system issue: The bug in the operating system may cause the parent program is no longer running.

Impact of the zombie process-
  1. No out of memory issue as the zombie process does not consume memory
  2. The issue with running out of process table entries

 What are Orphan processes?

A child process which remains running itself even after its parent process is completed or terminated is called as an orphan process.

Important points

  1. The orphan process is get created unknowingly and unintentionally due to process crash.
  2. Normally, Unix system tries to protect the orphan process with help of user's shell. The Unix system tries to terminate the child processes by SIGHUP process signal.
  3. Re-parenting automatically happens in Unix environment. i.e. assigning the parent to the child process. However, it is internal to Unix system
  4. An orphan process is a computer process whose parent process has finished or terminated, though it remains running itself. Normally special init system process will be the parent for such orphan process. The process is still considered an orphan process as its original parent who created this process is no more exists.
  5. In some cases, the orphan process is created intentionally. This is to detach the current user's session and let it run in the background, especially when the process is long running. Sometimes such orphan processes are also called a daemon process.

What is the daemon process?

The system related processes which run in the background and often run with the permissions of the root are called daemon processes. In many cases, these daemon processes service requests from other processes.
  1. A daemon has no controlling terminal. 
  2. The daemon process cannot open /dev/tty. 
  3. e.g If we execute the command "ps -ef" and all daemon processes will have ? for the tty field in the output.
  4. If we have a program which runs for a long time, it is good idea to make it a daemon and run it in the background.
  5. Normally, such processes start when the system is bootstrapped 
  6. The daemon processes terminate only when the system is shut down. 

Example of daemon process is real world is - printer daemon waiting for print commands.



Navigating Healthcare: A Guide to CareLink Patient Portal

  In the modern era of healthcare, patient engagement and empowerment are paramount. CareLink Patient Portal stands as a digital bridge betw...