Programming Languages

Programming Languages: Prepare Programming Languages Interview Questions, Answers, Tips, news, tutorials. Find Programming Languages Questions asked in various companies, Get Career advice & Interview Procedures from Programming Languages experts.

  • What are anonymous classes in PHP7.
    Php 7

    Posted By: Annie

    Anonymous Class in PHP is new way of creating object without the need to name them. Anonymous classes are created and initiated at same time.

    Example of an Anonymous Class in PHP

    $object =new class('argument'){
    
    public $property;
    
    public function __construct($argument){
    
    	$this->property=$argument;
    
    }
    
    }
    

  • What is Coercive mode in PHP?
    Php 7

    Posted By: Gene

    Coercive mode in PHP is the default mode of Scalar type declarations (Feature introduced in PHP 7).

  • What is Strict mode in PHP?
    Php 7

    Posted By: Prashant

    Strict mode is new feature in PHP in which variable declaration is required before using it.

  • What are Array constants?
    Php 7

    Posted By: Dana

    In PHP 5.6 or we can define constants as a scalar expression. We can define an array constant using the define keyword.

    Array Constant Example in PHP

     define('fruits', [
          'apple',
          'mango',
          'banana'
       ]);
     print(fruits[2]); // outputs banana
    

  • Explain Spaceship Operator?
    Php 7

    Posted By: Marcel

    Spaceship operator also is known as (combined comparison operator) is a new operator introduced in PHP 7. This operator is denoted by "<=>". This single operator can perform greater than, less than, and equal comparison between two operands. Its behavior is similar like strcmp() or version_compare() functions and can be used with integers, floats, strings, arrays, objects, etc.

  • What is use of random_bytes() in PHP?
    Php 7

    Posted By: EvgeniaAnd

    random_bytes() function in PHP is used to generate cryptographically secure pseudo-random bytes.

    Syntax:

    String random_bytes ( int $length )
    

    Usage

    $length = random_bytes('4'); 
      
    //Print the reult and convert by binaryhexa 
    var_dump(bin2hex($length)); 
    
    

  • List some features of PHP that are deprecated in PHP 7?
    Php 7

    Posted By: Manjiri Kulkarni

    PHP Features that are deprecated in PHP 7 are.

    • PHP 4 style constructors
    • Static calls to non-static methods
    • password_hash() salt option
    • capture_session_meta SSL context option

  • What is use of set_exception_handler() in PHP?
    Php 7

    Posted By: Anonymous

    set_exception_handler() is a library function in PHP. It is used to set the default exception handler if an exception is not caught within a try/catch block in PHP.exception_handler stop the execution of script.

  • List some extensions have been removed from PHP 7?
    Php 7

    Posted By: Sol

    Following extensions are removed from PHP and are no longer in use

    • ereg
    • mssql
    • mysql
    • sybase_ct

    Read More from https://www.php.net

  • What is mvc in PHP?
    Php

    Posted By: bookermontenegro

    MVC is a design pattern for creating applications that separate Business logic (Controller) and Application data (Models) from the USER interface (View). MVC is an acronym of Model, View Controller.

  • Write a program to upload files using curl
    Php

    Posted By: Abercormlen

  • What is name of max execution time constant in php?
    Php

    Posted By: Winfred

    max_execution_time is of the constant that is used to increase the execution time of a script in PHP.

  • What is difference between echo and print in PHP?
    Php

    Posted By: Vincent

     There are small difference between Echo and Print in PHP. 

     These are - 

    1. Echo has no return value while Print has a return value of 1.
    2. Echo is marginally faster in comparison of Print.
    3. Echo can output one are more strings while Print can output only 1 string.
    4. Echo is a language constructor while Print is a function.

  • What is HTML DOM?
    Php

    Posted By: Oran

    DOM (Document Object Model) is a Object Model for HTML. The Document Object Model (DOM) defines the logical structure of documents and the way a document is accessed and manipulated.

  • Explian the difference between cookie and session?
    Php

    Posted By: Akhil Joy

  • How to create cookies via Ajax in PHP?
    Php

    Posted By: Sim

  • What is sql injection? What you do to prevent SQL Injection in PHP?
    Php

    Posted By: Lyman

  • Explain scope levels in PHP.
    Php

    Posted By: Jignesh

    There are 3 different levels of Scopes are available in PHP. They are.

    • Public: Public scopes allow you to access all data and functions of a Class.
    • Private: Private scopes don't allow you to access the private data and functions of a Class.
    • Protected: Protected scopes only allows its derived class to access the Protected data and functions of a Class.

  • Find the longest palindrome in a string
    Php

    Posted By: Bud

  • What is difference between session and cookie?
    Php

    Posted By: Eddierot

    The Major difference between sessions and cookies are - 

    1.  Sessions are stored in Server Side while Cookies are sotred in Client Side.
    2.  Sessions are stored unlimited amount of Data while Cookies are Stored limited amount of Data.
    3.  Sessions are holding multiple variables while Cookies are not holding multiple varibles.
    4.  Sessions are more secure than Cookies.
    5.  Sessions values are not easily accessible While Cookies values are easily accessible.
    6.  Sessions can not disabled by visitor while cookies can disabled by the visitor.

  • How to get IP address of user in PHP
    Php

    Posted By: Jose

    In your code simply use  $_SERVER['REMOTE_ADDR'] to get the IP address of the client or User.

  • What is the full form of PHP?
    Php

    Posted By: Mohammed Vajhullah

    The full form of PHP is Hypertext preprocessor (earlier called personal home page)

  • How to create object of Interface?
    Php

    Posted By: Asbury

  • What is cross site scripting and how it can be prevented?
    Php

    Posted By: Allen

  • Write pyramid structure without using PHP function ?
    Php

    Posted By: Winfield

  • What is difference between XAMPP, WAMP, and LAMP
    Php

    Posted By: Gardner

    The difference among XAMPP, WAMP and LAMP are - 

                      XAMPP                WAMP                     LAMP
    It is a combine Package of Apache, MariaDB,PHP and Perl.It is a combine Package of Apache, MYSQL and PHP. It is a combine Package of Apache MYSQL And PHP.
    It has compatible with all available operating system as Window, OS-X and Linux.It has limited only for windows operating system. It is a open source platform and Compatible with only Linux.

  • Tell me few diffrence between GET & POST
    Php

    Posted By: Faisal alamgir

    Few difference between GET & POST is - 

    GET request remains in browser history while POST Request does not remain in browser history.

    GET is availbale for retrieving data while POST is available for writing/Updating data.

    GET have no side effects while POST have some side effects.

     

  • How to connect MongoDB using PHP?
    Php

    Posted By: Hunter

  • What is default session time in PHP? How to increase It?
    Php

    Posted By: Leon

  • How can you connect a web page data with mysql ?
    Php

    Posted By: Michael

  • Explian the difference between preg_Match and preg_replace?
    Php

    Posted By: luciomontague9

    preg_Match is the pattern, that is used for searching as a string, while preg_replace is the pattern, that contains the string which is used to search the content, which can be the array of string.

     

  • List the HTTP methods avalable in PHP?
    Php

    Posted By: SMK

  • What is Interface? Why we use it?
    Php

    Posted By: Hayden

  • What is difference betwwen PHP 4, 5 and 7?
    Php

    Posted By: B.V.Sravani

  • What is difference between the include(), require(),require_once() functions in PHP?
    Php

    Posted By: Krishna Kushwaha

  • What are design patterns in PHP? Can you list few.
    Php

    Posted By: Enoch

  • What are Super Global variables in PHP?
    Php

    Posted By: Rollin

  • What is Php ini?
    Php

    Posted By: Elvis

  • Code to send a mail with attachment using phpmailer?
    Php

    Posted By: Lambert

  • What is difference between CURL and AJAX?
    Php

    Posted By: Henderson

  • How to set and Get a value in PHP Session.
    Php

    Posted By: Antone

  • What are Python dictionaries? How to implement it?
    Python

    Posted By: Ray

  • What are immutable data types?
    Python

    Posted By: Ayesha Badepir

  • What is proprioception?
    Python

    Posted By: Roland

  • How to achieve Multithreading in Python?
    Python

    Posted By: Tolbert

  • What is monkey patching in Python?
    Python

    Posted By: Author

  • What are *args and **kwargs in Python?
    Python

    Posted By: Justus

  • Explain few differences between range & xrange?
    Python

    Posted By: Tilman

  • What is the difference between NumPy and SciPy?
    Python

    Posted By: Prosper

  • What is pickling and unpickling in Python?
    Python

    Posted By: Harmon

  • Explain lambda in Python?
    Python

    Posted By: Stacy

  • How to share global variables across modules in Python?
    Python

    Posted By: Anonymous

  • Enlist some Mutable datatypes in Python?
    Python

    Posted By: S.K.Mahalingam

  • What is difference Between List and Tuple in Python?
    Python

    Posted By: Raman verma

  • What Is The Purpose Of Id() Function In Python?
    Python

    Posted By: Benjamin

  • What Is GIL In Python Language?
    Python

    Posted By: Peter

  • Is Python is Thread Safe? Explain how?
    Python

    Posted By: Ajeet Prajapati

  • What are generators in Python?
    Python

    Posted By: KUMAR KANISHK

  • Explain Decorators in Python?
    Python

    Posted By: Austin

  • What is the usage of link() in PHP?
    Php

    Posted By: Jignesh

  • How To Create A Map In Elixir?
    Elixir

    Posted By: Hector

  • How to perform String Interpolation in Elixir?
    Elixir

    Posted By: Sneha Padmakar Patil

  • What are main features of Elixir?
    Elixir

    Posted By: Hence

  • How to install Elixir on Mac Book?
    Elixir

    Posted By: Michel

  • How to read and write a file in Elixir?
    Elixir

    Posted By: Dominick

  • For what sigil are used in Elixir?
    Elixir

    Posted By: Tilman

  • What are Macros in Elixir?
    Elixir

    Posted By: Adolf

  • How to create a Macro in Elixir?
    Elixir

    Posted By: Addie

  • How to define a Struct in Elixir?
    Elixir

    Posted By: Isreal

  • List types of variables supported by Elixir?
    Elixir

    Posted By: Andrew

  • What are $routeProvider and $locationProvider in AngularJs?
    Angularjs

    Posted By: Anonymous

  • Explain the difference between Factory and Service methods?
    Angularjs

    Posted By: prasad

  • What is $http and $q in AngularJS?
    Angularjs

    Posted By: Ajay

  • How to cretae a controller in AngularJS?
    Angularjs

    Posted By: Anonymous

  • What is difference between ng-model and {{}} and ng-bind?
    Angularjs

    Posted By: Nanarrjnuff

  • What does link function do in a directive?
    Angularjs

    Posted By: Gustavus

  • Explain promises in AngularJS?
    Angularjs

    Posted By: Maude

  • Explain box model and who introduced it?
    Angularjs

    Posted By: Charley

  • What is asynchronous mean in AngularJS?
    Angularjs

    Posted By: Elton

  • How do you share data between controllers in Angular?
    Angularjs

    Posted By: venkatesh

  • What is use of angular.copy()?
    Angularjs

    Posted By: Orley

  • What are different types of directives available in AngularJS?
    Angularjs

    Posted By: Golden

  • What are Filters in AngularJS?
    Angularjs

    Posted By: Richard David

  • What are authGuards?
    Angularjs

    Posted By: Houston

  • What are http interceptors?
    Angularjs

    Posted By: Titus

  • What is difference between $rootScope and $scope in AngularJS?
    Angularjs

    Posted By: AnthonySen

  • Explain precompile, link, postcompile?
    Angularjs

    Posted By: Eddie

  • Explain AngularJS Compliation process?
    Angularjs

    Posted By: Rodney

  • What is difference between $scope and scope.
    Angularjs

    Posted By: Nurry

  • How to access $rootScope in view?
    Angularjs

    Posted By: Omar

  • How to define a default route in AngularJS?
    Angularjs

    Posted By: Ossie

  • How to filter the selected checkbox using AngularJS?
    Angularjs

    Posted By: Shalesh Rana

  • What is Data Binding in AngularJs?
    Angularjs

    Posted By: Luis

  • What is use of Compiler?
    Angularjs

    Posted By: Tomas

  • What is E2E Testing?
    Angularjs

    Posted By: Albertus

  • What are CSS classes used by AngularJS?
    Angularjs

    Posted By: Osborne

  • What Architecture Django follows ?
    Django

    Posted By: Elbridge

    Django follows model-template-view (MTV) architectural pattern.

  • What is difference between MVT and MVC?
    Django

    Posted By: Roll

  • What are Middlewares? Lists some important Middlewares you have used in Django?
    Django

    Posted By: Harlan

  • What is Decorator? How to write custom decorator in Django ?
    Django

    Posted By: Homer