Blog Archives
1 2 3 4 5 6 7 21

03: Coding Scala Way – Lazy Eval

Example #6: Lazy initialization & evaluation of code Scala support “views“, which are collections that can be lazily evaluated. One use for views is when you need to traverse a collection of values which are expensive to compute and you only need one value at a time. … Read more...



03: Python context manager tutorial

Q. What is a Python context manager?
A. The most common use of context managers is to properly manage resources. Context managers are a way of allocating and releasing some sort of resource exactly where you need it. The simplest example is file access:

Instead of:

The following code ensures that the file handle is closed,

Read more ›



03: Q1 – Q6 Scala interview Q&As on Functional Programming

100+ FAQ Scala interview questions answered with code. Learn more about FP – 6 tips to transforming your thinking from OOP/imperative programming to functional programming (i.e. FP). Scala is very popular in Apache Spark programming to process Big Data. 70+ FAQ Bigdata & Hadoop interview questions &

Read more ›



03: Q16 – Q26 Hadoop MapReduce interview questions & answers

This extends 02: Hadoop overview & architecture interview Q&As. Q16. What is MapReduce (i.e MR)? A16. MapReduce is a parallel programming model used for processing large datasets across 10 to 1000 of servers across the Hadoop cluster. A MapReduce program consists of 3 parts. … Read more ›...



03: Simple Linear Regression interview Q&As

Q01. What is a gradient? A01. In algebra we can represent a straight line with: y = mx + c A parabola is represented as: y = m1x2 + m2x + c, and so on. … Read more ›...



04: Coding Scala Way – Null checks with Option-Some-None

Example #10: Null checks with “Option-Some-None”

Nulls in Scala is a code smell, and a better way to handle null values is with an “Option“, which has 2 sub classes “Some” that has a value and a “None

Read more ›



04: Currying, partial application & functional composition in Scala

Let’s see how we can wire up functions with & without currying, and then touch on functional composition.

Without currying

Here are simple functions example that add, add10, multiply and multiplyBy10 without currying.

Output:

With currying & partial application with functional composition

Note: You can also do

Output:

What is Currying?

Read more ›



1 2 3 4 5 6 7 21

Java Interview FAQs

800+ Java Interview Q&As

Top