FULL-STACK DEVELOPER INTERVIEW QUESTIONS AND ANSWERS
Last updated
Was this helpful?
Last updated
Was this helpful?
A module should be responsible to one, and only one, actor.
A software artifact should be open for extension but closed for modification.
It should be possible to substitute base class with derived class.
Many client-specific interfaces are better than one general-purpose interface.
Depend upon Abstractions but not on concretions. This means that each module should be separated from other using an abstract layer which binds them together. Source code dependency points in the opposite direction compared to the flow of control.
Pros of microservices (The services are easy to replace, Services can be implemented using different programming languages, databases, hardware and software environment, depending on what fits best)
Design patterns.
3-layer architecture (DAO (Repository), Business (Service) layer, Controller)
Nullipotent operation (GET method is a safe method (or nullipotent), meaning that calling it produces no side-effects)
Why do you need web server (tomcat, jetty)?
Advantages of using modules. (reuse, decoupling, namespace)
Adding new features will take an order of magnitude longer
Impossible to optimize
Extremely difficult to test
Fixing and debugging can be a nightmare (fixing something in one place can lead to something else breaking that seems completely unrelated).
What is the difference between thread and process? (Threads (of the same process) run in a shared memory space, while processes run in separate memory spaces)
What is a
algorithm?
Synchonization aids in Java
CountDownLatch
CyclicBarrier
Phaser
ReentrantLock
Exchanger
Semaphore
LinkedTransferQueue
A program is correctly synchronized if and only if all sequentially consistent executions are free of data races
Correctly synchronized programs have sequentially consistent semantics. If a program is correctly synchronized, then all executions of the program will appear to be sequentially consistent
What is monitor in Java? (Each object in Java is associated with a monitor, which a thread can lock or unlock)
What is safe publication?
What is wait/notify?
How to correctly stop a thread? (Thread.interrupt())
What is Spring? (Spring Framework is an application container for Java that supplies many useful features, such as Inversion of Control, Dependency Injection, abstract data access, transaction management, and more)
Spring is a framework for dependency injection: a design pattern that allows the developer to build very decoupled systems by injecting dependencies into classes.
It elegantly wraps Java libraries and makes then much easier to use in your application.
Included in the framework are implementations of commonly used patterns such as REST and MVC web framework which are predominately use by in web applications.
What is Spring-Boot?
What is Hibernate and JPA (Caches, lazy-loading)?
Garbage collection. (G1, Young/Old generation collectors combination examples: PS Scavenge/PS MarkSweep, Copy/MarkSweepCompact)
What are Java 9 modularity?
What is OSGI? (Specification describes a modular system and a service platform for the Java programming language that implements a complete and dynamic component model. Each bundle has its own classpath. Dependency hell avoidance. META-INF/MANIFEST. MF contains OSGI-info)
Serializable / Externalizable
What is a servlet (versions of servlet api, Servlet 4.0)?
What is a servlet filter? How to implement GZipFilter? (ResponseWrapper)
What is generics and PECS (producer extends and consumer super)?
Major specs: JAX-RS, JAX-WS, JMS, JAXB, XSLT, XPATH, JNDI, JMX, JDBC, XML(SAX, DOM, StAX)
CSRF prevention (CSRF-token)
Browser-server communication methods: WebSocket, EventSource, Comet(Polling, Long-Polling, Streaming)
SQL join types (inner join, left/right outer join, full outer join, cross join)
SQL normal forms
The domain of each attribute contains only atomic values, and the value of each attribute contains only a single value from that domain
No non-prime attribute in the table is functionally dependent on a proper subset of any candidate key
Every non-prime attribute is non-transitively dependent on every candidate key in the table. BCNF.Every non-trivial functional dependency in the table is a dependency on a superkey.)
Isolation levels and Anomalies
Read Uncommitted
-
may occur
may occur
may occur
may occur
Read Committed
-
-
may occur
may occur
may occur
Repeatable Read
-
-
-
may occur
may occur
Snapshot
-
-
-
-
may occur
Serializable
-
-
-
-
-
Types of NoSQL databases?
Document Stores (MongoDB, Couchbase)
Key-Value Stores (Redis, Volgemort)
Column Stores (Cassandra)
Graph Stores (Neo4j, Giraph)
Horizontal and vertical scaling.
How to scale database? (Data partitioning, sharding(vertical/horizontal), replication(master-slave, master-master)).
Denormalization.
What is synchronous multimaster replication? (Each server can accept write requests, and modified data is transmitted from the original server to every other server before each transaction commits)
What is asynchronous multimaster replication? (Each server works independently, and periodically communicates with the other servers to identify conflicting transactions. The conflicts can be resolved by users or conflict resolution rules)
When to use messaging queue?
MongoDB, Redis.
Hadoop basics.
sticky/non-sticky sessions
Sticky sessions vs storing sessions in Redis.
What is map-reduce? (Word count example)
Sharding counters.
Distributed software:
Distributed streaming platforms: kafka
Distributed key-value store: zookeeper, etcd, Consul
Map-reduce: hadoop, spark
Distributed file system: hbase
Cluster management: kubernetes, docker-swarm, mesos
Consensus number. Maximum number of threads for which objects of the class can solve consensus problem.
What is write-through and write-behind caching? (write-through (synchronous), write-behind (asynchronous))
HTTP cache options?
OSI model (Physical, Data link, Network, Transport, Session, Presentation, Application)
Multithreading vs select
TCP back-pressure
Interprocess communication methods. (Pipes, Events, Mailboxes/Ports (can be implemented by using shared memory and semaphores), Direct Message Passing).
Process scheduler.
Data race. When an evaluation of an expression writes to a memory location and another evaluation reads or modifies the same memory location, the expressions are said to conflict. A program that has two conflicting evaluations has a data race unless
both evaluations execute on the same thread or in the same signal handler, or
both conflicting evaluations are atomic operations (see std::atomic), or
one of the conflicting evaluations happens-before another (see std::memory_order)
If a data race occurs, the behavior of the program is undefined.
this keyword
How prototypes work?
inheritance
closures
recursion
What is MVC, MVP, MVVM?
What is promise?
What is event bubbling and capturing? (target.addEventListener(type, listener[, useCapture]))
What is AMD(Asynchronous Module Design) and CommonJS?
What is jQuery?
Implement binary search
Implement quick sort
Git workflow? (Master: production-ready state; Develop: latest delivered development changes for the next release; Feature Branches; Release Branches; Hotfixes)
What is a rebase?
What is Docker?
What is unit test? (A test that purely tests a single unit of functionality)
What is component test?
What is integration test? (Examine several parts of a system to make sure that when integrated, these parts behave as expected)
What is user acceptance test? BDD?
Unit tests advantages?
Types of tests: acceptance testing, functional testing, smoke testing, regression testing, unit testing, integration testing, stress testing, (Load, Performance, Sanity, Stability, Security, Feature, Progression, Installation, Business).
Differences between stub and mock? (A stub is a test double with preprogrammed behavior. Mocks are stubs with preprogrammed expectations)
Selenium tests and webdriver.
How to test multithreading code?
Individuals and interactions over Processes and tools
Working software over Comprehensive documentation
Customer collaboration over Contract negotiation
Responding to change over Following a plan
What is Scrum? (Roles: product owner, development team, scrum master. Events: sprint)
What is XP? ()
What is Kanban?
What is Lean development?
What Ο(n), Ω(n), Θ(n)?
What is NP, NP-completeness, NP-hardness with examples?
How to find memory leak. (Memory snapshot diff).
Profiling: sampling and instrumentation.
Regular expressions. (Examples)
What are your goals to work in our company? (3 categories: professional, financial, social)
What is virtualization?
What is total/partial order?
What is OpenID and OAuth2.0 and OpenID Connect?
Four main actors in an OAuth system (clients, resource owners, authorization servers, and protected resources)
What is access_token, refresh_token, SAML token, JWT token?
Sticky session vs Session Replication.
What is Federated Authentication ?
What is CSP and SRI hash ?
What is Clickjacking and Cursorjacking ? How to prevent it ?
C++ programming
Java programming
Algorithms
Concurrent programming
Statistics
Machine Learning
Digital Signal Processing
Digital Image Processing
Other
** **
Design principles. (, , , , , , , , boy scout rule, , , , , )
are a style of software architecture that involves delivering systems as a set of very small, granular, independent collaborating services.
Creational: , , , , , ,
Structural: , , , , , ,
Behavioral: , , , , , , , , , ,
, .
(Presentation tier, Application tier, Data tier)
(Representational state transfer),
(The PUT and DELETE methods are referred to as idempotent, meaning that the operation will produce the same result no matter how many times it is repeated)
, .
vs (Inheritance - is-a relationship, whether clients will want to use the subclass type as a superclass type. Composition - has-a or part-of relationship).
Drawbacks of not using
What is ? (client code should not be affected by a decision to implement an attribute as a field or method)
(organizations which design systems ... are constrained to produce designs which are copies of the communication structures of these organizations)
** **
What is , ? (Deadlock is a situation in which two or more competing actions are each waiting for the other to finish, and thus neither ever does. A livelock is similar to a deadlock, except that the states of the processes involved in the livelock constantly change with regard to one another, none progressing.)
. (prevention, detection, avoidance (Mutex hierarchy), and recovery)
What is ? (a problem encountered in concurrent computing where a process is perpetually denied necessary resources to process its work)
What is ? (Behavior of software system where the output is dependent on the sequence or timing of other uncontrollable events)
What is relation?
What is ? (Contention is simply when two threads try to access either the same resource or related resources in such a way that at least one of the contending threads runs more slowly than it would if the other thread(s) were not running). Contention occurs when multiple threads try to acquire a lock at the same time
What is a function? (Can be safely invoked by multiple threads at the same time)
pattern
What is ? (Growing phase, shrinking phase. Guarantees serializablity for transactions, doesn't prevent deadlock).
What is , , cache miss, , , ?
- if all other threads are paused, then any given thread will complete its operation in a bounded number of steps
- if multiple threads are operating on a data structure, then after a bounded number of steps one of them will complete its operation
- every thread operating on a data structure will complete its operation in a bounded number of steps, even if other threads are also operating on the data structure
What is ? (The result of any execution is the same as if the operations of all the processors were executed in some sequential order, and the operations of each individual processor appear in this sequence in the order specified by its program).
What is a ? (A memory barrier, also known as a membar, memory fence or fence instruction, is a type of barrier instruction that causes a CPU or compiler to enforce an ordering constraint on memory operations issued before and after the barrier instruction)
What is data race? (When a program contains two conflicting accesses that are not ordered by a relationship, it is said to contain a data race. Two accesses to (reads of or writes to) the same variable are said to be conflicting if at least one of the accesses is a write. But see )
Java
Causality requirement for incorrectly synchronized programs:
? (Speedup = 1 / (1 - p + p / n))
(Resource hierarchy (first take lower-indexed fork), arbitrator, communication (dirty/clean forks)).
problem.
problem.
** **
, , , finalize(), ReferenceQueue.
How to write benchmarks? ()
What is the difference between <?>, <Object>, <? extends Object> and no generic type?
Explain method signature for , , ,
Why are arrays covariant but generics are invariant?
** **
(Variable of type Shape could refer to an object of type Square, Circle... Ability of a function to handle objects of many types)
(Packing of data and functions into a single component)
(Overridable function)
(Actual method implementation invoked is determined at run time based on the class of the object, not the type of the variable or expression)
How does work? (Mark and sweep: mark: traverse object graph starting from root objects, sweep: garbage collect unmarked objects. Optimizations: young/old generations, incremental mark and sweep)
(A tail call is a subroutine call performed as the final action of a procedure)
** **
WEB security vulnerabilities (, , , , , )
What is , ? (A communication technique used in JavaScript programs running in web browsers to request data from a server in a different domain, something prohibited by typical web browsers because of the same-origin policy)
negotiation steps.
What is HTTP Strict Transport Security ()? (Prevents Man in the Middle attacks)
What is and ?
What is session and persistent cookies, sessionStorage and ?
How to implement remember-me? ()
Authentication using cookies, (JSON Web Tokens).
** **
)
** **
** **
What is pessimistic / locking?
** **
** **
** **
What is ? (Cloud computing platform is a fully automated server platform that allows users to purchase, remotely create, dynamically scale, and administer system)
** **
()
What is ? . (It is impossible for a distributed computer system to simultaneously provide all three of the following guarantees: consistency, availability, partition tolerance). . ).
. Every shared object can be assigned a consensus number, which is the maximum number of processes for which the object can solve wait-free consensus in an asynchronous system.
:
** **
** **
, ,
** **
What is file and its benefits?
organization.
** **
** **
[PImpl]
** **
differences between == and === ()
** **
** **
** **
** **
What is ?
** **
(responsive, resilient, elastic, message driven)
What is asynchronous and non-blocking?
** **
** **
What is Blue-green Deployment, Canary release, A/B testing?
** **
What is Consumer Driven Contract?
** **
What is Agile? ()
What are the differences between Scrum and Waterfall? ( )
** **
** **
How to work with legacy code? ()
** **
:
&space; =&space; \dfrac{P(B|A)\times&space; P(A)}{P(B)}, P(B)&space; =&space; \sum\limits_{i}{P(Ai)\times&space; P(B|Ai)})
, , , ,
** **
** **
** **
** **
What is hash ?
** **
** **