<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Guru prasanna</title>
    <description>The latest articles on DEV Community by Guru prasanna (@guru_prasanna_01).</description>
    <link>https://dev.to/guru_prasanna_01</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2437224%2F17ff9c0a-8443-4d5d-a647-e6c1df906403.png</url>
      <title>DEV Community: Guru prasanna</title>
      <link>https://dev.to/guru_prasanna_01</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/guru_prasanna_01"/>
    <language>en</language>
    <item>
      <title>Oracle PL/SQL - Basic Terms</title>
      <dc:creator>Guru prasanna</dc:creator>
      <pubDate>Fri, 16 May 2025 07:25:28 +0000</pubDate>
      <link>https://dev.to/guru_prasanna_01/oracle-plsql-basic-terms-25m3</link>
      <guid>https://dev.to/guru_prasanna_01/oracle-plsql-basic-terms-25m3</guid>
      <description>&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Term&lt;/th&gt;
&lt;th&gt;Explanation&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;PL/SQL&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Procedural Language extension of SQL used in Oracle databases. It adds procedural features like variables, loops, and conditions to SQL.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Block&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The basic unit of a PL/SQL program. Every PL/SQL code is written in blocks (anonymous or named).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;DECLARE&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Section to declare variables, constants, cursors, and exceptions (optional).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;BEGIN&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Mandatory section where the actual executable code (SQL &amp;amp; PL/SQL statements) is written.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;EXCEPTION&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Optional section to handle runtime errors (exceptions).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;END&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Marks the end of the PL/SQL block.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Variable&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A placeholder to store data temporarily during program execution.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Constant&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A variable whose value cannot be changed once initialized.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Cursor&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Used to retrieve multiple rows from a SELECT query, row-by-row.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Loop&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Allows repeated execution of a block of code.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;IF-THEN-ELSE&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Conditional statement to perform different actions based on conditions.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Procedure&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A named PL/SQL block that performs a task.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Function&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Similar to a procedure, but it returns a value.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Trigger&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A PL/SQL block that executes automatically in response to an event (e.g., insert, update).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Exception&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Error condition during execution (e.g., NO_DATA_FOUND, TOO_MANY_ROWS).&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Basic syntax:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DECLARE
   -- Variable declarations
   variable_name datatype;
BEGIN
   -- Executable statements
   -- SQL and PL/SQL code goes here
   DBMS_OUTPUT.PUT_LINE('Hello PL/SQL!');
EXCEPTION
   -- Exception handling
   WHEN OTHERS THEN
     DBMS_OUTPUT.PUT_LINE('An error occurred.');
END;
/

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>oracle</category>
      <category>sql</category>
      <category>database</category>
      <category>dbms</category>
    </item>
    <item>
      <title>Javascript - ServiceNow</title>
      <dc:creator>Guru prasanna</dc:creator>
      <pubDate>Mon, 28 Apr 2025 09:19:54 +0000</pubDate>
      <link>https://dev.to/guru_prasanna_01/javascript-servicenow-cf7</link>
      <guid>https://dev.to/guru_prasanna_01/javascript-servicenow-cf7</guid>
      <description>&lt;h3&gt;
  
  
  How is JavaScript linked with ServiceNow?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ServiceNow is built on JavaScript&lt;/strong&gt;.
&lt;/li&gt;
&lt;li&gt;Almost &lt;strong&gt;all the backend scripts&lt;/strong&gt; (like Business Rules, Script Includes, Scheduled Jobs) are written using &lt;strong&gt;Server-side JavaScript&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Client-side scripts&lt;/strong&gt; (like Client Scripts, UI Policies, Catalog Client Scripts) also use &lt;strong&gt;JavaScript&lt;/strong&gt; to control what happens on the user’s browser.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Glide API&lt;/strong&gt; is ServiceNow’s built-in library written in JavaScript — it helps you easily interact with the ServiceNow database.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;➔ In short: ServiceNow = JavaScript + ServiceNow's Glide API.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  JavaScript Interview Questions (ServiceNow Focused)
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. &lt;strong&gt;How is JavaScript used in ServiceNow?&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Answer:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
JavaScript is used both on the &lt;strong&gt;client-side&lt;/strong&gt; (browser) and &lt;strong&gt;server-side&lt;/strong&gt; (server) in ServiceNow.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Client-side scripting is used for &lt;strong&gt;form manipulation, field validation&lt;/strong&gt;, and &lt;strong&gt;UI actions&lt;/strong&gt; (example: Client Script, Catalog Client Script).
&lt;/li&gt;
&lt;li&gt;Server-side scripting is used for &lt;strong&gt;database operations, automation&lt;/strong&gt;, and &lt;strong&gt;backend processing&lt;/strong&gt; (example: Business Rules, Script Includes).&lt;/li&gt;
&lt;/ul&gt;


&lt;h4&gt;
  
  
  2. &lt;strong&gt;What is a Client Script in ServiceNow?&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Answer:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A Client Script is a piece of JavaScript that runs &lt;strong&gt;on the client’s browser&lt;/strong&gt; when forms are loaded, changed, or submitted.&lt;br&gt;&lt;br&gt;
It is used to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Auto-populate fields&lt;/li&gt;
&lt;li&gt;Validate input before saving&lt;/li&gt;
&lt;li&gt;Display alerts or messages&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;onLoad&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Welcome to the form!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h4&gt;
  
  
  3. &lt;strong&gt;What is a Business Rule in ServiceNow?&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Answer:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A Business Rule is a &lt;strong&gt;server-side script&lt;/strong&gt; that runs when records are inserted, updated, deleted, or queried.&lt;br&gt;&lt;br&gt;
It is used to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automate tasks&lt;/li&gt;
&lt;li&gt;Enforce business logic&lt;/li&gt;
&lt;li&gt;Interact with the database&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;executeRule&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;gsn&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;gs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;short_description&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Updated by Business Rule&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;})(&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;gsn&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;gs&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h4&gt;
  
  
  4. &lt;strong&gt;What is GlideRecord in ServiceNow?&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Answer:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;code&gt;GlideRecord&lt;/code&gt; is a &lt;strong&gt;JavaScript class&lt;/strong&gt; used to query, read, update, and delete records in ServiceNow tables (server-side).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;gr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;GlideRecord&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;incident&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;gr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;priority&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;gr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="k"&gt;while &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;gr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;gs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;gr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;number&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h4&gt;
  
  
  5. &lt;strong&gt;Difference between Client-side and Server-side scripting in ServiceNow?&lt;/strong&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Feature     | Client-side        | Server-side
Runs where? | User's browser     | ServiceNow server
Example     | Client Script      | Business Rule
Purpose     | Form behavior      | Database operations
API used    | GlideForm (g_form) | GlideRecord (gr), GlideSystem (gs)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h4&gt;
  
  
  6. &lt;strong&gt;What is a Script Include in ServiceNow?&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Answer:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A Script Include is a &lt;strong&gt;reusable server-side JavaScript function&lt;/strong&gt; or library that you can call from other scripts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;HelloWorld&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Class&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;HelloWorld&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;prototype&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{},&lt;/span&gt;
  &lt;span class="na"&gt;sayHello&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello, World!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;HelloWorld&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h4&gt;
  
  
  7. &lt;strong&gt;How do you call a Script Include from a Client Script?&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Answer:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
You can use &lt;code&gt;GlideAjax&lt;/code&gt; to call server-side Script Includes from Client Scripts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;ga&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;GlideAjax&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;HelloWorld&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;ga&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addParam&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sysparm_name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sayHello&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;ga&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getXMLAnswer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
  &lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  In Short:
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Script Type&lt;/th&gt;
&lt;th&gt;Place&lt;/th&gt;
&lt;th&gt;Language&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Client Script&lt;/td&gt;
&lt;td&gt;Browser&lt;/td&gt;
&lt;td&gt;JavaScript&lt;/td&gt;
&lt;td&gt;&lt;code&gt;g_form.setValue()&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Business Rule&lt;/td&gt;
&lt;td&gt;Server&lt;/td&gt;
&lt;td&gt;JavaScript&lt;/td&gt;
&lt;td&gt;&lt;code&gt;current.update()&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Script Include&lt;/td&gt;
&lt;td&gt;Server&lt;/td&gt;
&lt;td&gt;JavaScript&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Class.create()&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




</description>
      <category>javascript</category>
      <category>servicenow</category>
      <category>programming</category>
      <category>payilagam</category>
    </item>
    <item>
      <title>Welcome to ServiceNow - course</title>
      <dc:creator>Guru prasanna</dc:creator>
      <pubDate>Fri, 25 Apr 2025 13:21:22 +0000</pubDate>
      <link>https://dev.to/guru_prasanna_01/welcome-to-servicenow-course-2gob</link>
      <guid>https://dev.to/guru_prasanna_01/welcome-to-servicenow-course-2gob</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;ServiceNow&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;ServiceNow is a cloud-based platform that helps organizations manage their IT services, business workflows, and operations in one centralized system.&lt;/p&gt;

&lt;p&gt;Originally built for IT Service Management (ITSM), it has grown into a full enterprise platform for digital workflows.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to the User Menu (select the System Administrator avatar in the top right corner).&lt;/li&gt;
&lt;li&gt;Select Impersonate user.&lt;/li&gt;
&lt;li&gt;Locate and select Platform User [platform.user].&lt;/li&gt;
&lt;li&gt;Complete the impersonation request by selecting the Impersonate user button.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcahjaj4scddd7js6k745.png" alt="Image description" width="800" height="357"&gt;
&lt;/li&gt;
&lt;li&gt;Select and pin the 'All' menu so it is always present as you walk through tasks.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr4gc5yk54sjlqwx61u1p.png" alt="Image description" width="800" height="433"&gt;
&lt;/li&gt;
&lt;li&gt;Navigate to Self-Service &amp;gt; Knowledge, explore the homepage.&lt;/li&gt;
&lt;li&gt;Favorite the Knowledge module in order to easily locate it again in the future.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxwhard3pwrlryt00wunc.png" alt="Image description" width="800" height="450"&gt;
&lt;/li&gt;
&lt;li&gt;Ask yourself: what applications are available to you as the Platform User?&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Lists and Filters&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;A list displays a set of records from a table. You can identify table data in the form of rows and columns. Each row represents one record. Each column represents one field. &lt;/p&gt;

&lt;p&gt;Lists can be filtered and customized to display the information you need. &lt;/p&gt;

&lt;p&gt;--&amp;gt; The list editor allows direct editing of field values in a list without opening a form.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Editing Process:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Open Editor:&lt;/strong&gt; Double-click an empty area of the field or enable single-click editing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enter Values:&lt;/strong&gt; Input the desired values.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Save Changes:&lt;/strong&gt; Use the save icon, cancel icon, or press the Escape key to retain original values.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keyboard Navigation:&lt;/strong&gt; Use Tab and arrow keys to navigate fields.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-line Text:&lt;/strong&gt; Press Shift + Enter to add a new line.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Save Options:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Press Enter to save and move to the next field.&lt;/li&gt;
&lt;li&gt;Use Ctrl + Enter for immediate save.&lt;/li&gt;
&lt;li&gt;Press Esc to close without saving.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Breadcrumb:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;--&amp;gt; A breadcrumb is a navigation aid used primarily in lists and filters.&lt;br&gt;
--&amp;gt; It visually displays the current filter conditions applied to a list and allows users to quickly modify or remove parts of the filter.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;List filters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A filter is a set of conditions applied to a table list to isolate a subset of data. Three components that make up a filter condition include &lt;br&gt;
[1] field, &lt;br&gt;
[2] operator, and &lt;br&gt;
[3] value. &lt;br&gt;
Select the Show/hide filter (funnel) icon to add, remove, or edit filter conditions and apply them.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F901oc6v3w4d7oxdwrrjc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F901oc6v3w4d7oxdwrrjc.png" alt="Image description" width="800" height="276"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Field:&lt;/strong&gt; A choice list based on the table and user access rights. The choice list includes fields on related tables by dot-walking. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Operator:&lt;/strong&gt; A choice list based on the field type. For example, in the incident table, the greater than operator does not apply to the Active field but it does apply to the Priority field. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Value:&lt;/strong&gt; A text entry field or a choice list, depending on the field type. For example, in the Incident table, the Active field offers a choice list with values true, false, and empty, while the Short description field offers a text entry field. &lt;/p&gt;

</description>
      <category>servicenow</category>
      <category>javascript</category>
      <category>programming</category>
      <category>tooling</category>
    </item>
    <item>
      <title>ServiceNow - Important Terms</title>
      <dc:creator>Guru prasanna</dc:creator>
      <pubDate>Thu, 24 Apr 2025 10:09:47 +0000</pubDate>
      <link>https://dev.to/guru_prasanna_01/servicenow-important-terms-4knc</link>
      <guid>https://dev.to/guru_prasanna_01/servicenow-important-terms-4knc</guid>
      <description>&lt;h3&gt;
  
  
  Terms used in serviceNow:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Instance&lt;/strong&gt; – Your own version of the ServiceNow platform.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Table&lt;/strong&gt; – Stores data, similar to a spreadsheet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Record&lt;/strong&gt; – A single entry in a table (like one incident).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Field&lt;/strong&gt; – A column in the table (like “Priority” or “Status”).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Form&lt;/strong&gt; – The screen you use to view or edit a single record.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;List&lt;/strong&gt; – Displays multiple records from a table.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Module&lt;/strong&gt; – A menu item that opens a table, form, list, or other feature.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Application&lt;/strong&gt; – A collection of modules with a common purpose (e.g., Incident Management).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UI (User Interface)&lt;/strong&gt; – The parts of ServiceNow you interact with (menus, forms, lists).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Filter / Breadcrumb&lt;/strong&gt; – Used to search and narrow down data in a list.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Technical Terms:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Client Script&lt;/strong&gt; – JavaScript that runs in the browser for form validation or automation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Business Rule&lt;/strong&gt; – Server-side script that runs when records are created, updated, or deleted.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UI Policy&lt;/strong&gt; – Controls field behavior like visibility, read-only, or mandatory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Catalog Item&lt;/strong&gt; – A requestable item (like “Request Laptop”) in the Service Catalog.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Workflow / Flow&lt;/strong&gt; – Automation that performs a series of steps based on conditions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GlideRecord&lt;/strong&gt; – A script API used to query or manipulate data on the server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ACL (Access Control List)&lt;/strong&gt; – Security rules that control access to data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Update Set&lt;/strong&gt; – A saved collection of changes that can be moved between instances.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SLA (Service Level Agreement)&lt;/strong&gt; – Defines how long a task should take (e.g., resolve a ticket within 24 hours).&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Common Tables used:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;incident&lt;/code&gt; – For IT issue tracking.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;change_request&lt;/code&gt; – For change management.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;task&lt;/code&gt; – General table for tasks.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cmdb_ci&lt;/code&gt; – Stores configuration items.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sys_user&lt;/code&gt; – Stores user information.&lt;/li&gt;
&lt;/ul&gt;




</description>
      <category>servicenow</category>
      <category>developer</category>
      <category>programming</category>
      <category>javascript</category>
    </item>
    <item>
      <title>About Linux - Compiler , Process ,Executable</title>
      <dc:creator>Guru prasanna</dc:creator>
      <pubDate>Wed, 23 Apr 2025 07:52:48 +0000</pubDate>
      <link>https://dev.to/guru_prasanna_01/about-linux-compiler-process-executable-53gl</link>
      <guid>https://dev.to/guru_prasanna_01/about-linux-compiler-process-executable-53gl</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Why linux?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;--&amp;gt; Every code run in linux machine.&lt;br&gt;
--&amp;gt; Linux is efficient due to its command line/Terminal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Linux commands for renaming multiple images at a time:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;--&amp;gt; ls img_*.jpg|sed&lt;br&gt;
--&amp;gt; mv&lt;/p&gt;

&lt;p&gt;In terminal for manual(To know about a command)&lt;br&gt;
--&amp;gt; man sh&lt;/p&gt;

&lt;p&gt;After knowing about commands then we can start scripting which can lead to devops.&lt;/p&gt;

&lt;p&gt;To know how many mount point?&lt;/p&gt;

&lt;p&gt;findmnt  --real&lt;/p&gt;

&lt;p&gt;partition:(About home directory)&lt;br&gt;
mvmvp0 p1 p2&lt;/p&gt;

&lt;p&gt;ls /usr/bin/ --&amp;gt; To store all executable&lt;br&gt;
ls /usr/bin/ls&lt;/p&gt;

&lt;p&gt;To view Task manager:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;top&lt;/code&gt; &lt;br&gt;
--&amp;gt; Now to exit from this click q.&lt;/p&gt;

&lt;p&gt;How to create executable?&lt;/p&gt;

&lt;p&gt;1) type gcc&lt;br&gt;
--&amp;gt; If not found &lt;code&gt;sudo apt install gcc&lt;/code&gt;&lt;br&gt;
c source to convert file into executable.&lt;br&gt;
2) gcc helloworld.c&lt;br&gt;
3) Then remove conio.h line and again run.&lt;br&gt;
4) You will get this error:&lt;/p&gt;

&lt;p&gt;warning: implicit declaration of function ‘getch’; did you mean ‘getc’?&lt;/p&gt;

&lt;p&gt;5) Run this code in terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;
int main() {
printf("hello world\n");
return 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;6) &lt;code&gt;a.out&lt;/code&gt; --&amp;gt; Command not found&lt;br&gt;
7) &lt;code&gt;echo $PATH&lt;/code&gt; --&amp;gt; not in that directory&lt;br&gt;
8) &lt;code&gt;./a.out&lt;/code&gt; --&amp;gt; Runs file inside current folder&lt;br&gt;
9) &lt;code&gt;echo  $$&lt;/code&gt; --&amp;gt; 3401&lt;/p&gt;

&lt;p&gt;So using gcc we have compiled c code and converted to executable and then to run the file we used &lt;code&gt;./a.out&lt;/code&gt; and maked it process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;While running this code:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1) fork --&amp;gt; &lt;code&gt;a.out&lt;/code&gt;&lt;br&gt;
2) exec&lt;/p&gt;

&lt;p&gt;Name change:&lt;br&gt;
Before we have not specified name and now we are specifying name as helloworld and we can run with this name.&lt;/p&gt;

&lt;p&gt;10) &lt;code&gt;gcc -ohelloworld helloworld.c&lt;/code&gt;&lt;br&gt;
11) &lt;code&gt;./helloworld&lt;/code&gt; --&amp;gt; File will be executed&lt;/p&gt;

</description>
      <category>linux</category>
      <category>opensource</category>
      <category>compiling</category>
      <category>process</category>
    </item>
    <item>
      <title>Python programs for interview preparation</title>
      <dc:creator>Guru prasanna</dc:creator>
      <pubDate>Tue, 22 Apr 2025 07:10:17 +0000</pubDate>
      <link>https://dev.to/guru_prasanna_01/python-programs-for-interview-preparation-5094</link>
      <guid>https://dev.to/guru_prasanna_01/python-programs-for-interview-preparation-5094</guid>
      <description>&lt;h3&gt;
  
  
  1. &lt;strong&gt;Check if a number is even or odd&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Enter a number: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Even number&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Odd number&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  2. &lt;strong&gt;Find the largest among three numbers&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Enter first number: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Enter second number: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Enter third number: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;largest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;
&lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;largest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;largest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;The largest number is&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;largest&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  3. &lt;strong&gt;Check if a string is a palindrome&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Enter a string: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[::&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Palindrome&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Not a palindrome&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  4. &lt;strong&gt;Print Fibonacci series up to N terms&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Enter number of terms: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt; &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  5. &lt;strong&gt;Factorial of a number (using loop)&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Enter a number: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="n"&gt;fact&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;fact&lt;/span&gt; &lt;span class="o"&gt;*=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Factorial is&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fact&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  6. &lt;strong&gt;Check if a number is prime&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Enter a number: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Not Prime&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Not Prime&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;break&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Prime Number&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  7. &lt;strong&gt;Reverse a string&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Enter a string: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;rev&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[::&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Reversed string:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  8. &lt;strong&gt;Sum of digits of a number&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Enter a number: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
    &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Sum of digits:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  9. &lt;strong&gt;Find the second largest number in a list&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;numbers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Second largest:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  10. &lt;strong&gt;Count vowels in a string&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Enter a string: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;vowels&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;aeiouAEIOU&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;char&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;char&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;vowels&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Number of vowels:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  11. &lt;strong&gt;sum of digits repeatedly until the number becomes a single digit&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;sum_of_digits&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
        &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
            &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
        &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt;

&lt;span class="n"&gt;number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Enter a number: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;sum_of_digits&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Single digit sum is:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  12. &lt;strong&gt;Reverse a number (e.g., 123 → 321)&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Enter a number: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="n"&gt;rev&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;digit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
    &lt;span class="n"&gt;rev&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;digit&lt;/span&gt;
    &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Reversed number:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  13. &lt;strong&gt;Find sum of elements in a list using sum() and without sum()&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Using built-in:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;lst&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Sum:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Without built-in:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;lst&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Sum:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  14. &lt;strong&gt;Count frequency of each character in a string&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Enter a string: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;freq&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;char&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;freq&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;char&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;freq&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;char&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;freq&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;items&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>programming</category>
      <category>python</category>
      <category>payilagam</category>
      <category>interview</category>
    </item>
    <item>
      <title>ServiceNow - Interview Questions and Answers</title>
      <dc:creator>Guru prasanna</dc:creator>
      <pubDate>Mon, 21 Apr 2025 10:07:47 +0000</pubDate>
      <link>https://dev.to/guru_prasanna_01/servicenow-interview-questions-and-answers-3fmd</link>
      <guid>https://dev.to/guru_prasanna_01/servicenow-interview-questions-and-answers-3fmd</guid>
      <description>&lt;h2&gt;
  
  
  ServiceNow
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. What is ServiceNow?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Answer:&lt;br&gt;
ServiceNow is a cloud-based platform that helps organizations manage digital workflows, especially for IT services like incident management, request tracking, approvals, and automation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. What is an Incident in ServiceNow?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Answer:&lt;br&gt;
An incident is an unplanned interruption or issue in a service. It’s tracked using the incident table to restore service as quickly as possible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. What is a ServiceNow Table?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Answer:&lt;br&gt;
A table stores data in rows and columns. Every record in ServiceNow — incidents, users, changes — is stored in a table.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. What is the difference between a Client Script and a Business Rule?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Answer:&lt;br&gt;
&lt;strong&gt;Client Script&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
--&amp;gt; Runs in browser (client-side)&lt;br&gt;&lt;br&gt;
--&amp;gt; Used for form validation or behavior                            &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Business Rule&lt;/strong&gt;&lt;br&gt;
--&amp;gt; Runs on server (backend)&lt;br&gt;
--&amp;gt; Used to update data or send field notifications&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. What is a Record in ServiceNow?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Answer:&lt;br&gt;
A record is a single entry in a table — like one incident or one user. It’s like a row in Excel.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. What is a Form and a List in ServiceNow?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Answer:&lt;br&gt;
--&amp;gt; A form shows one record at a time (like filling a ticket).&lt;/p&gt;

&lt;p&gt;--&amp;gt; A list shows multiple records (like a table view).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. What is a UI Policy?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Answer:&lt;br&gt;
A UI Policy changes how fields look on the form — like making them mandatory, hidden, or read-only based on conditions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. What is the Service Catalog?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Answer:&lt;br&gt;
The Service Catalog is a place where users can request items or services, like new laptops, software, or access. Each request can trigger workflows and approvals.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9. What is the use of Flow Designer in ServiceNow?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Answer:&lt;br&gt;
Flow Designer allows you to create automated workflows visually — without coding. It’s used to build flows like approval chains or email notifications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10. What is GlideRecord?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Answer:&lt;br&gt;
GlideRecord is a server-side script in ServiceNow used to query and interact with database tables (similar to SQL in code).&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>payilagam</category>
      <category>servicenow</category>
    </item>
    <item>
      <title>Software Testing - Manual Testing ,Levels,Types</title>
      <dc:creator>Guru prasanna</dc:creator>
      <pubDate>Sat, 22 Mar 2025 06:30:45 +0000</pubDate>
      <link>https://dev.to/guru_prasanna_01/software-testing-manual-testing-levelstypes-1hk</link>
      <guid>https://dev.to/guru_prasanna_01/software-testing-manual-testing-levelstypes-1hk</guid>
      <description>&lt;h3&gt;
  
  
  &lt;strong&gt;Manual Testing&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Manual Testing is the process of testing software manually (without using automation tools) to find bugs. A tester plays the role of an end-user and executes test cases to ensure the application works as expected.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;1. What is Software Testing?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Software testing is the process of checking whether a software application meets the required specifications and is free of defects. It ensures that the application behaves correctly, is reliable, and performs well.  &lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Why is Testing Needed?&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;To &lt;strong&gt;find bugs&lt;/strong&gt; before users face them.
&lt;/li&gt;
&lt;li&gt;To ensure the software &lt;strong&gt;meets user requirements&lt;/strong&gt;.
&lt;/li&gt;
&lt;li&gt;To &lt;strong&gt;improve software quality&lt;/strong&gt;.
&lt;/li&gt;
&lt;li&gt;To &lt;strong&gt;avoid financial and reputation loss&lt;/strong&gt; due to software failures.
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;2. What is Manual Testing?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Manual testing is testing software &lt;strong&gt;without using automation tools&lt;/strong&gt;. Testers check the application by &lt;strong&gt;clicking buttons, entering data, and verifying outputs&lt;/strong&gt;.  &lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Advantages of Manual Testing:&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;✔ Better for &lt;strong&gt;new applications&lt;/strong&gt; that change frequently.&lt;br&gt;&lt;br&gt;
✔ Finds &lt;strong&gt;user experience issues&lt;/strong&gt; that automation may miss.&lt;br&gt;&lt;br&gt;
✔ Cost-effective for &lt;strong&gt;small projects&lt;/strong&gt;.  &lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Disadvantages of Manual Testing:&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;❌ Time-consuming for &lt;strong&gt;large applications&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
❌ More chance of &lt;strong&gt;human errors&lt;/strong&gt;.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;3. Types of Manual Testing&lt;/strong&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;a) Black Box Testing(For testers)&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;The tester doesn’t need to know the internal code.
&lt;/li&gt;
&lt;li&gt;Tests based on user actions.
&lt;/li&gt;
&lt;li&gt;Example: Checking if a login form works by entering a username and password.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;b) White Box Testing(For developers or automation testers)&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;The tester &lt;strong&gt;knows the internal code&lt;/strong&gt; and tests how different parts of the program work.
&lt;/li&gt;
&lt;li&gt;Example: Checking if a function correctly calculates the sum of two numbers.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;c) Grey Box Testing(For testers with partial code knowledge)&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;A mix of &lt;strong&gt;Black Box and White Box testing&lt;/strong&gt;.
&lt;/li&gt;
&lt;li&gt;The tester knows some internal working of the application but tests it as an end-user.
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;4. Different Levels of Manual Testing&lt;/strong&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;a) Unit Testing&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Testing &lt;strong&gt;individual parts of the application&lt;/strong&gt; (like a single function or module).
&lt;/li&gt;
&lt;li&gt;Example: Checking if the “Add to Cart” button works properly.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;b) Integration Testing&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Testing &lt;strong&gt;how different modules work together&lt;/strong&gt;.
&lt;/li&gt;
&lt;li&gt;Example: Checking if the cart updates correctly when an item is added.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;c) System Testing&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Testing the &lt;strong&gt;entire application&lt;/strong&gt; to ensure it meets requirements.
&lt;/li&gt;
&lt;li&gt;Example: Checking if an e-commerce website works from login to checkout.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;d) User Acceptance Testing (UAT)&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Done by &lt;strong&gt;end users or clients&lt;/strong&gt; before releasing the software.
&lt;/li&gt;
&lt;li&gt;Example: A customer testing a banking app before it goes live.
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;5. Test Case &amp;amp; Test Scenario&lt;/strong&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Test Case:&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;detailed step-by-step document&lt;/strong&gt; to test a specific function.
&lt;/li&gt;
&lt;li&gt;Example:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Test Case:&lt;/strong&gt; Verify the login page
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Steps:&lt;/strong&gt; Enter username, enter password, click login
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expected Result:&lt;/strong&gt; User should log in successfully
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Test Scenario:&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;high-level idea&lt;/strong&gt; of what to test.
&lt;/li&gt;
&lt;li&gt;Example: “Test login functionality” (without detailed steps).
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;6. Defect Life Cycle (Bug Life Cycle)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;When a tester finds a bug, it follows a &lt;strong&gt;lifecycle&lt;/strong&gt;:  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;New&lt;/strong&gt; → Bug is reported.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Assigned&lt;/strong&gt; → Sent to a developer.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;In Progress&lt;/strong&gt; → Developer starts fixing it.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fixed&lt;/strong&gt; → Bug is resolved.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retest&lt;/strong&gt; → Tester checks if it is fixed.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Closed&lt;/strong&gt; → If fixed, it is marked as closed.
&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;7. Difference Between Manual &amp;amp; Automation Testing&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Execution:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;--&amp;gt; Manual Testing is performed by a human tester.&lt;br&gt;
--&amp;gt; Automation Testing is done using scripts and tools like Selenium.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Speed:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;--&amp;gt; Manual Testing is slower since it requires human effort.&lt;br&gt;
--&amp;gt; Automation Testing is faster as scripts execute quickly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cost:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;--&amp;gt; Manual Testing is cost-effective for small projects.&lt;br&gt;
--&amp;gt; Automation Testing has a higher initial cost due to tool and script development.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Accuracy:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;--&amp;gt; Manual Testing is prone to human errors.&lt;br&gt;
--&amp;gt; Automation Testing is more accurate since it follows predefined scripts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best For:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;--&amp;gt; Manual Testing is ideal for small projects, exploratory testing, and UI testing.&lt;br&gt;
--&amp;gt; Automation Testing is best for large projects, repetitive tasks, and regression testing.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;8. Common Manual Testing Tools&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Although manual testing doesn’t use automation, testers may use tools for reporting and tracking defects.  &lt;/p&gt;

&lt;p&gt;✔ &lt;strong&gt;JIRA&lt;/strong&gt; – Tracks bugs and test cases.&lt;br&gt;&lt;br&gt;
✔ &lt;strong&gt;TestRail&lt;/strong&gt; – Manages test cases.&lt;br&gt;&lt;br&gt;
✔ &lt;strong&gt;Bugzilla&lt;/strong&gt; – Reports and tracks defects.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Software Development Life Cycle (SDLC)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;SDLC is the process of developing software in a structured way, ensuring that it meets user requirements and is of high quality.&lt;br&gt;
&lt;strong&gt;Phases of SDLC:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Requirement Gathering &amp;amp; Analysis:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Collect requirements from the client.&lt;/li&gt;
&lt;li&gt;Example: A client wants an online banking system.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Planning:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Decide the budget, timeline, and resources needed for the project.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Design:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create system architecture and UI/UX designs.&lt;/li&gt;
&lt;li&gt;Example: Designing how the login page will look.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Development (Coding):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Developers write the code based on the design.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Testing:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Testers check for bugs and defects.&lt;/li&gt;
&lt;li&gt;Example: Checking if the login works correctly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Deployment:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The software is released for users.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Maintenance:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fixing bugs and updating features after release.&lt;/li&gt;
&lt;li&gt;Example: Fixing issues reported by users.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Software Testing Life Cycle (STLC)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;STLC is a step-by-step process followed by testers to ensure the software is free of bugs and meets requirements.&lt;br&gt;
&lt;strong&gt;Phases of STLC:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Requirement Analysis:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Testers understand what needs to be tested.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Example: Checking login, payments, and UI elements in a banking app.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Test Planning:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a test strategy and decide testing timelines.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Test Case Development:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Write test cases (step-by-step instructions for testing).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Test Environment Setup:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Prepare hardware, software, and test data for testing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Test Execution:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Execute test cases and report bugs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Test Closure:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Prepare a report summarizing the testing process and defects found.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Difference Between SDLC &amp;amp; STLC&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;SDLC is about software development, whereas STLC is about software testing.&lt;/li&gt;
&lt;li&gt;SDLC includes coding, but STLC focuses only on testing.&lt;/li&gt;
&lt;li&gt;STLC starts after SDLC’s requirement phase and runs in parallel with development.&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;9. Common Interview Questions on Manual Testing&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. What is the difference between testing and debugging?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Testing&lt;/strong&gt; is finding defects; &lt;strong&gt;debugging&lt;/strong&gt; is fixing them.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. What are the qualities of a good tester?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Attention to detail, patience, analytical thinking, communication skills&lt;/strong&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. What is a test plan?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A document outlining &lt;strong&gt;what to test, how to test, and who will test&lt;/strong&gt;.
&lt;/li&gt;
&lt;/ul&gt;




</description>
      <category>testing</category>
      <category>softwareengineering</category>
      <category>career</category>
      <category>security</category>
    </item>
    <item>
      <title>Python - Theory Questions and Answers</title>
      <dc:creator>Guru prasanna</dc:creator>
      <pubDate>Wed, 19 Mar 2025 07:55:16 +0000</pubDate>
      <link>https://dev.to/guru_prasanna_01/python-theory-questions-and-answers-3an</link>
      <guid>https://dev.to/guru_prasanna_01/python-theory-questions-and-answers-3an</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;1. Introduction to Python&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Python is a high-level, interpreted, dynamically typed, and object-oriented programming language.
&lt;/li&gt;
&lt;li&gt;It is widely used for web development, data science, automation, AI, and more.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Key Features:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Simple and easy-to-learn syntax.
&lt;/li&gt;
&lt;li&gt;Interpreted language (no need for compilation).
&lt;/li&gt;
&lt;li&gt;Dynamically typed (no need to declare variable types).
&lt;/li&gt;
&lt;li&gt;Extensive standard library support.
&lt;/li&gt;
&lt;li&gt;Supports multiple programming paradigms (Object-Oriented, Functional, and Procedural).
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;2. Python Data Types&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Basic Data Types:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;int&lt;/code&gt; → Integer values, e.g., &lt;code&gt;x = 10&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;float&lt;/code&gt; → Decimal numbers, e.g., &lt;code&gt;y = 3.14&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;str&lt;/code&gt; → Sequence of characters, e.g., &lt;code&gt;name = "Python"&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;bool&lt;/code&gt; → Boolean values, &lt;code&gt;True&lt;/code&gt; or &lt;code&gt;False&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Collection Data Types:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;List&lt;/strong&gt; → Ordered, mutable collection, e.g., &lt;code&gt;fruits = ["apple", "banana"]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tuple&lt;/strong&gt; → Ordered, immutable collection, e.g., &lt;code&gt;numbers = (1, 2, 3)&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set&lt;/strong&gt; → Unordered, unique elements, e.g., &lt;code&gt;s = {1, 2, 3}&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dictionary&lt;/strong&gt; → Key-value pairs, e.g., &lt;code&gt;student = {"name": "John", "age": 25}&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;3. Variables and Operators&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Variables:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Variables store data and do not require explicit type declaration.
&lt;/li&gt;
&lt;li&gt;Example:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;  &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;  &lt;span class="c1"&gt;# Integer
&lt;/span&gt;  &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Python&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;  &lt;span class="c1"&gt;# String
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Operators:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Arithmetic:&lt;/strong&gt; &lt;code&gt;+&lt;/code&gt;, &lt;code&gt;-&lt;/code&gt;, &lt;code&gt;*&lt;/code&gt;, &lt;code&gt;/&lt;/code&gt;, &lt;code&gt;%&lt;/code&gt;, &lt;code&gt;**&lt;/code&gt;, &lt;code&gt;//&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Comparison:&lt;/strong&gt; &lt;code&gt;==&lt;/code&gt;, &lt;code&gt;!=&lt;/code&gt;, &lt;code&gt;&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;&lt;/code&gt;, &lt;code&gt;&amp;gt;=&lt;/code&gt;, &lt;code&gt;&amp;lt;=&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Logical:&lt;/strong&gt; &lt;code&gt;and&lt;/code&gt;, &lt;code&gt;or&lt;/code&gt;, &lt;code&gt;not&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Assignment:&lt;/strong&gt; &lt;code&gt;=&lt;/code&gt;, &lt;code&gt;+=&lt;/code&gt;, &lt;code&gt;-=&lt;/code&gt;, &lt;code&gt;*=&lt;/code&gt;, &lt;code&gt;/=&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Membership:&lt;/strong&gt; &lt;code&gt;in&lt;/code&gt;, &lt;code&gt;not in&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Identity:&lt;/strong&gt; &lt;code&gt;is&lt;/code&gt;, &lt;code&gt;is not&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;4. Control Flow Statements&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Conditional Statements:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Used for decision-making.
&lt;/li&gt;
&lt;li&gt;Example:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;  &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Positive&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Zero&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Negative&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Loops:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;For Loop:&lt;/strong&gt; Iterates over a sequence.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
      &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Output: 0 1 2 3 4
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;While Loop:&lt;/strong&gt; Repeats a block of code while a condition is true.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;  &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
  &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Loop Control Statements:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;break&lt;/code&gt; → Exits the loop early.
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;continue&lt;/code&gt; → Skips the current iteration.
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pass&lt;/code&gt; → Placeholder for future code.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;5. Functions in Python&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Functions help reuse code and improve modularity.
&lt;/li&gt;
&lt;li&gt;Example:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello, &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;

  &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;John&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: Hello, John
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Lambda (Anonymous) Functions:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;  &lt;span class="n"&gt;square&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;
  &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;square&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: 16
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;6. Object-Oriented Programming (OOP) in Python&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Key OOP Concepts:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Class &amp;amp; Object:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;  &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Person&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
          &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;
          &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;

      &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
          &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello, my name is &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

  &lt;span class="n"&gt;p1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Person&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Alice&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;  &lt;span class="c1"&gt;# Output: Hello, my name is Alice
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Encapsulation:&lt;/strong&gt; Hiding data inside classes.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inheritance:&lt;/strong&gt; Reusing features of a parent class.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Polymorphism:&lt;/strong&gt; Using a single method name for different types.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;7. Exception Handling&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Used to handle runtime errors.
&lt;/li&gt;
&lt;li&gt;Example:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;  &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
  &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;ZeroDivisionError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Cannot divide by zero&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;finally&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Execution complete&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;8. File Handling&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Opening and Reading a File:&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;file.txt&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;r&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nb"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Writing to a File:&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;file.txt&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;w&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nb"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nb"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello, Python!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;9. Python Modules and Packages&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Modules&lt;/strong&gt; are files with Python code (&lt;code&gt;.py&lt;/code&gt;).
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;  &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;
  &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sqrt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: 4.0
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Creating a Custom Module:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;  &lt;span class="c1"&gt;# mymodule.py
&lt;/span&gt;  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello, &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

  &lt;span class="c1"&gt;# main.py
&lt;/span&gt;  &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;mymodule&lt;/span&gt;
  &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mymodule&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Alice&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;10. Decorators in Python&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Used to modify functions without changing their code.
&lt;/li&gt;
&lt;li&gt;Example:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;decorator_function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;original_function&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
      &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;wrapper_function&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
          &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Wrapper executed before&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;original_function&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__name__&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
          &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;original_function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;wrapper_function&lt;/span&gt;

  &lt;span class="nd"&gt;@decorator_function&lt;/span&gt;
  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;display&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
      &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Display function executed&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="nf"&gt;display&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;11. Python’s &lt;code&gt;map()&lt;/code&gt;, &lt;code&gt;filter()&lt;/code&gt;, and &lt;code&gt;reduce()&lt;/code&gt; Functions&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Using &lt;code&gt;map()&lt;/code&gt;:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Applies a function to all elements of an iterable.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;  &lt;span class="n"&gt;nums&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="n"&gt;squared&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
  &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;squared&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Output: [1, 4, 9, 16]
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Using &lt;code&gt;filter()&lt;/code&gt;:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Filters elements based on a condition.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;  &lt;span class="n"&gt;nums&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="n"&gt;even&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
  &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;even&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Output: [2, 4]
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Using &lt;code&gt;reduce()&lt;/code&gt;:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Performs a cumulative operation on elements.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;  &lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;functools&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nb"&gt;reduce&lt;/span&gt;
  &lt;span class="n"&gt;nums&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Output: 10
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;12. Python Memory Management&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Python uses &lt;strong&gt;automatic garbage collection&lt;/strong&gt; to manage memory.
&lt;/li&gt;
&lt;li&gt;Objects are deleted when their &lt;strong&gt;reference count&lt;/strong&gt; becomes zero.
&lt;/li&gt;
&lt;li&gt;Example:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;  &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;
  &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
  &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getrefcount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# Output: Reference count of object
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>python</category>
      <category>interview</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>SQL Interview questions and answers</title>
      <dc:creator>Guru prasanna</dc:creator>
      <pubDate>Mon, 17 Mar 2025 10:03:25 +0000</pubDate>
      <link>https://dev.to/guru_prasanna_01/sql-interview-questions-and-answers-4dfb</link>
      <guid>https://dev.to/guru_prasanna_01/sql-interview-questions-and-answers-4dfb</guid>
      <description>&lt;h2&gt;
  
  
  SQL Interview Questions &amp;amp; Answers:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. What is SQL?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;--&amp;gt; SQL (Structured Query Language) is used to store, retrieve, manage, and manipulate data in relational databases like MySQL, PostgreSQL, SQL Server, and Oracle.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. What are the different types of SQL commands?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;SQL commands are categorized into five types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;    DDL (Data Definition Language): CREATE, ALTER, DROP, TRUNCATE (Defines database structure).&lt;/li&gt;
&lt;li&gt;    DML (Data Manipulation Language): SELECT, INSERT, UPDATE, DELETE (Manipulates data).&lt;/li&gt;
&lt;li&gt;    DCL (Data Control Language): GRANT, REVOKE (Controls user permissions).&lt;/li&gt;
&lt;li&gt;    TCL (Transaction Control Language): COMMIT, ROLLBACK, SAVEPOINT (Manages transactions).&lt;/li&gt;
&lt;li&gt;    DQL (Data Query Language): SELECT (Retrieves data).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. What is the difference between DELETE, TRUNCATE, and DROP?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;    DELETE removes specific rows from a table and can be rolled back using ROLLBACK.&lt;/li&gt;
&lt;li&gt;    TRUNCATE removes all rows from a table but keeps its structure. It cannot be rolled back.&lt;/li&gt;
&lt;li&gt;    DROP removes the entire table, including its structure. It also cannot be rolled back.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. What is the difference between WHERE and HAVING?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;WHERE is used to filter rows before grouping.&lt;br&gt;
HAVING is used to filter grouped data after GROUP BY.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT department, COUNT(*) 
FROM employees 
WHERE salary &amp;gt; 30000  
GROUP BY department
HAVING COUNT(*) &amp;gt; 5;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;5. What is a Primary Key and Foreign Key?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;--&amp;gt; Primary Key uniquely identifies each record in a table. It cannot have duplicate or NULL values.&lt;br&gt;
--&amp;gt; Foreign Key references the primary key of another table, maintaining relationships between tables.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE TABLE Customers (
    customer_id INT PRIMARY KEY,
    name VARCHAR(100)
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE TABLE Orders (
    order_id INT PRIMARY KEY,
    customer_id INT,
    FOREIGN KEY (customer_id) REFERENCES Customers(customer_id)
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;6. What is the difference between UNION and UNION ALL?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; UNION combines results from multiple queries and removes duplicates.&lt;/li&gt;
&lt;li&gt; UNION ALL combines results without removing duplicates.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT name FROM customers
UNION  
SELECT name FROM employees;

SELECT name FROM customers
UNION ALL 
SELECT name FROM employees;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;7. What are Joins in SQL? Explain types.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Joins combine records from multiple tables based on a related column.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;INNER JOIN: Returns matching records from both tables.&lt;/li&gt;
&lt;li&gt;LEFT JOIN: Returns all records from the left table + matching records from the right table.&lt;/li&gt;
&lt;li&gt;RIGHT JOIN: Returns all records from the right table + matching records from the left table.&lt;/li&gt;
&lt;li&gt;FULL JOIN: Returns all records when there is a match in either table.&lt;/li&gt;
&lt;li&gt;SELF JOIN: Joins a table with itself.&lt;/li&gt;
&lt;li&gt;CROSS JOIN: Returns the Cartesian product of both tables.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example of INNER JOIN:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT customers.name, orders.order_id  
FROM customers  
INNER JOIN orders ON customers.customer_id = orders.customer_id;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;8. What is an Index in SQL?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;--&amp;gt; An index improves search performance by creating a lookup table for faster access. &lt;br&gt;
--&amp;gt; However, it can slow down INSERT, UPDATE, and DELETE operations because the index must be updated.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE INDEX idx_customer_name ON customers(name);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;9. What are Aggregate Functions?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Aggregate functions perform calculations on multiple rows and return a single value.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;COUNT() → Returns the number of rows.
SUM() → Returns the total sum.
AVG() → Returns the average value.
MIN() → Returns the smallest value.
MAX() → Returns the largest value.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;SELECT department, COUNT(*) AS total_employees, AVG(salary) AS avg_salary&lt;br&gt;
FROM employees&lt;br&gt;
GROUP BY department;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10. What is the difference between GROUP BY and ORDER BY?&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GROUP BY groups rows with the same values and is used with aggregate functions.
ORDER BY sorts the result set in ascending (ASC) or descending (DESC) order.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT department, COUNT(*) 
FROM employees 
GROUP BY department 

SELECT name, salary 
FROM employees 
ORDER BY salary DESC;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;11. What is a Subquery?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A subquery is a query inside another query, typically used in WHERE, FROM, or SELECT clauses.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT name FROM employees
WHERE salary &amp;gt; (SELECT AVG(salary) FROM employees);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Executes the inner query first (AVG(salary)).&lt;/li&gt;
&lt;li&gt;The outer query filters employees with a salary above the average.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>sql</category>
      <category>postgres</category>
      <category>backend</category>
      <category>database</category>
    </item>
    <item>
      <title>OOPS - Interview Questions in python</title>
      <dc:creator>Guru prasanna</dc:creator>
      <pubDate>Mon, 17 Mar 2025 08:57:59 +0000</pubDate>
      <link>https://dev.to/guru_prasanna_01/oops-interview-questions-in-python-16c9</link>
      <guid>https://dev.to/guru_prasanna_01/oops-interview-questions-in-python-16c9</guid>
      <description>&lt;h2&gt;
  
  
  OOPs (Object-Oriented Programming) Interview Questions in Python
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1) What is Object-Oriented Programming (OOP)?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;OOP is a programming paradigm based on the concept of objects, which contain data (attributes) and methods (functions). It allows for code reusability, modularity, and abstraction.&lt;/p&gt;

&lt;p&gt;Key principles of OOP:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;    Encapsulation : Hiding data inside a class and restricting direct access.&lt;/li&gt;
&lt;li&gt;    Abstraction : Hiding implementation details and exposing only necessary parts.&lt;/li&gt;
&lt;li&gt;    Inheritance : Reusing code by creating a new class from an existing one.&lt;/li&gt;
&lt;li&gt;    Polymorphism : Having multiple forms of the same method (overloading &amp;amp; overriding).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2) What is a Class and an Object?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; A class is a blueprint/template for creating objects.&lt;/li&gt;
&lt;li&gt; An object is an instance of a class.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3) What is Encapsulation?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;--&amp;gt; Encapsulation is the process of hiding data within a class and only allowing controlled access via methods.&lt;br&gt;
--&amp;gt; In Python, we use private attributes (__varname) to enforce encapsulation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4) What is Inheritance?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Inheritance allows a class (child class) to inherit attributes and methods from another class (parent class).&lt;/p&gt;

&lt;p&gt;Types of inheritance:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Single Inheritance → A child class inherits from a single parent class.&lt;/li&gt;
&lt;li&gt;Multiple Inheritance → A child class inherits from multiple parent classes.&lt;/li&gt;
&lt;li&gt;Multilevel Inheritance → A child class inherits from a parent class, which itself inherits from another parent.&lt;/li&gt;
&lt;li&gt;Hierarchical Inheritance → Multiple child classes inherit from a single parent class.&lt;/li&gt;
&lt;li&gt;Hybrid Inheritance → A mix of two or more types of inheritance (e.g., multiple + multilevel).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5) What is Polymorphism?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Polymorphism allows different classes to use the same method name but behave differently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6) What is Abstraction?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;--&amp;gt; Abstraction means hiding implementation details and exposing only the required functionalities using abstract classes.&lt;br&gt;
--&amp;gt; Python provides ABC (Abstract Base Class) to achieve abstraction.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7) What is the difference between Method Overloading and Method Overriding?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Method overloading : Same method name with different parameters in the same class.&lt;br&gt;
Method Overriding : Same method name and same parameters in a parent-child relationship (Inheritance).&lt;/p&gt;

</description>
      <category>programming</category>
      <category>python</category>
      <category>oop</category>
      <category>payilagam</category>
    </item>
    <item>
      <title>Python Programs - Interview Questions and Answers</title>
      <dc:creator>Guru prasanna</dc:creator>
      <pubDate>Fri, 14 Mar 2025 13:25:57 +0000</pubDate>
      <link>https://dev.to/guru_prasanna_01/python-programs-interview-questions-and-answers-4i0l</link>
      <guid>https://dev.to/guru_prasanna_01/python-programs-interview-questions-and-answers-4i0l</guid>
      <description>&lt;p&gt;&lt;strong&gt;1️⃣ Reverse a String&lt;/strong&gt;&lt;br&gt;
Program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
def reverse_string(s):
    return s[::-1]

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Example usage
print(reverse_string("hello"))  # Output: "olleh"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;s[::-1]&lt;/code&gt; is slicing with a step of &lt;code&gt;-1&lt;/code&gt; which reverses the string.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2️⃣ Check if a Number is Prime&lt;/strong&gt;&lt;br&gt;
Program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;no = int(input("Enter a number: "))

if no &amp;lt; 2:
    print("Not Prime")
else:
    div = 2
    while div &amp;lt; no:
        if no % div == 0:
            print("Not Prime")
            break
        div += 1
    else:
        print("Prime")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A number is prime if it is only divisible by 1 and itself.&lt;br&gt;
We check if number is divisible by 2 and if remainder is 0 then it is not prime number.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3️⃣ Find the Factorial of a Number&lt;/strong&gt;&lt;br&gt;
Program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
def factorial(n):
    if n == 0 or n == 1:
        return 1
    return n * factorial(n - 1)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Example usage
print(factorial(5))  # Output: 120
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`Uses recursion: factorial(n) = n * factorial(n-1), base case factorial(1) = 1.`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;4️⃣ Check if a String is a Palindrome&lt;/strong&gt;&lt;br&gt;
Program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def is_palindrome(s):
    return s == s[::-1]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Example usage
print(is_palindrome("madam"))  # Output: True
print(is_palindrome("hello"))  # Output: False
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Compares the string with its reverse to determine if it is a palindrome.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;5️⃣ Fibonacci Series using Recursion&lt;/strong&gt;&lt;br&gt;
Program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def fibonacci(n):
    if n &amp;lt;= 0:
        return 0
    elif n == 1:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Example usage
&lt;/h1&gt;

&lt;p&gt;print([fibonacci(i) for i in range(6)])  # Output: [0, 1, 1, 2, 3, 5]&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Recursively calculates the Fibonacci sequence.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;6️⃣ Find the Largest Element in a List&lt;/strong&gt;&lt;br&gt;
Program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
def find_largest(lst):
    return max(lst)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Example usage
print(find_largest([3, 5, 2, 9, 1]))  # Output: 9
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Uses Python’s built-in `max()` function.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;7️⃣ Swap Two Variables Without a Temporary Variable&lt;/strong&gt;&lt;br&gt;
Program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
a, b = 5, 10
a, b = b, a
print(a, b)  # Output: 10, 5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Swaps values using tuple unpacking.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;8️⃣ Count the Number of Vowels in a String&lt;/strong&gt;&lt;br&gt;
Program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def count_vowels(s):
    return sum(1 for char in s.lower() if char in "aeiou")

# Example usage
print(count_vowels("Hello World"))  # Output: 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Uses list comprehension and `sum()` to count vowels.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;9️⃣ Remove Duplicates from a List&lt;/strong&gt;&lt;br&gt;
Program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
def remove_duplicates(lst):
    return list(set(lst))

# Example usage
print(remove_duplicates([1, 2, 2, 3, 4, 4, 5]))  # Output: [1, 2, 3, 4, 5]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Converts list to a set to remove duplicates, then back to a list.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;🔟 Check if Two Strings are Anagrams&lt;/strong&gt;&lt;br&gt;
Program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def are_anagrams(s1, s2):
    return sorted(s1) == sorted(s2)

# Example usage
print(are_anagrams("listen", "silent"))  # Output: True
print(are_anagrams("hello", "world"))  # Output: False
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Anagrams have the same letters in different orders, so sorting both strings should yield the same result.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>programming</category>
      <category>python</category>
      <category>webdev</category>
      <category>interview</category>
    </item>
  </channel>
</rss>
