Skip to content

Instantly share code, notes, and snippets.

@kodekracker
Last active January 14, 2016 10:46
Show Gist options
  • Select an option

  • Save kodekracker/a0dff57be8692b6ed30b to your computer and use it in GitHub Desktop.

Select an option

Save kodekracker/a0dff57be8692b6ed30b to your computer and use it in GitHub Desktop.
A list of interview questions
  1. Most common 4 HTTP VERB used in WEB API
    • GET,PUT,POST,DELETE
  2. what is CORS ?
    • Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources (e.g. fonts) on a web page to be requested from another domain outside the domain from which the resource originated.
    • Only web fonts and AJAX(XMLHttpRequest) requests faced CORS problem.
    • For simple CORS requests, the server only needs to add the following header to its response: Access-Control-Allow-Origin: *
  3. what is CSRF attack?
    • Cross-site request forgery (XSRF or CSRF) is a method of attacking a Web site in which an intruder masquerades as a legitimate and trusted user. An XSRF attack can be used to modify firewall settings, post unauthorized data on a forum or conduct fraudulent financial transactions.
    • Prevention methods :- Synchronizer token pattern , Cookie-to-Header Token
  4. what is XSS attack?
    • Cross-Site Scripting (XSS) attacks are a type of injection, in which malicious scripts are injected into otherwise benign and trusted web sites.
    • Prevention methods:- Sanitizing the input of form
  5. Does python support switch/case statement in Python?
    • NO
  6. Diff b/w mutable vs immutable datatypes?
    • The content of objects of immutable types cannot be changed after they are created.
    • mutable -> list, set, dict, byte array
    • immutable -> tuple, frozen set, int, float, str
  7. What is the use of init.py file?
    • It is used to import a module in a directory, which is called package import.
  8. Diff b/w range() and xrange()?
    • range() returns a list containing all the numbers from a to b
    • xrange() returns an iterator rather than a list, which makes it more lighter in terms of memory use
  9. which method you have declare to make object iterable?
    • iter() with next()
  10. Diff b/w docstrings vs comments?
    • A docstring is the documentation string for a function
  11. Diff b/w classmethod vs staticmethod?
  12. Ask about map(), filter(), reduce(), lambda function, list comprehension?
  13. Usage of *args and **kwargs ?
    • Putting *args and/or **kwargs as the last items in our function definition's argument list allows that function to accept an arbitrary number of anonymous and/or keyword arguments.
  14. Diff b/w RDMS and NoSQL?
  15. what is normalization in DBMS?
    • Normalization is a process of organizing the data in database to avoid data redundancy, insertion anomaly, update anomaly & deletion anomaly. 1NF, 2NF, 3NF and BCNF(Boyce and Codd Normal Form )
  16. List command of DDL, DML, and DCL?
    • Data Definition Language, which deals with database schemas and descriptions, of how the data should reside in the database. [ CREATE, ALTER, DROP, TRUNCATE, COMMENT, RENAME]
    • Data Manipulation Language, which deals with data manipulation and used to store, modify, retrieve, delete and update data in database. [ SELECT, INSERT, UPDATE, DELETE, MERGE, CALL]
    • Data Control Language which includes commands such as GRANT, and mostly concerned with rights, permissions and other controls of the database system. [GRANT, REVOKE]
  17. Diff b/w DROP, DELETE and TRUNCATE command of SQL?
    • DROP command deleting the table and its structure from the data base.
    • DELETE command used for deleting the records from the table,and it removing the table space which is allocated by the data base, and returns number of rows deleted.
    • TRUNCATE command is also delete the records but it doesn't delete the table space which is created by the data base, and does not return number of deleted rows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment